Skip to content

Commit

Permalink
fix: obriga autenticação para download do PDF #69
Browse files Browse the repository at this point in the history
  • Loading branch information
andrekutianski committed Apr 6, 2022
1 parent 2768162 commit 203d717
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions modules/addons/NFEioServiceInvoices/lib/Client/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,17 @@ class Controller {
*/
public function downloadNfPdf($vars)
{
$nfId = $_GET['nfid'];
$legacyFunctions = new \NFEioServiceInvoices\Legacy\Functions();
$legacyFunctions->gnfe_pdf_nfe($nfId);
exit();
$currentUser = new \WHMCS\Authentication\CurrentUser;
$client = $currentUser->client();
if ($client) {
$nfId = $_GET['nfid'];
$legacyFunctions = new \NFEioServiceInvoices\Legacy\Functions();
$legacyFunctions->gnfe_pdf_nfe($nfId);
exit();
} else {
http_response_code(401);

}
}

/**
Expand Down

0 comments on commit 203d717

Please sign in to comment.