4fd2e6450f5ec5e756696c7df13841bc44314894
4 * signout.php -- cleans up session and logs the user out
6 * Copyright (c) 1999-2005 The SquirrelMail Project Team
7 * Licensed under the GNU GPL. For full terms see the file COPYING.
9 * Cleans up after the user. Resets cookies and terminates session.
12 * @package squirrelmail
16 * Path for SquirrelMail required files.
19 define('SM_PATH','../');
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 */
23 if( ! isset($_SESSION) ||
empty($_SESSION['user_is_logged_in']) ) {
30 require_once(SM_PATH
. 'include/validate.php');
31 require_once(SM_PATH
. 'functions/prefs.php');
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']);
41 require_once(SM_PATH
. 'functions/plugin.php');
42 require_once(SM_PATH
. 'functions/strings.php');
43 require_once(SM_PATH
. 'functions/html.php');
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);
59 if (!isset($frame_top)) {
63 /* If a user hits reload on the last page, $base_uri isn't set
64 * because it was deleted with the session. */
65 if (! sqgetGlobalVar('base_uri', $base_uri, SQ_SESSION
) ) {
66 require_once(SM_PATH
. 'functions/display_messages.php');
67 $base_uri = sqm_baseuri();
75 header('Status: 303 See Other');
76 header("Location: $signout_page");
77 exit; /* we send no content if we're redirecting. */
80 /* internal gettext functions will fail, if language is not set */
81 set_up_language($squirrelmail_language, true, true);
83 <!DOCTYPE HTML
PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
87 if ($theme_css != '') {
89 <link rel
="stylesheet" type
="text/css" href
="<?php echo $theme_css; ?>" />
93 <title
><?php
echo $org_title . ' - ' . _("Signout"); ?
></title
>
95 <body text
="<?php echo $color[8]; ?>" bgcolor
="<?php echo $color[4]; ?>"
96 link
="<?php echo $color[7]; ?>" vlink
="<?php echo $color[7]; ?>"
97 alink
="<?php echo $color[7]; ?>">
100 $plugin_message = concat_hook_function('logout_above_text');
104 html_tag( 'th', _("Sign Out"), 'center' ) ,
105 '', $color[0], 'width="100%"' ) .
108 html_tag( 'td', _("You have been successfully signed out.") .
109 '<br /><a href="login.php" target="' . $frame_top . '">' .
110 _("Click here to log back in.") . '</a><br />' ,
112 '', $color[4], 'width="100%"' ) .
114 html_tag( 'td', '<br />', 'center' ) ,
115 '', $color[0], 'width="100%"' ) ,
116 'center', $color[4], 'width="50%" cols="1" cellpadding="2" cellspacing="0" border="0"' )