This repository was archived by the owner on Sep 19, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +19
-5
lines changed
Expand file tree Collapse file tree 2 files changed +19
-5
lines changed Original file line number Diff line number Diff line change 22All notable changes to this project will be documented in this file.
33
44## [ Unreleased]
5+ #### Fixed
6+ - Fixed getting attributes from Perun in partial mode
7+ - Allow to store one source attribute to more destination attributes
58
69## [ v4.0.1]
710#### Fixed
Original file line number Diff line number Diff line change @@ -81,17 +81,28 @@ public function process(&$request)
8181 } elseif ($ this ->mode === self ::MODE_PARTIAL ) {
8282 // Check if attribute has some value
8383 foreach ($ this ->attrMap as $ attrName => $ attrValue ) {
84- if (isset ($ request ['Attributes ' ][$ attrValue ])) {
85- $ attr = $ request ['Attributes ' ][$ attrValue ];
86- if (empty ($ attr )) {
84+ if (is_array ($ attrValue )) {
85+ $ attrValueList = $ attrValue ;
86+ } else {
87+ $ attrValueList = [$ attrValue ];
88+ }
89+ foreach ($ attrValueList as $ item ) {
90+ if (isset ($ request ['Attributes ' ][$ item ])) {
91+ $ attr = $ request ['Attributes ' ][$ item ];
92+ if (empty ($ attr )) {
93+ array_push ($ attributes , $ attrName );
94+ }
95+ } else {
8796 array_push ($ attributes , $ attrName );
8897 }
89- } else {
90- array_push ($ attributes , $ attrName );
9198 }
9299 }
93100 }
94101
102+ if (empty ($ attributes )) {
103+ return ;
104+ }
105+ $ attributes = array_unique ($ attributes );
95106 $ attrs = $ this ->adapter ->getUserAttributesValues ($ user , $ attributes );
96107
97108 foreach ($ attrs as $ attrName => $ attrValue ) {
You can’t perform that action at this time.
0 commit comments