Changed " to ' on some themes.
[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 14/*****************************************************************/
15/*** THIS FILE NEEDS TO HAVE ITS FORMATTING FIXED!!! ***/
16/*** PLEASE DO SO AND REMOVE THIS COMMENT SECTION. ***/
17/*** + Base level indent should begin at left margin, as ***/
18/*** the require_once below looks. ***/
19/*** + All identation should consist of four space blocks ***/
20/*** + Tab characters are evil. ***/
21/*** + all comments should use "slash-star ... star-slash" ***/
22/*** style -- no pound characters, no slash-slash style ***/
23/*** + FLOW CONTROL STATEMENTS (if, while, etc) SHOULD ***/
24/*** ALWAYS USE { AND } CHARACTERS!!! ***/
25/*** + Please use ' instead of ", when possible. Note " ***/
26/*** should always be used in _( ) function calls. ***/
27/*** Thank you for your help making the SM code more readable. ***/
28/*****************************************************************/
29
30require_once('../src/validate.php');
31require_once('../functions/prefs.php');
32require_once('../functions/plugin.php');
46d38f78 33require_once('../functions/strings.php');
f740c049 34
f740c049 35 // Erase any lingering attachments
cf6c6275 36 if (! isset($attachments)) {
5c263f27 37 $attachments = array();
cf6c6275 38 }
3392dc86 39 $hashed_attachment_dir = getHashedDir($username, $attachment_dir);
cf6c6275 40 foreach ($attachments as $info) {
3392dc86 41 $attached_file = "$hashed_attachment_dir/$info[localfilename]";
42 if (file_exists($attached_file)) {
43 unlink($attached_file);
f740c049 44 }
45 }
288491a4 46
d03f3582 47 if (!isset($frame_top)) {
48 $frame_top = '_top';
49 }
50
ceac7a2f 51 // If a user hits reload on the last page, $base_uri isn't set
52 // because it was deleted with the session.
cf6c6275 53 if (! isset($base_uri)) {
ceac7a2f 54 ereg ("(^.*/)[^/]+/[^/]+$", $PHP_SELF, $regs);
55 $base_uri = $regs[1];
56 }
57
91dc6e4e 58 do_hook('logout');
59 setcookie('username', '', 0, $base_uri);
60 setcookie('key', '', 0, $base_uri);
9f2215a1 61 session_destroy();
f923b93d 62
63 if ($signout_page) {
64 header("Status: 303 See Other");
65 header("Location: $signout_page");
66 exit; /* we send no content if we're redirecting. */
67 }
21c3249f 68?>
69<HTML>
e90872be 70 <HEAD>
59177427 71<?php
91dc6e4e 72 if ($theme_css != '') {
8c65f339 73?>
cab59568 74<LINK REL="stylesheet" TYPE="text/css" HREF="<?php echo $theme_css ?>">
8c65f339 75<?php
e90872be 76 }
21c3249f 77?>
8437bc78 78<TITLE><?php echo $org_title ?> - Signout</TITLE>
8c65f339 79</HEAD>
8437bc78 80<BODY TEXT="<?php echo $color[8] ?>" BGCOLOR="<?php echo $color[4] ?>"
cf6df86f 81LINK="<?php echo $color[7] ?>" VLINK="<?php echo $color[7] ?>"
82ALINK="<?php echo $color[7] ?>">
8c65f339 83<BR><BR>
26f277a6 84<TABLE BGCOLOR="<?php echo $color[4]; ?>" BORDER="0" COLS="1" WIDTH="50%" CELLSPACING="0"
8c65f339 85CELLPADDING="2" ALIGN="CENTER">
bd9bbfef 86 <TR BGCOLOR="<?php echo $color[0] ?>" WIDTH="100%">
8c65f339 87 <TD ALIGN="CENTER">
8437bc78 88 <B><?php echo _("Sign Out") ?></B>
8c65f339 89 </TD>
90 </TR>
bd9bbfef 91 <TR BGCOLOR="<?php echo $color[4] ?>" WIDTH="100%">
8c65f339 92 <TD ALIGN="CENTER">
cf6df86f 93 <?php do_hook('logout_above_text'); ?>
8437bc78 94 <?php echo _("You have been successfully signed out.") ?><BR>
80e86e94 95 <A HREF="login.php" TARGET="<?php echo $frame_top ?>">
8437bc78 96 <?php echo _("Click here to log back in.") ?>
8c65f339 97 </A><BR><BR>
98 </TD>
99 </TR>
bd9bbfef 100 <TR BGCOLOR="<?php echo $color[0] ?>" WIDTH="100%">
8c65f339 101 <TD ALIGN="CENTER">
102 <BR>
103 </TD>
104 </TR>
105</TABLE>
21c3249f 106</BODY>
e0dcff78 107</HTML>