$result = db_query($sql, "could not get user for email $email");
+ if (db_num_rows($result) != 1)
+ return false;
+
return db_fetch($result);
}
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;
}
global $path_to_root;
echo "<center><br><br><font size='5' color='red'><b>" . _("Incorrect Email") . "<b></font><br><br>";
- echo "<b>" . _("The email address does not exist in the system.") . "<b><br><br>";
+ echo "<b>" . _("The email address does not exist in the system, or is used by more than one user.") . "<b><br><br>";
- echo _("If you are not an authorized user, please contact your system administrator to obtain an account to enable you to use the system.");
+ echo _("Plase try again or contact your system administrator to obtain new password.");
echo "<br><a href='$path_to_root/index.php?reset=1'>" . _("Try again") . "</a>";
echo "</center>";