From 6d69b5270243afba5d4868b2ad07761233a53ef3 Mon Sep 17 00:00:00 2001 From: Florent Bruneau Date: Sat, 20 Mar 2010 14:54:02 +0100 Subject: [PATCH] Wiki selection is done by the Platal class. Signed-off-by: Florent Bruneau --- classes/xnet.php | 4 ++-- classes/xorg.php | 18 ++++++++++++++++++ core | 2 +- htdocs/xnet.php | 12 +----------- htdocs/xorg.php | 17 +---------------- include/xnet.inc.php | 1 + include/xorg.inc.php | 1 + modules/xnet.php | 2 ++ 8 files changed, 27 insertions(+), 30 deletions(-) diff --git a/classes/xnet.php b/classes/xnet.php index 9983aba..4d0437f 100644 --- a/classes/xnet.php +++ b/classes/xnet.php @@ -23,8 +23,8 @@ class Xnet extends Platal { public function __construct() { - $modules = func_get_args(); - parent::__construct($modules); + parent::__construct('xnet', 'xnetgrp', 'xnetlists', 'xnetevents', + 'payment', 'bandeau'); global $globals; if ($globals->asso()) { diff --git a/classes/xorg.php b/classes/xorg.php index 827aa0f..83bc952 100644 --- a/classes/xorg.php +++ b/classes/xorg.php @@ -21,6 +21,24 @@ class Xorg extends Platal { + public function __construct() + { + parent::__construct('auth', 'carnet', 'email', 'events', 'forums', + 'lists', 'marketing', 'payment', 'platal', + 'profile', 'register', 'search', 'stats', 'admin', + 'newsletter', 'axletter', 'bandeau', 'survey', + 'fusionax', 'gadgets', 'googleapps', 'poison', + 'openid', 'reminder'); + } + + public function find_hook() + { + if ($this->path{0} >= 'A' && $this->path{0} <= 'Z') { + return self::wiki_hook(); + } + return parent::find_hook(); + } + public function force_login(PlPage &$page) { header($_SERVER['SERVER_PROTOCOL'] . ' 403 Forbidden'); diff --git a/core b/core index ff539a0..fd669a5 160000 --- a/core +++ b/core @@ -1 +1 @@ -Subproject commit ff539a07a4f86dbb19f43afb190102bdd8d8cf95 +Subproject commit fd669a5756eb8607006d19575956a2f6ea1508ce diff --git a/htdocs/xnet.php b/htdocs/xnet.php index a530688..8b4e795 100644 --- a/htdocs/xnet.php +++ b/htdocs/xnet.php @@ -20,18 +20,8 @@ ***************************************************************************/ $GLOBALS['IS_XNET_SITE'] = true; - require_once dirname(__FILE__).'/../include/xnet.inc.php'; - -$platal = new Xnet('xnet', 'xnetgrp', 'xnetlists', 'xnetevents', 'payment', 'bandeau'); -if (!($path = Env::v('n')) || substr($path, 0, 4) != 'Xnet') { - $platal->run(); - exit; -} - -/*** WIKI CODE ***/ - -include pl_core_include('wiki.engine.inc.php'); +require_once pl_core_include('run.inc.php'); // vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8: ?> diff --git a/htdocs/xorg.php b/htdocs/xorg.php index 3c27ba2..c8e4fc6 100644 --- a/htdocs/xorg.php +++ b/htdocs/xorg.php @@ -20,22 +20,7 @@ ***************************************************************************/ require_once dirname(__FILE__).'/../include/xorg.inc.php'; - -$platal = new Xorg('auth', 'carnet', 'email', 'events', 'forums', - 'lists', 'marketing', 'payment', 'platal', - 'profile', 'register', 'search', 'stats', 'admin', - 'newsletter', 'axletter', 'bandeau', 'survey', - 'fusionax', 'gadgets', 'googleapps', 'poison', - 'openid', 'reminder'); - -if (!($path = Env::v('n')) || ($path{0} < 'A' || $path{0} > 'Z')) { - $platal->run(); - exit; -} - -/*** WIKI CODE ***/ - -include pl_core_include('wiki.engine.inc.php'); +require_once pl_core_include('run.inc.php'); // vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8: ?> diff --git a/include/xnet.inc.php b/include/xnet.inc.php index cc6fc5b..391162b 100644 --- a/include/xnet.inc.php +++ b/include/xnet.inc.php @@ -19,6 +19,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ***************************************************************************/ +define('PL_CLASS', 'Xnet'); define('PL_GLOBALS_CLASS', 'PlatalGlobals'); define('PL_LOGGER_CLASS', 'PlatalLogger'); define('PL_SESSION_CLASS', 'XnetSession'); diff --git a/include/xorg.inc.php b/include/xorg.inc.php index 9d9b592..cd6f6ff 100644 --- a/include/xorg.inc.php +++ b/include/xorg.inc.php @@ -19,6 +19,7 @@ * 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'); diff --git a/modules/xnet.php b/modules/xnet.php index 7edb674..9ad297a 100644 --- a/modules/xnet.php +++ b/modules/xnet.php @@ -33,6 +33,8 @@ class XnetModule extends PLModule 'plan' => $this->make_hook('plan', AUTH_PUBLIC), 'photo' => $this->make_hook('photo', AUTH_MDP), 'autologin' => $this->make_hook('autologin', AUTH_MDP), + + 'Xnet' => $this->make_wiki_hook(), ); } -- 2.1.4