Add base url to output of configtest.php.
[squirrelmail.git] / src / signout.php
CommitLineData
59177427 1<?php
895905c0 2
35586184 3/**
4 * signout.php -- cleans up session and logs the user out
5 *
6c84ba1e 6 * Copyright (c) 1999-2005 The SquirrelMail Project Team
35586184 7 * Licensed under the GNU GPL. For full terms see the file COPYING.
8 *
9 * Cleans up after the user. Resets cookies and terminates session.
10 *
30967a1e 11 * @version $Id$
8f6f9ba5 12 * @package squirrelmail
35586184 13 */
8b522a59 14
30967a1e 15/**
16 * Path for SquirrelMail required files.
17 * @ignore
18 */
86725763 19define('SM_PATH','../');
20
d6599308 21/* check if we're already logged out (e.g. when this page is reloaded),
22 * so we can skip to the output and not give error messages */
23if( ! isset($_SESSION) || empty($_SESSION['user_is_logged_in']) ) {
24 $loggedin = false;
25} else {
26 $loggedin = true;
27}
28
29if($loggedin) {
30 require_once(SM_PATH . 'include/validate.php');
31 require_once(SM_PATH . 'functions/prefs.php');
32} else {
33 // this comes in through validate.php usually
34 require_once(SM_PATH . 'config/config.php');
35 require_once(SM_PATH . 'functions/i18n.php');
36 require_once(SM_PATH . 'functions/page_header.php');
37 if (@file_exists($theme[$theme_default]['PATH'])) {
38 @include ($theme[$theme_default]['PATH']);
39 }
40}
86725763 41require_once(SM_PATH . 'functions/plugin.php');
42require_once(SM_PATH . 'functions/strings.php');
43require_once(SM_PATH . 'functions/html.php');
f740c049 44
d6599308 45if($loggedin) {
46 /* Erase any lingering attachments */
47 if (isset($attachments) && is_array($attachments)
48 && sizeof($attachments)){
49 $hashed_attachment_dir = getHashedDir($username, $attachment_dir);
50 foreach ($attachments as $info) {
51 $attached_file = "$hashed_attachment_dir/$info[localfilename]";
52 if (file_exists($attached_file)) {
53 unlink($attached_file);
54 }
fb745cc7 55 }
32f4e318 56 }
57}
288491a4 58
32f4e318 59if (!isset($frame_top)) {
fb745cc7 60 $frame_top = '_top';
32f4e318 61}
d03f3582 62
32f4e318 63/* If a user hits reload on the last page, $base_uri isn't set
64 * because it was deleted with the session. */
f38b7cf0 65if (! sqgetGlobalVar('base_uri', $base_uri, SQ_SESSION) ) {
66 require_once(SM_PATH . 'functions/display_messages.php');
f3bc099d 67 $base_uri = sqm_baseuri();
32f4e318 68}
e8bef7f4 69
32f4e318 70do_hook('logout');
f923b93d 71
e8bef7f4 72sqsession_destroy();
73
32f4e318 74if ($signout_page) {
75 header('Status: 303 See Other');
76 header("Location: $signout_page");
77 exit; /* we send no content if we're redirecting. */
78}
118eb9a4 79
80/* internal gettext functions will fail, if language is not set */
81set_up_language($squirrelmail_language, true, true);
21c3249f 82?>
e8bef7f4 83<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
fab3baa6 84<html>
e8bef7f4 85<head>
59177427 86<?php
32f4e318 87 if ($theme_css != '') {
8c65f339 88?>
3c621ba1 89 <link rel="stylesheet" type="text/css" href="<?php echo $theme_css; ?>" />
8c65f339 90<?php
32f4e318 91 }
21c3249f 92?>
8178e728 93 <title><?php echo $org_title . ' - ' . _("Signout"); ?></title>
fab3baa6 94</head>
91e0dccc 95<body text="<?php echo $color[8]; ?>" bgcolor="<?php echo $color[4]; ?>"
3c621ba1 96link="<?php echo $color[7]; ?>" vlink="<?php echo $color[7]; ?>"
97alink="<?php echo $color[7]; ?>">
98<br /><br />
d4651fa2 99<?php
ed89e55b 100$plugin_message = concat_hook_function('logout_above_text');
fab3baa6 101echo
102html_tag( 'table',
103 html_tag( 'tr',
ca52e31b 104 html_tag( 'th', _("Sign Out"), 'center' ) ,
fab3baa6 105 '', $color[0], 'width="100%"' ) .
ed89e55b 106 $plugin_message .
fab3baa6 107 html_tag( 'tr',
108 html_tag( 'td', _("You have been successfully signed out.") .
3c621ba1 109 '<br /><a href="login.php" target="' . $frame_top . '">' .
110 _("Click here to log back in.") . '</a><br />' ,
fab3baa6 111 'center' ) ,
112 '', $color[4], 'width="100%"' ) .
113 html_tag( 'tr',
3c621ba1 114 html_tag( 'td', '<br />', 'center' ) ,
fab3baa6 115 '', $color[0], 'width="100%"' ) ,
116'center', $color[4], 'width="50%" cols="1" cellpadding="2" cellspacing="0" border="0"' )
117?>
118</body>
d6599308 119</html>