Skip to content

Commit 90493ad

Browse files
committed
catch edge case in uid2pigids
1 parent d8e59c7 commit 90493ad

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

resources/lib/UnityLDAP.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,14 @@ public function getAllUID2PIGIDs()
337337
foreach ($this->getAllPIGroupsAttributes(["cn", "memberuid"]) as $array) {
338338
$gid = $array["cn"][0];
339339
foreach ($array["memberuid"] as $uid) {
340-
array_push($uid2pigids[$uid], $gid);
340+
if (array_key_exists($uid, $uid2pigids)) {
341+
array_push($uid2pigids[$uid], $gid);
342+
} else {
343+
UnitySite::errorLog(
344+
"warning",
345+
"user '$uid' is a member of a PI group but is not a Unity user!"
346+
);
347+
}
341348
}
342349
}
343350
return $uid2pigids;

0 commit comments

Comments
 (0)