From cedad817e1fa58e6cd218b03e0e142664f16406a Mon Sep 17 00:00:00 2001 From: Simon Leary Date: Mon, 10 Nov 2025 19:37:37 -0500 Subject: [PATCH 1/4] require ToS for requesting PI group membership in groups.php --- test/functional/PIMemberRequestTest.php | 1 + webroot/panel/groups.php | 3 +++ webroot/panel/modal/new_pi.php | 5 +++++ 3 files changed, 9 insertions(+) diff --git a/test/functional/PIMemberRequestTest.php b/test/functional/PIMemberRequestTest.php index 71072fef..4d8a41fa 100644 --- a/test/functional/PIMemberRequestTest.php +++ b/test/functional/PIMemberRequestTest.php @@ -10,6 +10,7 @@ private function requestMembership(string $gid_or_mail) http_post(__DIR__ . "/../../webroot/panel/groups.php", [ "form_type" => "addPIform", "pi" => $gid_or_mail, + "tos" => "agree", ]); } diff --git a/webroot/panel/groups.php b/webroot/panel/groups.php index 37f6d526..d13327a0 100644 --- a/webroot/panel/groups.php +++ b/webroot/panel/groups.php @@ -26,6 +26,9 @@ switch ($_POST["form_type"]) { case "addPIform": + if (!isset($_POST["tos"]) || $_POST["tos"] != "agree") { + UnityHTTPD::badRequest("user did not agree to terms of service"); + } if ($pi_account->exists()) { if ($pi_account->requestExists($USER)) { array_push($modalErrors, "You've already requested this"); diff --git a/webroot/panel/modal/new_pi.php b/webroot/panel/modal/new_pi.php index 53368e96..d102c733 100644 --- a/webroot/panel/modal/new_pi.php +++ b/webroot/panel/modal/new_pi.php @@ -13,6 +13,11 @@ + From b6fa3088df6c941a619cd1a638db4f9703b0af60 Mon Sep 17 00:00:00 2001 From: Simon Leary Date: Mon, 10 Nov 2025 19:49:26 -0500 Subject: [PATCH 2/4] missed one --- test/functional/PiMemberApproveTest.php | 1 + 1 file changed, 1 insertion(+) diff --git a/test/functional/PiMemberApproveTest.php b/test/functional/PiMemberApproveTest.php index 4d74c103..b59643b7 100644 --- a/test/functional/PiMemberApproveTest.php +++ b/test/functional/PiMemberApproveTest.php @@ -34,6 +34,7 @@ private function requestJoinPI(string $gid) http_post(__DIR__ . "/../../webroot/panel/groups.php", [ "form_type" => "addPIform", "pi" => $gid, + "tos" => "agree", ]); } From 1618012c33f5d4cd5feee3ef3acda6f23835f8f3 Mon Sep 17 00:00:00 2001 From: simonLeary42 <71396965+simonLeary42@users.noreply.github.com> Date: Mon, 10 Nov 2025 19:49:51 -0500 Subject: [PATCH 3/4] Update webroot/panel/modal/new_pi.php Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- webroot/panel/modal/new_pi.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webroot/panel/modal/new_pi.php b/webroot/panel/modal/new_pi.php index d102c733..f12788ad 100644 --- a/webroot/panel/modal/new_pi.php +++ b/webroot/panel/modal/new_pi.php @@ -16,7 +16,7 @@ From 20af2164081ce396a813e6ddb75fed34f0bff091 Mon Sep 17 00:00:00 2001 From: Simon Leary Date: Mon, 10 Nov 2025 19:51:40 -0500 Subject: [PATCH 4/4] indentation --- webroot/panel/modal/new_pi.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/webroot/panel/modal/new_pi.php b/webroot/panel/modal/new_pi.php index f12788ad..14d486f6 100644 --- a/webroot/panel/modal/new_pi.php +++ b/webroot/panel/modal/new_pi.php @@ -16,7 +16,9 @@