Skip to content

Commit

Permalink
Añadido el usuario y la página a la sesión en los controladores están…
Browse files Browse the repository at this point in the history
…dar.
  • Loading branch information
NeoRazorX committed Aug 6, 2022
1 parent fb7cd34 commit 591e4cb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Core/Base/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
use FacturaScripts\Core\DataSrc\Empresas;
use FacturaScripts\Core\Html;
use FacturaScripts\Core\KernelException;
use FacturaScripts\Core\Session;
use FacturaScripts\Dinamic\Lib\AssetManager;
use FacturaScripts\Dinamic\Lib\MultiRequestProtection;
use FacturaScripts\Dinamic\Model\Empresa;
Expand Down Expand Up @@ -284,12 +285,14 @@ public function run(): void
$this->updateCookies($user, $response);
ToolBox::i18nLog()->debug('login-ok', ['%nick%' => $user->nick]);
ToolBox::log()::setContext('nick', $user->nick);
Session::set('user', $user);
Session::set('page', $this->className);

$menuManager = new MenuManager();
$menuManager->setUser($user);
$menuManager->selectPage($this->getPageData());

$permissions = new ControllerPermissions($user, $this->getClassName());
$permissions = new ControllerPermissions($user, $this->className);
if (false === $permissions->allowAccess) {
echo Html::render('Error/AccessDenied.html.twig', [
'fsc' => $this,
Expand Down

0 comments on commit 591e4cb

Please sign in to comment.