ef307e9e9139f551240bc0bbf23148721f89ac08
4 * signout.php -- cleans up session and logs the user out
6 * Copyright (c) 1999-2002 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.
14 /* Path for SquirrelMail required files. */
15 define('SM_PATH','../');
17 /* SquirrelMail required files. */
18 require_once(SM_PATH
. 'include/validate.php');
19 require_once(SM_PATH
. 'functions/prefs.php');
20 require_once(SM_PATH
. 'functions/plugin.php');
21 require_once(SM_PATH
. 'functions/strings.php');
22 require_once(SM_PATH
. 'functions/html.php');
24 /* Erase any lingering attachments */
25 if (isset($attachments) && is_array($attachments)
26 && sizeof($attachments)){
27 $hashed_attachment_dir = getHashedDir($username, $attachment_dir);
28 foreach ($attachments as $info) {
29 $attached_file = "$hashed_attachment_dir/$info[localfilename]";
30 if (file_exists($attached_file)) {
31 unlink($attached_file);
36 if (!isset($frame_top)) {
40 /* If a user hits reload on the last page, $base_uri isn't set
41 * because it was deleted with the session. */
42 if (!isset($base_uri)) {
43 if (!function_exists('sqm_baseuri')){
44 require_once(SM_PATH
. 'functions/display_messages.php');
46 $base_uri = sqm_baseuri();
50 setcookie('username', '', 0, $base_uri);
51 setcookie('key', '', 0, $base_uri);
55 header('Status: 303 See Other');
56 header("Location: $signout_page");
57 exit; /* we send no content if we're redirecting. */
63 if ($theme_css != '') {
65 <link rel
="stylesheet" type
="text/css" href
="<?php echo $theme_css ?>">
69 <title
><?php
echo $org_title ?
> - Signout
</title
>
71 <body text
="<?php echo $color[8] ?>" bgcolor
="<?php echo $color[4] ?>"
72 link
="<?php echo $color[7] ?>" vlink
="<?php echo $color[7] ?>"
73 alink
="<?php echo $color[7] ?>">
76 do_hook('logout_above_text');
80 html_tag( 'th', _("Sign Out"), 'center' ) ,
81 '', $color[0], 'width="100%"' ) .
83 html_tag( 'td', _("You have been successfully signed out.") .
84 '<br><a href="login.php" target="' . $frame_top . '">' .
85 _("Click here to log back in.") . '</a><br>' ,
87 '', $color[4], 'width="100%"' ) .
89 html_tag( 'td', '<br>', 'center' ) ,
90 '', $color[0], 'width="100%"' ) ,
91 'center', $color[4], 'width="50%" cols="1" cellpadding="2" cellspacing="0" border="0"' )