* Got bored and copied all the validate.php and define() stuff to 1.1
[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 foreach ($attachments as $info)
25 {
26 if (file_exists($attachment_dir . $info['localfilename']))
27 {
28 unlink($attachment_dir . $info['localfilename']);
29 }
30 }
31
32 set_up_language(getPref($data_dir, $username, 'language'));
33
34 // If a user hits reload on the last page, $base_uri isn't set
35 // because it was deleted with the session.
36 if (! isset($base_uri))
37 {
38 ereg ("(^.*/)[^/]+/[^/]+$", $PHP_SELF, $regs);
39 $base_uri = $regs[1];
40 }
41
42 do_hook('logout');
43 setcookie('username', '', 0, $base_uri);
44 setcookie('key', '', 0, $base_uri);
45 setcookie('logged_in', '', 0, $base_uri);
46 session_destroy();
47 ?>
48 <HTML>
49 <HEAD>
50 <?php
51 if ($theme_css != '') {
52 ?>
53 <LINK REL="stylesheet" TYPE="text/css" HREF="<?php echo $theme_css ?>">
54 <?php
55 }
56 ?>
57 <TITLE><?php echo $org_title ?> - Signout</TITLE>
58 </HEAD>
59 <BODY TEXT="<?php echo $color[8] ?>" BGCOLOR="<?php echo $color[4] ?>"
60 LINK="<?php echo $color[7] ?>" VLINK="<?php echo $color[7] ?>" A
61 LINK="<?php echo $color[7] ?>">
62 <BR><BR>
63 <TABLE BGCOLOR="FFFFFF" BORDER="0" COLS="1" WIDTH="50%" CELLSPACING="0"
64 CELLPADDING="2" ALIGN="CENTER">
65 <TR BGCOLOR="<?php echo $color[0] ?>" WIDTH=100%>
66 <TD ALIGN="CENTER">
67 <B><?php echo _("Sign Out") ?></B>
68 </TD>
69 </TR>
70 <TR BGCOLOR="<?php echo $color[4] ?>" WIDTH=100%>
71 <TD ALIGN="CENTER">
72 <?php echo _("You have been successfully signed out.") ?><BR>
73 <A HREF="login.php" TARGET="_top">
74 <?php echo _("Click here to log back in.") ?>
75 </A><BR><BR>
76 </TD>
77 </TR>
78 <TR BGCOLOR="<?php echo $color[0] ?>" WIDTH=100%>
79 <TD ALIGN="CENTER">
80 <BR>
81 </TD>
82 </TR>
83 </TABLE>
84 </BODY>
85 </HTML>