Fixed function ldapsearch

Former-commit-id: 36678038a878673a3aae86ed014ee189775829db
This commit is contained in:
samucarc 2019-03-27 15:18:37 +01:00
parent 8160983e36
commit de3934ddb8
1 changed files with 4 additions and 1 deletions

View File

@ -1369,7 +1369,10 @@ function local_ldap_search($ldap_host, $ldap_port=389, $ldap_version=3, $dn, $ac
$tls = ' -ZZ ';
}
if (stripos($ldap_host, 'ldap') !== false) {
if (stripos($ldap_host, 'ldap://') !== false
|| stripos($ldap_host, 'ldaps://') !== false
|| stripos($ldap_host, 'ldapi://') !== false
) {
$ldap_host = ' -H '.$ldap_host.':'.$ldap_port;
} else {
$ldap_host = ' -h '.$ldap_host.' -p '.$ldap_port;