Skip to content
Snippets Groups Projects
Commit 7c4d43c0 authored by Guy Halse's avatar Guy Halse
Browse files

Consent: Rename noconsentattributes option

Per suggestion from @jaimeperez, rename the undocumented
noconsentattributes option to be more consistent with other things and
with what has been done in the ConsentAdmin module. The old version
remains supported for backwards compatibility but issues a warning.
parent 5d88f969
No related branches found
No related tags found
No related merge requests found
......@@ -160,7 +160,7 @@ The following options can be used when configuring the Consent module:
the attributes that should have their value hidden. Default behaviour is that
all attribute values are shown.
`noconsentattributes`
`attributes.exclude`
: Allows certain attributes to be excluded from the attribute hash when
`includeValues` is `true` (and as a side effect, to be hidden from display
as `hiddenAttributes` does). Set to an array of the attributes that should
......
......@@ -116,7 +116,15 @@ class sspmod_consent_Auth_Process_Consent extends SimpleSAML_Auth_ProcessingFilt
$this->_hiddenAttributes = $config['hiddenAttributes'];
}
if (array_key_exists('noconsentattributes', $config)) {
if (array_key_exists('attributes.exclude', $config)) {
if (!is_array($config['attributes.exclude'])) {
throw new SimpleSAML_Error_Exception(
'Consent: attributes.exclude must be an array. '.
var_export($config['attributes.exclude'], true).' given.'
);
}
} elseif (array_key_exists('noconsentattributes', $config)) {
SimpleSAML\Logger::warning("The 'noconsentattributes' option has been deprecated in favour of 'attributes.exclude'.");
if (!is_array($config['noconsentattributes'])) {
throw new SimpleSAML_Error_Exception(
'Consent: noconsentattributes must be an array. '.
......
......@@ -19,7 +19,7 @@ $config = array(
// Hash attributes including values or not
'attributes.hash' => true,
// If you set noconsentattributes in the consent module, this must match
// If you set attributes.exclude in the consent module, this must match
// 'attributes.exclude' => array(),
// Where to direct the user after logout
......
......@@ -44,7 +44,7 @@ Setting optional parameters
In order to make the consentAdmin module work together with the consent
module correctly, you need to set the configuration 'attributes.hash'
according to the value of 'includeValues' configuration in the consent
module. Likewise, if you've used the 'noconsentattributes' configuration
module. Likewise, if you've used the 'attributes.exclude' configuration
option in the consent module, you should also set the 'attributes.exclude'
configuration option here to match.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment