55use UnityWebPortal \lib \exceptions \EntryNotFoundException ;
66use PHPOpenLDAPer \LDAPConn ;
77use PHPOpenLDAPer \LDAPEntry ;
8+ use UnityWebPortal \lib \PosixGroup ;
89
910/**
1011 * An LDAP connection class which extends LDAPConn tailored for the Unity Cluster
@@ -35,8 +36,12 @@ class UnityLDAP extends LDAPConn
3536 private LDAPEntry $ groupOU ;
3637 private LDAPEntry $ pi_groupOU ;
3738 private LDAPEntry $ org_groupOU ;
38- private LDAPEntry $ adminGroup ;
39- private LDAPEntry $ qualifiedUserGroup ;
39+
40+ public PosixGroup $ adminGroup ;
41+ public PosixGroup $ qualifiedUserGroup ;
42+ public PosixGroup $ lockedUserGroup ;
43+ public PosixGroup $ idlelockedUserGroup ;
44+ public PosixGroup $ ghostUserGroup ;
4045
4146 public function __construct ()
4247 {
@@ -46,8 +51,21 @@ public function __construct()
4651 $ this ->groupOU = $ this ->getEntry (CONFIG ["ldap " ]["group_ou " ]);
4752 $ this ->pi_groupOU = $ this ->getEntry (CONFIG ["ldap " ]["pigroup_ou " ]);
4853 $ this ->org_groupOU = $ this ->getEntry (CONFIG ["ldap " ]["orggroup_ou " ]);
49- $ this ->adminGroup = $ this ->getEntry (CONFIG ["ldap " ]["admin_group " ]);
50- $ this ->qualifiedUserGroup = $ this ->getEntry (CONFIG ["ldap " ]["qualified_user_group " ]);
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+ );
5169 }
5270
5371 public function getUserOU (): LDAPEntry
@@ -70,16 +88,6 @@ public function getOrgGroupOU(): LDAPEntry
7088 return $ this ->org_groupOU ;
7189 }
7290
73- public function getAdminGroup (): LDAPEntry
74- {
75- return $ this ->adminGroup ;
76- }
77-
78- public function getQualifiedUserGroup (): LDAPEntry
79- {
80- return $ this ->qualifiedUserGroup ;
81- }
82-
8391 public function getDefUserShell (): string
8492 {
8593 return $ this ->def_user_shell ;
@@ -191,7 +199,7 @@ public function getQualifiedUsersUIDs(): array
191199 {
192200 // should not use $user_ou->getChildren or $base_ou->getChildren(objectClass=posixAccount)
193201 // qualified users might be outside user ou, and not all users in LDAP tree are qualified users
194- return $ this ->qualifiedUserGroup ->getAttribute ( " memberuid " );
202+ return $ this ->qualifiedUserGroup ->getMemberUIDs ( );
195203 }
196204
197205 public function getQualifiedUsers ($ UnitySQL , $ UnityMailer , $ UnityWebhook ): array
0 commit comments