Calendar: Add missing CSRF checks

This commit is contained in:
johnnyq
2026-03-01 21:52:28 -05:00
parent 308dc6e550
commit e1daa14087
5 changed files with 17 additions and 1 deletions

View File

@@ -8,6 +8,8 @@ defined('FROM_POST_HANDLER') || die("Direct file access is not allowed");
if (isset($_POST['add_calendar'])) {
validateCSRFToken($_POST['csrf_token']);
$name = sanitizeInput($_POST['name']);
$color = sanitizeInput($_POST['color']);
@@ -25,6 +27,8 @@ if (isset($_POST['add_calendar'])) {
if (isset($_POST['edit_calendar'])) {
validateCSRFToken($_POST['csrf_token']);
$calendar_id = intval($_POST['calendar_id']);
$name = sanitizeInput($_POST['name']);
$color = sanitizeInput($_POST['color']);
@@ -41,6 +45,8 @@ if (isset($_POST['edit_calendar'])) {
if (isset($_POST['add_event'])) {
validateCSRFToken($_POST['csrf_token']);
require_once 'event_model.php';
mysqli_query($mysqli,"INSERT INTO calendar_events SET event_title = '$title', event_location = '$location', event_description = '$description', event_start = '$start', event_end = '$end', event_repeat = '$repeat', event_calendar_id = $calendar_id, event_client_id = $client");
@@ -111,6 +117,8 @@ if (isset($_POST['add_event'])) {
if (isset($_POST['edit_event'])) {
validateCSRFToken($_POST['csrf_token']);
require_once 'event_model.php';
$event_id = intval($_POST['event_id']);
@@ -178,6 +186,8 @@ if (isset($_POST['edit_event'])) {
if (isset($_GET['delete_event'])) {
validateCSRFToken($_GET['csrf_token']);
$event_id = intval($_GET['delete_event']);
// Get Event Title