Explorar o código

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

graf25 %!s(int64=24) %!d(string=hai) anos
pai
achega
a8dca8a7e1
Modificáronse 1 ficheiros con 8 adicións e 0 borrados
  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";