- added more hooks
[squirrelmail.git] / src / signout.php
1 <?php
2 session_start();
3
4 /**
5 ** signout.php -- cleans up session and logs the user out
6 **
7 ** Copyright (c) 1999-2000 The SquirrelMail development team
8 ** Licensed under the GNU GPL. For full terms see the file COPYING.
9 **
10 ** Cleans up after the user. Resets cookies and terminates
11 ** session.
12 **
13 **/
14
15 include ("../src/load_prefs.php");
16
17 if (!isset($i18n_php))
18 include("../functions/i18n.php");
19 if (!isset($prefs_php))
20 include ("../functions/prefs.php");
21 if (!isset($plugin_php))
22 include ("../functions/plugin.php");
23
24 // Quick Fix for Gettext in LogOut Screen
25 if (!function_exists("_")) {
26 function _($string) {
27 return $string;
28 }
29 }
30
31 $squirrelmail_language = getPref ($data_dir, $username, "language");
32 if (isset($squirrelmail_language)) {
33 if ($squirrelmail_language != "en" && $squirrelmail_language != "") {
34 putenv("LC_ALL=".$squirrelmail_language);
35 bindtextdomain("squirrelmail", "../locale/");
36 textdomain("squirrelmail");
37 header ("Content-Type: text/html; charset=".$languages[$squirrelmail_language]["CHARSET"]);
38
39 // Setting cookie to use on the login screen the next time the
40 // same user logs in.
41 setcookie("squirrelmail_language", $squirrelmail_language,
42 time()+2592000);
43
44 }
45 }
46
47 do_hook("logout");
48 setcookie("username", "", 0, $base_uri);
49 setcookie("key", "", 0, $base_uri);
50 setcookie("logged_in", "", 0, $base_uri);
51 session_destroy();
52 ?>
53 <HTML>
54 <?php
55 echo "<BODY TEXT=000000 BGCOLOR=$color[4] LINK=$color[7] VLINK=$color[7] ALINK=$color[7]>\n";
56 echo "<BR><BR><TABLE BGCOLOR=FFFFFF BORDER=0 COLS=1 WIDTH=50% CELLSPACING=0 CELLPADDING=2 ALIGN=CENTER>";
57 echo " <TR BGCOLOR=$color[0] WIDTH=100%>";
58 echo " <TD ALIGN=CENTER>";
59 echo " <B>";
60 echo _("Sign Out");
61 echo "</B>";
62 echo " </TD>";
63 echo " </TR>";
64 echo " <TR BGCOLOR=$color[4] WIDTH=100%>";
65 echo " <TD ALIGN=CENTER>";
66 echo " <BR>";
67 echo _("You have been successfully signed out.");
68 echo "<BR>";
69 echo "<A HREF=\"login.php\" TARGET=_top>";
70 echo _("Click here to log back in.");
71 echo "</A><BR><BR>";
72 echo " </TD>";
73 echo " </TR>";
74 echo " <TR BGCOLOR=$color[0] WIDTH=100%>";
75 echo " <TD ALIGN=CENTER>";
76 echo " <br>";
77 echo " </TD>";
78 echo " </TR>";
79 echo "</TABLE>";
80 echo "<br><br>";
81 ?>
82 </BODY>
83 </HTML>