Browse Source

Now compares the user's language cookie with his preferences and corrects the cookie if they are different or it is unset

graf25 24 năm trước cách đây
mục cha
commit
a8dca8a7e1
1 tập tin đã thay đổi với 8 bổ sung0 xóa
  1. 8 0
      src/webmail.php

+ 8 - 0
src/webmail.php

@@ -44,6 +44,14 @@
    include ('../src/load_prefs.php');
 
    // We'll need this to later have a noframes version
+   //
+   // Check if the user has a language preference, but no cookie.
+   // Send him a cookie with his language preference, if there is
+   // such discrepancy.
+   $my_language=getPref($data_dir, $username, "language");
+   if ($my_language != $squirrelmail_language)
+     setcookie('squirrelmail_language', $my_language, time()+2592000);
+
    set_up_language(getPref($data_dir, $username, 'language'));
 
    echo "<html><head>\n";