Commit 0aee6b10 authored by Bertrand Gauthier's avatar Bertrand Gauthier
Browse files

Correction bug survenu avec le module ZfcUser 0.1.3.

parent a19f7e00
...@@ -57,6 +57,10 @@ class Cas extends AbstractAdapter implements ServiceManagerAwareInterface, Event ...@@ -57,6 +57,10 @@ class Cas extends AbstractAdapter implements ServiceManagerAwareInterface, Event
*/ */
public function authenticate(AuthEvent $e) public function authenticate(AuthEvent $e)
{ {
if ($e->getIdentity()) {
return;
}
$config = $this->getOptions()->getCas(); $config = $this->getOptions()->getCas();
if (!$config) { if (!$config) {
return; // NB: l'authentification CAS est désactivée ssi le tableau des options est vide return; // NB: l'authentification CAS est désactivée ssi le tableau des options est vide
...@@ -82,10 +86,6 @@ class Cas extends AbstractAdapter implements ServiceManagerAwareInterface, Event ...@@ -82,10 +86,6 @@ class Cas extends AbstractAdapter implements ServiceManagerAwareInterface, Event
->setMessages(array('Authentication successful.')); ->setMessages(array('Authentication successful.'));
$this->getEventManager()->trigger('userAuthenticated', $e); $this->getEventManager()->trigger('userAuthenticated', $e);
$e->stopPropagation();
return true;
} }
/** /**
......
...@@ -32,6 +32,10 @@ class Db extends \ZfcUser\Authentication\Adapter\Db implements ServiceManagerAwa ...@@ -32,6 +32,10 @@ class Db extends \ZfcUser\Authentication\Adapter\Db implements ServiceManagerAwa
*/ */
public function authenticate(AuthEvent $e) public function authenticate(AuthEvent $e)
{ {
if ($e->getIdentity()) {
return;
}
try { try {
$result = parent::authenticate($e); $result = parent::authenticate($e);
} }
......
...@@ -108,10 +108,6 @@ class Ldap extends AbstractAdapter implements ServiceManagerAwareInterface, Even ...@@ -108,10 +108,6 @@ class Ldap extends AbstractAdapter implements ServiceManagerAwareInterface, Even
->setMessages(array('Authentication successful.')); ->setMessages(array('Authentication successful.'));
$this->getEventManager()->trigger('userAuthenticated', $e); $this->getEventManager()->trigger('userAuthenticated', $e);
$e->stopPropagation();
return true;
} }
/** /**
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment