From af3e1809d535fa67dc7331112fe8d28b3740b8a5 Mon Sep 17 00:00:00 2001 From: Fred Neumann Date: Wed, 28 Apr 2021 17:32:55 +0200 Subject: [PATCH] optional check for vhb access --- classes/class.ilVhbShibAuthConfig.php | 8 ++++++++ classes/class.ilVhbShibAuthMatching.php | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/classes/class.ilVhbShibAuthConfig.php b/classes/class.ilVhbShibAuthConfig.php index 64c180a..8062833 100644 --- a/classes/class.ilVhbShibAuthConfig.php +++ b/classes/class.ilVhbShibAuthConfig.php @@ -34,6 +34,14 @@ public function __construct($a_plugin_object) 'Einstellungen zum Anlegen und Auffinden von Benutzerkonten', ilVhbShibAuthParam::TYPE_HEAD ); + + $params[] = ilVhbShibAuthParam::_create( + 'check_vhb_access', + 'vhb-Zugriffsrecht prüfen', + 'Prüft, ob das Shibboleth-Attribut "eduPersonEntitlement" die Zeichenkette "urn:mace:vhb.org:entitlement:vhb-access" enthält. Nur mit dieser erhalten Nutzer/-innen Zugriff.', + ilVhbShibAuthParam::TYPE_BOOLEAN + ); + $params[] = ilVhbShibAuthParam::_create( 'local_user_suffix', 'Suffix bei lokalen Benutzern', diff --git a/classes/class.ilVhbShibAuthMatching.php b/classes/class.ilVhbShibAuthMatching.php index 659d0b2..ac457ba 100644 --- a/classes/class.ilVhbShibAuthMatching.php +++ b/classes/class.ilVhbShibAuthMatching.php @@ -66,7 +66,7 @@ public function checkAccess(ilVhbShibAuthUser $user) /** @var ilErrorHandling $ilErr */ $ilErr = $DIC['ilErr']; - if (!$this->hasVhbAccess()) { + if ($this->config->get('check_vhb_access') && !$this->hasVhbAccess()) { $ilErr->raiseError($this->plugin->txt('err_no_vhb_access')); }