Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions test/functional/PIMemberRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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",
]);
}

Expand Down
1 change: 1 addition & 0 deletions test/functional/PiMemberApproveTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ private function requestJoinPI(string $gid)
http_post(__DIR__ . "/../../webroot/panel/groups.php", [
"form_type" => "addPIform",
"pi" => $gid,
"tos" => "agree",
]);
}

Expand Down
3 changes: 3 additions & 0 deletions webroot/panel/groups.php
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
7 changes: 7 additions & 0 deletions webroot/panel/modal/new_pi.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@
<input type="text" id="pi_search" name="pi" placeholder="Search PI by NetID" required>
<div class="searchWrapper" style="display: none;"></div>
</div>
<label>
<input type='checkbox' name='tos' value='agree' required>
I have read and accept the
<a href='<?php echo CONFIG["site"]["terms_of_service_url"]; ?>' target='_blank'>
Terms of Service
</a>.
</label>
<input type="submit" value="Send Request">
</form>

Expand Down