<?php function authLDAP($username, $password){ $ldap_domain = 'midominio'; $adServer = "miservidor"; $ldapconn = ldap_connect($adServer) or die("Could not connect to LDAP server."); $ldaprdn = $username; # Descomentar si la App corre bajo Apache2 sobre Windows Server #ldap_set_option($ldapconn, LDAP_OPT_PROTOCOL_VERSION, 3) $ldapbind = ldap_bind($ldapconn, "$ldaprdn@$ldap_domain", $password); if($ldapbind) return true; else return false; } authLDAP("sad", "asd"); ?>
habilitar
ResponderEliminarextension=php_ldap.dll
en el php.ini