Moving to GitHub.
[platal.git] / include / xorg.inc.php
index 0d46e8d..164293e 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2014 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************/
 
+define('PL_CLASS', 'Xorg');
 define('PL_GLOBALS_CLASS', 'PlatalGlobals');
+define('PL_LOGGER_CLASS', 'PlatalLogger');
 define('PL_SESSION_CLASS', 'XorgSession');
 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';
-require_once 'xorg/session.inc.php';
+require_once 'common.inc.php';
 
-function __autoload($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();
-}
-
-
-
-// {{{ class XorgPage
-
-class XorgPage extends PlPage
-{
-    public function __construct()
-    {
-        parent::__construct();
-
-        // Set the default page
-        $this->changeTpl('platal/index.tpl');
-    }
-
-    public function run()
-    {
-        global $globals, $platal;
-        if (isset($platal) && $platal->path == 'register') {
-            $skin = $globals->register_skin . ".tpl";
-        } else {
-            $skin = S::v('skin', $globals->skin . ".tpl");
-        }
-        $this->_run('skin/' . $skin);
-    }
-}
-
-// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
+// vim:set et sw=4 sts=4 sws=4 foldmethod=marker fenc=utf-8:
 ?>