Loading Module.php +0 −1 Original line number Diff line number Diff line Loading @@ -6,7 +6,6 @@ use Zend\ModuleManager\Feature\AutoloaderProviderInterface; use Zend\ModuleManager\Feature\ConfigProviderInterface; use Zend\ModuleManager\Feature\ServiceProviderInterface; use Zend\ModuleManager\Feature\ViewHelperProviderInterface; use Zend\View\HelperPluginManager; /** * Point d'entrée du module d'authentification Unicaen. Loading config/module.config.php +5 −23 Original line number Diff line number Diff line Loading @@ -160,33 +160,15 @@ return array( ), 'invokables' => array( 'unicaen-auth_user_service' => 'UnicaenAuth\Service\User', 'UnicaenAuth\Authentication\Storage\Db' => 'UnicaenAuth\Authentication\Storage\Db', 'UnicaenAuth\Authentication\Storage\Ldap' => 'UnicaenAuth\Authentication\Storage\Ldap', ), 'abstract_factories' => array( 'UnicaenAuth\Authentication\Adapter\AbstractFactory', ), 'factories' => array( 'unicaen-auth_module_options' => function(Zend\ServiceManager\ServiceLocatorInterface $serviceLocator) { $config = $serviceLocator->get('Config'); return new UnicaenAuth\Options\ModuleOptions(array_merge($config['zfcuser'], $config['unicaen-auth'])); }, 'UnicaenAuth\Authentication\Storage\Db' => function() { return new UnicaenAuth\Authentication\Storage\Db(); }, 'UnicaenAuth\Authentication\Storage\Ldap' => function() { return new UnicaenAuth\Authentication\Storage\Ldap(); }, 'UnicaenAuth\Authentication\Storage\LdapDb' => function(Zend\ServiceManager\ServiceLocatorInterface $serviceLocator) { $storage = new UnicaenAuth\Authentication\Storage\LdapDb(); $storage->setLdapStorage($serviceLocator->get('UnicaenAuth\Authentication\Storage\Ldap')) ->setDbStorage( $serviceLocator->get('UnicaenAuth\Authentication\Storage\Db')); return $storage; }, 'zfcuser_auth_service' => function (Zend\ServiceManager\ServiceLocatorInterface $serviceLocator) { return new \Zend\Authentication\AuthenticationService( $serviceLocator->get('UnicaenAuth\Authentication\Storage\Chain'), $serviceLocator->get('ZfcUser\Authentication\Adapter\AdapterChain') ); }, 'unicaen-auth_module_options' => 'UnicaenAuth\Options\ModuleOptionsFactory', 'zfcuser_auth_service' => 'UnicaenAuth\Authentication\AuthenticationServiceFactory', 'UnicaenAuth\Authentication\Storage\Chain' => 'UnicaenAuth\Authentication\Storage\ChainServiceFactory', 'UnicaenAuth\Provider\Identity\Chain' => 'UnicaenAuth\Provider\Identity\ChainServiceFactory', 'UnicaenAuth\Provider\Identity\Ldap' => 'UnicaenAuth\Provider\Identity\LdapServiceFactory', Loading config/unicaen-auth.global.php.dist +1 −1 Original line number Diff line number Diff line Loading @@ -24,6 +24,6 @@ $settings = array( return array( 'unicaen-auth' => $settings, 'zfcuser' => array( $k='enable_registration' => isset($settings[$k]) ? $settings[$k] : false, 'enable_registration' => isset($settings['enable_registration']) ? $settings['enable_registration'] : false, ), ); No newline at end of file src/UnicaenAuth/Authentication/AuthenticationServiceFactory.php 0 → 100644 +29 −0 Original line number Diff line number Diff line <?php namespace UnicaenAuth\Authentication; use Zend\ServiceManager\FactoryInterface; use Zend\ServiceManager\ServiceLocatorInterface; use Zend\Authentication\AuthenticationService; /** * Description of AuthenticationServiceFactory * * @author Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr> */ class AuthenticationServiceFactory implements FactoryInterface { /** * Create service * * @param ServiceLocatorInterface $serviceLocator * @return AuthenticationService */ public function createService(ServiceLocatorInterface $serviceLocator) { return new AuthenticationService( $serviceLocator->get('UnicaenAuth\Authentication\Storage\Chain'), $serviceLocator->get('ZfcUser\Authentication\Adapter\AdapterChain') ); } } No newline at end of file src/UnicaenAuth/Options/ModuleOptionsFactory.php 0 → 100644 +29 −0 Original line number Diff line number Diff line <?php namespace UnicaenAuth\Options; use Zend\ServiceManager\FactoryInterface; use Zend\ServiceManager\ServiceLocatorInterface; /** * Description of ModuleOptionsFactory * * @author Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr> */ class ModuleOptionsFactory implements FactoryInterface { /** * Create service * * @param ServiceLocatorInterface $serviceLocator * @return mixed */ public function createService(ServiceLocatorInterface $serviceLocator) { $config = $serviceLocator->get('Configuration'); $moduleConfig = isset($config['unicaen-auth']) ? $config['unicaen-auth'] : array(); $moduleConfig = array_merge($config['zfcuser'], $moduleConfig); return new ModuleOptions($moduleConfig); } } No newline at end of file Loading
Module.php +0 −1 Original line number Diff line number Diff line Loading @@ -6,7 +6,6 @@ use Zend\ModuleManager\Feature\AutoloaderProviderInterface; use Zend\ModuleManager\Feature\ConfigProviderInterface; use Zend\ModuleManager\Feature\ServiceProviderInterface; use Zend\ModuleManager\Feature\ViewHelperProviderInterface; use Zend\View\HelperPluginManager; /** * Point d'entrée du module d'authentification Unicaen. Loading
config/module.config.php +5 −23 Original line number Diff line number Diff line Loading @@ -160,33 +160,15 @@ return array( ), 'invokables' => array( 'unicaen-auth_user_service' => 'UnicaenAuth\Service\User', 'UnicaenAuth\Authentication\Storage\Db' => 'UnicaenAuth\Authentication\Storage\Db', 'UnicaenAuth\Authentication\Storage\Ldap' => 'UnicaenAuth\Authentication\Storage\Ldap', ), 'abstract_factories' => array( 'UnicaenAuth\Authentication\Adapter\AbstractFactory', ), 'factories' => array( 'unicaen-auth_module_options' => function(Zend\ServiceManager\ServiceLocatorInterface $serviceLocator) { $config = $serviceLocator->get('Config'); return new UnicaenAuth\Options\ModuleOptions(array_merge($config['zfcuser'], $config['unicaen-auth'])); }, 'UnicaenAuth\Authentication\Storage\Db' => function() { return new UnicaenAuth\Authentication\Storage\Db(); }, 'UnicaenAuth\Authentication\Storage\Ldap' => function() { return new UnicaenAuth\Authentication\Storage\Ldap(); }, 'UnicaenAuth\Authentication\Storage\LdapDb' => function(Zend\ServiceManager\ServiceLocatorInterface $serviceLocator) { $storage = new UnicaenAuth\Authentication\Storage\LdapDb(); $storage->setLdapStorage($serviceLocator->get('UnicaenAuth\Authentication\Storage\Ldap')) ->setDbStorage( $serviceLocator->get('UnicaenAuth\Authentication\Storage\Db')); return $storage; }, 'zfcuser_auth_service' => function (Zend\ServiceManager\ServiceLocatorInterface $serviceLocator) { return new \Zend\Authentication\AuthenticationService( $serviceLocator->get('UnicaenAuth\Authentication\Storage\Chain'), $serviceLocator->get('ZfcUser\Authentication\Adapter\AdapterChain') ); }, 'unicaen-auth_module_options' => 'UnicaenAuth\Options\ModuleOptionsFactory', 'zfcuser_auth_service' => 'UnicaenAuth\Authentication\AuthenticationServiceFactory', 'UnicaenAuth\Authentication\Storage\Chain' => 'UnicaenAuth\Authentication\Storage\ChainServiceFactory', 'UnicaenAuth\Provider\Identity\Chain' => 'UnicaenAuth\Provider\Identity\ChainServiceFactory', 'UnicaenAuth\Provider\Identity\Ldap' => 'UnicaenAuth\Provider\Identity\LdapServiceFactory', Loading
config/unicaen-auth.global.php.dist +1 −1 Original line number Diff line number Diff line Loading @@ -24,6 +24,6 @@ $settings = array( return array( 'unicaen-auth' => $settings, 'zfcuser' => array( $k='enable_registration' => isset($settings[$k]) ? $settings[$k] : false, 'enable_registration' => isset($settings['enable_registration']) ? $settings['enable_registration'] : false, ), ); No newline at end of file
src/UnicaenAuth/Authentication/AuthenticationServiceFactory.php 0 → 100644 +29 −0 Original line number Diff line number Diff line <?php namespace UnicaenAuth\Authentication; use Zend\ServiceManager\FactoryInterface; use Zend\ServiceManager\ServiceLocatorInterface; use Zend\Authentication\AuthenticationService; /** * Description of AuthenticationServiceFactory * * @author Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr> */ class AuthenticationServiceFactory implements FactoryInterface { /** * Create service * * @param ServiceLocatorInterface $serviceLocator * @return AuthenticationService */ public function createService(ServiceLocatorInterface $serviceLocator) { return new AuthenticationService( $serviceLocator->get('UnicaenAuth\Authentication\Storage\Chain'), $serviceLocator->get('ZfcUser\Authentication\Adapter\AdapterChain') ); } } No newline at end of file
src/UnicaenAuth/Options/ModuleOptionsFactory.php 0 → 100644 +29 −0 Original line number Diff line number Diff line <?php namespace UnicaenAuth\Options; use Zend\ServiceManager\FactoryInterface; use Zend\ServiceManager\ServiceLocatorInterface; /** * Description of ModuleOptionsFactory * * @author Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr> */ class ModuleOptionsFactory implements FactoryInterface { /** * Create service * * @param ServiceLocatorInterface $serviceLocator * @return mixed */ public function createService(ServiceLocatorInterface $serviceLocator) { $config = $serviceLocator->get('Configuration'); $moduleConfig = isset($config['unicaen-auth']) ? $config['unicaen-auth'] : array(); $moduleConfig = array_merge($config['zfcuser'], $moduleConfig); return new ModuleOptions($moduleConfig); } } No newline at end of file