X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Fxorg.inc.php;h=b67126b39310995311ad47fd4c82c98e7abccc80;hb=0b37833b3b42f608fa0d5864f9d4b2518d9676ae;hp=d463f7d8e5af18cbcec4b38dddfc775f1d1ccb67;hpb=de08a5eb35a0daa5ea1817532f02367e0f0edbec;p=platal.git diff --git a/include/xorg.inc.php b/include/xorg.inc.php index d463f7d..b67126b 100644 --- a/include/xorg.inc.php +++ b/include/xorg.inc.php @@ -25,52 +25,7 @@ define('PL_PAGE_CLASS', 'XorgPage'); require_once dirname(dirname(__FILE__)) . '/core/include/platal.inc.php'; require_once 'security.inc.php'; -require_once 'globals.inc.php'; - -function __autoload($cls) -{ - $cls = strtolower($cls); - if (!pl_autoload($cls)) { - if (substr($cls, -3, 3) == 'req') { - @include 'validations.inc.php'; - return; - } else if (substr($cls, 0, 6) == 'banana') { - require_once 'banana/banana.inc.php'; - Banana::load(substr($cls, 6)); - return; - } - @include "$cls.inc.php"; - } -} - -/****************************************************************************** - * 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(); -} +require_once 'common.inc.php'; // vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8: ?>