changed email adress and added copyright notice
[squirrelmail.git] / src / signout.php
CommitLineData
59177427 1<?php
c6d6fe73 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 **
245a6892 11 ** $Id$
c6d6fe73 12 **/
8b522a59 13
ff8a98e7 14 require_once('../src/validate.php');
15 require_once('../functions/prefs.php');
16 require_once('../functions/plugin.php');
f740c049 17
f740c049 18 // Erase any lingering attachments
cf6c6275 19 if (! isset($attachments)) {
5c263f27 20 $attachments = array();
cf6c6275 21 }
22 foreach ($attachments as $info) {
23 if (file_exists($attachment_dir . $info['localfilename'])) {
f740c049 24 unlink($attachment_dir . $info['localfilename']);
25 }
26 }
288491a4 27
ceac7a2f 28 // If a user hits reload on the last page, $base_uri isn't set
29 // because it was deleted with the session.
cf6c6275 30 if (! isset($base_uri)) {
ceac7a2f 31 ereg ("(^.*/)[^/]+/[^/]+$", $PHP_SELF, $regs);
32 $base_uri = $regs[1];
33 }
34
91dc6e4e 35 do_hook('logout');
36 setcookie('username', '', 0, $base_uri);
37 setcookie('key', '', 0, $base_uri);
e0dcff78 38 setcookie('delimiter', '', 0, $base_uri);
9f2215a1 39 session_destroy();
f923b93d 40
41 if ($signout_page) {
42 header("Status: 303 See Other");
43 header("Location: $signout_page");
44 exit; /* we send no content if we're redirecting. */
45 }
21c3249f 46?>
47<HTML>
e90872be 48 <HEAD>
59177427 49<?php
91dc6e4e 50 if ($theme_css != '') {
8c65f339 51?>
cab59568 52<LINK REL="stylesheet" TYPE="text/css" HREF="<?php echo $theme_css ?>">
8c65f339 53<?php
e90872be 54 }
21c3249f 55?>
8437bc78 56<TITLE><?php echo $org_title ?> - Signout</TITLE>
8c65f339 57</HEAD>
8437bc78 58<BODY TEXT="<?php echo $color[8] ?>" BGCOLOR="<?php echo $color[4] ?>"
cf6df86f 59LINK="<?php echo $color[7] ?>" VLINK="<?php echo $color[7] ?>"
60ALINK="<?php echo $color[7] ?>">
8c65f339 61<BR><BR>
62<TABLE BGCOLOR="FFFFFF" BORDER="0" COLS="1" WIDTH="50%" CELLSPACING="0"
63CELLPADDING="2" ALIGN="CENTER">
8437bc78 64 <TR BGCOLOR="<?php echo $color[0] ?>" WIDTH=100%>
8c65f339 65 <TD ALIGN="CENTER">
8437bc78 66 <B><?php echo _("Sign Out") ?></B>
8c65f339 67 </TD>
68 </TR>
8437bc78 69 <TR BGCOLOR="<?php echo $color[4] ?>" WIDTH=100%>
8c65f339 70 <TD ALIGN="CENTER">
cf6df86f 71 <?php do_hook('logout_above_text'); ?>
8437bc78 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.") ?>
8c65f339 75 </A><BR><BR>
76 </TD>
77 </TR>
8437bc78 78 <TR BGCOLOR="<?php echo $color[0] ?>" WIDTH=100%>
8c65f339 79 <TD ALIGN="CENTER">
80 <BR>
81 </TD>
82 </TR>
83</TABLE>
21c3249f 84</BODY>
e0dcff78 85</HTML>