allow_call_time_pass_reference = Off
[squirrelmail.git] / functions / auth.php
index dde3147547b482272b47d88e883b83d34d2d93ba..10c33294a30af5f971590ed54ed831bb69bd190c 100644 (file)
  * $Id$
  */
 
-require_once( '../functions/page_header.php' );
-
-function is_logged_in () {
-    global $squirrelmail_language, $frame_top, $base_uri;
+function is_logged_in() {
 
     if ( session_is_registered('user_is_logged_in') ) {
         return;
+    } else {
+        global $HTTP_POST_VARS, $PHP_SELF, $session_expired_post, 
+              $session_expired_location;
+
+        /*  First we store some information in the new session to prevent
+         *  information-loss.
+         */
+       $session_expired_post = $HTTP_POST_VARS;
+        $session_expired_location = $PHP_SELF;
+        if (!session_is_registered('session_expired_post')) {    
+           session_register('session_expired_post');
+        }
+        if (!session_is_registered('session_expired_location')) {
+           session_register('session_expired_location');
+        }
+        include_once( '../functions/display_messages.php' );
+        logout_error( _("You must be logged in to access this page.") );
+        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;
 }
 
-?>
+?>
\ No newline at end of file