added option to enable/disable alternating row colors
[squirrelmail.git] / src / signout.php
1 <?php
2 /**
3 ** signout.php -- cleans up session and logs the user out
4 **
5 ** Copyright (c) 1999-2000 The SquirrelMail development team
6 ** Licensed under the GNU GPL. For full terms see the file COPYING.
7 **
8 ** Cleans up after the user. Resets cookies and terminates
9 ** session.
10 **
11 ** $Id$
12 **/
13
14 include('../src/validate.php');
15 include('../functions/strings.php');
16 include ('../src/load_prefs.php');
17 include('../config/config.php');
18 include('../functions/i18n.php');
19 include ('../functions/prefs.php');
20 include ('../functions/plugin.php');
21
22
23 // Erase any lingering attachments
24 if (! isset($attachments))
25 $attachments = array();
26 foreach ($attachments as $info)
27 {
28 if (file_exists($attachment_dir . $info['localfilename']))
29 {
30 unlink($attachment_dir . $info['localfilename']);
31 }
32 }
33
34 set_up_language(getPref($data_dir, $username, 'language'));
35
36 // If a user hits reload on the last page, $base_uri isn't set
37 // because it was deleted with the session.
38 if (! isset($base_uri))
39 {
40 ereg ("(^.*/)[^/]+/[^/]+$", $PHP_SELF, $regs);
41 $base_uri = $regs[1];
42 }
43
44 do_hook('logout');
45 setcookie('username', '', 0, $base_uri);
46 setcookie('key', '', 0, $base_uri);
47 setcookie('logged_in', '', 0, $base_uri);
48 session_destroy();
49 ?>
50 <HTML>
51 <HEAD>
52 <?php
53 if ($theme_css != '') {
54 ?>
55 <LINK REL="stylesheet" TYPE="text/css" HREF="<?php echo $theme_css ?>">
56 <?php
57 }
58 ?>
59 <TITLE><?php echo $org_title ?> - Signout</TITLE>
60 </HEAD>
61 <BODY TEXT="<?php echo $color[8] ?>" BGCOLOR="<?php echo $color[4] ?>"
62 LINK="<?php echo $color[7] ?>" VLINK="<?php echo $color[7] ?>" A
63 LINK="<?php echo $color[7] ?>">
64 <BR><BR>
65 <TABLE BGCOLOR="FFFFFF" BORDER="0" COLS="1" WIDTH="50%" CELLSPACING="0"
66 CELLPADDING="2" ALIGN="CENTER">
67 <TR BGCOLOR="<?php echo $color[0] ?>" WIDTH=100%>
68 <TD ALIGN="CENTER">
69 <B><?php echo _("Sign Out") ?></B>
70 </TD>
71 </TR>
72 <TR BGCOLOR="<?php echo $color[4] ?>" WIDTH=100%>
73 <TD ALIGN="CENTER">
74 <?php echo _("You have been successfully signed out.") ?><BR>
75 <A HREF="login.php" TARGET="_top">
76 <?php echo _("Click here to log back in.") ?>
77 </A><BR><BR>
78 </TD>
79 </TR>
80 <TR BGCOLOR="<?php echo $color[0] ?>" WIDTH=100%>
81 <TD ALIGN="CENTER">
82 <BR>
83 </TD>
84 </TR>
85 </TABLE>
86 </BODY>
87 </HTML>