Rerun. Fixed wrong calculaiton of standard cost during Advanced Manufacturing. Petros
[fa-stable.git] / includes / current_user.inc
index 31f53ae6c411d79d26eb451cbf4024c8f6237c3d..515f6e4e0d57bcd8f04e3c62cd0ff7d3918e0586 100644 (file)
@@ -132,29 +132,29 @@ class current_user
        }
 
        function reset_password($company, $email) {
-               global $path_to_root, $app_title;
+               global $app_title;
 
                $this->set_company($company);
                $this->logged = false;
 
                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")." ".$app_title, $password);
+                       mail($user['email'], _("New password for")." ".$app_title, $password);
 
                        return true;
                }
-       return false;
+               return false;
     }
 
        function check_user_access()