Commit 6fed579e authored by Son Nguyen's avatar Son Nguyen
Browse files

Fix the error when attempting to add saml auth with 'create users'


checked

(bug #1045134)

Change-Id: I2ea0419d95caea1c972160b4e0b2abea5e079ff3
Signed-off-by: default avatarSon Nguyen <son.nguyen@catalyst.net.nz>
parent 1b2fd4f2
......@@ -516,11 +516,13 @@ class PluginAuthSaml extends PluginAuth {
GROUP BY instance
ORDER BY instance',
array($values['institutionattribute'], $values['institutionvalue'], $values['instance']));
foreach ($dup as $instance) {
if ($instance->instance >= 2) {
// we already have an authinstance with these same values
$form->set_error('institutionattribute', get_string('errorbadinstitutioncombo', 'auth.saml'));
break;
if (is_array($dup)) {
foreach ($dup as $instance) {
if ($instance->instance >= 2) {
// we already have an authinstance with these same values
$form->set_error('institutionattribute', get_string('errorbadinstitutioncombo', 'auth.saml'));
break;
}
}
}
}
......
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