Updating LDAP such that each user is not required to be bindable to LDAP (#6571)

* Update Ldap.php

* Update Ldap.php

* Update Ldap.php

* Update Ldap.php

* Update Ldap.php

Updating LDAP.php such that the admin bind will ONLY occur if the user attempting auth cannot bind. If that is the case, it will attempt to bind as admin and search for that user, prior to failing.
This commit is contained in:
fanta8897 2019-01-15 17:04:21 -05:00 committed by snipe
parent 187206cb88
commit 49073742b5

View file

@ -96,8 +96,11 @@ class Ldap extends Model
$filterQuery = $settings->ldap_auth_filter_query . $username;
if (!$ldapbind = @ldap_bind($connection, $userDn, $password)) {
return false;
if(!$ldapbind = Ldap::bindAdminToLdap($connection)){
return false;
}
}
if (!$results = ldap_search($connection, $baseDn, $filterQuery)) {