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/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", ]); } 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..14d486f6 100644 --- a/webroot/panel/modal/new_pi.php +++ b/webroot/panel/modal/new_pi.php @@ -13,6 +13,13 @@ +