Catch the case when the received assertion has the username of an already existing account
Without this try/catch the user is gonna stay blocked with "Username already exists" error message as long as the simpleSAMLPhp session does not expire.
This commit is contained in:
parent
a31333a907
commit
aabce87d03
|
@ -33,8 +33,13 @@
|
|||
}
|
||||
if (! $user)
|
||||
{
|
||||
register_user($elgg_user['username'], $elgg_user['password'],
|
||||
$elgg_user['name'], $elgg_user['email']);
|
||||
try {
|
||||
if (!register_user($elgg_user['username'], $elgg_user['password'],
|
||||
$elgg_user['name'], $elgg_user['email']))
|
||||
return 1;
|
||||
} catch (RegistrationException $e) {
|
||||
return true;
|
||||
}
|
||||
$user = get_user_by_username($elgg_user['username']);
|
||||
$user->ldapDN = $elgg_user['ldapDN'];
|
||||
}
|
||||
|
|
Reference in New Issue