Permalink
Browse files

MDL-18006 MDL-18807 MDL-20853 do not force changing of admin password…

…s if password not stored in Moodle
  • Loading branch information...
1 parent 5c66ab3 commit 8993cd4d22e4df6ecc47462fc03e6be60433a164 @skodak skodak committed Nov 17, 2009
Showing with 5 additions and 1 deletion.
  1. +5 −1 lib/db/upgrade.php
View
@@ -3213,7 +3213,7 @@ function xmldb_main_upgrade($oldversion=0) {
}
// Force administrators to change password on next login
- $sql = "SELECT DISTINCT u.id, u.firstname, u.lastname, u.picture, u.imagealt, u.email
+ $sql = "SELECT DISTINCT u.id, u.firstname, u.lastname, u.picture, u.imagealt, u.email, u.password
FROM {$CFG->prefix}role_capabilities rc
JOIN {$CFG->prefix}role_assignments ra ON (ra.contextid = rc.contextid AND ra.roleid = rc.roleid)
JOIN {$CFG->prefix}user u ON u.id = ra.userid
@@ -3224,6 +3224,10 @@ function xmldb_main_upgrade($oldversion=0) {
$adminusers = get_records_sql($sql);
foreach ($adminusers as $adminuser) {
+ if ($adminuser->password === 'not cached') {
+ // no need to change password if stored only outside of moodle - most probably ldap auth
+ continue;
+ }
if ($preference = get_record('user_preferences', 'userid', $adminuser->id, 'name', 'auth_forcepasswordchange')) {
if ($preference->value == '1') {
continue;

0 comments on commit 8993cd4

Please sign in to comment.