diff --git a/modules/consent/docs/consent.txt b/modules/consent/docs/consent.txt index bd78b73b0247cdd78c6740259d14b557c728a8d5..93ee0dc053b355efde376dfbf0fff0a7e1398060 100644 --- a/modules/consent/docs/consent.txt +++ b/modules/consent/docs/consent.txt @@ -160,6 +160,9 @@ The following options can be used when configuring the Consent module the attributes that should have it value hidden. Default behaviour is that all attribute values are shown +`showNoConsentAboutService` +: Whether we will show a link to more information about the service from the + no consent page. Defaults to `TRUE`. External options ---------------- diff --git a/modules/consent/lib/Auth/Process/Consent.php b/modules/consent/lib/Auth/Process/Consent.php index cf57ba3c236bb1d5e9c129dfd033a0f17ed6b9f8..25067ec97b19aeb46c3a00bc0893ba4f1e79eed0 100644 --- a/modules/consent/lib/Auth/Process/Consent.php +++ b/modules/consent/lib/Auth/Process/Consent.php @@ -52,6 +52,13 @@ class sspmod_consent_Auth_Process_Consent extends SimpleSAML_Auth_ProcessingFilt */ private $_noconsentattributes = array(); + /** + * Whether we should show the "about service"-link on the no consent page. + * + * @var bool + */ + private $_showNoConsentAboutService = true; + /** * Initialize consent filter * @@ -125,6 +132,14 @@ class sspmod_consent_Auth_Process_Consent extends SimpleSAML_Auth_ProcessingFilt ); } } + + if (array_key_exists('showNoConsentAboutService', $config)) { + if (!is_bool($config['showNoConsentAboutService'])) { + throw new SimpleSAML_Error_Exception('Consent: showNoConsentAboutService must be a boolean.'); + } + $this->_showNoConsentAboutService = $config['showNoConsentAboutService']; + } + } /** @@ -250,6 +265,7 @@ class sspmod_consent_Auth_Process_Consent extends SimpleSAML_Auth_ProcessingFilt $state['consent:checked'] = $this->_checked; $state['consent:hiddenAttributes'] = $this->_hiddenAttributes; $state['consent:noconsentattributes'] = $this->_noconsentattributes; + $state['consent:showNoConsentAboutService'] = $this->_showNoConsentAboutService; // User interaction nessesary. Throw exception on isPassive request if (isset($state['isPassive']) && $state['isPassive'] == true) { diff --git a/modules/consent/www/noconsent.php b/modules/consent/www/noconsent.php index 258b0ceb5b8553c57250dd17035bb61cfef25025..06e5554c0ea7868e802c0622705ecacfd0346ae7 100644 --- a/modules/consent/www/noconsent.php +++ b/modules/consent/www/noconsent.php @@ -26,8 +26,10 @@ $logoutLink = SimpleSAML_Module::getModuleURL( $aboutService = null; -if (isset($state['Destination']['url.about'])) { - $aboutService = $state['Destination']['url.about']; +if (!isset($state['consent:showNoConsentAboutService']) || $state['consent:showNoConsentAboutService']) { + if (isset($state['Destination']['url.about'])) { + $aboutService = $state['Destination']['url.about']; + } } $statsInfo = array();