Commit 12a32560 authored by Bertrand Gauthier's avatar Bertrand Gauthier
Browse files

Corrections nécessaires pour monter à zf-commons/zfc-user ^3.0

parent fa319b5a
Loading
Loading
Loading
Loading
+3 −5
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@ use Zend\EventManager\EventManagerAwareInterface;
use Zend\EventManager\EventManagerInterface;
use Zend\Router\Http\TreeRouteStack;
use ZfcUser\Authentication\Adapter\AbstractAdapter;
use ZfcUser\Authentication\Adapter\AdapterChainEvent as AuthEvent;
use ZfcUser\Authentication\Adapter\AdapterChainEvent;
use ZfcUser\Authentication\Adapter\ChainableAdapter;

/**
@@ -78,14 +78,12 @@ class Cas extends AbstractAdapter implements EventManagerAwareInterface
    /**
     * Réalise l'authentification.
     *
     * @param Event $e
     * @param AdapterChainEvent $e
     * @throws UnexpectedValueException
     * @see ChainableAdapter
     */
    public function authenticate(Event $e)
    public function authenticate(AdapterChainEvent $e)
    {
        $e = $e->getTarget();

//        if ($e->getIdentity()) {
//            return;
//        }
+7 −8
Original line number Diff line number Diff line
@@ -7,8 +7,7 @@ use UnicaenApp\ServiceManager\ServiceLocatorAwareInterface;
use UnicaenApp\ServiceManager\ServiceLocatorAwareTrait;
use UnicaenAuth\Options\ModuleOptions;
use Zend\ServiceManager\Exception\ServiceNotFoundException;
use ZfcUser\Authentication\Adapter\AdapterChainEvent as AuthEvent;
use ZfcUser\Options\AuthenticationOptionsInterface;
use ZfcUser\Authentication\Adapter\AdapterChainEvent;

/**
 * Adpater d'authentification à partir de la base de données.
@@ -40,13 +39,13 @@ class Db extends \ZfcUser\Authentication\Adapter\Db implements ServiceLocatorAwa
    /**
     * Authentification.
     *
     * @param AuthEvent|\Zend\EventManager\Event $e
     * @param AdapterChainEvent $e
     * @return boolean
     */
    public function authenticate(\Zend\EventManager\Event $e)
    public function authenticate(AdapterChainEvent $e)
    {
        if ($e->getTarget()->getIdentity()) {
            return;
        if ($e->getIdentity()) {
            return true;
        }
        
        try {
@@ -60,10 +59,10 @@ class Db extends \ZfcUser\Authentication\Adapter\Db implements ServiceLocatorAwa
    }

    /**
     * @param AuthenticationOptionsInterface $options
     * @param \ZfcUser\Options\ModuleOptions $options
     * @return self
     */
    public function setOptions(AuthenticationOptionsInterface $options)
    public function setOptions(\ZfcUser\Options\ModuleOptions $options)
    {
        $this->options = $options;
        return $this;
+3 −4
Original line number Diff line number Diff line
@@ -14,6 +14,7 @@ use Zend\EventManager\EventManager;
use Zend\EventManager\EventManagerAwareInterface;
use Zend\EventManager\EventManagerInterface;
use ZfcUser\Authentication\Adapter\AbstractAdapter;
use ZfcUser\Authentication\Adapter\AdapterChainEvent;
use ZfcUser\Authentication\Adapter\ChainableAdapter;

/**
@@ -78,16 +79,14 @@ class Ldap extends AbstractAdapter implements EventManagerAwareInterface

    /**
     *
     * @param Event $e
     * @param AdapterChainEvent $e
     * @return boolean
     * @throws \Zend\Authentication\Adapter\Exception\ExceptionInterface
     * @throws \Zend\Ldap\Exception\LdapException
     * @see ChainableAdapter
     */
    public function authenticate(Event $e)
    public function authenticate(AdapterChainEvent $e)
    {
        $e = $e->getTarget();

        if ($this->isSatisfied()) {
            try {
                $storage = $this->getStorage()->read();