Skip to content
Snippets Groups Projects
Commit 8952dfae authored by Andreas Åkre Solberg's avatar Andreas Åkre Solberg
Browse files

Adding backward compability to AttributeLimit proc filter in core module. It...

Adding backward compability to AttributeLimit proc filter in core module. It nows can filter on the attributes parameter of config...

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@1101 44740490-163a-0410-bde0-09ae8108e29a
parent 1f3dae3c
No related branches found
No related tags found
No related merge requests found
......@@ -32,15 +32,16 @@ class sspmod_core_Auth_Process_AttributeLimit extends SimpleSAML_Auth_Processing
parent::__construct($config, $reserved);
assert('is_array($config)');
foreach($config as $name) {
if(!is_string($name)) {
throw new Exception('Invalid attribute name: ' . var_export($name, TRUE));
}
$this->allowedAttributes[] = $name;
}
}
......@@ -55,6 +56,18 @@ class sspmod_core_Auth_Process_AttributeLimit extends SimpleSAML_Auth_Processing
assert('is_array($request)');
assert('array_key_exists("Attributes", $request)');
if (empty($this->allowedAttributes)) {
if (array_key_exists('attributes', $request['Source'])) {
if (array_key_exists('attributes', $request['Destination'])) {
$this->allowedAttributes = array_intersect($request['Source']['attributes'], $request['Destination']['attributes']);
} else {
$this->allowedAttributes = $request['Source']['attributes'];
}
} else {
$this->allowedAttributes = $request['Destination']['attributes'];
}
}
$attributes =& $request['Attributes'];
foreach($attributes as $name => $values) {
......
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