Commit 4148ee3b authored by Cecilia Vela Gurovic's avatar Cecilia Vela Gurovic

Bug 1818901: mysql upgrade fix - User creation not set passwordchange

behatnotneede

Change-Id: Ifabbb291391e60caa57d5d2421ad41402a70a6f7
parent c7001577
......@@ -1363,13 +1363,23 @@ function xmldb_core_upgrade($oldversion=0) {
if ($oldversion < 2019062600) {
log_debug('Remove force password change for those using external auth');
execute_sql("UPDATE {usr} SET passwordchange = 0
WHERE id IN (
SELECT u.id FROM {usr} u
JOIN {auth_instance} ui ON ui.id = u.authinstance
WHERE ui.authname != 'internal' AND ui.active = 1
)
AND id != 0"); // Ignore the root user
if (is_mysql()) {
execute_sql("UPDATE {usr} u
JOIN {auth_instance} ui
ON ui.id = u.authinstance
SET passwordchange = 0
WHERE ui.authname != 'internal' AND ui.active = 1 AND u.id != 0
");
}
else {
execute_sql("UPDATE {usr} SET passwordchange = 0
WHERE id IN (
SELECT u.id FROM {usr} u
JOIN {auth_instance} ui ON ui.id = u.authinstance
WHERE ui.authname != 'internal' AND ui.active = 1
)
AND id != 0"); // Ignore the root user
}
}
return $status;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment