diff --git a/admin/cli/reset_password.php b/admin/cli/reset_password.php index d7b4f74ed08..3cc3204055b 100644 --- a/admin/cli/reset_password.php +++ b/admin/cli/reset_password.php @@ -51,25 +51,25 @@ Options: Example: \$sudo -u www-data /usr/bin/php admin/cli/reset_password.php -"; //TODO: localize - to be translated later when everything is finished +"; echo $help; die; } -cli_heading('Password reset'); // TODO: localize -$prompt = "enter username (manual authentication only)"; // TODO: localize +cli_heading('Password reset'); +$prompt = "Enter username (manual authentication only)"; $username = cli_input($prompt); if (!$user = $DB->get_record('user', array('auth'=>'manual', 'username'=>$username, 'mnethostid'=>$CFG->mnet_localhost_id))) { cli_error("Can not find user '$username'"); } -$prompt = "Enter new password"; // TODO: localize +$prompt = "Enter new password"; $password = cli_input($prompt); $errmsg = '';//prevent eclipse warning if (!check_password_policy($password, $errmsg)) { - cli_error($errmsg); + cli_error(html_to_text($errmsg, 0)); } $hashedpassword = hash_internal_user_password($password); @@ -78,4 +78,4 @@ $DB->set_field('user', 'password', $hashedpassword, array('id'=>$user->id)); echo "Password changed\n"; -exit(0); // 0 means success \ No newline at end of file +exit(0); // 0 means success.