X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=classes%2Fplatalglobals.php.in;h=5f0ce5a3e431a9ebeb8eb6452eccc63771d4d3cb;hb=c90dde9391588ae99bd1852fa1e95f32b016e013;hp=5d8493eb63ba6e0b0aa4fc15ebf5da16f681c3d7;hpb=2f8bacc215bab9d9e3401e73004574cfb0eb4540;p=platal.git diff --git a/classes/platalglobals.php.in b/classes/platalglobals.php.in index 5d8493e..5f0ce5a 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