X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=classes%2Fplatalglobals.php.in;h=5f0ce5a3e431a9ebeb8eb6452eccc63771d4d3cb;hb=c90dde9391588ae99bd1852fa1e95f32b016e013;hp=774a809a9a5570edab7d40f8d622af6ea7f41739;hpb=34465ab035104f739a54ec62660f04f874448627;p=platal.git diff --git a/classes/platalglobals.php.in b/classes/platalglobals.php.in index 774a809..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() @@ -88,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