Some refactoring of access checks - in progress.
[timetracker.git] / invoice_view.php
index 3715b80..62f0cbb 100644 (file)
@@ -32,11 +32,15 @@ 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();
 }
+if (!$user->isPluginEnabled('iv')) {
+  header('Location: feature_disabled.php');
+  exit();
+}
 
 $cl_id = (int)$request->getParameter('id');
 $invoice = ttInvoiceHelper::getInvoice($cl_id);