X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/timetracker.git/blobdiff_plain/e560c531255da8d1fa40295c58cc5c4b1bb4e9d3..0a7886b373c91ef0c2c41307f81177d043c807be:/mobile/time_edit.php diff --git a/mobile/time_edit.php b/mobile/time_edit.php index 683bab74..eff9b335 100644 --- a/mobile/time_edit.php +++ b/mobile/time_edit.php @@ -39,6 +39,14 @@ if (!ttAccessAllowed('track_own_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(); +} // Use custom fields plugin if it is enabled. if ($user->isPluginEnabled('cf')) { @@ -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.