File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -122,6 +122,10 @@ public function getDisplayNameAttribute(): string {
122122 return $ this ->ldapConfig ->ldapUserDisplayName ;
123123 }
124124
125+ public function getGroupMemberAssocAttribute (): string {
126+ return strtolower ($ this ->ldapConfig ->ldapGroupMemberAssocAttr );
127+ }
128+
125129 public function groupsEnabled (): bool {
126130 $ filter = trim ((string )$ this ->ldapConfig ->ldapGroupFilter );
127131 $ gAssoc = trim ((string )$ this ->ldapConfig ->ldapGroupMemberAssocAttr );
Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ public function createGroup($gid): ?string {
5353 * on passing an already inserted [ug]id, which we do not have at this point.
5454 */
5555
56- $ newGroupEntry = $ this ->buildNewEntry ($ gid );
56+ $ newGroupEntry = $ this ->buildNewEntry ($ gid, $ this -> ldapConnect -> getGroupMemberAssocAttribute () );
5757 $ connection = $ this ->ldapConnect ->getLDAPConnection ();
5858 $ newGroupDN = "cn= $ gid, " . $ this ->ldapConnect ->getLDAPBaseGroups ()[0 ];
5959 $ newGroupDN = $ this ->ldapProvider ->sanitizeDN ([$ newGroupDN ])[0 ];
@@ -178,12 +178,11 @@ public function isLDAPGroup($gid): bool {
178178 }
179179 }
180180
181- private function buildNewEntry (string $ gid ): array {
181+ private function buildNewEntry (string $ gid, string $ attribute ): array {
182182 $ entry = [
183183 'objectClass ' => [],
184184 'cn ' => $ gid ,
185185 ];
186- $ attribute = strtolower ($ this ->ldapProvider ->getLDAPGroupMemberAssoc ($ gid ));
187186 switch ($ attribute ) {
188187 case 'memberuid ' :
189188 case 'gidnumber ' :
You can’t perform that action at this time.
0 commit comments