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 @@ -674,8 +674,17 @@ public function updateAttributes($uid,
674
674
675
675
if ($ newGroups !== null ) {
676
676
$ prefix = '' ;
677
- if ($ this ->config ->getAppValue ('user_saml ' , 'unique_groups_per_idp ' , '0 ' ) === '1 ' ) {
678
- list (, $ idp ) = explode ('@ ' , $ uid );
677
+ $ mapping = $ this ->config ->getSystemValue ('user_saml.unique_groups_per_idp ' , '' );
678
+ if ($ mapping === '' ) {
679
+ $ mapping = $ this ->config ->getAppValue ('user_saml ' , 'unique_groups_per_idp ' , '' );
680
+ }
681
+
682
+ if ($ mapping !== '' &&
683
+ array_key_exists ($ mapping , $ attributes ) &&
684
+ is_array ($ attributes [$ mapping ]) &&
685
+ sizeof ($ attributes [$ mapping ]) === 1 ) {
686
+ $ realUid = $ attributes [$ mapping ][0 ];
687
+ list (, $ idp ) = explode ('@ ' , $ realUid );
679
688
$ prefix = substr (md5 ($ idp ), 0 , 7 );
680
689
$ newGroups = array_map (
681
690
function ($ g ) use ($ prefix ) {
You can’t perform that action at this time.
0 commit comments