Merge branch 'develop' into feature/complex-mapping
Conflicts: model/LdapAdapter.php
This commit is contained in:
commit
2ca812159d
@ -58,9 +58,6 @@ class LdapAdapter implements LoginAdapter
|
|||||||
/** @var $configuration array $configuration */
|
/** @var $configuration array $configuration */
|
||||||
protected $configuration;
|
protected $configuration;
|
||||||
|
|
||||||
/** @var $mapping array $mapping */
|
|
||||||
protected $mapping;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var \Zend\Authentication\Adapter\Ldap
|
* @var \Zend\Authentication\Adapter\Ldap
|
||||||
*/
|
*/
|
||||||
@ -73,7 +70,16 @@ class LdapAdapter implements LoginAdapter
|
|||||||
* @return oat\authLdap\model\LdapAdapter
|
* @return oat\authLdap\model\LdapAdapter
|
||||||
*/
|
*/
|
||||||
public static function createFromConfig(array $configuration) {
|
public static function createFromConfig(array $configuration) {
|
||||||
return new self($configuration);
|
$adapter = new self();
|
||||||
|
$adapter->setOptions($configuration);
|
||||||
|
return $adapter;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Instantiates Zend Ldap adapter
|
||||||
|
*/
|
||||||
|
public function __construct() {
|
||||||
|
$this->adapter = new Ldap();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -84,9 +90,13 @@ class LdapAdapter implements LoginAdapter
|
|||||||
|
|
||||||
$this->adapter = new Ldap();
|
$this->adapter = new Ldap();
|
||||||
$this->adapter->setOptions($configuration['config']);
|
$this->adapter->setOptions($configuration['config']);
|
||||||
$this->setMapping(isset($configuration['mapping']) ? $configuration['mapping'] : array());
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function setOptions(array $options) {
|
||||||
|
$this->configuration = $options;
|
||||||
|
$this->adapter->setOptions($options['config']);
|
||||||
|
}
|
||||||
|
|
||||||
public function getOption($name) {
|
public function getOption($name) {
|
||||||
return $this->configuration[$name];
|
return $this->configuration[$name];
|
||||||
@ -162,24 +172,6 @@ class LdapAdapter implements LoginAdapter
|
|||||||
return $this->configuration;
|
return $this->configuration;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param array $mapping
|
|
||||||
*/
|
|
||||||
public function setMapping($mapping)
|
|
||||||
{
|
|
||||||
$this->mapping = $mapping;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return array
|
|
||||||
*/
|
|
||||||
public function getMapping()
|
|
||||||
{
|
|
||||||
return $this->mapping;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $password
|
* @param string $password
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user