De Wiki inetshell
Saltar a: navegación, buscar

https://www.novell.com/coolsolutions/tip/5838.html

<?php
// This code goes directly to the 636 SSL port
$ldaphost = "ldaps://server.domain.local";
$ldapUsername  = "CN=ldapuser,OU=Users,DC=domain,DC=local";
$ldapPassword = "SuperSafePassword";

$ds = ldap_connect($ldaphost);

if(!ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3)){
print "Could not set LDAPv3\r\n";
}
else {
// now we need to bind to the ldap server
$bth = ldap_bind($ds, $ldapUsername, $ldapPassword) or die("\r\nCould not connect to LDAP server\r\n");
}
?>