X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;ds=sidebyside;f=include%2Fxorg.inc.php;h=b67126b39310995311ad47fd4c82c98e7abccc80;hb=bd4f648ba40d48ad6bf8b60d5707f2a9324c450c;hp=8927abaf2a4bcb7ec607e1a504867e02c37eb59c;hpb=bec580ff2bb4e580e51cb852e07121fbdea6c5f2;p=platal.git diff --git a/include/xorg.inc.php b/include/xorg.inc.php index 8927aba..b67126b 100644 --- a/include/xorg.inc.php +++ b/include/xorg.inc.php @@ -25,51 +25,7 @@ define('PL_PAGE_CLASS', 'XorgPage'); require_once dirname(dirname(__FILE__)) . '/core/include/platal.inc.php'; require_once 'security.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: ?>