Commit 9cd3a401 authored by Stephane Bouvry's avatar Stephane Bouvry
Browse files

Fix buf authentification

parent 8d216e49
Loading
Loading
Loading
Loading
+6 −7
Original line number Diff line number Diff line
@@ -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',
            "*",
@@ -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 {