summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorJan-Philipp Litza <janphilipp@litza.de>2012-12-30 13:08:03 +0100
committerJan-Philipp Litza <janphilipp@litza.de>2012-12-30 13:08:03 +0100
commitf91e00adc78e1f1c3b0fdb59c7810f273bd1c709 (patch)
treeeee3f8258529b9db52957183025f6b260f523baf /includes
parent7e44546f5c41259fd1b9be1a5844c02a814b6427 (diff)
fix bug in signing off from shifts
Diffstat (limited to 'includes')
-rw-r--r--includes/pages/user_myshifts.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/includes/pages/user_myshifts.php b/includes/pages/user_myshifts.php
index f21b11b2..aa4a1e1b 100644
--- a/includes/pages/user_myshifts.php
+++ b/includes/pages/user_myshifts.php
@@ -57,7 +57,7 @@ function user_myshifts() {
}
elseif (isset ($_REQUEST['cancel']) && preg_match("/^[0-9]*$/", $_REQUEST['cancel'])) {
$id = $_REQUEST['cancel'];
- $shift = sql_select("SELECT * FROM `ShiftEntry` WHERE `id`=" . sql_escape($id) . " AND `UID`=" . sql_escape($shifts_user['UID']) . " LIMIT 1");
+ $shift = sql_select("SELECT `Shifts`.`start` FROM `Shifts` INNER JOIN `ShiftEntry` USING (`SID`) WHERE `ShiftEntry`.`id`=" . sql_escape($id) . " AND `UID`=" . sql_escape($shifts_user['UID']) . " LIMIT 1");
if (count($shift) > 0) {
$shift = $shift[0];
if (($shift['start'] > time() + $LETZTES_AUSTRAGEN * 3600) || in_array('user_shifts_admin', $privileges)) {