Move xorg/xnet classes in /classes.
authorFlorent Bruneau <florent.bruneau@polytechnique.org>
Sun, 22 Jun 2008 13:31:50 +0000 (15:31 +0200)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Sun, 22 Jun 2008 13:31:50 +0000 (15:31 +0200)
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
classes/xnetpage.php [moved from include/xnet/page.inc.php with 100% similarity]
classes/xnetsession.php [moved from include/xnet/session.inc.php with 100% similarity]
classes/xorgpage.php [new file with mode: 0644]
classes/xorgsession.php [moved from include/xorg/session.inc.php with 100% similarity]
include/wiki.inc.php
include/xnet.inc.php
include/xorg.inc.php

diff --git a/classes/xorgpage.php b/classes/xorgpage.php
new file mode 100644 (file)
index 0000000..f0d42ea
--- /dev/null
@@ -0,0 +1,45 @@
+<?php
+/***************************************************************************
+ *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  http://opensource.polytechnique.org/                                   *
+ *                                                                         *
+ *  This program is free software; you can redistribute it and/or modify   *
+ *  it under the terms of the GNU General Public License as published by   *
+ *  the Free Software Foundation; either version 2 of the License, or      *
+ *  (at your option) any later version.                                    *
+ *                                                                         *
+ *  This program is distributed in the hope that it will be useful,        *
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of         *
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          *
+ *  GNU General Public License for more details.                           *
+ *                                                                         *
+ *  You should have received a copy of the GNU General Public License      *
+ *  along with this program; if not, write to the Free Software            *
+ *  Foundation, Inc.,                                                      *
+ *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
+ ***************************************************************************/
+
+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:
+?>
index 4c42135..bba6b11 100644 (file)
@@ -130,7 +130,6 @@ function wiki_apply_feed_perms($perm)
     }
     $table = $res->fetchOneAssoc();
     $_SESSION = array_merge($_SESSION, $table, array('forlife' => Env::v('user')));
-    require_once 'xorg/session.inc.php';
     $_SESSION['perms'] =& XorgSession::make_perms($_SESSION['perms']);
     if ($perm == 'logged' || $_SESSION['perms']->hasFlag('admin')) {
         return;
index fb24876..42b047d 100644 (file)
@@ -25,11 +25,10 @@ define('PL_PAGE_CLASS', 'XnetPage');
 
 require_once dirname(dirname(__FILE__)) . '/core/include/platal.inc.php';
 require_once 'globals.inc.php';
-require_once 'xnet/session.inc.php';
-require_once 'xnet/page.inc.php';
 
 function __autoload($cls)
 {
+    $cls = strtolower($cls);
     if (!pl_autoload($cls)) {
         if (substr($cls, -3, 3) == 'req') {
             @include 'validations.inc.php';
index 0d46e8d..d463f7d 100644 (file)
@@ -26,10 +26,10 @@ 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';
 
 function __autoload($cls)
 {
+    $cls = strtolower($cls);
     if (!pl_autoload($cls)) {
         if (substr($cls, -3, 3) == 'req') {
             @include 'validations.inc.php';
@@ -72,31 +72,5 @@ function update_NbNotifs()
     $_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:
 ?>