[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Accessing LDAP jpegPhoto attribute in Ruby...

augustf

9/22/2006 6:17:00 PM

Hi everyone,
In writing my Ruby LDAP application, I'm able (with activeldap) to
access any ldap attribute I need - except binary ones. user.uid, for
instance would get me the userid of the user. But user.jpegPhoto yields
binary rubbish.

The excellent documentation for active ldap
(http://ruby-activeldap.rubyforg...) showed how to access a
userCertificate like so: user.userCertificate = {'binary' =>
File.read('example.der')} . I'm unable to replicate something
comparable for jpegPhoto. Anyone know how I can display the jpegPhoto
attribute properly?

4 Answers

Francis Cianfrocca

9/22/2006 6:30:00 PM

0

On 9/22/06, augustf@gmail.com <augustf@gmail.com> wrote:
> Hi everyone,
> In writing my Ruby LDAP application, I'm able (with activeldap) to
> access any ldap attribute I need - except binary ones. user.uid, for
> instance would get me the userid of the user. But user.jpegPhoto yields
> binary rubbish.
>

Have you tried querying this attribute with the Net::LDAP library? It
recently acquired some significant improvements in how it handles
binary attributes. I can tell you from my own research that some
versions of the native-code LDAP libraries (which Ruby/LDAP and
ActiveLDAP are based on) have some possibly incorrect behavior with
regard to binary values.

augustf

9/22/2006 6:35:00 PM

0

Sorry to impose further, but I'm a relative newbie to Ruby - what would
be the general sort of syntax needed in this situation?


Francis Cianfrocca wrote:
> On 9/22/06, augustf@gmail.com <augustf@gmail.com> wrote:
> > Hi everyone,
> > In writing my Ruby LDAP application, I'm able (with activeldap) to
> > access any ldap attribute I need - except binary ones. user.uid, for
> > instance would get me the userid of the user. But user.jpegPhoto yields
> > binary rubbish.
> >
>
> Have you tried querying this attribute with the Net::LDAP library? It
> recently acquired some significant improvements in how it handles
> binary attributes. I can tell you from my own research that some
> versions of the native-code LDAP libraries (which Ruby/LDAP and
> ActiveLDAP are based on) have some possibly incorrect behavior with
> regard to binary values.

Francis Cianfrocca

9/22/2006 6:45:00 PM

0

On 9/22/06, augustf@gmail.com <augustf@gmail.com> wrote:
> Sorry to impose further, but I'm a relative newbie to Ruby - what would
> be the general sort of syntax needed in this situation?
>

I'll contact you privately. Then if this succeeds we'll post the
results to the list.

augustf

10/10/2006 3:17:00 PM

0

Since my last post, I've made some significant progress on this
problem, but am still stuck with some non-workable code. Have a look:
http://p.cabo... Thanks everyone!