Commit 4e6d1663 authored by David Surville's avatar David Surville
Browse files

Suppression du court-circuitage (je sais ça n'existe pas) lorsqu'une...

Suppression du court-circuitage (je sais ça n'existe pas) lorsqu'une authentification renvoie "true" car sinon les événements "authenticate", "authenticate.success" et "authenticate.fail" ne peuvent pas être utilisés. Ça ne change rien au bon fonctionnemnet de l'authentification.
parent 217c5410
Loading
Loading
Loading
Loading
Loading
+8 −8
Changes for src/UnicaenAuthentification/Authentication/Adapter/AdapterChain.php: 8 added lines, 8 removed lines.
Original line number Diff line number Diff line
@@ -23,20 +23,20 @@ class AdapterChain extends \ZfcUser\Authentication\Adapter\AdapterChain
        $this->getEventManager()->trigger('authenticate.pre', $e);

        $result = $this->getEventManager()->triggerUntil(function ($result) {
            return $result === true || $result instanceof Response;
            return $result instanceof Response;
        }, 'authenticate', $e);

        if ($result->stopped()) {
            $last = $result->last();
            if ($last === true || $last instanceof Response) {
            if ($last instanceof Response) {
                return $last;
            }
//            throw new Exception\AuthenticationEventException(
//                sprintf(
//                    'Auth event was stopped without a response. Got "%s" instead',
//                    is_object($result->last()) ? get_class($result->last()) : gettype($result->last())
//                )
//            );
            throw new Exception\AuthenticationEventException(
                sprintf(
                    'Auth event was stopped without a response. Got "%s" instead',
                    is_object($result->last()) ? get_class($result->last()) : gettype($result->last())
                )
            );
        }

        if ($e->getIdentity()) {
+1 −1
Changes for src/UnicaenAuthentification/Authentication/Adapter/LocalAdapter.php: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -58,7 +58,7 @@ class LocalAdapter extends AbstractAdapter
//            );
        }

        return true;
        return false;
    }

    /**
+2 −2
Changes for src/UnicaenAuthentification/Authentication/Storage/ChainEvent.php: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -8,9 +8,9 @@ use Zend\EventManager\Event;
 * utilisé pour collecter les diverses données concernant l'identité authentifiée.
 *
 * Exemples de données collectées :
 *  - <code>array('ldap' => object(UnicaenApp\Entity\Ldap\People), 'db' => object(UnicaenAuth\Entity\Db\User))</code>
 *  - <code>array('ldap' => object(UnicaenApp\Entity\Ldap\People), 'db' => object(UnicaenUtilisateur\Entity\Db\User))</code>
 *  - <code>array('ldap' => object(UnicaenApp\Entity\Ldap\People), 'db' => null)</code>
 *  - <code>array('ldap' => null, 'db' => object(UnicaenAuth\Entity\Db\User))</code>
 *  - <code>array('ldap' => null, 'db' => object(UnicaenUtilisateur\Entity\Db\User))</code>
 *  - <code>array('ldap' => null, 'db' => null)</code>
 *
 * @author Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr>
+1 −1
Changes for view/unicaen-authentification/auth/login-tabs.phtml: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -26,7 +26,7 @@ $form->setAttributes([
/** @var AbstractConnectViewHelper[] $helpers */
$helpers = [];
foreach ($types as $t => $config) {
    $helpers[$t] = $this->connect($t, $form); /** @see \UnicaenAuth\View\Helper\ConnectViewHelper */
    $helpers[$t] = $this->connect($t, $form); /** @see \UnicaenAuthentification\View\Helper\ConnectViewHelper */
}

$activeHelper = null;