X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=blobdiff_plain;f=functions%2Fauth.php;h=6ce4e4a69f7c582e3d10ba496cda825a3ee7b645;hp=5b3f31e5e6b3f32b09fde2c360f3de135fc358bb;hb=27e0f2b6733f71aceec05289b5b119cfd64d3ac1;hpb=2ba138034e8cf69a80201035e0abdb51af93083d diff --git a/functions/auth.php b/functions/auth.php index 5b3f31e5..6ce4e4a6 100644 --- a/functions/auth.php +++ b/functions/auth.php @@ -1,34 +1,48 @@ \n" . - '

'. - _("You must be logged in to access this page.").'

'. - ""._("Go to the login page")."\n". - "
\n"; - exit; +/** + * auth.php + * + * Copyright (c) 1999-2002 The SquirrelMail Project Team + * Licensed under the GNU GPL. For full terms see the file COPYING. + * + * Contains functions used to do authentication. + * + * $Id$ + */ + +require_once( '../functions/page_header.php' ); + +/* If a user opens a new session then comes back to this one, + * $base_uri isn't set because it the session is invalid. + */ + +if (! isset($base_uri)) { + ereg ('(^.*/)[^/]+/[^/]+$', $PHP_SELF, $regs); + $base_uri = $regs[1]; +} + +function is_logged_in () { + global $squirrelmail_language, $frame_top, $base_uri; + + if ( session_is_registered('user_is_logged_in') ) { + return; } + if (!isset($frame_top) || $frame_top == '' ) { + $frame_top = '_top'; + } + + set_up_language($squirrelmail_language, true); + + displayHtmlHeader( 'SquirrelMail', '', FALSE ); + + echo "\n" . + '

' . + _("You must be logged in to access this page.").'

' . + ""._("Go to the login page")."\n" . + "
\n"; + exit; +} + ?>