@@ -166,7 +166,7 @@ private function getIDNumsInUse()
166
166
range (100 , 999 ), // reserved for debian packages
167
167
range (6000 , 64999 ), // reserved for debian packages
168
168
array_map (fn ($ x ) => $ x ["uidnumber " ][0 ], $ this ->getAllUsersAttributes (["uidnumber " ])),
169
- array_map (fn ($ x ) => $ x ["gidnumber " ][0 ], $ this ->pi_groupOU ->getChildrenArray (true )),
169
+ array_map (fn ($ x ) => $ x ["gidnumber " ][0 ], $ this ->pi_groupOU ->getChildrenArray ([ " gidnumber " ], true )),
170
170
);
171
171
}
172
172
@@ -203,7 +203,7 @@ public function getUnassignedID($uid, $UnitySQL)
203
203
//
204
204
// Functions that return user/group objects
205
205
//
206
- public function getAllUsers ($ UnitySQL , $ UnityMailer , $ UnityRedis , $ UnityWebhook , $ ignorecache = false )
206
+ public function getUnityUsers ($ UnitySQL , $ UnityMailer , $ UnityRedis , $ UnityWebhook , $ ignorecache = false )
207
207
{
208
208
$ out = array ();
209
209
@@ -218,7 +218,7 @@ public function getAllUsers($UnitySQL, $UnityMailer, $UnityRedis, $UnityWebhook,
218
218
}
219
219
}
220
220
221
- $ users = array_map (fn ($ x ) => $ x ["cn " ][0 ], $ this ->getAllUsersAttributes (["cn " ]));
221
+ $ users = array_map (fn ($ x ) => $ x ["cn " ][0 ], $ this ->getUnityUsersAttributes (["cn " ]));
222
222
sort ($ users );
223
223
foreach ($ users as $ user ) {
224
224
$ params = array ($ user , $ this , $ UnitySQL , $ UnityMailer , $ UnityRedis , $ UnityWebhook );
@@ -230,11 +230,15 @@ public function getAllUsers($UnitySQL, $UnityMailer, $UnityRedis, $UnityWebhook,
230
230
231
231
public function getAllUsersAttributes ($ attributes )
232
232
{
233
- // some LDAP users might be unity users but not be in the users OU
234
- $ users = $ this ->baseOU ->getChildrenArray (true , "objectClass=posixAccount " );
235
- // some LDAP users might not be unity users at all
236
- $ unityuser_CNs = $ this ->getUserGroup ()->getAttribute ("memberuid " );
237
- return array_filter ($ users , fn ($ x ) => in_array ($ x ["cn " ], $ unityuser_CNs ));
233
+ return $ this ->baseOU ->getChildrenArray ($ attributes , true , "objectClass=posixAccount " );
234
+ }
235
+
236
+ public function getUnityUsersAttributes ($ attributes )
237
+ {
238
+ return array_filter (
239
+ getAllUsersAttributes ($ attributes ),
240
+ fn ($ x ) => in_array ($ x ["cn " ], $ unityuser_CNs )
241
+ );
238
242
}
239
243
240
244
public function getAllPIGroups ($ UnitySQL , $ UnityMailer , $ UnityRedis , $ UnityWebhook , $ ignorecache = false )
0 commit comments