use PAGE_NAME rather than PHP_SELF in session_expired_location
authorkink <kink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sat, 14 Jul 2007 18:04:09 +0000 (18:04 +0000)
committerkink <kink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sat, 14 Jul 2007 18:04:09 +0000 (18:04 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@12536 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/auth.php
src/redirect.php

index de11da7da3f70c147daeb6ec02fe1747329325cf..11a484fed5b6e99faf95734dcb5b3a161cd26323 100644 (file)
@@ -21,8 +21,8 @@
  *
  * Function is similar to is_logged_in() function. If user is logged in, function
  * returns true. If user is not logged in or session is expired, function saves $_POST
- * and $PHP_SELF in session and returns false. POST information is saved in
- * 'session_expired_post' variable, PHP_SELF is saved in 'session_expired_location'.
+ * and PAGE_NAME in session and returns false. POST information is saved in
+ * 'session_expired_post' variable, PAGE_NAME is saved in 'session_expired_location'.
  *
  * Script that uses this function instead of is_logged_in() function, must handle user
  * level messages.
@@ -36,10 +36,8 @@ function sqauth_is_logged_in() {
 
        //  First we store some information in the new session to prevent
        //  information-loss.
-       sqGetGlobalVar('PHP_SELF', $PHP_SELF, SQ_SERVER);
-
        $session_expired_post = $_POST;
-       $session_expired_location = $PHP_SELF;
+       $session_expired_location = PAGE_NAME;
        if (!sqsession_is_registered('session_expired_post')) {
            sqsession_register($session_expired_post,'session_expired_post');
        }
index de8877634f7a03de8e58024a2320bdaeaed35a45..ae1fedf616353b82afd2d97e8339b91f530a05c3 100644 (file)
@@ -144,14 +144,14 @@ $redirect_url = $location . '/webmail.php';
 
 if ( sqgetGlobalVar('session_expired_location', $session_expired_location, SQ_SESSION) ) {
     sqsession_unregister('session_expired_location');
-    if ( strpos($session_expired_location, 'compose.php') !== FALSE ) {
+    if ( $session_expired_location == 'compose' ) {
         $compose_new_win = getPref($data_dir, $username, 'compose_new_win', 0);
         if ($compose_new_win) {
-            // do not prefix $location here because $session_expired_location is set to PHP_SELF
+            // do not prefix $location here because $session_expired_location is set to the PAGE_NAME
             // of the last page
-            $redirect_url = $session_expired_location;
+            $redirect_url = $session_expired_location.'.php';
         } else {
-            $redirect_url = $location.'/webmail.php?right_frame='.urlencode($session_expired_location);
+            $redirect_url = $location.'/webmail.php?right_frame='.urlencode($session_expired_location).'php';
         }
     }
     unset($session_expired_location);