| Server IP : 74.208.250.37 / Your IP : 216.73.216.114 Web Server : Apache/2.4.58 (Ubuntu) System : Linux ubuntu 6.8.0-124-generic #124-Ubuntu SMP PREEMPT_DYNAMIC Tue May 26 13:00:45 UTC 2026 x86_64 User : miferval ( 1000) PHP Version : 8.3.6 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/araltecservicios/src/Controller/ |
Upload File : |
<?php
declare(strict_types=1);
namespace Mosaico\Controller;
use Jasny\Auth\Auth;
use Jasny\Auth\Authz;
use League\Plates\Engine;
use Mosaico\Auth\AuthStorage;
class BaseController
{
public function auth()
{
$levels = new Authz\Levels([
'user' => 1,
'admin' => 10,
'root' => 100
]);
$auth = new Auth($levels, new AuthStorage());
$auth->initialize();
if (! $auth->isLoggedIn()) {
return $this->template('admin/loginPage', []);
}
}
public function getEnv()
{
return parse_ini_file(__DIR__ . '../../../.env');
}
public function template(string $file, array $data): string
{
$template = new Engine(__DIR__ . '../../../resources/templates');
return $template->render($file, $data);
}
public function getAuth()
{
$levels = new Authz\Levels([
'user' => 1,
'admin' => 10,
'root' => 100
]);
$auth = new Auth($levels, new AuthStorage());
$auth->initialize();
return $auth;
}
}