[imp] userPassword

semot api semotapi@yahoo.com
Wed, 27 Feb 2002 00:38:39 -0800 (PST)


solved.
the problem was i tuned my brain too much to the qmail-ldap userPassword attribute. notice the
capital P !
and changing the line:
   echo "userPassword entry is: ". $info[$i]["userPassword"][0] ."<p>";
to:
   echo "userPassword entry is: ". $info[$i]["userpassword"][0] ."<p>";

made it work. sorry for the trouble. as a consolation, it could be useful to someone, i hope.

best rgds.

--
sem



--- semot api <semotapi@yahoo.com> wrote:
> 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
> 
> -- 
> IMP mailing list: http://horde.org/imp/
> Archive: http://marc.theaimsgroup.com/?l=imp&r=1&w=2
> Frequently Asked Questions: http://horde.org/faq/
> To unsubscribe, mail: imp-unsubscribe@lists.horde.org
> 


__________________________________________________
Do You Yahoo!?
Yahoo! Greetings - Send FREE e-cards for every occasion!
http://greetings.yahoo.com