X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Fxorg.inc.php;h=0d46e8d4ec9374b8ebf13b39a00390c946ec6348;hb=f70f2bcdc077c220e40ecebaf569e097f6028743;hp=849e0180a8b8dae27a392761428475564acfd374;hpb=91ebb7ff6485f03fcccfdf2142e997e44ee399b2;p=platal.git diff --git a/include/xorg.inc.php b/include/xorg.inc.php index 849e018..0d46e8d 100644 --- a/include/xorg.inc.php +++ b/include/xorg.inc.php @@ -24,9 +24,9 @@ define('PL_SESSION_CLASS', 'XorgSession'); define('PL_PAGE_CLASS', 'XorgPage'); require_once dirname(dirname(__FILE__)) . '/core/include/platal.inc.php'; -require_once('xorg.misc.inc.php'); -require_once('globals.inc.php'); -require_once('xorg/session.inc.php'); +require_once 'security.inc.php'; +require_once 'globals.inc.php'; +require_once 'xorg/session.inc.php'; function __autoload($cls) { @@ -43,6 +43,37 @@ function __autoload($cls) } } +/****************************************************************************** + * Dynamic configuration update/edition stuff + *****************************************************************************/ + +function update_NbIns() +{ + global $globals; + $res = XDB::query("SELECT COUNT(*) + FROM auth_user_md5 + WHERE perms IN ('admin','user') AND deces=0"); + $cnt = $res->fetchOneCell(); + $globals->changeDynamicConfig(array('NbIns' => $cnt)); +} + +function update_NbValid() +{ + global $globals; + $res = XDB::query("SELECT COUNT(*) + FROM requests"); + $globals->changeDynamicConfig(array('NbValid' => $res->fetchOneCell())); +} + +function update_NbNotifs() +{ + require_once 'notifs.inc.php'; + $n = select_notifs(false, S::i('uid'), S::v('watch_last'), false); + $_SESSION['notifs'] = $n->numRows(); +} + + + // {{{ class XorgPage class XorgPage extends PlPage