Conversie codeigniter 4

This commit is contained in:
2026-01-09 11:41:28 +01:00
parent dbd8c8aed2
commit f0b9c6ad40
242 changed files with 20034 additions and 346 deletions
@@ -0,0 +1,45 @@
<?php
namespace App\Libraries\Beheer\Session;
use CodeIgniter\Session\Session;
class RetrieveUserSession
{
private Session $session;
public function __construct(Session $session)
{
$this->session = $session;
}
public function handle(): void
{
$this->setUserID();
$this->setRole();
$this->setAuthenticated();
}
private function setUserID(): void
{
$userId = $this->session->get('userID');
if (!defined('USERID')) {
define('USERID', $userId);
}
}
private function setRole(): void
{
$role = $this->session->get('role');
if (!defined('ROLE')) {
define('ROLE', $role);
}
}
private function setAuthenticated(): void
{
if (!defined('AUTHENTICATED')) {
define('AUTHENTICATED', USERID ? true : false);
}
}
}