瀏覽代碼

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 年之前
父節點
當前提交
39671bce30
共有 1 個文件被更改,包括 18 次插入15 次删除
  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)) {
 if (! isset($base_uri)) {
     ereg ('(^.*/)[^/]+/[^/]+$', $PHP_SELF, $regs);
     ereg ('(^.*/)[^/]+/[^/]+$', $PHP_SELF, $regs);
     $base_uri = $regs[1];
     $base_uri = $regs[1];
+    
 }
 }
 
 
 function is_logged_in () {
 function is_logged_in () {
@@ -27,22 +28,24 @@ function is_logged_in () {
 
 
     if ( session_is_registered('user_is_logged_in') ) {
     if ( session_is_registered('user_is_logged_in') ) {
         return;
         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;
 }
 }
 
 
 ?>
 ?>