8e15b7c83d7ad3b060241d11f16fd4e59f85d85c
4 * signout.php -- cleans up session and logs the user out
6 * Copyright (c) 1999-2001 The SquirrelMail Development 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 /*****************************************************************/
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 /*****************************************************************/
30 require_once('../src/validate.php');
31 require_once('../functions/prefs.php');
32 require_once('../functions/plugin.php');
34 // Erase any lingering attachments
35 if (! isset($attachments)) {
36 $attachments = array();
38 $hashed_attachment_dir = getHashedDir($username, $attachment_dir);
39 foreach ($attachments as $info) {
40 $attached_file = "$hashed_attachment_dir/$info[localfilename]";
41 if (file_exists($attached_file)) {
42 unlink($attached_file);
46 // If a user hits reload on the last page, $base_uri isn't set
47 // because it was deleted with the session.
48 if (! isset($base_uri)) {
49 ereg ("(^.*/)[^/]+/[^/]+$", $PHP_SELF, $regs);
54 setcookie('username', '', 0, $base_uri);
55 setcookie('key', '', 0, $base_uri);
59 header("Status: 303 See Other");
60 header("Location: $signout_page");
61 exit; /* we send no content if we're redirecting. */
67 if ($theme_css != '') {
69 <LINK REL
="stylesheet" TYPE
="text/css" HREF
="<?php echo $theme_css ?>">
73 <TITLE
><?php
echo $org_title ?
> - Signout
</TITLE
>
75 <BODY TEXT
="<?php echo $color[8] ?>" BGCOLOR
="<?php echo $color[4] ?>"
76 LINK
="<?php echo $color[7] ?>" VLINK
="<?php echo $color[7] ?>"
77 ALINK
="<?php echo $color[7] ?>">
79 <TABLE BGCOLOR
="FFFFFF" BORDER
="0" COLS
="1" WIDTH
="50%" CELLSPACING
="0"
80 CELLPADDING
="2" ALIGN
="CENTER">
81 <TR BGCOLOR
="<?php echo $color[0] ?>" WIDTH
=100%
>
83 <B
><?php
echo _("Sign Out") ?
></B
>
86 <TR BGCOLOR
="<?php echo $color[4] ?>" WIDTH
=100%
>
88 <?php
do_hook('logout_above_text'); ?
>
89 <?php
echo _("You have been successfully signed out.") ?
><BR
>
90 <A HREF
="login.php" TARGET
="_top">
91 <?php
echo _("Click here to log back in.") ?
>
95 <TR BGCOLOR
="<?php echo $color[0] ?>" WIDTH
=100%
>