From 0fe97517351638ed30fcb2eaabfdfc3855d527a6 Mon Sep 17 00:00:00 2001 From: Simon Leary Date: Tue, 22 Apr 2025 12:59:44 -0400 Subject: [PATCH 01/22] add tests for approving, denying PI membership requests --- test/functional/PiMemberApproveTest.php | 74 ++++++++++++++++++++++++ test/functional/PiMemberDenyTest.php | 46 +++++++++++++++ test/phpunit-bootstrap.php | 10 ++++ tools/docker-dev/sql/bootstrap-users.sql | 7 ++- 4 files changed, 136 insertions(+), 1 deletion(-) create mode 100644 test/functional/PiMemberApproveTest.php create mode 100644 test/functional/PiMemberDenyTest.php diff --git a/test/functional/PiMemberApproveTest.php b/test/functional/PiMemberApproveTest.php new file mode 100644 index 00000000..3e8f9778 --- /dev/null +++ b/test/functional/PiMemberApproveTest.php @@ -0,0 +1,74 @@ +getUID(); + switchUser(...getNormalUser2()); + self::$noRequestUid = $USER->getUID(); + } + + private function approveUser(string $uid) + { + post( + __DIR__ . "/../../webroot/panel/pi.php", + ["form_type" => "userReq", "action" => "approve", "uid" => $uid] + ); + } + + public function testApproveRequest() + { + global $USER, $LDAP, $SQL, $MAILER, $REDIS, $WEBHOOK; + switchUser(...getUserIsPIHasNoMembersNoMemberRequests()); + $pi = $USER; + $piGroup = $USER->getPIGroup(); + $this->assertTrue($piGroup->exists()); + $this->assertEquals([$pi], $piGroup->getGroupMembers()); + $this->assertEmpty($piGroup->getRequests()); + $requestedUser = new UnityUser(self::$requestUid, $LDAP, $SQL, $MAILER, $REDIS, $WEBHOOK); + try { + $piGroup->newUserRequest($requestedUser); + $this->assertFalse($piGroup->userExists($requestedUser)); + + $piGroup->approveUser($requestedUser); + $this->assertEmpty($piGroup->getRequests()); + + $this->assertEquals([$requestedUser, $pi], $piGroup->getGroupMembers()); + $this->assertTrue($piGroup->userExists($requestedUser)); + } finally { + $piGroup->removeUser($requestedUser); + $SQL->removeRequest(self::$requestUid, $piGroup->getPIUID()); + } + } + + public function testApproveNonexistentRequest() + { + global $USER, $LDAP, $SQL, $MAILER, $REDIS, $WEBHOOK; + switchUser(...getUserIsPIHasNoMembersNoMemberRequests()); + $pi = $USER; + $piGroup = $USER->getPIGroup(); + $this->assertTrue($piGroup->exists()); + $this->assertEquals([$pi], $piGroup->getGroupMembers()); + $this->assertEmpty($piGroup->getRequests()); + + $notRequestedUser = new UnityUser(self::$noRequestUid, $LDAP, $SQL, $MAILER, $REDIS, $WEBHOOK); + $this->assertFalse($piGroup->userExists($notRequestedUser)); + $this->assertEmpty($piGroup->getRequests()); + + try { + $piGroup->approveUser($notRequestedUser); + $this->assertEquals([$pi], $piGroup->getGroupMembers()); + $this->assertFalse($piGroup->userExists($notRequestedUser)); + } finally { + $piGroup->removeUser($notRequestedUser); + } + } +} diff --git a/test/functional/PiMemberDenyTest.php b/test/functional/PiMemberDenyTest.php new file mode 100644 index 00000000..9436d7ba --- /dev/null +++ b/test/functional/PiMemberDenyTest.php @@ -0,0 +1,46 @@ +getUID(); + } + + private function denyUser(string $uid) + { + post( + __DIR__ . "/../../webroot/panel/pi.php", + ["form_type" => "userReq", "action" => "approve", "uid" => $uid] + ); + } + + public function testDenyRequest() + { + global $USER, $LDAP, $SQL, $MAILER, $REDIS, $WEBHOOK; + switchUser(...getUserIsPIHasNoMembersNoMemberRequests()); + $pi = $USER; + $piGroup = $USER->getPIGroup(); + $this->assertTrue($piGroup->exists()); + $this->assertEquals([$pi], $piGroup->getGroupMembers()); + $this->assertEmpty($piGroup->getRequests()); + $requestedUser = new UnityUser(self::$requestUid, $LDAP, $SQL, $MAILER, $REDIS, $WEBHOOK); + try { + $piGroup->newUserRequest($requestedUser); + $this->assertFalse($piGroup->userExists($requestedUser)); + + $piGroup->denyUser($requestedUser); + $this->assertEmpty($piGroup->getRequests()); + $this->assertEquals([$pi], $piGroup->getGroupMembers()); + $this->assertFalse($piGroup->userExists($requestedUser)); + } finally { + $SQL->removeRequest(self::$requestUid, $piGroup->getPIUID()); + } + } +} diff --git a/test/phpunit-bootstrap.php b/test/phpunit-bootstrap.php index a53261c5..0d459f83 100644 --- a/test/phpunit-bootstrap.php +++ b/test/phpunit-bootstrap.php @@ -80,6 +80,11 @@ function getNormalUser() return ["user1@org1.test", "foo", "bar", "user1@org1.test"]; } +function getNormalUser2() +{ + return ["user2@org1.test", "foo", "bar", "user2@org1.test"]; +} + function getUserHasNotRequestedAccountDeletionHasGroup() { return ["user1@org1.test", "foo", "bar", "user1@org1.test"]; @@ -109,3 +114,8 @@ function getUserWithOneKey() { return ["user5@org2.test", "foo", "bar", "user5@org2.test"]; } + +function getUserIsPIHasNoMembersNoMemberRequests() +{ + return ["user5@org2.test", "foo", "bar", "user5@org2.test"]; +} diff --git a/tools/docker-dev/sql/bootstrap-users.sql b/tools/docker-dev/sql/bootstrap-users.sql index b56421f5..3fe7da0b 100644 --- a/tools/docker-dev/sql/bootstrap-users.sql +++ b/tools/docker-dev/sql/bootstrap-users.sql @@ -1 +1,6 @@ -INSERT INTO `account_deletion_requests` (`id`, `timestamp`, `uid`) VALUES (1, '1970-01-01 00:00:01', 'user4_org1_test'); +INSERT INTO `account_deletion_requests` (`id`, `timestamp`, `uid`) VALUES + (1, '1970-01-01 00:00:01', 'user4_org1_test'); + +-- INSERT INTO `requests` (`id`, `request_for`, `uid`, `timestamp`) VALUES +-- (1, 'pi_user1_org1_test', 'user6_org1_test', '1970-01-01 00:00:01'), +-- (2, 'pi_user1_org1_test', 'user7_org1_test', '1970-01-01 00:00:01'); From 787c166bb3e6f9bbc9e3d070df7e4fb69a12aef6 Mon Sep 17 00:00:00 2001 From: Simon Leary Date: Tue, 22 Apr 2025 13:04:38 -0400 Subject: [PATCH 02/22] use uids instead of objects for assertions --- test/functional/PiMemberApproveTest.php | 8 ++++---- test/functional/PiMemberDenyTest.php | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/test/functional/PiMemberApproveTest.php b/test/functional/PiMemberApproveTest.php index 3e8f9778..dd51b571 100644 --- a/test/functional/PiMemberApproveTest.php +++ b/test/functional/PiMemberApproveTest.php @@ -31,7 +31,7 @@ public function testApproveRequest() $pi = $USER; $piGroup = $USER->getPIGroup(); $this->assertTrue($piGroup->exists()); - $this->assertEquals([$pi], $piGroup->getGroupMembers()); + $this->assertEquals([$pi->getUID()], $piGroup->getGroupMemberUIDs()); $this->assertEmpty($piGroup->getRequests()); $requestedUser = new UnityUser(self::$requestUid, $LDAP, $SQL, $MAILER, $REDIS, $WEBHOOK); try { @@ -41,7 +41,7 @@ public function testApproveRequest() $piGroup->approveUser($requestedUser); $this->assertEmpty($piGroup->getRequests()); - $this->assertEquals([$requestedUser, $pi], $piGroup->getGroupMembers()); + $this->assertEquals([$pi->getUID(), self::$requestUid], $piGroup->getGroupMemberUIDs()); $this->assertTrue($piGroup->userExists($requestedUser)); } finally { $piGroup->removeUser($requestedUser); @@ -56,7 +56,7 @@ public function testApproveNonexistentRequest() $pi = $USER; $piGroup = $USER->getPIGroup(); $this->assertTrue($piGroup->exists()); - $this->assertEquals([$pi], $piGroup->getGroupMembers()); + $this->assertEquals([$pi->getUID()], $piGroup->getGroupMemberUIDs()); $this->assertEmpty($piGroup->getRequests()); $notRequestedUser = new UnityUser(self::$noRequestUid, $LDAP, $SQL, $MAILER, $REDIS, $WEBHOOK); @@ -65,7 +65,7 @@ public function testApproveNonexistentRequest() try { $piGroup->approveUser($notRequestedUser); - $this->assertEquals([$pi], $piGroup->getGroupMembers()); + $this->assertEquals([$pi->getUID()], $piGroup->getGroupMemberUIDs()); $this->assertFalse($piGroup->userExists($notRequestedUser)); } finally { $piGroup->removeUser($notRequestedUser); diff --git a/test/functional/PiMemberDenyTest.php b/test/functional/PiMemberDenyTest.php index 9436d7ba..79e5df77 100644 --- a/test/functional/PiMemberDenyTest.php +++ b/test/functional/PiMemberDenyTest.php @@ -28,7 +28,7 @@ public function testDenyRequest() $pi = $USER; $piGroup = $USER->getPIGroup(); $this->assertTrue($piGroup->exists()); - $this->assertEquals([$pi], $piGroup->getGroupMembers()); + $this->assertEquals([$pi->getUID()], $piGroup->getGroupMemberUIDs()); $this->assertEmpty($piGroup->getRequests()); $requestedUser = new UnityUser(self::$requestUid, $LDAP, $SQL, $MAILER, $REDIS, $WEBHOOK); try { @@ -37,7 +37,7 @@ public function testDenyRequest() $piGroup->denyUser($requestedUser); $this->assertEmpty($piGroup->getRequests()); - $this->assertEquals([$pi], $piGroup->getGroupMembers()); + $this->assertEquals([$pi->getUID()], $piGroup->getGroupMemberUIDs()); $this->assertFalse($piGroup->userExists($requestedUser)); } finally { $SQL->removeRequest(self::$requestUid, $piGroup->getPIUID()); From 244bc7e4bfefa778033f2f17be0573d2fb096ad0 Mon Sep 17 00:00:00 2001 From: Simon Leary Date: Tue, 22 Apr 2025 13:49:06 -0400 Subject: [PATCH 03/22] add tests for removing group members --- test/functional/PiRemoveUserTest.php | 66 ++++++++++++++++++++++++++++ test/phpunit-bootstrap.php | 10 ++++- 2 files changed, 75 insertions(+), 1 deletion(-) create mode 100644 test/functional/PiRemoveUserTest.php diff --git a/test/functional/PiRemoveUserTest.php b/test/functional/PiRemoveUserTest.php new file mode 100644 index 00000000..9f69c641 --- /dev/null +++ b/test/functional/PiRemoveUserTest.php @@ -0,0 +1,66 @@ + "remUser", "uid" => $uid] + ); + } + + public function testRemoveUser() + { + global $USER, $LDAP, $SQL, $MAILER, $REDIS, $WEBHOOK; + switchUser(...getUserIsPIHasAtLeastOneMember()); + $pi = $USER; + $piUid = $USER->getUID(); + $piGroup = $USER->getPIGroup(); + $this->assertTrue($piGroup->exists()); + $memberUIDs = $piGroup->getGroupMemberUIDs(); + // the 0th member of the PI group is the PI + $this->assertGreaterThan(1, count($memberUIDs)); + $memberToDelete = null; + foreach ($memberUIDs as $uid) { + if ($uid != $piUid) { + $memberToDelete = new UnityUser($uid, $LDAP, $SQL, $MAILER, $REDIS, $WEBHOOK); + break; + } + } + $this->assertNotEquals($pi->getUID(), $memberToDelete->getUID()); + $this->assertTrue($piGroup->userExists($memberToDelete)); + try { + $this->removeUser($memberToDelete->getUID()); + $this->assertFalse($piGroup->userExists($memberToDelete)); + } finally { + if (!$piGroup->userExists($memberToDelete)) { + $piGroup->newUserRequest($memberToDelete); + $piGroup->approveUser($memberToDelete); + } + } + } + + public function testRemovePIFromTheirOwnGroup() + { + global $USER, $LDAP, $SQL, $MAILER, $REDIS, $WEBHOOK; + switchUser(...getUserIsPIHasAtLeastOneMember()); + $pi = $USER; + $piGroup = $USER->getPIGroup(); + $this->assertTrue($piGroup->exists()); + $this->assertTrue($piGroup->userExists($pi)); + $this->expectException(Exception::class); + try { + $this->removeUser($pi->getUID()); + $this->assertTrue($piGroup->userExists($pi)); + } finally { + if (!$piGroup->userExists($pi)) { + $piGroup->newUserRequest($pi); + $piGroup->approveUser($pi); + } + } + } +} diff --git a/test/phpunit-bootstrap.php b/test/phpunit-bootstrap.php index 0d459f83..399a6a21 100644 --- a/test/phpunit-bootstrap.php +++ b/test/phpunit-bootstrap.php @@ -67,7 +67,10 @@ function post(string $phpfile, array $post_data): void include $phpfile; ob_get_clean(); // discard output } catch (Throwable $e) { - error_log(ob_get_clean()); // don't discard output + $output = ob_get_clean(); + if (!empty($output)) { + error_log($output); + } throw $e; } finally { unset($_POST); @@ -119,3 +122,8 @@ function getUserIsPIHasNoMembersNoMemberRequests() { return ["user5@org2.test", "foo", "bar", "user5@org2.test"]; } + +function getUserIsPIHasAtLeastOneMember() +{ + return ["user1@org1.test", "foo", "bar", "user1@org1.test"]; +} From 92016c2b5d8d16ff72d387f45a471396af2558de Mon Sep 17 00:00:00 2001 From: Simon Leary Date: Wed, 23 Apr 2025 11:57:34 -0400 Subject: [PATCH 04/22] unityLDAP use its own getEntry method --- resources/lib/UnityLDAP.php | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/resources/lib/UnityLDAP.php b/resources/lib/UnityLDAP.php index fc44cd4f..05686cdc 100644 --- a/resources/lib/UnityLDAP.php +++ b/resources/lib/UnityLDAP.php @@ -315,25 +315,21 @@ public function getAllOrgGroups($UnitySQL, $UnityMailer, $UnityRedis, $UnityWebh public function getUserEntry($uid) { - $ldap_entry = new LDAPEntry($this->getConn(), unityLDAP::RDN . "=$uid," . $this->STR_USEROU); - return $ldap_entry; + return $this->getEntry(unityLDAP::RDN . "=$uid," . $this->STR_USEROU); } public function getGroupEntry($gid) { - $ldap_entry = new LDAPEntry($this->getConn(), unityLDAP::RDN . "=$gid," . $this->STR_GROUPOU); - return $ldap_entry; + return $this->getEntry(unityLDAP::RDN . "=$gid," . $this->STR_GROUPOU); } public function getPIGroupEntry($gid) { - $ldap_entry = new LDAPEntry($this->getConn(), unityLDAP::RDN . "=$gid," . $this->STR_PIGROUPOU); - return $ldap_entry; + return $this->getEntry(unityLDAP::RDN . "=$gid," . $this->STR_PIGROUPOU); } public function getOrgGroupEntry($gid) { - $ldap_entry = new LDAPEntry($this->getConn(), unityLDAP::RDN . "=$gid," . $this->STR_ORGGROUPOU); - return $ldap_entry; + return $this->getEntry(unityLDAP::RDN . "=$gid," . $this->STR_ORGGROUPOU); } } From 932958ccdf16c8883de001b12fc4898df0574552 Mon Sep 17 00:00:00 2001 From: Simon Leary Date: Wed, 23 Apr 2025 12:58:25 -0400 Subject: [PATCH 05/22] write test for PI group disband (requires changes in phpopenldaper) --- resources/autoload.php | 1 + resources/lib/UnitySite.php | 2 +- .../lib/exceptions/RedirectException.php | 7 +++ test/functional/PiDisbandTest.php | 56 +++++++++++++++++++ test/phpunit-bootstrap.php | 1 + 5 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 resources/lib/exceptions/RedirectException.php create mode 100644 test/functional/PiDisbandTest.php diff --git a/resources/autoload.php b/resources/autoload.php index 32a8ebf7..2ed3d44f 100644 --- a/resources/autoload.php +++ b/resources/autoload.php @@ -20,6 +20,7 @@ require_once __DIR__ . "/lib/UnityWebhook.php"; require_once __DIR__ . "/lib/UnityRedis.php"; require_once __DIR__ . "/lib/UnityGithub.php"; +require_once __DIR__ . "/lib/exceptions/RedirectException.php"; // run init script require __DIR__ . "/init.php"; diff --git a/resources/lib/UnitySite.php b/resources/lib/UnitySite.php index 1b3acb88..ec65855a 100644 --- a/resources/lib/UnitySite.php +++ b/resources/lib/UnitySite.php @@ -10,7 +10,7 @@ public static function redirect($destination) { if ($_SERVER["PHP_SELF"] != $destination) { header("Location: $destination"); - die("Redirect failed, click here to continue."); + throw new RedirectException("Redirect failed, click here to continue."); } } diff --git a/resources/lib/exceptions/RedirectException.php b/resources/lib/exceptions/RedirectException.php new file mode 100644 index 00000000..37764e72 --- /dev/null +++ b/resources/lib/exceptions/RedirectException.php @@ -0,0 +1,7 @@ +getUID(); + } + + private function disband() + { + // PI disband leads to redirect, redirect doesn't work during testing + try { + post( + __DIR__ . "/../../webroot/panel/pi.php", + ["form_name" => "disband"] + ); + } catch (RedirectException $e) {} + } + + public function testDisband() + { + global $USER, $SQL; + switchUser(...getUserIsPIHasNoMembersNoMemberRequests()); + $pi = $USER; + $piGroup = $USER->getPIGroup(); + $piGroup->requestGroup(true); + $piGroup->approveGroup(); + $piGroupEntry = $piGroup->getLDAPPiGroup(); + $piGroupAttributesBefore = $piGroupEntry->getAttributes(); + error_log(json_encode($piGroupAttributesBefore, JSON_PRETTY_PRINT)); + $piGroupName = $piGroup->getPIUID(); + $this->assertTrue($piGroup->exists()); + $this->assertEquals([$pi->getUID()], $piGroup->getGroupMemberUIDs()); + $this->assertEmpty($piGroup->getRequests()); + try { + $SQL->addRequest(self::$requestUid, $piGroupName); + $this->disband(); + $this->assertFalse($piGroup->exists()); + $this->assertEmpty($SQL->getRequests($piGroup->getPIUID())); + } finally { + $piGroupEntry->setAttributes($piGroupAttributesBefore); + if (!$piGroupEntry->write()) { + throw new Exception("Failed to recreate POSIX group $piGroupName"); + } + } + } +} diff --git a/test/phpunit-bootstrap.php b/test/phpunit-bootstrap.php index 399a6a21..723ad6ff 100644 --- a/test/phpunit-bootstrap.php +++ b/test/phpunit-bootstrap.php @@ -14,6 +14,7 @@ require_once __DIR__ . "/../resources/lib/UnityWebhook.php"; require_once __DIR__ . "/../resources/lib/UnityRedis.php"; require_once __DIR__ . "/../resources/lib/UnityGithub.php"; +require_once __DIR__ . "/../resources/lib/exceptions/RedirectException.php"; global $HTTP_HEADER_TEST_INPUTS; $HTTP_HEADER_TEST_INPUTS = [ From 310595c61dd4ee4da5bc642e3132809e7130aaec Mon Sep 17 00:00:00 2001 From: Simon Leary Date: Wed, 23 Apr 2025 13:07:57 -0400 Subject: [PATCH 06/22] remove print debugging --- test/functional/PiDisbandTest.php | 1 - 1 file changed, 1 deletion(-) diff --git a/test/functional/PiDisbandTest.php b/test/functional/PiDisbandTest.php index e99fc72a..3ad50ce2 100644 --- a/test/functional/PiDisbandTest.php +++ b/test/functional/PiDisbandTest.php @@ -36,7 +36,6 @@ public function testDisband() $piGroup->approveGroup(); $piGroupEntry = $piGroup->getLDAPPiGroup(); $piGroupAttributesBefore = $piGroupEntry->getAttributes(); - error_log(json_encode($piGroupAttributesBefore, JSON_PRETTY_PRINT)); $piGroupName = $piGroup->getPIUID(); $this->assertTrue($piGroup->exists()); $this->assertEquals([$pi->getUID()], $piGroup->getGroupMemberUIDs()); From 970414b02fdf3c7ce7e6afef1cd3d3f4e5d4182f Mon Sep 17 00:00:00 2001 From: Simon Leary Date: Wed, 23 Apr 2025 13:10:06 -0400 Subject: [PATCH 07/22] add comment --- test/functional/PiRemoveUserTest.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/functional/PiRemoveUserTest.php b/test/functional/PiRemoveUserTest.php index 9f69c641..7953e5be 100644 --- a/test/functional/PiRemoveUserTest.php +++ b/test/functional/PiRemoveUserTest.php @@ -24,6 +24,8 @@ public function testRemoveUser() $memberUIDs = $piGroup->getGroupMemberUIDs(); // the 0th member of the PI group is the PI $this->assertGreaterThan(1, count($memberUIDs)); + // the ordering of the uids in getGroupMemberUIDs is different each time + // use a linear search to find a user who is not the PI $memberToDelete = null; foreach ($memberUIDs as $uid) { if ($uid != $piUid) { From 2ace549c4e492adafe892c613add746412d88b12 Mon Sep 17 00:00:00 2001 From: Simon Leary Date: Wed, 23 Apr 2025 14:18:46 -0400 Subject: [PATCH 08/22] remove checks on write success --- resources/lib/UnityGroup.php | 17 +++--------- resources/lib/UnityOrg.php | 17 +++--------- resources/lib/UnityUser.php | 45 +++++++------------------------ test/functional/PiDisbandTest.php | 4 +-- 4 files changed, 16 insertions(+), 67 deletions(-) diff --git a/resources/lib/UnityGroup.php b/resources/lib/UnityGroup.php index d1616225..f7301021 100644 --- a/resources/lib/UnityGroup.php +++ b/resources/lib/UnityGroup.php @@ -487,10 +487,7 @@ private function init() $ldapPiGroupEntry->setAttribute("objectclass", UnityLDAP::POSIX_GROUP_CLASS); $ldapPiGroupEntry->setAttribute("gidnumber", strval($nextGID)); $ldapPiGroupEntry->setAttribute("memberuid", array($owner->getUID())); - - if (!$ldapPiGroupEntry->write()) { - throw new Exception("Failed to create POSIX group for " . $owner->getUID()); // this shouldn't execute - } + $ldapPiGroupEntry->write(); } $this->REDIS->appendCacheArray("sorted_groups", "", $this->getPIUID()); @@ -503,11 +500,7 @@ private function addUserToGroup($new_user) // Add to LDAP Group $pi_group = $this->getLDAPPiGroup(); $pi_group->appendAttribute("memberuid", $new_user->getUID()); - - if (!$pi_group->write()) { - throw new Exception("Unable to write PI group"); - } - + $pi_group->write(); $this->REDIS->appendCacheArray($this->getPIUID(), "members", $new_user->getUID()); $this->REDIS->appendCacheArray($new_user->getUID(), "groups", $this->getPIUID()); } @@ -517,11 +510,7 @@ private function removeUserFromGroup($old_user) // Remove from LDAP Group $pi_group = $this->getLDAPPiGroup(); $pi_group->removeAttributeEntryByValue("memberuid", $old_user->getUID()); - - if (!$pi_group->write()) { - throw new Exception("Unable to write PI group"); - } - + $pi_group->write(); $this->REDIS->removeCacheArray($this->getPIUID(), "members", $old_user->getUID()); $this->REDIS->removeCacheArray($old_user->getUID(), "groups", $this->getPIUID()); } diff --git a/resources/lib/UnityOrg.php b/resources/lib/UnityOrg.php index 03f85818..d5215bf2 100644 --- a/resources/lib/UnityOrg.php +++ b/resources/lib/UnityOrg.php @@ -34,10 +34,7 @@ public function init() $org_group->setAttribute("objectclass", UnityLDAP::POSIX_GROUP_CLASS); $org_group->setAttribute("gidnumber", strval($nextGID)); - - if (!$org_group->write()) { - throw new Exception("Failed to create POSIX group for " . $this->orgid); // this shouldn't execute - } + $org_group->write(); } $this->REDIS->appendCacheArray("sorted_orgs", "", $this->getOrgID()); @@ -101,11 +98,7 @@ public function addUser($user) { $org_group = $this->getLDAPOrgGroup(); $org_group->appendAttribute("memberuid", $user->getUID()); - - if (!$org_group->write()) { - throw new Exception("Unable to write to org group"); - } - + $org_group->write(); $this->REDIS->appendCacheArray($this->getOrgID(), "members", $user->getUID()); } @@ -113,11 +106,7 @@ public function removeUser($user) { $org_group = $this->getLDAPOrgGroup(); $org_group->removeAttributeEntryByValue("memberuid", $user->getUID()); - - if (!$org_group->write()) { - throw new Exception("Unable to write to org group"); - } - + $org_group->write(); $this->REDIS->removeCacheArray($this->getOrgID(), "members", $user->getUID()); } } diff --git a/resources/lib/UnityUser.php b/resources/lib/UnityUser.php index ccf7fb9e..6ec916d6 100644 --- a/resources/lib/UnityUser.php +++ b/resources/lib/UnityUser.php @@ -58,10 +58,7 @@ public function init($send_mail = true) if (!$ldapGroupEntry->exists()) { $ldapGroupEntry->setAttribute("objectclass", UnityLDAP::POSIX_GROUP_CLASS); $ldapGroupEntry->setAttribute("gidnumber", strval($id)); - - if (!$ldapGroupEntry->write()) { - throw new Exception("Failed to create POSIX group for $this->uid"); - } + $ldapGroupEntry->write(); } // @@ -80,11 +77,7 @@ public function init($send_mail = true) $ldapUserEntry->setAttribute("loginshell", $this->LDAP->getDefUserShell()); $ldapUserEntry->setAttribute("uidnumber", strval($id)); $ldapUserEntry->setAttribute("gidnumber", strval($id)); - - if (!$ldapUserEntry->write()) { - $ldapGroupEntry->delete(); // Cleanup previous group - throw new Exception("Failed to create POSIX user for $this->uid"); - } + $ldapUserEntry->write(); } // update cache @@ -177,11 +170,7 @@ public function setOrg($org) { $ldap_user = $this->getLDAPUser(); $ldap_user->setAttribute("o", $org); - - if (!$ldap_user->write()) { - throw new Exception("Error updating LDAP entry $this->uid"); - } - + $ldap_user->write(); $this->REDIS->setCache($this->uid, "org", $org); } @@ -225,10 +214,7 @@ public function setFirstname($firstname, $operator = null) $this->getUID() ); - if (!$ldap_user->write()) { - throw new Exception("Error updating LDAP entry $this->uid"); - } - + $ldap_user->write(); $this->REDIS->setCache($this->uid, "firstname", $firstname); } @@ -277,10 +263,7 @@ public function setLastname($lastname, $operator = null) $this->getUID() ); - if (!$this->getLDAPUser()->write()) { - throw new Exception("Error updating LDAP entry $this->uid"); - } - + $this->getLDAPUser()->write(); $this->REDIS->setCache($this->uid, "lastname", $lastname); } @@ -334,10 +317,7 @@ public function setMail($email, $operator = null) $this->getUID() ); - if (!$this->getLDAPUser()->write()) { - throw new Exception("Error updating LDAP entry $this->uid"); - } - + $this->getLDAPUser()->write(); $this->REDIS->setCache($this->uid, "mail", $email); } @@ -380,9 +360,7 @@ public function setSSHKeys($keys, $operator = null, $send_mail = true) $keys_filt = array_values(array_unique($keys)); if ($ldapUser->exists()) { $ldapUser->setAttribute("sshpublickey", $keys_filt); - if (!$ldapUser->write()) { - throw new Exception("Failed to modify SSH keys for $this->uid"); - } + $ldapUser->write(); } $this->REDIS->setCache($this->uid, "sshkeys", $keys_filt); @@ -451,9 +429,7 @@ public function setLoginShell($shell, $operator = null, $send_mail = true) $ldapUser = $this->getLDAPUser(); if ($ldapUser->exists()) { $ldapUser->setAttribute("loginshell", $shell); - if (!$ldapUser->write()) { - throw new Exception("Failed to modify login shell for $this->uid"); - } + $ldapUser->write(); } $operator = is_null($operator) ? $this->getUID() : $operator->getUID(); @@ -510,10 +486,7 @@ public function setHomeDir($home, $operator = null) $ldapUser = $this->getLDAPUser(); if ($ldapUser->exists()) { $ldapUser->setAttribute("homedirectory", $home); - if (!$ldapUser->write()) { - throw new Exception("Failed to modify home directory for $this->uid"); - } - + $ldapUser->write(); $operator = is_null($operator) ? $this->getUID() : $operator->getUID(); $this->SQL->addLog( diff --git a/test/functional/PiDisbandTest.php b/test/functional/PiDisbandTest.php index 3ad50ce2..d2611857 100644 --- a/test/functional/PiDisbandTest.php +++ b/test/functional/PiDisbandTest.php @@ -47,9 +47,7 @@ public function testDisband() $this->assertEmpty($SQL->getRequests($piGroup->getPIUID())); } finally { $piGroupEntry->setAttributes($piGroupAttributesBefore); - if (!$piGroupEntry->write()) { - throw new Exception("Failed to recreate POSIX group $piGroupName"); - } + $piGroupEntry->write(); } } } From 490386089aa6852d96afaeb229a01dcb36ef97b3 Mon Sep 17 00:00:00 2001 From: Simon Leary Date: Wed, 23 Apr 2025 14:49:39 -0400 Subject: [PATCH 09/22] add phpopenldaper as a submodule --- .gitignore | 5 ++++- .gitmodules | 3 +++ composer.json | 3 +-- resources/autoload.php | 3 +++ test/phpunit-bootstrap.php | 3 +++ vendor/hakasapl/phpopenldaper | 1 + 6 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 .gitmodules create mode 160000 vendor/hakasapl/phpopenldaper diff --git a/.gitignore b/.gitignore index 6c9cc065..9d00bbff 100644 --- a/.gitignore +++ b/.gitignore @@ -9,7 +9,10 @@ resources/custom_user_mappings/*.csv **/.rnd # don't track vendor files from composer -vendor +vendor/** +!vendor/hakasapl/ +!vendor/hakasapl/phpopenldaper/ +!vendor/hakasapl/phpopenldaper/** composer.lock # don't track site configs diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..36d3db05 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "vendor/hakasapl/phpopenldaper"] + path = vendor/hakasapl/phpopenldaper + url = git@github.com:hakasapl/phpopenldaper.git diff --git a/composer.json b/composer.json index 2b7bbc14..45e6d7ec 100644 --- a/composer.json +++ b/composer.json @@ -2,8 +2,7 @@ "require": { "psr/log": "1.1.4", "phpseclib/phpseclib": "3.0.43", - "phpmailer/phpmailer": "6.6.4", - "hakasapl/phpopenldaper": "1.0.6" + "phpmailer/phpmailer": "6.6.4" }, "require-dev": { "phpunit/phpunit": "<12.1" diff --git a/resources/autoload.php b/resources/autoload.php index 2ed3d44f..d5f86d9f 100644 --- a/resources/autoload.php +++ b/resources/autoload.php @@ -6,6 +6,9 @@ // Load Composer Libs require_once __DIR__ . "/../vendor/autoload.php"; +// submodule +require_once __DIR__ . "/../vendor/hakasapl/phpopenldaper/src/PHPOpenLDAPer/LDAPEntry.php"; +require_once __DIR__ . "/../vendor/hakasapl/phpopenldaper/src/PHPOpenLDAPer/LDAPConn.php"; // load libs require_once __DIR__ . "/lib/UnityLDAP.php"; diff --git a/test/phpunit-bootstrap.php b/test/phpunit-bootstrap.php index 723ad6ff..cae37dd3 100644 --- a/test/phpunit-bootstrap.php +++ b/test/phpunit-bootstrap.php @@ -1,6 +1,9 @@ Date: Wed, 23 Apr 2025 14:58:20 -0400 Subject: [PATCH 10/22] make sure github actions does recursive checkout --- .github/workflows/functional.yml | 2 ++ .github/workflows/phpunit.yml | 2 ++ .github/workflows/pre-commit.yml | 2 ++ 3 files changed, 6 insertions(+) diff --git a/.github/workflows/functional.yml b/.github/workflows/functional.yml index 431092c4..783539c7 100644 --- a/.github/workflows/functional.yml +++ b/.github/workflows/functional.yml @@ -10,6 +10,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + with: + submodules: true - name: setup PHP uses: shivammathur/setup-php@v2 with: diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml index bfcb066c..013d7d89 100644 --- a/.github/workflows/phpunit.yml +++ b/.github/workflows/phpunit.yml @@ -7,6 +7,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + with: + submodules: true - name: setup PHP uses: shivammathur/setup-php@v2 with: diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 5a5abbc2..929a14b2 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -10,6 +10,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + with: + submodules: true - uses: actions/setup-python@v3 - name: setup PHP uses: shivammathur/setup-php@v2 From 93381b2bc4745ccc8085768e514dd41106cb2f7f Mon Sep 17 00:00:00 2001 From: Simon Leary Date: Wed, 23 Apr 2025 15:07:17 -0400 Subject: [PATCH 11/22] remove junk submodule --- tools/docker-dev/unity-web-portal | 1 - 1 file changed, 1 deletion(-) delete mode 160000 tools/docker-dev/unity-web-portal diff --git a/tools/docker-dev/unity-web-portal b/tools/docker-dev/unity-web-portal deleted file mode 160000 index 7087b787..00000000 --- a/tools/docker-dev/unity-web-portal +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 7087b78718a64185ea1ebaf615f4a8b395f39267 From af68f5e69cce2cfd76fdbc35cede7436734ff04b Mon Sep 17 00:00:00 2001 From: Simon Leary Date: Wed, 23 Apr 2025 15:10:36 -0400 Subject: [PATCH 12/22] update submodule --- vendor/hakasapl/phpopenldaper | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vendor/hakasapl/phpopenldaper b/vendor/hakasapl/phpopenldaper index 41a769d9..9628975d 160000 --- a/vendor/hakasapl/phpopenldaper +++ b/vendor/hakasapl/phpopenldaper @@ -1 +1 @@ -Subproject commit 41a769d9e1b3ac79ff38af0c2a5a06cadb382ff2 +Subproject commit 9628975d47781465d829d1f9b8cc669396f0699d From bc05b95e23afc7f51365b61bc0f8cf4ece61fb06 Mon Sep 17 00:00:00 2001 From: Simon Leary Date: Wed, 23 Apr 2025 15:20:10 -0400 Subject: [PATCH 13/22] phpcs:disable not needed in test/ --- test/functional/LoginShellSetTest.php | 2 -- test/unit/AjaxSshValidateTest.php | 2 -- test/unit/UnityGithubTest.php | 2 -- 3 files changed, 6 deletions(-) diff --git a/test/functional/LoginShellSetTest.php b/test/functional/LoginShellSetTest.php index 79dc2202..82b14e45 100644 --- a/test/functional/LoginShellSetTest.php +++ b/test/functional/LoginShellSetTest.php @@ -23,9 +23,7 @@ public function tearDown(): void public static function getShells() { global $HTTP_HEADER_TEST_INPUTS; - // phpcs:disable return [["/bin/bash"]] + array_map(function($x){return [$x];}, $HTTP_HEADER_TEST_INPUTS); - // phpcs:enable } #[DataProvider("getShells")] diff --git a/test/unit/AjaxSshValidateTest.php b/test/unit/AjaxSshValidateTest.php index 6f670a43..e4bf6aac 100644 --- a/test/unit/AjaxSshValidateTest.php +++ b/test/unit/AjaxSshValidateTest.php @@ -12,9 +12,7 @@ public static function providerTestSshValidate() // sanity check only, see UnitySiteTest for more comprehensive test cases return [ [false, "foobar"], - // phpcs:disable [true, "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIB+XqO25MUB9x/pS04I3JQ7rMGboWyGXh0GUzkOrTi7a"], - // phpcs:enable ]; } diff --git a/test/unit/UnityGithubTest.php b/test/unit/UnityGithubTest.php index d36841b3..a860db3d 100644 --- a/test/unit/UnityGithubTest.php +++ b/test/unit/UnityGithubTest.php @@ -17,9 +17,7 @@ public static function providerTestGetGithubKeys() # user with no keys ["sheldor1510", []], # user with 1 key - //phpcs:disable ["simonLeary42", ["ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDGRl6JWPj+Gq2Lz9GjYdUl4/unLoFOyfgeiII1CxutpabPByRJbeuonR0zTpn51tZeYuAUOJBOeKt+Lj4i4UDGl6igpdXXSwkBXl7jxfRPwJ6WuTkDx7Z8ynwnqlDV2q089q4OX/b/uuHgsIhIBwrouKsRQaZIqTbwNMfiqQ2zl14V0KMrTPzOiwR6Q+hqSaR5Z29WKE7ff/OWzSC3/0T6avCmcCbQaRPJdVM+QC17B0vl8FzPwRjorMngwZ0cImdQ/0Ww1d12YAL7UWp1c2egfnthKP3MuQZnNF8ixsAk1eIIwTRdiI87BOoorW8NXhxXmhyheRCsFwyP4LJBqyUVoZJ0UYyk0AO4G9EStnfpiz8YXGK+M1G4tUrWgzs1cdjlHtgCWUmITtgabnYCC4141m7n4GZTk2H/lSrJcvAs3JEiwLTj1lzeGgzeSsz/XKsnOJyzjEVr2Jp3iT+J9PbQpfS0SxTCIGgxMqllovv79pfsF/zc+vaxqSShyHW7oyn7hLMHM60LO/IIX1RWGL3rD9ecXx2pXXQ1RhIkVteIi13XkFt+KW00cstFlAd3EHCoY/XorShd2jeID7tpnYlmNfotYUs6IKefvpNC0PWkh5UXFEv3SUfw4Wd8O0DiHfhkrhxn1W/GajqSIlZ5DKgPzFg8EHexv8lSa7WJg0H3YQ=="]] - //phpcs:enable ]; } From 507fc9e72b0f4f01211cd093bbf0eb22bd322827 Mon Sep 17 00:00:00 2001 From: Simon Leary Date: Wed, 23 Apr 2025 15:34:24 -0400 Subject: [PATCH 14/22] new exception type --- test/functional/LoginShellSetTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/functional/LoginShellSetTest.php b/test/functional/LoginShellSetTest.php index 82b14e45..fb3cc532 100644 --- a/test/functional/LoginShellSetTest.php +++ b/test/functional/LoginShellSetTest.php @@ -48,7 +48,7 @@ public function testSetLoginShellSelect(string $shell): void global $USER; // FIXME add check to avoid warning from ldap_modify if (!mb_check_encoding($shell, 'ASCII')) { - $this->expectException("Exception"); + $this->expectException(RuntimeException::class); } // FIXME shell is not validated post( From c8e01e1554197488eb791827e0e58bcd8814a469 Mon Sep 17 00:00:00 2001 From: Simon Leary Date: Wed, 23 Apr 2025 15:34:31 -0400 Subject: [PATCH 15/22] no more delete return success --- resources/lib/UnityGroup.php | 5 +---- vendor/hakasapl/phpopenldaper | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/resources/lib/UnityGroup.php b/resources/lib/UnityGroup.php index f7301021..1de65a65 100644 --- a/resources/lib/UnityGroup.php +++ b/resources/lib/UnityGroup.php @@ -218,10 +218,7 @@ public function removeGroup($send_mail = true) // now we delete the ldap entry $ldapPiGroupEntry = $this->getLDAPPiGroup(); if ($ldapPiGroupEntry->exists()) { - if (!$ldapPiGroupEntry->delete()) { - throw new Exception("Unable to delete PI ldap group"); - } - + $ldapPiGroupEntry->delete(); $this->REDIS->removeCacheArray("sorted_groups", "", $this->getPIUID()); foreach ($users as $user) { $this->REDIS->removeCacheArray($user->getUID(), "groups", $this->getPIUID()); diff --git a/vendor/hakasapl/phpopenldaper b/vendor/hakasapl/phpopenldaper index 9628975d..ae16e114 160000 --- a/vendor/hakasapl/phpopenldaper +++ b/vendor/hakasapl/phpopenldaper @@ -1 +1 @@ -Subproject commit 9628975d47781465d829d1f9b8cc669396f0699d +Subproject commit ae16e114f196254be8c60538ff4a731835181641 From 4b80bc2c9d0e6f35441da1345b0e80b61ca4e311 Mon Sep 17 00:00:00 2001 From: Simon Leary Date: Wed, 23 Apr 2025 15:38:01 -0400 Subject: [PATCH 16/22] update submodule --- vendor/hakasapl/phpopenldaper | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vendor/hakasapl/phpopenldaper b/vendor/hakasapl/phpopenldaper index ae16e114..43c1cd69 160000 --- a/vendor/hakasapl/phpopenldaper +++ b/vendor/hakasapl/phpopenldaper @@ -1 +1 @@ -Subproject commit ae16e114f196254be8c60538ff4a731835181641 +Subproject commit 43c1cd69f2ee564c2dcf63d58e284c3fcdd19514 From 5f7e61d001124217243ff5bda06d4cfd69662c2f Mon Sep 17 00:00:00 2001 From: Simon Leary Date: Wed, 23 Apr 2025 15:38:23 -0400 Subject: [PATCH 17/22] ignore phpunit result cache --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 9d00bbff..b088b238 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,5 @@ composer.lock deployment/* !deployment/**/README.md !deployment/deploy.sh + +.phpunit.result.cache From e21f6c2baea2a0ca73488e5674e5c941a5bd7d6f Mon Sep 17 00:00:00 2001 From: Simon Leary Date: Fri, 25 Apr 2025 10:42:09 -0400 Subject: [PATCH 18/22] PI disbanding has been removed --- test/functional/PiDisbandTest.php | 53 ------------------------------- 1 file changed, 53 deletions(-) delete mode 100644 test/functional/PiDisbandTest.php diff --git a/test/functional/PiDisbandTest.php b/test/functional/PiDisbandTest.php deleted file mode 100644 index d2611857..00000000 --- a/test/functional/PiDisbandTest.php +++ /dev/null @@ -1,53 +0,0 @@ -getUID(); - } - - private function disband() - { - // PI disband leads to redirect, redirect doesn't work during testing - try { - post( - __DIR__ . "/../../webroot/panel/pi.php", - ["form_name" => "disband"] - ); - } catch (RedirectException $e) {} - } - - public function testDisband() - { - global $USER, $SQL; - switchUser(...getUserIsPIHasNoMembersNoMemberRequests()); - $pi = $USER; - $piGroup = $USER->getPIGroup(); - $piGroup->requestGroup(true); - $piGroup->approveGroup(); - $piGroupEntry = $piGroup->getLDAPPiGroup(); - $piGroupAttributesBefore = $piGroupEntry->getAttributes(); - $piGroupName = $piGroup->getPIUID(); - $this->assertTrue($piGroup->exists()); - $this->assertEquals([$pi->getUID()], $piGroup->getGroupMemberUIDs()); - $this->assertEmpty($piGroup->getRequests()); - try { - $SQL->addRequest(self::$requestUid, $piGroupName); - $this->disband(); - $this->assertFalse($piGroup->exists()); - $this->assertEmpty($SQL->getRequests($piGroup->getPIUID())); - } finally { - $piGroupEntry->setAttributes($piGroupAttributesBefore); - $piGroupEntry->write(); - } - } -} From 33c4d864edfdc82c49ab8c16aec8723ef3ad74f7 Mon Sep 17 00:00:00 2001 From: Simon Leary Date: Wed, 30 Apr 2025 10:50:31 -0400 Subject: [PATCH 19/22] revert redirect changes --- resources/autoload.php | 1 - resources/lib/UnitySite.php | 2 +- resources/lib/exceptions/RedirectException.php | 7 ------- test/phpunit-bootstrap.php | 1 - 4 files changed, 1 insertion(+), 10 deletions(-) delete mode 100644 resources/lib/exceptions/RedirectException.php diff --git a/resources/autoload.php b/resources/autoload.php index d5f86d9f..0fdc9346 100644 --- a/resources/autoload.php +++ b/resources/autoload.php @@ -23,7 +23,6 @@ require_once __DIR__ . "/lib/UnityWebhook.php"; require_once __DIR__ . "/lib/UnityRedis.php"; require_once __DIR__ . "/lib/UnityGithub.php"; -require_once __DIR__ . "/lib/exceptions/RedirectException.php"; // run init script require __DIR__ . "/init.php"; diff --git a/resources/lib/UnitySite.php b/resources/lib/UnitySite.php index ec65855a..1b3acb88 100644 --- a/resources/lib/UnitySite.php +++ b/resources/lib/UnitySite.php @@ -10,7 +10,7 @@ public static function redirect($destination) { if ($_SERVER["PHP_SELF"] != $destination) { header("Location: $destination"); - throw new RedirectException("Redirect failed, click here to continue."); + die("Redirect failed, click here to continue."); } } diff --git a/resources/lib/exceptions/RedirectException.php b/resources/lib/exceptions/RedirectException.php deleted file mode 100644 index 37764e72..00000000 --- a/resources/lib/exceptions/RedirectException.php +++ /dev/null @@ -1,7 +0,0 @@ - Date: Wed, 30 Apr 2025 15:37:33 -0400 Subject: [PATCH 20/22] remove old submodule --- vendor/hakasapl/phpopenldaper | 1 - 1 file changed, 1 deletion(-) delete mode 160000 vendor/hakasapl/phpopenldaper diff --git a/vendor/hakasapl/phpopenldaper b/vendor/hakasapl/phpopenldaper deleted file mode 160000 index 43c1cd69..00000000 --- a/vendor/hakasapl/phpopenldaper +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 43c1cd69f2ee564c2dcf63d58e284c3fcdd19514 From 03b9b18ca6fb36a29f303ac8b174f9d1124ffdfd Mon Sep 17 00:00:00 2001 From: Simon Leary Date: Wed, 30 Apr 2025 15:38:21 -0400 Subject: [PATCH 21/22] revert gitignore change --- .gitignore | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index b088b238..90e7dd7d 100644 --- a/.gitignore +++ b/.gitignore @@ -9,10 +9,7 @@ resources/custom_user_mappings/*.csv **/.rnd # don't track vendor files from composer -vendor/** -!vendor/hakasapl/ -!vendor/hakasapl/phpopenldaper/ -!vendor/hakasapl/phpopenldaper/** +vendor composer.lock # don't track site configs From fcadc598885e15ef6b2fb45fc4c0606bd1dd96e0 Mon Sep 17 00:00:00 2001 From: Simon Leary Date: Wed, 30 Apr 2025 15:38:42 -0400 Subject: [PATCH 22/22] revert autoload change --- resources/autoload.php | 3 --- test/phpunit-bootstrap.php | 3 --- 2 files changed, 6 deletions(-) diff --git a/resources/autoload.php b/resources/autoload.php index 0302e928..5c0c25c2 100644 --- a/resources/autoload.php +++ b/resources/autoload.php @@ -6,9 +6,6 @@ // Load Composer Libs require_once __DIR__ . "/../vendor/autoload.php"; -// submodule -require_once __DIR__ . "/../vendor/hakasapl/phpopenldaper/src/PHPOpenLDAPer/LDAPEntry.php"; -require_once __DIR__ . "/../vendor/hakasapl/phpopenldaper/src/PHPOpenLDAPer/LDAPConn.php"; // submodule require_once __DIR__ . "/lib/phpopenldaper/src/PHPOpenLDAPer/LDAPEntry.php"; diff --git a/test/phpunit-bootstrap.php b/test/phpunit-bootstrap.php index fe815ec8..ae5f6a1b 100644 --- a/test/phpunit-bootstrap.php +++ b/test/phpunit-bootstrap.php @@ -1,9 +1,6 @@