fix for message list link coming from search.php Venge Lokalsound
[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. */
37if (! isset($base_uri)) {
38 ereg ('(^.*/)[^/]+/[^/]+$', $PHP_SELF, $regs);
39 $base_uri = $regs[1];
40}
ceac7a2f 41
32f4e318 42do_hook('logout');
43setcookie('username', '', 0, $base_uri);
44setcookie('key', '', 0, $base_uri);
45session_destroy();
f923b93d 46
32f4e318 47if ($signout_page) {
48 header('Status: 303 See Other');
49 header("Location: $signout_page");
50 exit; /* we send no content if we're redirecting. */
51}
21c3249f 52?>
53<HTML>
e90872be 54 <HEAD>
59177427 55<?php
32f4e318 56 if ($theme_css != '') {
8c65f339 57?>
cab59568 58<LINK REL="stylesheet" TYPE="text/css" HREF="<?php echo $theme_css ?>">
8c65f339 59<?php
32f4e318 60 }
21c3249f 61?>
8437bc78 62<TITLE><?php echo $org_title ?> - Signout</TITLE>
8c65f339 63</HEAD>
8437bc78 64<BODY TEXT="<?php echo $color[8] ?>" BGCOLOR="<?php echo $color[4] ?>"
cf6df86f 65LINK="<?php echo $color[7] ?>" VLINK="<?php echo $color[7] ?>"
66ALINK="<?php echo $color[7] ?>">
8c65f339 67<BR><BR>
26f277a6 68<TABLE BGCOLOR="<?php echo $color[4]; ?>" BORDER="0" COLS="1" WIDTH="50%" CELLSPACING="0"
8c65f339 69CELLPADDING="2" ALIGN="CENTER">
bd9bbfef 70 <TR BGCOLOR="<?php echo $color[0] ?>" WIDTH="100%">
8c65f339 71 <TD ALIGN="CENTER">
8437bc78 72 <B><?php echo _("Sign Out") ?></B>
8c65f339 73 </TD>
74 </TR>
bd9bbfef 75 <TR BGCOLOR="<?php echo $color[4] ?>" WIDTH="100%">
8c65f339 76 <TD ALIGN="CENTER">
cf6df86f 77 <?php do_hook('logout_above_text'); ?>
8437bc78 78 <?php echo _("You have been successfully signed out.") ?><BR>
80e86e94 79 <A HREF="login.php" TARGET="<?php echo $frame_top ?>">
8437bc78 80 <?php echo _("Click here to log back in.") ?>
8c65f339 81 </A><BR><BR>
82 </TD>
83 </TR>
bd9bbfef 84 <TR BGCOLOR="<?php echo $color[0] ?>" WIDTH="100%">
8c65f339 85 <TD ALIGN="CENTER">
86 <BR>
87 </TD>
88 </TR>
89</TABLE>
21c3249f 90</BODY>
32f4e318 91</HTML>