This repository was archived by the owner on Sep 19, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +21
-1
lines changed
Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change 66 * Because the attributes should not depends on IdP which user currently used.
77 *
88 * @author Ondrej Velisek <[email protected] > 9+ * @author Pavel Vyskočil <[email protected] > 910 */
10-
1111class sspmod_perun_Auth_Process_RemoveAllAttributes extends SimpleSAML_Auth_ProcessingFilter
1212{
1313
14+ const FILTER_ATTRIBUTE_LIST = "filterAttributeList " ;
15+
16+ private $ filterAttributeList = array ();
17+
1418 public function __construct ($ config , $ reserved )
1519 {
1620 parent ::__construct ($ config , $ reserved );
21+
22+ if (isset ($ config [self ::FILTER_ATTRIBUTE_LIST ])) {
23+ $ this ->filterAttributeList = $ config [self ::FILTER_ATTRIBUTE_LIST ];
24+ }
1725 }
1826
1927 public function process (&$ request )
2028 {
2129 assert ('is_array($request) ' );
2230
31+ $ attributes = array ();
32+
33+ foreach ($ request ['Attributes ' ] as $ attributeKey => $ attributeValue ) {
34+ if (in_array ($ attributeKey , $ this ->filterAttributeList )) {
35+ $ attributes [$ attributeKey ] = $ attributeValue ;
36+ }
37+ }
38+
2339 $ request ['Attributes ' ] = array ();
40+
41+ foreach ($ attributes as $ attributeKey => $ attributeValue ) {
42+ $ request ['Attributes ' ][$ attributeKey ] = $ attributeValue ;
43+ }
2444 }
2545
2646}
You can’t perform that action at this time.
0 commit comments