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:
Petr Skoda
2009-11-22 17:05:14 +00:00
parent 89d1fd9190
commit 847f077e39
2 changed files with 3 additions and 2 deletions
+2 -1
View File
@@ -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
View File
@@ -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,..]