X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=classes%2Fplatalglobals.php.in;h=8a29600f86ba5015fdf4cd6fa484766cd9b73c0c;hb=86668a58a94fc57493a335eb75a37171238c0220;hp=697c297d5ddb70f0637a0aaad713078065e00f50;hpb=4f247453ac4a734953df893117b72168c60dd22e;p=platal.git diff --git a/classes/platalglobals.php.in b/classes/platalglobals.php.in index 697c297..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