r2l by Yoav
[squirrelmail.git] / functions / auth.php
index bebc7f87a1739de545b3c994428b94118c809ccb..3ac8fc897b0919180dd5686217b666c6df30585f 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 {
+        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