Commit 453c088b authored by Robert Lyon's avatar Robert Lyon

Bug 1756726: Only run the password reset if no policy

behatnotneeded

Change-Id: Ic45a568c23094c74532ac3fabe77a06477d77e71
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent 390bf532
......@@ -5798,14 +5798,17 @@ function xmldb_core_upgrade($oldversion=0) {
}
if ($oldversion < 2018031900) {
log_debug('Force users to change their password to fix new password policy');
execute_sql("UPDATE {usr} SET passwordchange = 1
WHERE authinstance IN (
SELECT ai.id
FROM {auth_instance} ai
WHERE ai.authname = 'internal'
)
AND id != 0"); // Ignore the root user
if (!get_config('passwordpolicy')) {
log_debug('Force users to change their password to fix new password policy');
execute_sql("UPDATE {usr} SET passwordchange = 1
WHERE authinstance IN (
SELECT ai.id
FROM {auth_instance} ai
WHERE ai.authname = 'internal'
)
AND id != 0"); // Ignore the root user
set_config('passwordpolicy', '8_ulns');
}
}
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