Task 9: Add CSRF tokens to form templates and backend processors

Updated forms with hidden CSRF token fields:
- comment_box.php - Comment form
- course_details.php - Course booking form
- campsites.php - Campsite addition modal form
- bar_tabs.php - Bar tab creation modal form
- membership_application.php - Membership application form

Updated backend processors with CSRF validation:
- create_bar_tab.php - Bar tab AJAX processor
- add_campsite.php - Campsite form processor
- submit_order.php - Order submission processor

All forms now require validated CSRF tokens before processing, preventing cross-site request forgery attacks.
This commit is contained in:
twotalesanimation
2025-12-03 11:47:26 +02:00
parent ce6c8e257a
commit 3247d15ce7
8 changed files with 27 additions and 1 deletions

View File

@@ -155,6 +155,7 @@ unset($_SESSION['cart']);
</div>
<div class="modal-body">
<form id="barTabForm">
<input type="hidden" name="csrf_token" value="<?php echo generateCSRFToken(); ?>">
<div class="form-group">
<label for="userSelect">Select User</label>
<input type="text" id="userSelect" class="form-control" placeholder="Search User" required>