Marking some changes.
[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 *
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 * Cleans up after the user. Resets cookies and terminates session.
10 *
11 * $Id$
12 */
8b522a59 13
35586184 14require_once('../src/validate.php');
15require_once('../functions/prefs.php');
16require_once('../functions/plugin.php');
46d38f78 17require_once('../functions/strings.php');
f740c049 18
32f4e318 19/* Erase any lingering attachments */
20if (! isset($attachments)) {
21 $attachments = array();
22}
23$hashed_attachment_dir = getHashedDir($username, $attachment_dir);
24foreach ($attachments as $info) {
25 $attached_file = "$hashed_attachment_dir/$info[localfilename]";
26 if (file_exists($attached_file)) {
27 unlink($attached_file);
28 }
29}
288491a4 30
32f4e318 31if (!isset($frame_top)) {
32 $frame_top = '_top';
33}
d03f3582 34
32f4e318 35/* If a user hits reload on the last page, $base_uri isn't set
36 * because it was deleted with the session. */
85b454a0 37if (!isset($base_uri)) {
5afe02cf 38 $base_uri = dirname(dirname($PHP_SELF)) . "/";
32f4e318 39}
ceac7a2f 40
32f4e318 41do_hook('logout');
42setcookie('username', '', 0, $base_uri);
43setcookie('key', '', 0, $base_uri);
44session_destroy();
f923b93d 45
32f4e318 46if ($signout_page) {
47 header('Status: 303 See Other');
48 header("Location: $signout_page");
49 exit; /* we send no content if we're redirecting. */
50}
21c3249f 51?>
52<HTML>
e90872be 53 <HEAD>
59177427 54<?php
32f4e318 55 if ($theme_css != '') {
8c65f339 56?>
cab59568 57<LINK REL="stylesheet" TYPE="text/css" HREF="<?php echo $theme_css ?>">
8c65f339 58<?php
32f4e318 59 }
21c3249f 60?>
8437bc78 61<TITLE><?php echo $org_title ?> - Signout</TITLE>
8c65f339 62</HEAD>
8437bc78 63<BODY TEXT="<?php echo $color[8] ?>" BGCOLOR="<?php echo $color[4] ?>"
cf6df86f 64LINK="<?php echo $color[7] ?>" VLINK="<?php echo $color[7] ?>"
65ALINK="<?php echo $color[7] ?>">
8c65f339 66<BR><BR>
26f277a6 67<TABLE BGCOLOR="<?php echo $color[4]; ?>" BORDER="0" COLS="1" WIDTH="50%" CELLSPACING="0"
8c65f339 68CELLPADDING="2" ALIGN="CENTER">
bd9bbfef 69 <TR BGCOLOR="<?php echo $color[0] ?>" WIDTH="100%">
8c65f339 70 <TD ALIGN="CENTER">
8437bc78 71 <B><?php echo _("Sign Out") ?></B>
8c65f339 72 </TD>
73 </TR>
bd9bbfef 74 <TR BGCOLOR="<?php echo $color[4] ?>" WIDTH="100%">
8c65f339 75 <TD ALIGN="CENTER">
cf6df86f 76 <?php do_hook('logout_above_text'); ?>
8437bc78 77 <?php echo _("You have been successfully signed out.") ?><BR>
e27195f7 78 <A HREF="login.php" TARGET="<?php echo $frame_top ?>">
8437bc78 79 <?php echo _("Click here to log back in.") ?>
8c65f339 80 </A><BR><BR>
81 </TD>
82 </TR>
bd9bbfef 83 <TR BGCOLOR="<?php echo $color[0] ?>" WIDTH="100%">
8c65f339 84 <TD ALIGN="CENTER">
85 <BR>
86 </TD>
87 </TR>
88</TABLE>
21c3249f 89</BODY>
32f4e318 90</HTML>