mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-25 21:54:14 -08:00
Merge branch 'develop' of https://github.com/bushelpowered/snipe-it into bushelpowered-develop
This commit is contained in:
commit
6c23e881c7
|
@ -63,6 +63,8 @@ class LdapAd extends LdapAdConfiguration
|
|||
|
||||
parent::init();
|
||||
if($this->isLdapEnabled()) {
|
||||
$this->ldapConfig['account_prefix'] = 'uid=';
|
||||
$this->ldapConfig['account_suffix'] = ','.$this->ldapConfig['base_dn'];
|
||||
$this->ldap = new Adldap();
|
||||
$this->ldap->addProvider($this->ldapConfig);
|
||||
return true;
|
||||
|
@ -90,10 +92,7 @@ class LdapAd extends LdapAdConfiguration
|
|||
$username .= '@' . $this->ldapSettings['ad_domain'];
|
||||
}
|
||||
|
||||
try {
|
||||
$this->ldap->auth()->attempt($username, $password);
|
||||
} catch (Exception $e) {
|
||||
Log::error($e->getMessage());
|
||||
if ($this->ldap->auth()->attempt($username, $password, true) === false) {
|
||||
throw new Exception('Unable to validate user credentials!');
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue