Apply PHP Code Styling & Quality Changes (#1649)

Co-authored-by: FOSSBilling Bot <fossbilling-bot>
This commit is contained in:
FOSSBilling BotandFOSSBilling Bot authored and GitHub committed 2023-09-28 05:29:52 -07:00
1 parent f2f9701359
commit 76d89eb410
9 files changed
+27 -36

No files matched your search

+7 -4
View File
@@ -58,6 +58,7 @@ class Client implements \FOSSBilling\InjectionAwareInterface
if (!$this->di['auth']->isAdminLoggedIn() && $hash_access === '0') {
$this->redirectIfNotInvoiceBuyer($app, $invoice);
}
return $app->render('mod_invoice_invoice', ['invoice' => $invoice]);
}
@@ -75,6 +76,7 @@ class Client implements \FOSSBilling\InjectionAwareInterface
if (!$this->di['auth']->isAdminLoggedIn() && $hash_access === '0') {
$this->redirectIfNotInvoiceBuyer($app, $invoice);
}
return $app->render('mod_invoice_print', ['invoice' => $invoice]);
}
@@ -119,15 +121,16 @@ class Client implements \FOSSBilling\InjectionAwareInterface
if (!$this->di['auth']->isAdminLoggedIn() && $hash_access === '0') {
$this->redirectIfNotInvoiceBuyer($app, $invoice);
}
return $app->render('mod_invoice_pdf', ['invoice' => $invoice]);
}
public function redirectIfNotInvoiceBuyer($app, $invoice) {
return $app->render('mod_invoice_pdf', ['invoice' => $invoice]);
}
public function redirectIfNotInvoiceBuyer($app, $invoice)
{
$client = $this->di['loggedin_client'];
if ($invoice['client']['id'] != $client->id) {
// redirect to client invoices/invoice'));
return $app->redirect('/invoice');
}
}
}