fixed an HTML rendering bug in search display
[squirrelmail.git] / src / login.php
index ad71c775aa502a8f8be5872e299e6dc50ab3fa83..6e2119b18387dc5661d358aecbd22af37d41e4cc 100644 (file)
    if (!isset($plugin_php))
       include("../functions/plugin.php");
 
-   // let's check to see if they compiled with gettext support
-   if (!function_exists("_")) {
-      function _($string) {
-         return $string;
-      }
-   } else {
-      // $squirrelmail_language is set by a cookie when the user selects
-      // language and logs out
-
-      // Use HTTP content language negotiation if cookie not set
-      if (!isset($squirrelmail_language) && isset($HTTP_ACCEPT_LANGUAGE)) {
-         $squirrelmail_language = substr($HTTP_ACCEPT_LANGUAGE, 0, 2);
-      }
-
-      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"]);
-         }
-      }
-   }
+   // $squirrelmail_language is set by a cookie when the user selects
+   // language and logs out
+   set_up_language($squirrelmail_language, true);
 
    // Need the base URI to set the cookies. (Same code as in webmail.php)
    ereg ("(^.*/)[^/]+/[^/]+$", $PHP_SELF, $regs);
 
    // In case the last session was not terminated properly, make sure
    // we get a new one.
-   setcookie("PHPSESSID", "", 0, $base_uri);
+       $cookie_params = session_get_cookie_params(); 
+       setcookie(session_name(),"",0,$cookie_params["domain"].$cookie_params["path"]); 
 
    echo "<HTML>";
    echo "<HEAD><TITLE>";
    echo $org_name . " - " . _("Login");
    echo "</TITLE></HEAD>\n";
    echo "<BODY TEXT=000000 BGCOLOR=#FFFFFF LINK=0000CC VLINK=0000CC ALINK=0000CC>\n";
-   echo "<FORM ACTION=\"webmail.php\" METHOD=\"POST\" NAME=f>\n";
+   echo "<FORM ACTION=\"redirect.php\" METHOD=\"POST\" NAME=f>\n";
    
    $username_form_name = 'username';
    $password_form_name = 'secretkey';