userPassword
semot api
semotapi@yahoo.com
Wed, 27 Feb 2002 00:15:04 -0800 (PST)
system: horde2.0/imp3.0/turba1.0/php4.1.1/openldap2.0.22/rh7.2
how do we display the value of userPassword attribute with php? i can see the MD5 value with
GQ-client, but my php code reveals nothing. instead of doing an anonymous, i did a authenticated
bind but with no improvement. this is the output from my script:
dn is: uid=sem,ou=subdept,ou=majordept,o=myorgname,dc=myorg,dc=com
cn entry is: Semotapi
email entry is: sem@myorg.com
userPassword entry is:
Closing connection
notice that the userPassword attr is blank. the short script:
<?php
/* code from phpman */
$ds=ldap_connect("192.168.10.120");
if ($ds) {
$r=ldap_bind($ds,"cn=myorg_admin,o=Administrators,dc=myorg,dc=com","secret");
$sr=ldap_search($ds,"dc=myorg,dc=com","ou=majordept");
$info = ldap_get_entries($ds, $sr);
for ($i=0; $i<$info["count"]; $i++) {
echo "dn is: ". $info[$i]["dn"] ."<br>";
echo "cn entry is: ". $info[$i]["cn"][0] ."<br>";
echo "email entry is: ". $info[$i]["mail"][0] ."<br>";
echo "userPassword entry is: ". $info[$i]["userPassword"][0] ."<p>";
}
echo "Closing connection";
ldap_close($ds);
}
else {
echo "Unable to connect to LDAP server";
}
?>
excerpt from my slapd.conf:
#######################################################################
# ldbm database definitions
#######################################################################
database ldbm
suffix "dc=myorg,dc=com"
rootdn "cn=myorg_admin,o=Administrators,dc=myorg,dc=com"
cachesize 1000000
dbcachesize 1000000
# Cleartext passwords, especially for the rootdn, should
# be avoid. See slappasswd(8) and slapd.conf(5) for details.
# Use of strong authentication encouraged.
rootpw secret
# The database directory MUST exist prior to running slapd AND
# should only be accessible by the slapd/tools. Mode 700 recommended.
directory /usr/local/var/openldap-ldbm
# Indices to maintain
index cn,sn,uid pres,eq
index mail,mailAlternateAddress eq
index objectClass eq
access to attr=userPassword
by dn="cn=hc_admin,o=Administrators,dc=myorg,dc=com" write
by dn="cn=courier,o=Administrators,dc=myorg,dc=com" read
by dn="cn=qmail,o=Administrators,dc=myorg,dc=com" read
by self write
by * auth
access to *
by dn="cn=hc_admin,o=Administrators,dc=myorg,dc=com" write
by dn="cn=courier,o=Administrators,dc=myorg,dc=com" read
by dn="cn=qmail,o=Administrators,dc=myorg,dc=com" read
by self read
by anonymous read
pls advise.
TIA
--
sem
__________________________________________________
Do You Yahoo!?
Yahoo! Greetings - Send FREE e-cards for every occasion!
http://greetings.yahoo.com