MDL-20933 fixed a regression, we should not force changing of password for admins that can not actually change the password
This commit is contained in:
+2
-1
@@ -846,6 +846,7 @@ function xmldb_main_upgrade($oldversion=0) {
|
||||
if ($result && $oldversion < 2007021599.14) {
|
||||
// this block tries to undo incorrect forcing of new passwords for admins that have no
|
||||
// way to change passwords MDL-20933
|
||||
$systemcontext = get_context_instance(CONTEXT_SYSTEM);
|
||||
$sql = "SELECT DISTINCT u.id, u.firstname, u.lastname, u.picture, u.imagealt, u.email, u.password, u.auth
|
||||
FROM {$CFG->prefix}role_capabilities rc
|
||||
JOIN {$CFG->prefix}role_assignments ra ON (ra.contextid = rc.contextid AND ra.roleid = rc.roleid)
|
||||
@@ -853,7 +854,7 @@ function xmldb_main_upgrade($oldversion=0) {
|
||||
WHERE rc.capability = 'moodle/site:doanything'
|
||||
AND rc.permission = ".CAP_ALLOW."
|
||||
AND u.deleted = 0
|
||||
AND rc.contextid = ".SYSCONTEXTID."";
|
||||
AND rc.contextid = ".$systemcontext->id."";
|
||||
|
||||
$adminusers = get_records_sql($sql);
|
||||
foreach ($adminusers as $adminuser) {
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@
|
||||
// This is compared against the values stored in the database to determine
|
||||
// whether upgrades should be performed (see lib/db/*.php)
|
||||
|
||||
$version = 2007021599.13; // YYYYMMDD = date of the 1.8 branch (don't change)
|
||||
$version = 2007021599.14; // YYYYMMDD = date of the 1.8 branch (don't change)
|
||||
// 99 = we reached a .10 release! (don't change)
|
||||
// .XX = release number 1.8.[10,11,12,..]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user