diff --git a/modules/consent/docs/consent.md b/modules/consent/docs/consent.md index d057eb1b40d5c0c883e79019cd67ed297dab311c..33e15a38e1dc58b272394c7f7b53ed7cb70bc6d1 100644 --- a/modules/consent/docs/consent.md +++ b/modules/consent/docs/consent.md @@ -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 diff --git a/modules/consent/lib/Auth/Process/Consent.php b/modules/consent/lib/Auth/Process/Consent.php index 0647ac84f194f457b48e5d83139f23cd30067ddf..203666e655348ad06274a4a71f2798289ea20c66 100644 --- a/modules/consent/lib/Auth/Process/Consent.php +++ b/modules/consent/lib/Auth/Process/Consent.php @@ -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. '. diff --git a/modules/consentAdmin/config-templates/module_consentAdmin.php b/modules/consentAdmin/config-templates/module_consentAdmin.php index 627634ba13a9ae3c247b952c2bfb7e07829fe8d2..02fdf8d42009d69a9128b9e068353b7e02715e8d 100644 --- a/modules/consentAdmin/config-templates/module_consentAdmin.php +++ b/modules/consentAdmin/config-templates/module_consentAdmin.php @@ -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 diff --git a/modules/consentAdmin/docs/consentAdmin.md b/modules/consentAdmin/docs/consentAdmin.md index 6a420353c3dd73b326516ee7bdca00e30b02a827..1dc342e7f917930674a92ef66908e95cd0fafa99 100644 --- a/modules/consentAdmin/docs/consentAdmin.md +++ b/modules/consentAdmin/docs/consentAdmin.md @@ -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.