From 08d7cc452e666835373023f2ca8416e75e2cb9c5 Mon Sep 17 00:00:00 2001 From: Florent Bruneau Date: Sat, 21 Jun 2008 19:19:45 +0200 Subject: [PATCH] {site}.inc.php is the base for all jobs. Signed-off-by: Florent Bruneau --- bin/connect.db.inc.php | 4 ++-- bin/emails.broken.helper.php | 1 - bin/emails.broken.php | 1 - bin/lists.create_promo.php | 3 ++- classes/plpage.php | 2 +- htdocs/listes_redirect.php | 2 +- htdocs/webredirect.php | 6 +++++- include/platal.inc.php | 4 ++-- include/synchro_ax.inc.php | 3 --- include/xnet.inc.php | 6 ++++++ include/xnet/session.inc.php | 7 ++----- include/xorg.inc.php | 7 ++++++- include/xorg/session.inc.php | 3 +-- 13 files changed, 28 insertions(+), 21 deletions(-) diff --git a/bin/connect.db.inc.php b/bin/connect.db.inc.php index f13dfa1..0370d31 100644 --- a/bin/connect.db.inc.php +++ b/bin/connect.db.inc.php @@ -22,9 +22,9 @@ ini_set('include_path',dirname(__FILE__).'/../include:' . dirname(__FILE__).'/../classes:/usr/share/php'); require_once('xorg.inc.php'); -require_once('xorg.misc.inc.php'); - require_once 'xdb.php'; +new Platal('core'); + // vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8: ?> diff --git a/bin/emails.broken.helper.php b/bin/emails.broken.helper.php index c88db0b..9534e0e 100755 --- a/bin/emails.broken.helper.php +++ b/bin/emails.broken.helper.php @@ -23,7 +23,6 @@ ini_set('include_path', '.:../include:/usr/share/php'); require_once('connect.db.inc.php'); -require_once('xorg.inc.php'); require_once('emails.inc.php'); $opts = getopt('o:'); diff --git a/bin/emails.broken.php b/bin/emails.broken.php index 358fe0a..d371854 100755 --- a/bin/emails.broken.php +++ b/bin/emails.broken.php @@ -23,7 +23,6 @@ ini_set('include_path', '.:../include:/usr/share/php'); require_once('connect.db.inc.php'); -require_once('xorg.inc.php'); require_once('emails.inc.php'); require_once('../classes/plmailer.php'); diff --git a/bin/lists.create_promo.php b/bin/lists.create_promo.php index 7296798..34eb213 100755 --- a/bin/lists.create_promo.php +++ b/bin/lists.create_promo.php @@ -1,6 +1,7 @@ #!/usr/bin/php5 -q assign('xorg_triggers', $this->_errors); $this->assign('xorg_errors', $this->nb_errs()); $this->assign('xorg_failure', $this->_failure); - $this->assign('globals', $globals); + $this->assign_by_ref('globals', $globals); if (Env::has('json') && count($this->_jsonVars)) { return $this->jsonDisplay(); diff --git a/htdocs/listes_redirect.php b/htdocs/listes_redirect.php index 739c58d..432ca6f 100644 --- a/htdocs/listes_redirect.php +++ b/htdocs/listes_redirect.php @@ -19,7 +19,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ***************************************************************************/ -require_once dirname(__FILE__).'/../include/xorg.inc.php'; +require_once 'xorg.inc.php'; preg_match('!^/(moderate|admin|members|archives)/(.*)_([^_]*)(/.*)?$!', $_SERVER['REQUEST_URI'], $matches); diff --git a/htdocs/webredirect.php b/htdocs/webredirect.php index cca10b1..0de8baa 100644 --- a/htdocs/webredirect.php +++ b/htdocs/webredirect.php @@ -19,7 +19,9 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ***************************************************************************/ -require_once dirname(__FILE__).'/../include/xorg.inc.php'; +require_once 'xorg.inc.php'; + +new Platal('core'); global $globals; list($username, $path) = preg_split('/\//', $_SERVER["REQUEST_URI"], 2, PREG_SPLIT_NO_EMPTY); @@ -53,5 +55,7 @@ header("HTTP/1.0 404 Not Found");
Apache Server at www.carva.org Port 80
+ + diff --git a/include/platal.inc.php b/include/platal.inc.php index 6bfd24f..afeef62 100644 --- a/include/platal.inc.php +++ b/include/platal.inc.php @@ -41,7 +41,7 @@ define('DEBUG_BT', 1); define('DEBUG_VALID', 2); define('DEBUG_SMARTY', 4); -function __autoload($cls) +function pl_autoload($cls) { $cls = strtolower($cls); $path = dirname(dirname(__FILE__)); @@ -57,7 +57,7 @@ function __autoload($cls) @include "$cls.inc.php"; } } -__autoload('Env'); +pl_autoload('Env'); function pl_error_handler($errno, $errstr, $errfile, $errline) { diff --git a/include/synchro_ax.inc.php b/include/synchro_ax.inc.php index 208272f..6b06c12 100644 --- a/include/synchro_ax.inc.php +++ b/include/synchro_ax.inc.php @@ -19,9 +19,6 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ***************************************************************************/ - -require_once("xorg.inc.php"); - require_once('user.func.inc.php'); function is_ax_key_missing() { diff --git a/include/xnet.inc.php b/include/xnet.inc.php index 58d9ffd..ce22b5d 100644 --- a/include/xnet.inc.php +++ b/include/xnet.inc.php @@ -24,9 +24,15 @@ define('PL_SESSION_CLASS', 'XnetSession'); define('PL_PAGE_CLASS', 'XnetPage'); require_once('platal.inc.php'); +require_once('xorg.misc.inc.php'); require_once('globals.inc.php'); require_once('xnet/session.inc.php'); require_once('xnet/page.inc.php'); +function __autoload($cls) +{ + pl_autoload($cls); +} + // vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8: ?> diff --git a/include/xnet/session.inc.php b/include/xnet/session.inc.php index 2251662..e3e544e 100644 --- a/include/xnet/session.inc.php +++ b/include/xnet/session.inc.php @@ -115,14 +115,11 @@ class XnetSession public static function doAuthX() { - global $globals, $page; + global $globals; if (md5('1'.S::v('challenge').$globals->xnet->secret.Get::i('uid').'1') != Get::v('auth')) { Get::kill('auth'); - if (!$page) { - require_once 'xnet.inc.php'; - new_skinned_page('platal/index.tpl'); - } + $page =& Platal::page(); $page->kill("Erreur d'authentification avec polytechnique.org !"); } diff --git a/include/xorg.inc.php b/include/xorg.inc.php index 5f7af96..ed60c7f 100644 --- a/include/xorg.inc.php +++ b/include/xorg.inc.php @@ -24,9 +24,15 @@ define('PL_SESSION_CLASS', 'XorgSession'); define('PL_PAGE_CLASS', 'XorgPage'); require_once('platal.inc.php'); +require_once('xorg.misc.inc.php'); require_once('globals.inc.php'); require_once('xorg/session.inc.php'); +function __autoload($cls) +{ + pl_autoload($cls); +} + // {{{ class XorgPage class XorgPage extends PlPage @@ -42,7 +48,6 @@ class XorgPage extends PlPage public function run() { global $globals, $platal; - $this->assign_by_ref('globals', $globals); if (isset($platal) && $platal->path == 'register') { $skin = $globals->register_skin . ".tpl"; } else { diff --git a/include/xorg/session.inc.php b/include/xorg/session.inc.php index 8d86e93..e9b98b7 100644 --- a/include/xorg/session.inc.php +++ b/include/xorg/session.inc.php @@ -294,8 +294,7 @@ function start_connexion ($uid, $identified) global $page; $newpage = false; if (!$page) { - require_once 'xorg.inc.php'; - new_skinned_page('platal/index.tpl'); + $page =& Platal::page(); $newpage = true; } $page->trigError("Une erreur est survenue lors de la procédure d'authentification. " -- 2.1.4