@@ -37,11 +37,7 @@ class UnityLDAP extends LDAPConn
3737 private LDAPEntry $ pi_groupOU ;
3838 private LDAPEntry $ org_groupOU ;
3939
40- public PosixGroup $ adminGroup ;
41- public PosixGroup $ qualifiedUserGroup ;
42- public PosixGroup $ lockedUserGroup ;
43- public PosixGroup $ idlelockedUserGroup ;
44- public PosixGroup $ ghostUserGroup ;
40+ public array $ userModifierGroups ;
4541
4642 public function __construct ()
4743 {
@@ -51,21 +47,10 @@ public function __construct()
5147 $ this ->groupOU = $ this ->getEntry (CONFIG ["ldap " ]["group_ou " ]);
5248 $ this ->pi_groupOU = $ this ->getEntry (CONFIG ["ldap " ]["pigroup_ou " ]);
5349 $ this ->org_groupOU = $ this ->getEntry (CONFIG ["ldap " ]["orggroup_ou " ]);
54- $ this ->adminGroup = new PosixGroup (
55- new LDAPEntry ($ this ->conn , CONFIG ["ldap " ]["admin_group " ]),
56- );
57- $ this ->qualifiedUserGroup = new PosixGroup (
58- new LDAPEntry ($ this ->conn , CONFIG ["ldap " ]["qualified_user_group " ]),
59- );
60- $ this ->lockedUserGroup = new PosixGroup (
61- new LDAPEntry ($ this ->conn , CONFIG ["ldap " ]["locked_user_group " ]),
62- );
63- $ this ->idlelockedUserGroup = new PosixGroup (
64- new LDAPEntry ($ this ->conn , CONFIG ["ldap " ]["idlelocked_user_group " ]),
65- );
66- $ this ->ghostUserGroup = new PosixGroup (
67- new LDAPEntry ($ this ->conn , CONFIG ["ldap " ]["ghost_user_group " ]),
68- );
50+ $ this ->userModifierGroups = [];
51+ foreach (CONFIG ["ldap " ]["user_modifier_groups " ] as $ gid => $ dn ) {
52+ $ this ->userModifierGroups [$ gid ] = new PosixGroup (new LDAPEntry ($ this ->conn , $ dn ));
53+ }
6954 }
7055
7156 public function getUserOU (): LDAPEntry
@@ -199,7 +184,7 @@ public function getQualifiedUsersUIDs(): array
199184 {
200185 // should not use $user_ou->getChildren or $base_ou->getChildren(objectClass=posixAccount)
201186 // qualified users might be outside user ou, and not all users in LDAP tree are qualified users
202- return $ this ->qualifiedUserGroup ->getMemberUIDs ();
187+ return $ this ->userModifierGroups [ " qualified " ] ->getMemberUIDs ();
203188 }
204189
205190 public function getQualifiedUsers ($ UnitySQL , $ UnityMailer , $ UnityWebhook ): array
0 commit comments