From d509a101213673cc55bcf846ab757eac6899d373 Mon Sep 17 00:00:00 2001 From: Jan-Philipp Litza Date: Sun, 30 Dec 2012 12:51:29 +0100 Subject: [PATCH] Prevent from signing up for colliding shifts servier-side --- includes/pages/user_shifts.php | 6 ++++++ public/pic/icons/bin.png | Bin 0 -> 268 bytes 2 files changed, 6 insertions(+) create mode 100644 public/pic/icons/bin.png diff --git a/includes/pages/user_shifts.php b/includes/pages/user_shifts.php index 235208b9..7fb8ebe6 100644 --- a/includes/pages/user_shifts.php +++ b/includes/pages/user_shifts.php @@ -204,6 +204,12 @@ function user_shifts() { header("Location: " . page_link_to('user_shifts')); } + // Another shift the user is signed up for collides with this one + if(!in_array('user_shifts_admin', $privileges) && sql_num_query("SELECT `Shifts`.`SID` FROM `Shifts` INNER JOIN `ShiftEntry` ON (`Shifts`.`SID` = `ShiftEntry`.`SID` AND `ShiftEntry`.`UID` = " . sql_escape($user['UID']) . ") WHERE `start` < '" . sql_escape($shift['end']) . "' AND `end` > '" . sql_escape($shift['start']) . "'") > 0) { + error("Du bist bereits in einer parallelen Schicht eingetragen. Bitte kontaktiere den Schichtkoordinator, um dich eintragen zu lassen."); + header("Location: " . page_link_to('user_shifts')); + } + if (in_array('user_shifts_admin', $privileges)) $type = sql_select("SELECT * FROM `AngelTypes` WHERE `id`=" . sql_escape($type_id) . " LIMIT 1"); else diff --git a/public/pic/icons/bin.png b/public/pic/icons/bin.png new file mode 100644 index 0000000000000000000000000000000000000000..f5b829e315741dfcf09a54901fce6627e90eb403 GIT binary patch literal 268 zcmV+n0rUQeP)811fZdN3+ID3u#&8y_*p>xo5k3z$ah0$XkyB!%$G0?VZ)XnF~n&?cxk-EfBnvavd zu5BCm_GaK+UTC>9^(R`<)Dh*up&o+5$WYs}G*`!1VXkQ+3epk)nIH<%r3wJSQjnGc zfJ&)SN@u^rs%A?-l=_U5Mb9?7 SlA|;L0000Uo literal 0 HcmV?d00001