From 9e06a3eab03fb20c67c6ea84a34b21ea5a528e19 Mon Sep 17 00:00:00 2001 From: kink Date: Sat, 14 Jul 2007 17:39:27 +0000 Subject: [PATCH] use PAGE_NAME to switch on which page we are, rather than sInitLocation git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@12532 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- include/init.php | 16 +++++----------- src/login.php | 4 ---- src/redirect.php | 1 - src/style.php | 6 ------ 4 files changed, 5 insertions(+), 22 deletions(-) diff --git a/include/init.php b/include/init.php index fd507d2d..0e3241a0 100644 --- a/include/init.php +++ b/include/init.php @@ -49,9 +49,6 @@ if ((bool) ini_get('register_globals') && case 'key': case 'value': break; - case 'sInitLocation': - // FIXME: variable must be set only in src/login.php - break; default: unset($GLOBALS[$key]); } @@ -294,15 +291,12 @@ if (! sqgetGlobalVar('squirrelmail_language',$squirrelmail_language,SQ_COOKIE)) $squirrelmail_language = ''; } - /** - * @var $sInitlocation From where do we include. + * Do something special for some pages. This is based on the PAGE_NAME constand + * set at the top of every page. */ -if (!isset($sInitLocation)) { - $sInitLocation=NULL; -} - -switch ($sInitLocation) { +if ( !defined('PAGE_NAME') ) define('PAGE_NAME', NULL); +switch (PAGE_NAME) { case 'style': // need to get the right template set up @@ -417,7 +411,7 @@ switch ($sInitLocation) { // signout page will deal with users who aren't logged // in on its own; don't show error here // - if ( defined('PAGE_NAME') && PAGE_NAME == 'signout' ) { + if ( PAGE_NAME == 'signout' ) { return; } diff --git a/src/login.php b/src/login.php index d3abfc28..5122421a 100644 --- a/src/login.php +++ b/src/login.php @@ -15,15 +15,11 @@ /** This is the login page */ define('PAGE_NAME', 'login'); -// reduces the files included in init.php -$sInitLocation = 'login'; - /** * Include the SquirrelMail initialization file. */ require('../include/init.php'); - /* SquirrelMail required files. */ require_once(SM_PATH . 'functions/imap_general.php'); require_once(SM_PATH . 'functions/forms.php'); diff --git a/src/redirect.php b/src/redirect.php index 39e44880..de887763 100644 --- a/src/redirect.php +++ b/src/redirect.php @@ -10,7 +10,6 @@ * @version $Id$ * @package squirrelmail */ -$sInitLocation = 'redirect'; /** This is the redirect page */ define('PAGE_NAME', 'redirect'); diff --git a/src/style.php b/src/style.php index c79dcb4f..9b9202b9 100644 --- a/src/style.php +++ b/src/style.php @@ -23,12 +23,6 @@ /** This is the style page */ define('PAGE_NAME', 'style'); -/** - * Set the location in order to skip unneeded validation and other includes - * in the SquirrelMail initialisation file. - */ -$sInitLocation = 'style'; - /** * Include the SquirrelMail initialization file. */ -- 2.25.1