X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/timetracker.git/blobdiff_plain/fd0872d9e582113346fa1e93557f370286c5c9f2..dfc50841cd4b60eb8f2172044d6dd08785fe3df4:/mobile/expense_edit.php diff --git a/mobile/expense_edit.php b/mobile/expense_edit.php index 7107e785..1611378d 100644 --- a/mobile/expense_edit.php +++ b/mobile/expense_edit.php @@ -32,19 +32,23 @@ import('ttTeamHelper'); import('DateAndTime'); import('ttExpenseHelper'); -// Access check. -if (!ttAccessAllowed('track_own_expenses') || !$user->isPluginEnabled('ex')) { +// Access checks. +if (!(ttAccessAllowed('track_own_expenses') || ttAccessAllowed('track_expenses'))) { header('Location: access_denied.php'); exit(); } - -$cl_id = $request->getParameter('id'); - +if (!$user->isPluginEnabled('ex')) { + header('Location: feature_disabled.php'); + exit(); +} +$cl_id = (int)$request->getParameter('id'); // Get the expense item we are editing. $expense_item = ttExpenseHelper::getItem($cl_id, $user->getActiveUser()); - -// Prohibit editing invoiced items. -if ($expense_item['invoice_id']) die($i18n->get('error.sys')); +if (!$expense_item || $expense_item['invoice_id']) { + // Prohibit editing not ours or invoiced items. + header('Location: access_denied.php'); + exit(); +} $item_date = new DateAndTime(DB_DATEFORMAT, $expense_item['date']);