Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MDL-20962 fixed forced new passowrd logic

  • Loading branch information...
commit 676fff3fa189e048ec6086d099e2b391cc76bf2d 1 parent 6d558e7
@skodak skodak authored
Showing with 6 additions and 4 deletions.
  1. +6 −4 admin/uploaduser.php
View
10 admin/uploaduser.php
@@ -149,8 +149,7 @@
$renames = 0;
$renameerrors = 0;
$usersskipped = 0;
-
- $forcechangepassword = 0;
+ $weakpasswords = 0;
// caches
$ccache = array(); // course cache - do not fetch all courses here, we will not probably use them all anyway!
@@ -192,6 +191,8 @@
$upt->track('line', $linenum);
+ $forcechangepassword = false;
+
$user = new object();
// by default, use the local mnet id (this may be changed in the file)
$user->mnethostid = $CFG->mnet_localhost_id;
@@ -204,7 +205,8 @@
if ($value !== '') {
$user->password = hash_internal_user_password($value);
if (!empty($CFG->passwordpolicy) and !check_password_policy($value, $errmsg)) {
- $forcechangepassword++;
+ $forcechangepassword = true;
+ $weakpasswords++;
}
}
} else {
@@ -707,7 +709,7 @@
if ($usersskipped) {
echo get_string('usersskipped', 'admin').': '.$usersskipped.'<br />';
}
- echo get_string('usersweakpassword', 'admin').': '.$forcechangepassword.'<br />';
+ echo get_string('usersweakpassword', 'admin').': '.$weakpasswords.'<br />';
echo get_string('errors', 'admin').': '.$userserrors.'</p>';
print_box_end();
Please sign in to comment.
Something went wrong with that request. Please try again.