mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-06-18 02:59:27 +00:00
fix ldap authentication
This commit is contained in:
parent
8cd3e6cada
commit
194c6c4fe8
|
@ -161,22 +161,8 @@ if (isset($settings->_ldapHost) && strlen($settings->_ldapHost)>0) {
|
|||
if (isset($settings->_ldapFilter) && strlen($settings->_ldapFilter) > 0) {
|
||||
$search = ldap_search($ds, $settings->_ldapBaseDN, "(&(".$ldapSearchAttribut.$login.")".$settings->_ldapFilter.")");
|
||||
} else {
|
||||
$search = ldap_search($ds, $settings->_ldapBaseDN, $ldapSearchAttribut . $login);
|
||||
$search = ldap_search($ds, $settings->_ldapBaseDN, $ldapSearchAttribut.$login);
|
||||
}
|
||||
}
|
||||
$bind = @ldap_bind($ds, $dn, $pwd);
|
||||
if ($bind) {
|
||||
// Successfully authenticated. Now check to see if the user exists within
|
||||
// the database. If not, add them in, but do not add their password.
|
||||
$user = $dms->getUserByLogin($login);
|
||||
if (is_bool($user) && !$settings->_restricted) {
|
||||
// Retrieve the user's LDAP information.
|
||||
|
||||
|
||||
/* new code by doudoux - TO BE TESTED */
|
||||
$search = ldap_search($ds, $settings->_ldapBaseDN, $ldapSearchAttribut . $login);
|
||||
/* old code */
|
||||
//$search = ldap_search($ds, $dn, "uid=".$login);
|
||||
|
||||
if (!is_bool($search)) {
|
||||
$info = ldap_get_entries($ds, $search);
|
||||
|
@ -191,7 +177,6 @@ if (isset($settings->_ldapHost) && strlen($settings->_ldapHost)>0) {
|
|||
}
|
||||
ldap_close($ds);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user