Adapted to new LoginAdapter interface

This commit is contained in:
Joel Bout 2015-11-30 09:49:24 +01:00
parent 9727c8efce
commit 767943223d

View File

@ -63,25 +63,22 @@ class LdapAdapter implements LoginAdapter
protected $adapter; protected $adapter;
/** /**
* Create an adapter from the configuration * Instantiates Zend Ldap adapter
*
* @param array $configuration
* @return oat\authLdap\model\LdapAdapter
*/ */
public static function createFromConfig(array $configuration) { public function __construct() {
return new self($configuration); $this->adapter = new Ldap();
} }
/** /**
* @param array $configuration * (non-PHPdoc)
* @see \oat\oatbox\user\auth\LoginAdapter::setOptions()
*/ */
public function __construct(array $configuration) { public function setOptions(array $options) {
$this->configuration = $configuration; $this->configuration = $options;
$this->adapter->setOptions($options['config']);
$this->adapter = new Ldap(); if (isset($options['mapping'])) {
$this->adapter->setOptions($configuration['config']); $this->setMapping($options['mapping']);
$this->setMapping($configuration['mapping']); }
} }
/** /**