fixed more language settings in email; marked more strings for translation
[e-DoKo.git] / include / user.php
index d486b0746b96021d1c9f6b79f83bb2e2227c889b..a80fddd0a991e360ad70adbc176cc21f921d3b25 100644 (file)
@@ -64,12 +64,12 @@ if(myisset('forgot'))
            $hash  = md5('Anewpassword'.$email.$TIME);
            $newpw = substr($hash,1,8);
 
-           $message = "Someone (hopefully you) requested a new password. \n".
-             "You can use this email and the following password: \n".
-             "   $newpw    \n".
+           $message = sprintf( _("Someone (hopefully you) requested a new password.\n".
+             "You can use this email and the following password:\n".
+             "   %s\n".
              "to log into the server. The new password is valid for 24h, so make\n".
              "sure you reset your password to something new. Your old password will\n".
-             "also still be valid until you set a new one.\n";
+             "also still be valid until you set a new one.\n"), $newpw);
            mymail($myid,0, GAME_RECOVERY, $message);
 
            /* we save these in the database */
@@ -101,10 +101,14 @@ else
   { /* normal user page */
 
     /* verify password and email */
-
     $ok  = 1;
-    $myid = DB_get_userid('email-password',$email,$password);
-    if(!$myid)
+    if(isset($email, $password))
+      {
+       $myid = DB_get_userid('email-password',$email,$password);
+        if(!$myid)
+         $ok = 0;
+      }
+    else
       $ok = 0;
 
     if($ok)
@@ -116,6 +120,7 @@ else
        $PREF = DB_get_PREF($myid);
        /* set language chosen in preferences, will become active on the next reload (see index.php)*/
        $_SESSION['language'] = $PREF['language'];
+       set_language($PREF['language']);
 
        DB_update_user_timestamp($myid);