Fixed the cookie language problem. Thank Przemek Piotrowski
authorphilippe_mingo <philippe_mingo@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 22 Oct 2001 12:44:56 +0000 (12:44 +0000)
committerphilippe_mingo <philippe_mingo@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 22 Oct 2001 12:44:56 +0000 (12:44 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@1597 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/i18n.php
src/options.php
src/redirect.php
src/webmail.php

index a25dce1..77b66fe 100644 (file)
          $sm_language = substr($HTTP_ACCEPT_LANGUAGE, 0, 2);
       }
       if (!$sm_language && isset($squirrelmail_default_language))
-         $sm_language = $squirrelmail_default_language;
+         $squirrelmail_language = $squirrelmail_default_language;
       $sm_notAlias = $sm_language;
       while (isset($languages[$sm_notAlias]['ALIAS']))
          $sm_notAlias = $languages[$sm_notAlias]['ALIAS'];
index 3ad2191..37d478c 100644 (file)
    require_once('../functions/display_messages.php');
    require_once('../functions/imap.php');
    require_once('../functions/array.php');
+   
+  ereg ("(^.*/)[^/]+/[^/]+$", $PHP_SELF, $regs);
+  $base_uri = $regs[1];   
 
    if (isset($language)) {
-      setcookie('squirrelmail_language', $language, time()+2592000);
+      setcookie('squirrelmail_language', $language, time()+2592000, $base_uri);
       $squirrelmail_language = $language;
    }   
 
index 35a1d43..431ba25 100644 (file)
@@ -49,7 +49,7 @@
 
    // Refresh the language cookie.
    if (isset($squirrelmail_language)) {
-      setcookie('squirrelmail_language', $squirrelmail_language, time()+2592000);
+      setcookie('squirrelmail_language', $squirrelmail_language, time()+2592000,$base_uri);
    }
 
 
index 39a1c82..3544d16 100644 (file)
@@ -21,6 +21,9 @@
    require_once('../functions/i18n.php');
    require_once('../functions/auth.php');
 
+   ereg ("(^.*/)[^/]+/[^/]+$", $PHP_SELF, $regs);
+   $base_uri = $regs[1];
+
    session_start();
    is_logged_in();
    checkForPrefs($data_dir, $username);
@@ -32,7 +35,7 @@
    // such discrepancy.
    $my_language=getPref($data_dir, $username, "language");
    if ($my_language != $squirrelmail_language)
-     setcookie('squirrelmail_language', $my_language, time()+2592000);
+     setcookie('squirrelmail_language', $my_language, time()+2592000, $base_uri);
 
    set_up_language(getPref($data_dir, $username, 'language'));