X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/timetracker.git/blobdiff_plain/a62e4bdd1bc89ea4f3cf29507399b5b8f229597a..de79fff47f10297d7df2edf34aa6420de71cde5b:/invoice_view.php diff --git a/invoice_view.php b/invoice_view.php index 3715b80a..fd8424a3 100644 --- a/invoice_view.php +++ b/invoice_view.php @@ -32,20 +32,22 @@ import('ttInvoiceHelper'); import('ttClientHelper'); import('form.Form'); -// Access check. -if (!(ttAccessAllowed('manage_invoices') || ttAccessAllowed('view_own_invoices')) || !$user->isPluginEnabled('iv')) { +// Access checks. +if (!(ttAccessAllowed('manage_invoices') || ttAccessAllowed('view_own_invoices'))) { header('Location: access_denied.php'); exit(); } - -$cl_id = (int)$request->getParameter('id'); -$invoice = ttInvoiceHelper::getInvoice($cl_id); -// Temporary fix for invalid invoice id. TODO: implement properly and review security of other pages, -// where item id is passed (or posted) as parameter. +if (!$user->isPluginEnabled('iv')) { + header('Location: feature_disabled.php'); + exit(); +} +$cl_invoice_id = (int)$request->getParameter('id'); +$invoice = ttInvoiceHelper::getInvoice($cl_invoice_id); if (!$invoice) { header('Location: access_denied.php'); exit(); } +// End of access checks. $invoice_date = new DateAndTime(DB_DATEFORMAT, $invoice['date']); $client = ttClientHelper::getClient($invoice['client_id'], true);