Browse Source

Redirect the wrong access to the root pf the folder as index.php are in place
for such ocasions. This removes the bug into the redirector when the access
failure is within a plugin.

philippe_mingo 23 years ago
parent
commit
39671bce30
1 changed files with 18 additions and 15 deletions
  1. 18 15
      functions/auth.php

+ 18 - 15
functions/auth.php

@@ -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;
 }
 
 ?>