Skip to content

Commit b6397ef

Browse files
committed
edge case: empty memberuid in update-ldap-cache.php
1 parent 3ad4827 commit b6397ef

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

workers/update-ldap-cache.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,11 @@
5656

5757
$org_group_ou = new LDAPEntry($LDAP->getConn(), CONFIG["ldap"]["orggroup_ou"]);
5858
echo "waiting for LDAP search (org groups)...\n";
59-
$org_groups = $org_group_ou->getChildrenArrayStrict(["cn", "memberuid"], true);
59+
$org_groups = $org_group_ou->getChildrenArrayStrict(
60+
["cn", "memberuid"],
61+
true,
62+
default_values: ["memberuid" => []],
63+
);
6064
echo "response received.\n";
6165
$REDIS->setCache("sorted_orgs", "", $LDAP->getSortedOrgsForRedis());
6266
foreach ($org_groups as $org_group) {
@@ -66,7 +70,11 @@
6670

6771
$pi_group_ou = new LDAPEntry($LDAP->getConn(), CONFIG["ldap"]["pigroup_ou"]);
6872
echo "waiting for LDAP search (pi groups)...\n";
69-
$pi_groups = $pi_group_ou->getChildrenArrayStrict(["cn", "memberuid"], true);
73+
$pi_groups = $pi_group_ou->getChildrenArrayStrict(
74+
["cn", "memberuid"],
75+
true,
76+
default_values: ["memberuid" => []],
77+
);
7078
echo "response received.\n";
7179
$REDIS->setCache("sorted_groups", "", $LDAP->getSortedGroupsForRedis());
7280

0 commit comments

Comments
 (0)