Some refactoring of access checks - in progress.
[timetracker.git] / invoice_send.php
index 2c0894a..f0e30bc 100644 (file)
@@ -31,11 +31,15 @@ import('form.Form');
 import('ttInvoiceHelper');
 import('ttSysConfig');
 
-// 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_invoice_id = (int)$request->getParameter('id');
 $invoice = ttInvoiceHelper::getInvoice($cl_invoice_id);