From 767943223d6c460824b21781c0d443b5a62c3a62 Mon Sep 17 00:00:00 2001 From: Joel Bout Date: Mon, 30 Nov 2015 09:49:24 +0100 Subject: [PATCH] Adapted to new LoginAdapter interface --- model/LdapAdapter.php | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/model/LdapAdapter.php b/model/LdapAdapter.php index 2174a1f..09904fd 100644 --- a/model/LdapAdapter.php +++ b/model/LdapAdapter.php @@ -63,25 +63,22 @@ class LdapAdapter implements LoginAdapter protected $adapter; /** - * Create an adapter from the configuration - * - * @param array $configuration - * @return oat\authLdap\model\LdapAdapter + * Instantiates Zend Ldap adapter */ - public static function createFromConfig(array $configuration) { - return new self($configuration); - } - - /** - * @param array $configuration - */ - public function __construct(array $configuration) { - $this->configuration = $configuration; - + public function __construct() { $this->adapter = new Ldap(); - $this->adapter->setOptions($configuration['config']); - $this->setMapping($configuration['mapping']); - + } + + /** + * (non-PHPdoc) + * @see \oat\oatbox\user\auth\LoginAdapter::setOptions() + */ + public function setOptions(array $options) { + $this->configuration = $options; + $this->adapter->setOptions($options['config']); + if (isset($options['mapping'])) { + $this->setMapping($options['mapping']); + } } /**