Loading module/Oscar/Module.php +6 −7 Original line number Diff line number Diff line Loading @@ -82,12 +82,7 @@ class Module implements ConsoleBannerProviderInterface, ConsoleUsageProviderInte $moduleRouteListener = new ModuleRouteListener(); $moduleRouteListener->attach($eventManager); $e->getApplication()->getEventManager()->getSharedManager()->attach( 'UnicaenAuth\Service\User', UserAuthenticatedEvent::PRE_PERSIST, array($this, 'onUserLogin'), 100); // On capte l'authentification $e->getApplication()->getEventManager()->getSharedManager()->attach( //'ZfcUser\Authentication\Adapter\AdapterChain', "*", Loading Loading @@ -128,8 +123,12 @@ class Module implements ConsoleBannerProviderInterface, ConsoleUsageProviderInte $dbUser = null; if( $e instanceof AdapterChainEvent ){ if( is_string($e->getIdentity()) ){ $dbUser = $this->getEntityManager()->getRepository(Authentification::class)->findOneBy(['username' => $e->getIdentity()]); } else { $dbUser = $this->getEntityManager()->getRepository(Authentification::class)->find($e->getIdentity()); } } elseif ($e instanceof UserAuthenticatedEvent ) { $dbUser = $e->getDbUser(); } else { Loading Loading
module/Oscar/Module.php +6 −7 Original line number Diff line number Diff line Loading @@ -82,12 +82,7 @@ class Module implements ConsoleBannerProviderInterface, ConsoleUsageProviderInte $moduleRouteListener = new ModuleRouteListener(); $moduleRouteListener->attach($eventManager); $e->getApplication()->getEventManager()->getSharedManager()->attach( 'UnicaenAuth\Service\User', UserAuthenticatedEvent::PRE_PERSIST, array($this, 'onUserLogin'), 100); // On capte l'authentification $e->getApplication()->getEventManager()->getSharedManager()->attach( //'ZfcUser\Authentication\Adapter\AdapterChain', "*", Loading Loading @@ -128,8 +123,12 @@ class Module implements ConsoleBannerProviderInterface, ConsoleUsageProviderInte $dbUser = null; if( $e instanceof AdapterChainEvent ){ if( is_string($e->getIdentity()) ){ $dbUser = $this->getEntityManager()->getRepository(Authentification::class)->findOneBy(['username' => $e->getIdentity()]); } else { $dbUser = $this->getEntityManager()->getRepository(Authentification::class)->find($e->getIdentity()); } } elseif ($e instanceof UserAuthenticatedEvent ) { $dbUser = $e->getDbUser(); } else { Loading