a3eb90ea545298d2cde382db5684c3c4ab0517da
[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($config_php))
18 include("../config/config.php");
19 if (!isset($i18n_php))
20 include("../functions/i18n.php");
21 if (!isset($prefs_php))
22 include ("../functions/prefs.php");
23 if (!isset($plugin_php))
24 include ("../functions/plugin.php");
25
26 // Quick Fix for Gettext in LogOut Screen
27 if (!function_exists("_")) {
28 function _($string) {
29 return $string;
30 }
31 }
32
33 $squirrelmail_language = getPref ($data_dir, $username, "language");
34 if (isset($squirrelmail_language)) {
35 if ($squirrelmail_language != "en" && $squirrelmail_language != "") {
36 putenv("LC_ALL=".$squirrelmail_language);
37 bindtextdomain("squirrelmail", "../locale/");
38 textdomain("squirrelmail");
39 header ("Content-Type: text/html; charset=".$languages[$squirrelmail_language]["CHARSET"]);
40
41 // Setting cookie to use on the login screen the next time the
42 // same user logs in.
43 setcookie("squirrelmail_language", $squirrelmail_language,
44 time()+2592000);
45
46 }
47 }
48
49 do_hook("logout");
50 setcookie("username", "", 0, $base_uri);
51 setcookie("key", "", 0, $base_uri);
52 setcookie("logged_in", "", 0, $base_uri);
53 session_destroy();
54 ?>
55 <HTML>
56 <HEAD>
57 <?php
58 if ($theme_css != "") {
59 printf ('<LINK REL="stylesheet" TYPE="text/css" HREF="%s">',
60 $theme_css);
61 echo "\n";
62 }
63 echo "<TITLE>$title - Signout</TITLE>\n";
64 echo "</HEAD><BODY TEXT=000000 BGCOLOR=$color[4] LINK=$color[7] VLINK=$color[7] ALINK=$color[7]>\n";
65 echo "<BR><BR><TABLE BGCOLOR=FFFFFF BORDER=0 COLS=1 WIDTH=50% CELLSPACING=0 CELLPADDING=2 ALIGN=CENTER>";
66 echo " <TR BGCOLOR=$color[0] WIDTH=100%>";
67 echo " <TD ALIGN=CENTER>";
68 echo " <B>";
69 echo _("Sign Out");
70 echo "</B>";
71 echo " </TD>";
72 echo " </TR>";
73 echo " <TR BGCOLOR=$color[4] WIDTH=100%>";
74 echo " <TD ALIGN=CENTER>";
75 echo " <BR>";
76 echo _("You have been successfully signed out.");
77 echo "<BR>";
78 echo "<A HREF=\"login.php\" TARGET=_top>";
79 echo _("Click here to log back in.");
80 echo "</A><BR><BR>";
81 echo " </TD>";
82 echo " </TR>";
83 echo " <TR BGCOLOR=$color[0] WIDTH=100%>";
84 echo " <TD ALIGN=CENTER>";
85 echo " <br>";
86 echo " </TD>";
87 echo " </TR>";
88 echo "</TABLE>";
89 echo "<br><br>";
90 ?>
91 </BODY>
92 </HTML>