Skip to content

Commit d836c41

Browse files
committed
"entry" is the wrong word
1 parent 8898e72 commit d836c41

File tree

3 files changed

+30
-30
lines changed

3 files changed

+30
-30
lines changed

resources/lib/UnityLDAP.php

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -257,20 +257,20 @@ public function getAllUsers($UnitySQL, $UnityMailer, $UnityRedis, $UnityWebhook,
257257
}
258258
}
259259

260-
public function getAllUsersEntries($attributes = [])
260+
public function getAllUsersArrays($attributes = [])
261261
{
262262
$include_uids = $this->getAllUsersUIDs();
263-
$user_entries = $this->baseOU->getChildrenArray(
263+
$user_arrays = $this->baseOU->getChildrenArray(
264264
$attributes,
265265
true, // recursive
266266
"objectClass=posixAccount"
267267
);
268-
foreach ($user_entries as $i => $entry) {
269-
if (!in_array($entry["uid"][0], $include_uids)) {
270-
unset($user_entries[$i]);
268+
foreach ($user_arrays as $i => $array) {
269+
if (!in_array($array["uid"][0], $include_uids)) {
270+
unset($user_arrays[$i]);
271271
}
272272
}
273-
return $user_entries;
273+
return $user_arrays;
274274
}
275275

276276
public function getAllPIGroups($UnitySQL, $UnityMailer, $UnityRedis, $UnityWebhook, $ignorecache = false)
@@ -305,7 +305,7 @@ public function getAllPIGroups($UnitySQL, $UnityMailer, $UnityRedis, $UnityWebho
305305
return $out;
306306
}
307307

308-
public function getAllPIGroupsEntries()
308+
public function getAllPIGroupsArrays()
309309
{
310310
return $this->pi_groupOU->getChildrenArray([], true);
311311
}
@@ -322,7 +322,7 @@ public function getPIGroupGIDsWithMemberUID($uid)
322322
);
323323
}
324324

325-
public function getAllPIGroupOwnerEntries($attributes = [])
325+
public function getAllPIGroupOwnerArrays($attributes = [])
326326
{
327327
// get the PI groups, filter for just the GIDs, then map the GIDs to owner UIDs
328328
$owner_uids = array_map(
@@ -332,13 +332,13 @@ public function getAllPIGroupOwnerEntries($attributes = [])
332332
$this->pi_groupOU->getChildrenArray(["cn"]),
333333
),
334334
);
335-
$owner_entries = $this->getAllUsersEntries($attributes);
336-
foreach ($owner_entries as $i => $entry) {
337-
if (!in_array($entry["uid"][0], $owner_uids)) {
338-
unset($owner_entries[$i]);
335+
$owner_arrays = $this->getAllUsersArrays($attributes);
336+
foreach ($owner_arrays as $i => $array) {
337+
if (!in_array($array["uid"][0], $owner_uids)) {
338+
unset($owner_arrays[$i]);
339339
}
340340
}
341-
return $owner_entries;
341+
return $owner_arrays;
342342
}
343343

344344
/** Returns an assosiative array where keys are UIDs and values are arrays of PI GIDs */
@@ -348,9 +348,9 @@ public function getAllUID2PIGIDs()
348348
$uids = $this->getAllUsersUIDs();
349349
$uid2pigids = array_combine($uids, array_fill(0, count($uids), []));
350350
// for each PI group, append that GID to the member list for each of its member UIDs
351-
foreach ($this->getAllPIGroupsEntries() as $entry) {
352-
$gid = $entry["cn"][0];
353-
foreach ($entry["memberuid"] as $uid) {
351+
foreach ($this->getAllPIGroupsArrays() as $array) {
352+
$gid = $array["cn"][0];
353+
foreach ($array["memberuid"] as $uid) {
354354
array_push($uid2pigids[$uid], $gid);
355355
}
356356
}
@@ -388,7 +388,7 @@ public function getAllOrgGroups($UnitySQL, $UnityMailer, $UnityRedis, $UnityWebh
388388
return $out;
389389
}
390390

391-
public function getAllOrgGroupsEntries()
391+
public function getAllOrgGroupsArrays()
392392
{
393393
return $this->org_groupOU->getChildrenArray([], true);
394394
}

webroot/admin/pi-mgmt.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -108,13 +108,13 @@
108108
</tr>
109109

110110
<?php
111-
$owner_entries = $LDAP->getAllPIGroupOwnerEntries(["uid", "gecos", "mail"]);
112-
usort($owner_entries, fn($a, $b) => strcmp($a["uid"][0], $b["uid"][0]));
113-
foreach ($owner_entries as $entry) {
111+
$owner_arrays = $LDAP->getAllPIGroupOwnerArrays(["uid", "gecos", "mail"]);
112+
usort($owner_arrays, fn($a, $b) => strcmp($a["uid"][0], $b["uid"][0]));
113+
foreach ($owner_arrays as $array) {
114114
echo "<tr class='expandable'>";
115-
echo "<td><button class='btnExpand'>&#9654;</button>" . $entry["gecos"][0] . "</td>";
116-
echo "<td>" . UnityGroup::getPIUIDfromUID($entry["uid"][0]) . "</td>";
117-
echo "<td><a href='mailto:" . $entry["mail"][0] . "'>" . $entry["mail"][0] . "</a></td>";
115+
echo "<td><button class='btnExpand'>&#9654;</button>" . $array["gecos"][0] . "</td>";
116+
echo "<td>" . UnityGroup::getPIUIDfromUID($array["uid"][0]) . "</td>";
117+
echo "<td><a href='mailto:" . $array["mail"][0] . "'>" . $array["mail"][0] . "</a></td>";
118118
echo "</tr>";
119119
}
120120
?>

webroot/admin/user-mgmt.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,19 @@
3838

3939
<?php
4040
$UID2PIGIDs = $LDAP->getAllUID2PIGIDs();
41-
$user_entries = $LDAP->getAllUsersEntries(["uid", "gecos", "o", "mail"]);
42-
usort($user_entries, fn ($a, $b) => strcmp($a["uid"][0], $b["uid"][0]));
43-
foreach ($user_entries as $entry) {
44-
$uid = $entry["uid"][0];
41+
$user_arrays = $LDAP->getAllUsersArrays(["uid", "gecos", "o", "mail"]);
42+
usort($user_arrays, fn ($a, $b) => strcmp($a["uid"][0], $b["uid"][0]));
43+
foreach ($user_arrays as $array) {
44+
$uid = $array["uid"][0];
4545
if ($SQL->accDeletionRequestExists($uid)) {
4646
echo "<tr style='color:grey; font-style: italic'>";
4747
} else {
4848
echo "<tr>";
4949
}
50-
echo "<td>" . $entry["gecos"][0] . "</td>";
50+
echo "<td>" . $array["gecos"][0] . "</td>";
5151
echo "<td>" . $uid . "</td>";
52-
echo "<td>" . $entry["o"][0] . "</td>";
53-
echo "<td><a href='mailto:" . $entry["mail"][0] . "'>" . $entry["mail"][0] . "</a></td>";
52+
echo "<td>" . $array["o"][0] . "</td>";
53+
echo "<td><a href='mailto:" . $array["mail"][0] . "'>" . $array["mail"][0] . "</a></td>";
5454
echo "<td>";
5555
foreach ($UID2PIGIDs[$uid] as $gid) {
5656
echo "<p>$gid</p>";

0 commit comments

Comments
 (0)