How to show "jpegPhoto" attribute from LDAP entry?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
NeverHood
Forum Newbie
Posts: 1
Joined: Thu Apr 03, 2003 6:36 am
Location: Russia, Tomsk
Contact:

How to show "jpegPhoto" attribute from LDAP entry?

Post by NeverHood »

Hi!

I want to expand php-generated webpage to show jpeg picture saved in LDAP directory.
I can search and show all general attributes like cn, mail and similar, but I can't show jpegphoto attribute.

It seems that problem with right output from ldap_get_entries() call.

How to resolve this, if it possible?

Code that I use to check thing:

Code: Select all

$sr = ldap_search($ds, $base_bn, $filter, array("uid","mail","jpegPhoto"));
$info = ldap_get_entries($ds,$sr);

echo "<pre>";
print_r($info);
echo "</pre>";
and all I get

Code: Select all

Array
(
    &#1111;count] => 1
    &#1111;0] => Array
        (
            &#1111;uid] => Array
                (
                    &#1111;count] => 1
                    &#1111;0] => avv
                )

            &#1111;0] => uid
            &#1111;mail] => Array
                (
                    &#1111;count] => 1
                    &#1111;0] => avv@comm.ttg
                )

            &#1111;1] => mail
            &#1111;jpegphoto] => Array
                (
                    &#1111;count] => 1
                    &#1111;0] => &#1066;&#1100;&#1066;&#1070;
                )

            &#1111;2] => jpegphoto
            &#1111;count] => 3
            &#1111;dn] => uid=avv,ou=People,dc=tgs,dc=ttg
        )

)
I don't understand what's mean string in jpegphoto array.

ldap_search at the Linux command line show me nice information.
All of this reside on RH7.3 with stock Apache/PHP/LDAP.

Thank you.
Post Reply