Loading module/Application/src/Application/Controller/IndexController.php +4 −7 Changes for module/Application/src/Application/Controller/IndexController.php: 4 added lines, 7 removed lines. Original line number Diff line number Diff line Loading @@ -32,18 +32,15 @@ class IndexController extends AbstractActionController /** @var User $connectedUser */ $connectedUser = $this->getUserService()->getConnectedUser(); if ($this->getServiceUserContext()->getLdapUser()) { $agent = $this->getAgentService()->getAgentByUsername($connectedUser->getUsername()); if ($connectedUser !== null && $agent !== null && $agent->getUtilisateur() === null) { if ($agent !== null && $agent->getUtilisateur() === null) { $agent->setUtilisateur($connectedUser); $this->getAgentService()->update($agent); $personnel = $this->getRoleService()->findByRoleId(RoleConstant::PERSONNEL); $hasAgent = $connectedUser->hasRole($personnel); if (! $hasAgent) $this->getUserService()->addRole($connectedUser, $personnel); // $personnel = $this->getRoleService()->findByRoleId(RoleConstant::PERSONNEL); // $hasAgent = $connectedUser->hasRole($personnel); // if (! $hasAgent) $this->getUserService()->addRole($connectedUser, $personnel); return $this->redirect()->toRoute('agent/afficher', ['agent' => $agent->getId()], [], true); } } /** @var Role $connectedRole */ $connectedRole = $this->getUserService()->getConnectedRole(); Loading Loading
module/Application/src/Application/Controller/IndexController.php +4 −7 Changes for module/Application/src/Application/Controller/IndexController.php: 4 added lines, 7 removed lines. Original line number Diff line number Diff line Loading @@ -32,18 +32,15 @@ class IndexController extends AbstractActionController /** @var User $connectedUser */ $connectedUser = $this->getUserService()->getConnectedUser(); if ($this->getServiceUserContext()->getLdapUser()) { $agent = $this->getAgentService()->getAgentByUsername($connectedUser->getUsername()); if ($connectedUser !== null && $agent !== null && $agent->getUtilisateur() === null) { if ($agent !== null && $agent->getUtilisateur() === null) { $agent->setUtilisateur($connectedUser); $this->getAgentService()->update($agent); $personnel = $this->getRoleService()->findByRoleId(RoleConstant::PERSONNEL); $hasAgent = $connectedUser->hasRole($personnel); if (! $hasAgent) $this->getUserService()->addRole($connectedUser, $personnel); // $personnel = $this->getRoleService()->findByRoleId(RoleConstant::PERSONNEL); // $hasAgent = $connectedUser->hasRole($personnel); // if (! $hasAgent) $this->getUserService()->addRole($connectedUser, $personnel); return $this->redirect()->toRoute('agent/afficher', ['agent' => $agent->getId()], [], true); } } /** @var Role $connectedRole */ $connectedRole = $this->getUserService()->getConnectedRole(); Loading