[PHP] Problem with LDAP functions in PHP
Hello: I am trying to accomplish searches in a Windows active directory through LDAP functions in PHP, but the function ldap_search and ldap_get_entries are out of service, they give the following error messages Warning: ldap_search() [function.ldap-search]: Search: Operations error in C:\xampp\htdocs\asesor\ldaptest.php on line 20 Warning: ldap_get_entries(): supplied argument is not a valid ldap result resource in C:\xampp\htdocs\asesor\ldaptest.php on line 22 Here I send you the PHP code: $r=ldap_bind($ds, 'iespaloma\\poweruser', 'dfku34*+); // Autentificacion anonima, habitual de los accesos de solo lectura echo El resultado de la autentificacion es .$r.br /; $persona = 'Ad'; $dn = dc=iespaloma,dc=com; $filtro=(givenname=$persona*); $solonecesito = array( ou, sn, givenname, mail); $sr=ldap_search($ds, $dn, $filtro, $solonecesito); $info = ldap_get_entries($ds, $sr); I believe that the error occur due a bad DN that I am passing to the function, Could anyone help me to solve this problem? Aeropuerto Internacional Frank País García de Holguín. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Problem with LDAP
I have a problem with php (4.0.6) and ldap (openldap sever 2.0.11): When I use this .ldif file from shell I can enter this value without problem: -- dn: cn=pippo, dc=example, dc=it uid: pippo cn: pippo sn: pippo objectclass: person objectclass: account objectclass: posixAccount objectclass: top userpassword: {crypt}$1$a0811139$/xUzQIdsvChM1.mhBZx6j/ loginshell: /bin/bash uidnumber: 505 gidnumber: 505 homedirectory: /home/pippo -- but when I use this php script: -- [...] $ldap_bind = ldap_bind ($ldap_conn, $ldap_manager_dn, $ldap_password); $info [objectClass] = person;#ok $info [uid] = pippo; $info [cn] = pippo; #ok $info [sn] = pippo; #ok $info [objectClass] = person; $info [objectClass] = account; $info [objectClass] = posixAccount; $info [objectClass] = top; $info [userPassword] = {crypt}$1$a0811139$/xUzQIdsvChM1.mhBZx6j/; $info [loginShell] = /bin/bash; $info [uidNumber] = 505; $info [gidNumber] = 505; $info [homeDirectory] = /home/pippo; $ldap_bind = ldap_add ($ldap_conn, cn=pippo, dc=example, dc=it, $info); ldap_close ($ldap_conn); [...] -- I obtain tha following error message (in /var/log/httpd/error.log): -- LDAP: Object class violation additional info: attribute not allowed -- Note that if I use only entries tagged with the comment on the right the add is done... Why? Can anyone help me please? Thanx, tode [ [EMAIL PROTECTED] ] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]