added exception in ldapsearch

Former-commit-id: 4ab1637c30cac2bb4c827b1e08017f6b08fae1b9
This commit is contained in:
Daniel Maya 2019-02-15 09:10:21 +01:00
parent 63d589c918
commit ffe8bba3f7
1 changed files with 6 additions and 1 deletions

View File

@ -1369,7 +1369,12 @@ function local_ldap_search($ldap_host, $ldap_port=389, $ldap_version=3, $dn, $ac
$tls = ' -ZZ ';
}
$ldap_host = ' -H '.$ldap_host.':'.$ldap_port;
if (stripos($ldap_host, 'ldap') !== false) {
$ldap_host = ' -H '.$ldap_host.':'.$ldap_port;
} else {
$ldap_host = ' -h '.$ldap_host.' -p '.$ldap_port;
}
$ldap_version = ' -P '.$ldap_version;
if (!empty($ldap_admin_user)) {
$ldap_admin_user = " -D '".$ldap_admin_user."'";