Documenting the theme-as-cookie exploit fix.
[squirrelmail.git] / functions / auth.php
CommitLineData
3c13b9fb 1<?php
2
35586184 3/**
4 * auth.php
5 *
15e6162e 6 * Copyright (c) 1999-2002 The SquirrelMail Project Team
35586184 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
35586184 14require_once( '../functions/page_header.php' );
1026ec43 15
27e0f2b6 16/* If a user opens a new session then comes back to this one,
17 * $base_uri isn't set because it the session is invalid.
18 */
19
20if (! isset($base_uri)) {
21 ereg ('(^.*/)[^/]+/[^/]+$', $PHP_SELF, $regs);
22 $base_uri = $regs[1];
4d2c9f70 23
27e0f2b6 24}
25
e110c214 26function is_logged_in () {
88cb1b4d 27 global $squirrelmail_language, $frame_top, $base_uri;
2d367c68 28
e110c214 29 if ( session_is_registered('user_is_logged_in') ) {
30 return;
4d2c9f70 31 } else {
32
33 if (!isset($frame_top) || $frame_top == '' ) {
34 $frame_top = '_top';
35 }
36
37 set_up_language($squirrelmail_language, true);
38
39 displayHtmlHeader( _("You must be logged in to access this page.") );
40
41 echo "<body bgcolor=\"ffffff\">\n" .
42 '&nbsp;<p><center><b>' .
43 _("You must be logged in to access this page.").'</b><br><br>' .
44 '<a href="' . $base_uri . '" target="' . $frame_top . '">' .
45 _("Go to the login page") . "</a>\n" .
46 "</center></body></html>\n";
47 exit;
e110c214 48 }
e110c214 49}
3c13b9fb 50
80e86e94 51?>