diff options
author | Olav Morken <olav.morken@uninett.no> | 2012-08-30 11:39:38 +0000 |
---|---|---|
committer | Olav Morken <olav.morken@uninett.no> | 2012-08-30 11:39:38 +0000 |
commit | 35bf12a5b8f2a25e63b5a02512a70127df11b4c2 (patch) | |
tree | 371c6a9dba85800bf8a6123b2aeb0d897dd9c5dc | |
parent | 72ee2b24045f2236026bdf9d5ba489daef5220c3 (diff) | |
download | simplesamlphp-35bf12a5b8f2a25e63b5a02512a70127df11b4c2.zip simplesamlphp-35bf12a5b8f2a25e63b5a02512a70127df11b4c2.tar.gz simplesamlphp-35bf12a5b8f2a25e63b5a02512a70127df11b4c2.tar.bz2 |
consent: New option: showNoConsentAboutService
Since the "about service"-link takes the user away from the IdP, the
user will still have an session on the IdP. This option allows us to
disable that link.
git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@3158 44740490-163a-0410-bde0-09ae8108e29a
-rw-r--r-- | modules/consent/docs/consent.txt | 3 | ||||
-rw-r--r-- | modules/consent/lib/Auth/Process/Consent.php | 16 | ||||
-rw-r--r-- | modules/consent/www/noconsent.php | 6 |
3 files changed, 23 insertions, 2 deletions
diff --git a/modules/consent/docs/consent.txt b/modules/consent/docs/consent.txt index bd78b73..93ee0dc 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 cf57ba3..25067ec 100644 --- a/modules/consent/lib/Auth/Process/Consent.php +++ b/modules/consent/lib/Auth/Process/Consent.php @@ -53,6 +53,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 * * Validates and parses the configuration @@ -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 258b0ce..06e5554 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(); |