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 require_once('../src/validate.php');
15 require_once('../functions/prefs.php');
16 require_once('../functions/plugin.php');
17 require_once('../functions/strings.php');
18 require_once('../functions/html.php');
20 /* Erase any lingering attachments */
21 if (isset($attachments) && is_array($attachments)
22 && sizeof($attachments)){
23 $hashed_attachment_dir = getHashedDir($username, $attachment_dir);
24 foreach ($attachments as $info) {
25 $attached_file = "$hashed_attachment_dir/$info[localfilename]";
26 if (file_exists($attached_file)) {
27 unlink($attached_file);
32 if (!isset($frame_top)) {
36 /* If a user hits reload on the last page, $base_uri isn't set
37 * because it was deleted with the session. */
38 if (!isset($base_uri)) {
39 if (!function_exists('sqm_baseuri')){
40 require_once('../functions/display_messages.php');
42 $base_uri = sqm_baseuri();
46 setcookie('username', '', 0, $base_uri);
47 setcookie('key', '', 0, $base_uri);
51 header('Status: 303 See Other');
52 header("Location: $signout_page");
53 exit; /* we send no content if we're redirecting. */
59 if ($theme_css != '') {
61 <link rel
="stylesheet" type
="text/css" href
="<?php echo $theme_css ?>">
65 <title
><?php
echo $org_title ?
> - Signout
</title
>
67 <body text
="<?php echo $color[8] ?>" bgcolor
="<?php echo $color[4] ?>"
68 link
="<?php echo $color[7] ?>" vlink
="<?php echo $color[7] ?>"
69 alink
="<?php echo $color[7] ?>">
72 do_hook('logout_above_text');
76 html_tag( 'th', _("Sign Out"), 'center' ) ,
77 '', $color[0], 'width="100%"' ) .
79 html_tag( 'td', _("You have been successfully signed out.") .
80 '<br><a href="login.php" target="' . $frame_to . '">' .
81 _("Click here to log back in.") . '</a><br>' ,
83 '', $color[4], 'width="100%"' ) .
85 html_tag( 'td', '<br>', 'center' ) ,
86 '', $color[0], 'width="100%"' ) ,
87 'center', $color[4], 'width="50%" cols="1" cellpadding="2" cellspacing="0" border="0"' )