* Very minor bugfixes
[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
245a6892 14 session_start();
15
ceac7a2f 16 if (!isset($strings_php))
17 include("../functions/strings.php");
18
7b0a0f19 19 include ("../src/load_prefs.php");
20
e90872be 21 if (!isset($config_php))
22 include("../config/config.php");
7b0a0f19 23 if (!isset($i18n_php))
24 include("../functions/i18n.php");
25 if (!isset($prefs_php))
26 include ("../functions/prefs.php");
c6d6fe73 27 if (!isset($plugin_php))
28 include ("../functions/plugin.php");
7b0a0f19 29
441f2d33 30 set_up_language(getPref($data_dir, $username, "language"));
288491a4 31
ceac7a2f 32 // If a user hits reload on the last page, $base_uri isn't set
33 // because it was deleted with the session.
34 if (! isset($base_uri))
35 {
36 ereg ("(^.*/)[^/]+/[^/]+$", $PHP_SELF, $regs);
37 $base_uri = $regs[1];
38 }
39
c6d6fe73 40 do_hook("logout");
41 setcookie("username", "", 0, $base_uri);
42 setcookie("key", "", 0, $base_uri);
43 setcookie("logged_in", "", 0, $base_uri);
9f2215a1 44 session_destroy();
21c3249f 45?>
46<HTML>
e90872be 47 <HEAD>
59177427 48<?php
e90872be 49 if ($theme_css != "") {
50 printf ('<LINK REL="stylesheet" TYPE="text/css" HREF="%s">',
51 $theme_css);
52 echo "\n";
53 }
ceac7a2f 54
55 echo "<TITLE>$org_title - Signout</TITLE>\n";
5218b282 56 echo "</HEAD><BODY TEXT=$color[8] BGCOLOR=$color[4] LINK=$color[7] VLINK=$color[7] ALINK=$color[7]>\n";
71fd5383 57 echo "<BR><BR><TABLE BGCOLOR=FFFFFF BORDER=0 COLS=1 WIDTH=50% CELLSPACING=0 CELLPADDING=2 ALIGN=CENTER>";
58 echo " <TR BGCOLOR=$color[0] WIDTH=100%>";
21c3249f 59 echo " <TD ALIGN=CENTER>";
aae41ae9 60 echo " <B>";
b581fa60 61 echo _("Sign Out");
aae41ae9 62 echo "</B>";
21c3249f 63 echo " </TD>";
64 echo " </TR>";
71fd5383 65 echo " <TR BGCOLOR=$color[4] WIDTH=100%>";
21c3249f 66 echo " <TD ALIGN=CENTER>";
aae41ae9 67 echo " <BR>";
b581fa60 68 echo _("You have been successfully signed out.");
aae41ae9 69 echo "<BR>";
b581fa60 70 echo "<A HREF=\"login.php\" TARGET=_top>";
7b0a0f19 71 echo _("Click here to log back in.");
aae41ae9 72 echo "</A><BR><BR>";
21c3249f 73 echo " </TD>";
74 echo " </TR>";
71fd5383 75 echo " <TR BGCOLOR=$color[0] WIDTH=100%>";
21c3249f 76 echo " <TD ALIGN=CENTER>";
42a54da4 77 echo " <br>";
21c3249f 78 echo " </TD>";
79 echo " </TR>";
80 echo "</TABLE>";
42a54da4 81 echo "<br><br>";
21c3249f 82?>
83</BODY>
84</HTML>