use PAGE_NAME to switch on which page we are, rather than
authorkink <kink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sat, 14 Jul 2007 17:39:27 +0000 (17:39 +0000)
committerkink <kink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sat, 14 Jul 2007 17:39:27 +0000 (17:39 +0000)
sInitLocation

git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@12532 7612ce4b-ef26-0410-bec9-ea0150e637f0

include/init.php
src/login.php
src/redirect.php
src/style.php

index fd507d2da75707d2323753d28aaab0e8e0c399e3..0e3241a04756b92058e3582670baf88820160386 100644 (file)
@@ -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;
             }
 
index d3abfc28fd1477231eadacf438b6b470efa4a8e9..5122421ab912ddc9b252b028ca2974c539f54f4b 100644 (file)
 /** 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');
index 39e4488026e338dbe5fa7ec89e93c254dafb7433..de8877634f7a03de8e58024a2320bdaeaed35a45 100644 (file)
@@ -10,7 +10,6 @@
  * @version $Id$
  * @package squirrelmail
  */
-$sInitLocation = 'redirect';
 
 /** This is the redirect page */
 define('PAGE_NAME', 'redirect');
index c79dcb4fc36f3f5d7da497bcc6a04f1138e1cb17..9b9202b9755262c6d7f7da05c546b66b88350408 100644 (file)
 /** 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.
  */