[Date Prev][Date Next]
[Chronological]
[Thread]
[Top]
Problem with PHP/LDAP
Hi,
I have a problem with php (4.0.6) and ldap (openldap server 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
--
dr. Carlo Todeschini
--
[ senz@rete - Soluzioni Internet/intranet ]
http://www.senzarete.it - mailto:tode@senzarete.it
--
[ Rete Civica di Cremona - System administrator ]
http://www.rccr.cremona.it - mailto:tode@rccr.cremona.it
tel: 0372 25267 - fax: 0372 567701 - via Sesto, 41 - 26100 Cremona
--