@@ -132,16 +132,14 @@ public function getGroupMembers($resourceOwnerId, $groupId, $startIndex = 0, $co
132132
133133 $ all = ldap_get_entries ($ this ->ldapConnection , $ query );
134134
135- switch ($ groupsProvider ):
136- case "posixgroup " :
137- $ all = ldap_get_entries ($ this ->ldapConnection , $ query );
138- // we are only interested in group memberuid array
139- $ attributes = $ all [0 ];
140- break ;
141-
142- default :
143- break ;
144- endswitch ;
135+ switch ($ groupsProvider ) {
136+ case "posixgroup " :
137+ // we are only interested in group memberuid array
138+ $ attributes = $ all [0 ];
139+ break ;
140+ default :
141+ break ;
142+ }
145143
146144 $ entry = @ldap_first_entry ($ this ->ldapConnection , $ query );
147145 if (false === $ entry ) {
@@ -158,15 +156,15 @@ public function getGroupMembers($resourceOwnerId, $groupId, $startIndex = 0, $co
158156 for ($ i = 0 ; $ i < $ attributes [$ memberAttribute ]["count " ]; $ i ++) {
159157 // member DN
160158 // fetch attributes for this particular user
161- switch ($ groupsProvider ):
162- case "posixgroup " :
163- $ user_dn = 'uid= ' . $ attributes [$ memberAttribute ][$ i ] . ', ' . $ this ->config ->s ('LdapVootStorage ' )->l ('peopleDn ' );
164- $ userAttributes = $ this ->getUserAttributesByDn ($ user_dn );
165- break ;
166- default :
167- $ userAttributes = $ this ->getUserAttributesByDn ($ attributes [$ memberAttribute ][$ i ]);
168- break ;
169- endswitch ;
159+ switch ($ groupsProvider ) {
160+ case "posixgroup " :
161+ $ user_dn = 'uid= ' . $ attributes [$ memberAttribute ][$ i ] . ', ' . $ this ->config ->s ('LdapVootStorage ' )->l ('peopleDn ' );
162+ $ userAttributes = $ this ->getUserAttributesByDn ($ user_dn );
163+ break ;
164+ default :
165+ $ userAttributes = $ this ->getUserAttributesByDn ($ attributes [$ memberAttribute ][$ i ]);
166+ break ;
167+ }
170168
171169 $ userAttributes ['voot_membership_role ' ] = "member " ;
172170 array_push ($ data , $ userAttributes );
@@ -195,14 +193,14 @@ public function isMemberOf($resourceOwnerId, $startIndex = null, $count = null)
195193 $ groupsProvider = $ this ->config ->s ('LdapVootStorage ' )->l ('groupsProvider ' );
196194
197195 /* get the groups the user is a member of */
198- switch ($ groupsProvider ):
199- case "posixgroup " :
200- $ filter = '( ' . $ this ->config ->s ('LdapVootStorage ' )->l ('memberAttribute ' ) . '= ' . $ resourceOwnerId . ') ' ;
201- break ;
202- default :
203- $ filter = '( ' . $ this ->config ->s ('LdapVootStorage ' )->l ('memberAttribute ' ) . '= ' . $ userDn . ') ' ;
204- break ;
205- endswitch ;
196+ switch ($ groupsProvider ) {
197+ case "posixgroup " :
198+ $ filter = '( ' . $ this ->config ->s ('LdapVootStorage ' )->l ('memberAttribute ' ) . '= ' . $ resourceOwnerId . ') ' ;
199+ break ;
200+ default :
201+ $ filter = '( ' . $ this ->config ->s ('LdapVootStorage ' )->l ('memberAttribute ' ) . '= ' . $ userDn . ') ' ;
202+ break ;
203+ }
206204
207205 $ query = @ldap_search ($ this ->ldapConnection , $ this ->config ->s ('LdapVootStorage ' )->l ('groupDn ' ), $ filter );
208206 if (false === $ query ) {
0 commit comments