X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=time_edit.php;h=05db97c02f76a51f16d449cffffeb1b654201f8c;hb=926b8d63a0be596b0c95cb55f01addae410af50c;hp=dd3edde136cb00e5105f8a1cc88af577f653641b;hpb=fd0872d9e582113346fa1e93557f370286c5c9f2;p=timetracker.git diff --git a/time_edit.php b/time_edit.php index dd3edde1..05db97c0 100644 --- a/time_edit.php +++ b/time_edit.php @@ -34,8 +34,16 @@ import('ttClientHelper'); import('ttTimeHelper'); import('DateAndTime'); -// Access check. -if (!ttAccessAllowed('track_own_time')) { +// Access checks. +if (!(ttAccessAllowed('track_own_time') || ttAccessAllowed('track_time'))) { + header('Location: access_denied.php'); + exit(); +} +$cl_id = (int)$request->getParameter('id'); +// Get the time record we are editing. +$time_rec = ttTimeHelper::getRecord($cl_id, $user->getActiveUser()); +if (!$time_rec || $time_rec['invoice_id']) { + // Prohibit editing not ours or invoiced records. header('Location: access_denied.php'); exit(); } @@ -47,14 +55,6 @@ if ($user->isPluginEnabled('cf')) { $smarty->assign('custom_fields', $custom_fields); } -$cl_id = $request->getParameter('id'); - -// Get the time record we are editing. -$time_rec = ttTimeHelper::getRecord($cl_id, $user->getActiveUser()); - -// Prohibit editing invoiced records. -if ($time_rec['invoice_id']) die($i18n->get('error.sys')); - $item_date = new DateAndTime(DB_DATEFORMAT, $time_rec['date']); // Initialize variables.