Commit 6fd8ebb5 authored by Robert Lyon's avatar Robert Lyon
Browse files

Bug 1818901: User creation via SAML / XMLRPC not set passwordchange



As we shouldn't prompt user to change it if the SSO in and we have a
process if they switch from external to internal auth

Also update the DB for users on external auth and set their
passwordchange to 0

behatnotneeded

Change-Id: I79676b0502620128f873e7fb2f97644c30798cfe
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent 204f4e8e
......@@ -225,7 +225,7 @@ class AuthSaml extends Auth {
if ($create) {
$user->passwordchange = 1;
$user->passwordchange = 0;
$user->active = 1;
$user->deleted = 0;
......
......@@ -179,7 +179,7 @@ class AuthXmlrpc extends Auth {
if ($create) {
$user->passwordchange = 1;
$user->passwordchange = 0;
$user->active = 1;
$user->deleted = 0;
......
......@@ -1361,5 +1361,16 @@ 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
}
return $status;
}
......@@ -16,7 +16,7 @@ $config = new stdClass();
// See https://wiki.mahara.org/wiki/Developer_Area/Version_Numbering_Policy
// For upgrades on stable branches, increment the version by one. On master, use the date.
$config->version = 2019062000;
$config->version = 2019062600;
$config->series = '19.10';
$config->release = '19.10dev';
$config->minupgradefrom = 2017031605;
......
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