Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MDL-20933 fixed a regression, we should not force changing of passwor…

…d for admins that can not actually change the password
  • Loading branch information...
commit 847f077e39dd7deda8aedef064727faff1013892 1 parent 89d1fd9
@skodak skodak authored
Showing with 3 additions and 2 deletions.
  1. +2 −1  lib/db/upgrade.php
  2. +1 −1  version.php
View
3  lib/db/upgrade.php
@@ -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) {
View
2  version.php
@@ -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,..]
Please sign in to comment.
Something went wrong with that request. Please try again.