Loading code/test3.php +11 −5 Changes for code/test3.php: 11 added lines, 5 removed lines. Original line number Diff line number Diff line Loading @@ -6,14 +6,20 @@ * @var $io \Symfony\Component\Console\Style\SymfonyStyle */ echo '<br /><br /><br /><br /><br /><br /><br />'; $um = $container->get(\Framework\User\UserManager::class); $c = null; dump($um->getCurrent()); dump($um->getCurrentProfile()); //$c = $um->getPrivileges(); $intervenant = $um->getCurrentProfile()->getContext('intervenant'); dump($intervenant->getId()); $ldap = $container->get(\Utilisateur\Connecteur\LdapConnecteur::class); dump($ldap->getUtilisateurCourantCode()); $c = $um->getProfiles(); echo '<br /><br /><br /><br /><br /><br /><br />'; dump($c); No newline at end of file module/Framework/src/User/UserManager.php +14 −1 Changes for module/Framework/src/User/UserManager.php: 14 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -2,8 +2,11 @@ namespace Framework\User; use Framework\Application\Application; use Framework\Application\Session; use Intervenant\Service\IntervenantService; use UnicaenAuthentification\Service\UserContext; use Utilisateur\Connecteur\LdapConnecteur; class UserManager { Loading @@ -17,7 +20,8 @@ class UserManager public function __construct( private readonly Session $session, private readonly UserContext $userContext private readonly UserContext $userContext, private readonly LdapConnecteur $ldap, ) { } Loading Loading @@ -53,6 +57,15 @@ class UserManager $profile->setContext('role', $role->getDbRole()); $profile->setContext('structure', $role->getStructure()); if (!$role->getDbRole()) { $utilisateurCode = $this->ldap->getUtilisateurCourantCode(); if ($utilisateurCode) { $intervenantService = Application::getInstance()->container()->get(IntervenantService::class); $intervenant = $intervenantService->getByUtilisateurCode($utilisateurCode); $profile->setContext('intervenant', $intervenant); } } $profiles[$profile->getId()] = $profile; } Loading module/Intervenant/src/Entity/Db/Intervenant.php +8 −1 Changes for module/Intervenant/src/Entity/Db/Intervenant.php: 8 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -368,7 +368,14 @@ class Intervenant implements HistoriqueAwareInterface, ResourceInterface, Import function __sleep () { return []; return [ 'id', 'code', 'codeRh', 'utilisateurCode', 'nomUsuel', 'prenom', ]; } Loading Loading
code/test3.php +11 −5 Changes for code/test3.php: 11 added lines, 5 removed lines. Original line number Diff line number Diff line Loading @@ -6,14 +6,20 @@ * @var $io \Symfony\Component\Console\Style\SymfonyStyle */ echo '<br /><br /><br /><br /><br /><br /><br />'; $um = $container->get(\Framework\User\UserManager::class); $c = null; dump($um->getCurrent()); dump($um->getCurrentProfile()); //$c = $um->getPrivileges(); $intervenant = $um->getCurrentProfile()->getContext('intervenant'); dump($intervenant->getId()); $ldap = $container->get(\Utilisateur\Connecteur\LdapConnecteur::class); dump($ldap->getUtilisateurCourantCode()); $c = $um->getProfiles(); echo '<br /><br /><br /><br /><br /><br /><br />'; dump($c); No newline at end of file
module/Framework/src/User/UserManager.php +14 −1 Changes for module/Framework/src/User/UserManager.php: 14 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -2,8 +2,11 @@ namespace Framework\User; use Framework\Application\Application; use Framework\Application\Session; use Intervenant\Service\IntervenantService; use UnicaenAuthentification\Service\UserContext; use Utilisateur\Connecteur\LdapConnecteur; class UserManager { Loading @@ -17,7 +20,8 @@ class UserManager public function __construct( private readonly Session $session, private readonly UserContext $userContext private readonly UserContext $userContext, private readonly LdapConnecteur $ldap, ) { } Loading Loading @@ -53,6 +57,15 @@ class UserManager $profile->setContext('role', $role->getDbRole()); $profile->setContext('structure', $role->getStructure()); if (!$role->getDbRole()) { $utilisateurCode = $this->ldap->getUtilisateurCourantCode(); if ($utilisateurCode) { $intervenantService = Application::getInstance()->container()->get(IntervenantService::class); $intervenant = $intervenantService->getByUtilisateurCode($utilisateurCode); $profile->setContext('intervenant', $intervenant); } } $profiles[$profile->getId()] = $profile; } Loading
module/Intervenant/src/Entity/Db/Intervenant.php +8 −1 Changes for module/Intervenant/src/Entity/Db/Intervenant.php: 8 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -368,7 +368,14 @@ class Intervenant implements HistoriqueAwareInterface, ResourceInterface, Import function __sleep () { return []; return [ 'id', 'code', 'codeRh', 'utilisateurCode', 'nomUsuel', 'prenom', ]; } Loading