applied Patch #101198 There was an inconsistancy, where a color was hardcoded, and...
[squirrelmail.git] / src / signout.php
CommitLineData
59177427 1<?php
2a32fc83 2 session_start();
3
c6d6fe73 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 **/
8b522a59 14
7b0a0f19 15 include ("../src/load_prefs.php");
16
e90872be 17 if (!isset($config_php))
18 include("../config/config.php");
7b0a0f19 19 if (!isset($i18n_php))
20 include("../functions/i18n.php");
21 if (!isset($prefs_php))
22 include ("../functions/prefs.php");
c6d6fe73 23 if (!isset($plugin_php))
24 include ("../functions/plugin.php");
7b0a0f19 25
26 // Quick Fix for Gettext in LogOut Screen
27 if (!function_exists("_")) {
8b522a59 28 function _($string) {
29 return $string;
30 }
31 }
32
7b0a0f19 33 $squirrelmail_language = getPref ($data_dir, $username, "language");
71fd5383 34 if (isset($squirrelmail_language)) {
7b0a0f19 35 if ($squirrelmail_language != "en" && $squirrelmail_language != "") {
36 putenv("LC_ALL=".$squirrelmail_language);
71fd5383 37 bindtextdomain("squirrelmail", "../locale/");
38 textdomain("squirrelmail");
7b0a0f19 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
71fd5383 46 }
47 }
288491a4 48
c6d6fe73 49 do_hook("logout");
50 setcookie("username", "", 0, $base_uri);
51 setcookie("key", "", 0, $base_uri);
52 setcookie("logged_in", "", 0, $base_uri);
9f2215a1 53 session_destroy();
21c3249f 54?>
55<HTML>
e90872be 56 <HEAD>
59177427 57<?php
e90872be 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";
5218b282 64 echo "</HEAD><BODY TEXT=$color[8] BGCOLOR=$color[4] LINK=$color[7] VLINK=$color[7] ALINK=$color[7]>\n";
71fd5383 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%>";
21c3249f 67 echo " <TD ALIGN=CENTER>";
aae41ae9 68 echo " <B>";
b581fa60 69 echo _("Sign Out");
aae41ae9 70 echo "</B>";
21c3249f 71 echo " </TD>";
72 echo " </TR>";
71fd5383 73 echo " <TR BGCOLOR=$color[4] WIDTH=100%>";
21c3249f 74 echo " <TD ALIGN=CENTER>";
aae41ae9 75 echo " <BR>";
b581fa60 76 echo _("You have been successfully signed out.");
aae41ae9 77 echo "<BR>";
b581fa60 78 echo "<A HREF=\"login.php\" TARGET=_top>";
7b0a0f19 79 echo _("Click here to log back in.");
aae41ae9 80 echo "</A><BR><BR>";
21c3249f 81 echo " </TD>";
82 echo " </TR>";
71fd5383 83 echo " <TR BGCOLOR=$color[0] WIDTH=100%>";
21c3249f 84 echo " <TD ALIGN=CENTER>";
42a54da4 85 echo " <br>";
21c3249f 86 echo " </TD>";
87 echo " </TR>";
88 echo "</TABLE>";
42a54da4 89 echo "<br><br>";
21c3249f 90?>
91</BODY>
92</HTML>