X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=classes%2Fplatalglobals.php.in;h=8a29600f86ba5015fdf4cd6fa484766cd9b73c0c;hb=dd4f932d8e4488f98ac541a94d158fbd72a50e3c;hp=5d8493eb63ba6e0b0aa4fc15ebf5da16f681c3d7;hpb=c12cc82e1d97b51e19b294942ea9450a34d929cd;p=platal.git diff --git a/classes/platalglobals.php.in b/classes/platalglobals.php.in index 5d8493e..8a29600 100644 --- a/classes/platalglobals.php.in +++ b/classes/platalglobals.php.in @@ -1,6 +1,6 @@ fetchOneCell(); - $this->changeDynamicConfig(array('NbIns' => $cnt)); + $count = XDB::rawFetchOneCell("SELECT COUNT(*) + FROM accounts AS a + INNER JOIN account_profiles AS ap ON (ap.uid = a.uid AND FIND_IN_SET('owner', ap.perms)) + INNER JOIN profiles AS p ON (ap.pid = p.pid) + WHERE a.state = 'active' AND p.deathdate IS NULL"); + $this->changeDynamicConfig(array('NbIns' => $count)); } public function updateNbValid() @@ -85,8 +91,12 @@ class PlatalGlobals extends PlGlobals FROM requests"); $this->changeDynamicConfig(array('NbValid' => $res->fetchOneCell())); } -} + public function cacheEnabled() + { + return ($this->debug & self::DEBUG_NOCACHE) == 0; + } +} /****************************************************************************** * Dynamic configuration update/edition stuff