I need to do research in AD-PHP with LDAP, but every time I do not have success.
I'm filtering by sAMAccountName. When I use a user with simple name (E.x.: printer) everything is ok but when the name is not simple (E.x.: paulo.neves) it does not work.
Any ideas?
$usuario = "paulo.neves"; $base_dn = "ou=Administradores, dc=tiisa, dc=com, dc=br"; $filter = "(&(objectClass=user)(objectCategory=person)(cn=*)(samaccountname=$usuario))"; if (!($search=@ldap_search($connect, $base_dn, $filter))) { die("Unable to search ldap server"); }
.
is a reserved character for$filter
and requires escaping? – Matt.
in it you/the program consider it not simple?) – Bono