make global scale setup more robust

If this server acts as a global scale master and the user is not
a local admin of the server we just create the user and continue
no need to update additional attributes.
But for local users, e.g. the admins of the global scale master
we should complete the user setup with all attributes

Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
This commit is contained in:
Björn Schiessle 2018-10-22 11:59:55 +02:00
parent 51a4f07e33
commit 860ffb24ad
No known key found for this signature in database
GPG Key ID: 2378A753E2BF04F6
1 changed files with 7 additions and 2 deletions

View File

@ -119,8 +119,13 @@ class SAMLController extends Controller {
throw new \InvalidArgumentException('No valid uid given, please check your attribute mapping. Given uid: ' . $uid);
}
// in case of a global scale setup we make sure that the server knows the user and leave
if ($this->config->getSystemValue('gs.enabled', false)) {
// if this server acts as a global scale master and the user is not
// a local admin of the server we just create the user and continue
// no need to update additional attributes
$isGsEnabled = $this->config->getSystemValue('gs.enabled', false);
$isGsMaster = $this->config->getSystemValue('gss.mode', 'slave') === 'master';
$isGsMasterAdmin = in_array($uid, $this->config->getSystemValue('gss.master.admin', []));
if ($isGsEnabled && $isGsMaster && !$isGsMasterAdmin) {
$this->userBackend->createUserIfNotExists($uid);
return;
}