File tree 1 file changed +11
-2
lines changed
1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -661,8 +661,17 @@ public function updateAttributes($uid,
661
661
662
662
if ($ newGroups !== null ) {
663
663
$ prefix = '' ;
664
- if ($ this ->config ->getAppValue ('user_saml ' , 'unique_groups_per_idp ' , '0 ' ) === '1 ' ) {
665
- list (, $ idp ) = explode ('@ ' , $ uid );
664
+ $ mapping = $ this ->config ->getSystemValue ('user_saml.unique_groups_per_idp ' , '' );
665
+ if ($ mapping === '' ) {
666
+ $ mapping = $ this ->config ->getAppValue ('user_saml ' , 'unique_groups_per_idp ' , '' );
667
+ }
668
+
669
+ if ($ mapping !== '' &&
670
+ array_key_exists ($ mapping , $ attributes ) &&
671
+ is_array ($ attributes [$ mapping ]) &&
672
+ sizeof ($ attributes [$ mapping ]) === 1 ) {
673
+ $ realUid = $ attributes [$ mapping ][0 ];
674
+ list (, $ idp ) = explode ('@ ' , $ realUid );
666
675
$ prefix = substr (md5 ($ idp ), 0 , 7 );
667
676
$ newGroups = array_map (
668
677
function ($ g ) use ($ prefix ) {
You can’t perform that action at this time.
0 commit comments