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