From 2580fd63dab938f4fb2411ebb8fde4855cb626ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Laurent=20L=C3=A9cluse?= Date: Fri, 15 Nov 2019 16:56:19 +0100 Subject: [PATCH] =?UTF-8?q?On=20force=20le=20storage=20=C3=A0=20son=20name?= =?UTF-8?q?space=20par=20d=C3=A9faut,=20sinon=20ZfcUser=20utilise=20un=20n?= =?UTF-8?q?amespace=20par=20source=20d'authentification,=20ce=20qui=20fait?= =?UTF-8?q?=20que=20les=20donn=C3=A9es=20d'authentification=20ne=20sont=20?= =?UTF-8?q?pas=20syst=C3=A9matiquement=20purg=C3=A9es=20en=20cas=20d'usage?= =?UTF-8?q?=20multi-sources?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/UnicaenAuth/Authentication/Adapter/Cas.php | 10 ++++++++++ src/UnicaenAuth/Authentication/Adapter/Db.php | 10 ++++++++++ src/UnicaenAuth/Authentication/Adapter/Ldap.php | 10 ++++++++++ 3 files changed, 30 insertions(+) diff --git a/src/UnicaenAuth/Authentication/Adapter/Cas.php b/src/UnicaenAuth/Authentication/Adapter/Cas.php index fb3e21a..d1b0689 100644 --- a/src/UnicaenAuth/Authentication/Adapter/Cas.php +++ b/src/UnicaenAuth/Authentication/Adapter/Cas.php @@ -18,6 +18,7 @@ use Zend\Router\RouteInterface; use Zend\Router\RouteStackInterface; use ZfcUser\Authentication\Adapter\AbstractAdapter; use ZfcUser\Authentication\Adapter\ChainableAdapter; +use Zend\Authentication\Storage\Session; /** * CAS authentication adpater @@ -77,6 +78,15 @@ class Cas extends AbstractAdapter implements EventManagerAwareInterface $this->router = $router; } + public function getStorage() + { + if (null === $this->storage) { + $this->setStorage(new Session()); + } + + return $this->storage; + } + /** * Réalise l'authentification. * diff --git a/src/UnicaenAuth/Authentication/Adapter/Db.php b/src/UnicaenAuth/Authentication/Adapter/Db.php index 12edbac..2f13e4c 100644 --- a/src/UnicaenAuth/Authentication/Adapter/Db.php +++ b/src/UnicaenAuth/Authentication/Adapter/Db.php @@ -6,6 +6,7 @@ use Interop\Container\ContainerInterface; use UnicaenApp\ServiceManager\ServiceLocatorAwareInterface; use UnicaenApp\ServiceManager\ServiceLocatorAwareTrait; use UnicaenAuth\Options\ModuleOptions; +use Zend\Authentication\Storage\Session; use Zend\EventManager\EventInterface; use Zend\ServiceManager\Exception\ServiceNotFoundException; @@ -36,6 +37,15 @@ class Db extends \ZfcUser\Authentication\Adapter\Db implements ServiceLocatorAwa return $this; } + public function getStorage() + { + if (null === $this->storage) { + $this->setStorage(new Session()); + } + + return $this->storage; + } + /** * Authentification. * diff --git a/src/UnicaenAuth/Authentication/Adapter/Ldap.php b/src/UnicaenAuth/Authentication/Adapter/Ldap.php index 5a8d49e..41f7087 100644 --- a/src/UnicaenAuth/Authentication/Adapter/Ldap.php +++ b/src/UnicaenAuth/Authentication/Adapter/Ldap.php @@ -16,6 +16,7 @@ use Zend\EventManager\EventManagerAwareInterface; use Zend\EventManager\EventManagerInterface; use ZfcUser\Authentication\Adapter\AbstractAdapter; use ZfcUser\Authentication\Adapter\ChainableAdapter; +use Zend\Authentication\Storage\Session; /** * LDAP authentication adpater @@ -77,6 +78,15 @@ class Ldap extends AbstractAdapter implements EventManagerAwareInterface $this->appModuleOptions = $appModuleOptions; } + public function getStorage() + { + if (null === $this->storage) { + $this->setStorage(new Session()); + } + + return $this->storage; + } + /** * * @param EventInterface $e -- GitLab