Workaround for the "catalan" bug. This leaves blank language
[squirrelmail.git] / src / signout.php
1 <?php
2
3 /**
4 * signout.php -- cleans up session and logs the user out
5 *
6 * Copyright (c) 1999-2001 The SquirrelMail Development Team
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 */
13
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
30 require_once('../src/validate.php');
31 require_once('../functions/prefs.php');
32 require_once('../functions/plugin.php');
33
34 // Erase any lingering attachments
35 if (! isset($attachments)) {
36 $attachments = array();
37 }
38 foreach ($attachments as $info) {
39 if (file_exists($attachment_dir . $info['localfilename'])) {
40 unlink($attachment_dir . $info['localfilename']);
41 }
42 }
43
44 // If a user hits reload on the last page, $base_uri isn't set
45 // because it was deleted with the session.
46 if (! isset($base_uri)) {
47 ereg ("(^.*/)[^/]+/[^/]+$", $PHP_SELF, $regs);
48 $base_uri = $regs[1];
49 }
50
51 do_hook('logout');
52 setcookie('username', '', 0, $base_uri);
53 setcookie('key', '', 0, $base_uri);
54 session_destroy();
55
56 if ($signout_page) {
57 header("Status: 303 See Other");
58 header("Location: $signout_page");
59 exit; /* we send no content if we're redirecting. */
60 }
61 ?>
62 <HTML>
63 <HEAD>
64 <?php
65 if ($theme_css != '') {
66 ?>
67 <LINK REL="stylesheet" TYPE="text/css" HREF="<?php echo $theme_css ?>">
68 <?php
69 }
70 ?>
71 <TITLE><?php echo $org_title ?> - Signout</TITLE>
72 </HEAD>
73 <BODY TEXT="<?php echo $color[8] ?>" BGCOLOR="<?php echo $color[4] ?>"
74 LINK="<?php echo $color[7] ?>" VLINK="<?php echo $color[7] ?>"
75 ALINK="<?php echo $color[7] ?>">
76 <BR><BR>
77 <TABLE BGCOLOR="FFFFFF" BORDER="0" COLS="1" WIDTH="50%" CELLSPACING="0"
78 CELLPADDING="2" ALIGN="CENTER">
79 <TR BGCOLOR="<?php echo $color[0] ?>" WIDTH=100%>
80 <TD ALIGN="CENTER">
81 <B><?php echo _("Sign Out") ?></B>
82 </TD>
83 </TR>
84 <TR BGCOLOR="<?php echo $color[4] ?>" WIDTH=100%>
85 <TD ALIGN="CENTER">
86 <?php do_hook('logout_above_text'); ?>
87 <?php echo _("You have been successfully signed out.") ?><BR>
88 <A HREF="login.php" TARGET="_top">
89 <?php echo _("Click here to log back in.") ?>
90 </A><BR><BR>
91 </TD>
92 </TR>
93 <TR BGCOLOR="<?php echo $color[0] ?>" WIDTH=100%>
94 <TD ALIGN="CENTER">
95 <BR>
96 </TD>
97 </TR>
98 </TABLE>
99 </BODY>
100 </HTML>