* Very minor bugfixes
[squirrelmail.git] / src / signout.php
index a3eb90ea545298d2cde382db5684c3c4ab0517da..d77db43beb6571f4caef58ed40ab6b42ccaa111c 100644 (file)
@@ -1,6 +1,4 @@
 <?php
-   session_start();
-
    /**
     **  signout.php -- cleans up session and logs the user out
     **
@@ -10,8 +8,14 @@
     **  Cleans up after the user. Resets cookies and terminates
     **  session.
     **
+    **  $Id$
     **/
 
+   session_start();
+
+   if (!isset($strings_php))
+      include("../functions/strings.php");
+
    include ("../src/load_prefs.php");
 
    if (!isset($config_php))
    if (!isset($plugin_php))
       include ("../functions/plugin.php");
 
-   // Quick Fix for Gettext in LogOut Screen
-   if (!function_exists("_")) {
-      function _($string) {
-         return $string;
-      }
-   }
-
-   $squirrelmail_language = getPref ($data_dir, $username, "language");
-   if (isset($squirrelmail_language)) {
-      if ($squirrelmail_language != "en" && $squirrelmail_language != "") {
-         putenv("LC_ALL=".$squirrelmail_language);
-         bindtextdomain("squirrelmail", "../locale/");
-         textdomain("squirrelmail");
-         header ("Content-Type: text/html; charset=".$languages[$squirrelmail_language]["CHARSET"]);
-
-         // Setting cookie to use on the login screen the next time the
-         // same user logs in.
-         setcookie("squirrelmail_language", $squirrelmail_language, 
-                   time()+2592000);
+   set_up_language(getPref($data_dir, $username, "language"));
 
-      }
+   // If a user hits reload on the last page, $base_uri isn't set
+   // because it was deleted with the session.
+   if (! isset($base_uri))
+   {
+       ereg ("(^.*/)[^/]+/[^/]+$", $PHP_SELF, $regs);
+       $base_uri = $regs[1];
    }
 
    do_hook("logout");
@@ -60,8 +51,9 @@
                $theme_css);
       echo "\n";
    }
-   echo "<TITLE>$title - Signout</TITLE>\n";
-   echo "</HEAD><BODY TEXT=000000 BGCOLOR=$color[4] LINK=$color[7] VLINK=$color[7] ALINK=$color[7]>\n";
+   
+   echo "<TITLE>$org_title - Signout</TITLE>\n";
+   echo "</HEAD><BODY TEXT=$color[8] BGCOLOR=$color[4] LINK=$color[7] VLINK=$color[7] ALINK=$color[7]>\n";
    echo "<BR><BR><TABLE BGCOLOR=FFFFFF BORDER=0 COLS=1 WIDTH=50% CELLSPACING=0 CELLPADDING=2 ALIGN=CENTER>";
    echo "   <TR BGCOLOR=$color[0] WIDTH=100%>";
    echo "      <TD ALIGN=CENTER>";