Some optimization on frequent loaded code.
[squirrelmail.git] / functions / auth.php
1 <?php
2
3 /**
4 * auth.php
5 *
6 * Copyright (c) 1999-2002 The SquirrelMail Project Team
7 * Licensed under the GNU GPL. For full terms see the file COPYING.
8 *
9 * Contains functions used to do authentication.
10 *
11 * $Id$
12 */
13
14 /* If a user opens a new session then comes back to this one,
15 * $base_uri isn't set because it the session is invalid.
16 */
17
18 if (! isset($base_uri)) {
19 ereg ('(^.*/)[^/]+/[^/]+$', $PHP_SELF, $regs);
20 $base_uri = $regs[1];
21 }
22
23 function is_logged_in() {
24
25 if ( session_is_registered('user_is_logged_in') ) {
26 return;
27 } else {
28 include_once( '../functions/display_messages.php' );
29 logout_error( _("You must be logged in to access this page.") );
30 exit;
31 }
32 }
33
34 ?>