Now compares the user's language cookie with his preferences and corrects the cookie...
[squirrelmail.git] / src / webmail.php
index 95e2f41daaed8e9287e0828bba645322f4baf6d5..ae497bad6a0fb1c47936ffee559b987dbe1e6c2e 100644 (file)
    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";