Redirect the wrong access to the root pf the folder as index.php are in place
authorphilippe_mingo <philippe_mingo@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sun, 24 Mar 2002 08:28:41 +0000 (08:28 +0000)
committerphilippe_mingo <philippe_mingo@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sun, 24 Mar 2002 08:28:41 +0000 (08:28 +0000)
for such ocasions. This removes the bug into the redirector when the access
failure is within a plugin.

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

functions/auth.php

index 6ce4e4a69f7c582e3d10ba496cda825a3ee7b645..b7ad374a4618b68a09b8bdc45065afc49b2261e2 100644 (file)
@@ -20,6 +20,7 @@ require_once( '../functions/page_header.php' );
 if (! isset($base_uri)) {
     ereg ('(^.*/)[^/]+/[^/]+$', $PHP_SELF, $regs);
     $base_uri = $regs[1];
+    
 }
 
 function is_logged_in () {
@@ -27,22 +28,24 @@ function is_logged_in () {
 
     if ( session_is_registered('user_is_logged_in') ) {
         return;
+    } else {
+
+        if (!isset($frame_top) || $frame_top == '' ) {
+            $frame_top = '_top';
+        }
+        
+        set_up_language($squirrelmail_language, true);
+    
+        displayHtmlHeader( _("You must be logged in to access this page.") );
+    
+        echo "<body bgcolor=\"ffffff\">\n" .
+             '&nbsp;<p><center><b>' .
+             _("You must be logged in to access this page.").'</b><br><br>' .
+             '<a href="' . $base_uri . '" target="' . $frame_top . '">' . 
+             _("Go to the login page") . "</a>\n" .
+             "</center></body></html>\n";
+        exit;
     }
-
-    if (!isset($frame_top) || $frame_top == '' ) {
-        $frame_top = '_top';
-    }
-
-    set_up_language($squirrelmail_language, true);
-
-    displayHtmlHeader( 'SquirrelMail', '', FALSE );
-
-    echo "<body bgcolor=\"ffffff\">\n" .
-         '<br><br><center><b>' .
-         _("You must be logged in to access this page.").'</b><br><br>' .
-         "<a href=\"$base_uri" . "src/login.php\" target=\"$frame_top\">"._("Go to the login page")."</a>\n" .
-         "</center></body></html>\n";
-    exit;
 }
 
 ?>