Merge branch 'w09_MDL-26564_20_uploadusers' of git://github.com/skodak/moodle
authorEloy Lafuente (stronk7) <stronk7@moodle.org>
Tue, 1 Mar 2011 18:02:04 +0000 (19:02 +0100)
committerEloy Lafuente (stronk7) <stronk7@moodle.org>
Tue, 1 Mar 2011 18:02:04 +0000 (19:02 +0100)
admin/uploaduser.php

index c2be9f1..1861a5d 100644 (file)
@@ -538,7 +538,7 @@ if ($formdata = $mform2->is_cancelled()) {
             } else if (!empty($user->password)) {
                 if ($updatepasswords) {
                     $errmsg = null;
-                    $weak = check_password_policy($user->password, $errmsg);
+                    $weak = !check_password_policy($user->password, $errmsg);
                     if ($resetpasswords == UU_PWRESET_ALL or ($resetpasswords == UU_PWRESET_WEAK and $weak)) {
                         if ($weak) {
                             $weakpasswords++;
@@ -550,6 +550,7 @@ if ($formdata = $mform2->is_cancelled()) {
                     }
                     unset_user_preference('create_password', $existinguser); // no need to create password any more
                     $existinguser->password = hash_internal_user_password($user->password);
+                    $upt->track('password', $user->password, 'normal', false);
                 } else {
                     // do not print password when not changed
                     $upt->track('password', '', 'normal', false);
@@ -644,7 +645,7 @@ if ($formdata = $mform2->is_cancelled()) {
                     }
                 } else {
                     $errmsg = null;
-                    $weak = check_password_policy($user->password, $errmsg);
+                    $weak = !check_password_policy($user->password, $errmsg);
                     if ($resetpasswords == UU_PWRESET_ALL or ($resetpasswords == UU_PWRESET_WEAK and $weak)) {
                         if ($weak) {
                             $weakpasswords++;