Merging latest changes from stable branch up to 2.3.24
[fa-stable.git] / includes / current_user.inc
index 87f71b1e45ce2a6c9ee10357bb4f3cc1ae4ee3c1..72a97118adbbb31e337e7c3d9cee5d1a972a16f0 100644 (file)
@@ -150,16 +150,16 @@ class current_user
 
                set_global_connection();
 
-               $myrow = get_user_by_email($email);
+               $user = get_user_by_email($email);
 
-               if ($myrow['id'] != "") {
+               if ($user != false) {
 
                        $bytes = openssl_random_pseudo_bytes(8, $cstrong);
                        $password   = base64_encode($bytes);
 
                        $hash = md5($password);
 
-                       update_user_password($myrow['id'], $myrow['user_id'], $hash);
+                       update_user_password($user['id'], $user['user_id'], $hash);
 
                        mail($myrow['email'], _("New password for")." ".$SysPrefs->app_title, $password);