From 5e40388afb1867391aaac03c3cd8b3d26e280177 Mon Sep 17 00:00:00 2001 From: Simon Leary Date: Tue, 14 Oct 2025 11:21:02 -0400 Subject: [PATCH 1/2] disable button to prevent double submit --- resources/templates/header.php | 6 +- webroot/admin/ajax/get_group_members.php | 18 +++++- webroot/admin/pi-mgmt.php | 13 +++- webroot/panel/account.php | 78 +++++++++++++++++++----- webroot/panel/groups.php | 10 ++- webroot/panel/modal/new_key.php | 22 ++++++- webroot/panel/modal/new_pi.php | 2 +- webroot/panel/new_account.php | 15 ++++- webroot/panel/pi.php | 16 ++++- 9 files changed, 147 insertions(+), 33 deletions(-) diff --git a/resources/templates/header.php b/resources/templates/header.php index 23435428..62dfcbd9 100644 --- a/resources/templates/header.php +++ b/resources/templates/header.php @@ -162,7 +162,11 @@
- +
"; diff --git a/webroot/admin/ajax/get_group_members.php b/webroot/admin/ajax/get_group_members.php index cebf4115..cd9bcdcb 100644 --- a/webroot/admin/ajax/get_group_members.php +++ b/webroot/admin/ajax/get_group_members.php @@ -45,7 +45,7 @@ - + "; echo ""; @@ -71,8 +71,20 @@ - - "; + + + + "; echo ""; echo ""; diff --git a/webroot/admin/pi-mgmt.php b/webroot/admin/pi-mgmt.php index dc247326..0e582808 100644 --- a/webroot/admin/pi-mgmt.php +++ b/webroot/admin/pi-mgmt.php @@ -65,6 +65,7 @@ $requests = $SQL->getRequests(); foreach ($requests as $request) { + $uid = $request["uid"]; echo ""; echo "" . $request["firstname"] . " " . $request["lastname"] . ""; echo "" . $request["uid"] . ""; @@ -76,9 +77,17 @@ + onclick=' + confirm(\"Are you sure you want to approve $uid?\") + && this.form.submit() + && this.disabled=true; + '> + onclick=' + confirm(\"Are you sure you want to deny $uid?\") + && this.form.submit() + && this.disabled=true; + '> "; echo ""; echo ""; diff --git a/webroot/panel/account.php b/webroot/panel/account.php index add0e67e..3485068e 100644 --- a/webroot/panel/account.php +++ b/webroot/panel/account.php @@ -156,7 +156,14 @@ > "; if ($SQL->accDeletionRequestExists($USER->uid)) { - echo ""; + echo " + + "; echo "