powered by Jive Software

AVATAR and LDAP

Hi all,

I would like to test Openfire 3.4.1 new feature: get Avatar from LDAP. I need help with the following points:

1.- How to define VCARD mapping for PHOTO field?

2.- How to load a jpeg photo in Active Directory. I tried using bin2hex, opening resulting HEX file with notepad and paste the content in ADSI Edit… but no good result. Any other tool to load this field in AD?

Best regards and thanks in advance,

Juanjo.-

I do not believe that AD supports Avatars. There is a different avatar plugin for openfire that gives AD users this functionality.

I tested this out successfully recently with the following settings:

vcard changes in openfire.xml:

<PHOTO>

<TYPE>image/jpeg</TYPE>

<BINVAL></BINVAL>

</PHOTO>

As for importing avatar (photos) into the jpegPhoto attribute of an AD user object, I created the following vbs script. Name it something like “jpegphoto.vbs” and run it after editing it to work with your AD, etc.

=====

Const theUser = “user.name

Const theFile = “photo.jpg”

Function ReadBinaryFile(FileName)

Const adTypeBinary = 1

Dim BinaryStream

Set BinaryStream = CreateObject(“ADODB.Stream”)

BinaryStream.Type = adTypeBinary

BinaryStream.Open

BinaryStream.LoadFromFile FileName

ReadBinaryFile = BinaryStream.Read

End Function

Set objNewUser = GetObject(“LDAP://localhost:389/cn=” & theuser & “,ou=Organization,dc=mydomain,dc=internal”)

objNewUser.Put “jpegPhoto”, ReadBinaryFile(theFile)

objNewUser.SetInfo

Set objNewUser = Nothing

=====

I suggest keeping your photos small. A 100x100 pixel jpeg seems to be about 5 k in size and works well with spark, etc.

Thanks for that info. I learned something new today. I had no idea that was an option in AD. I have never seen it referenced in any of the AD management tools.

This plugin however makes it totally painless to use avatars with AD LDAP. It stores the avatar in the Openfire database instead. http://www.eyecraft.ch/coding/ldapvcardavatar/

Ya, the jpegPhoto attribute has been around since 2003 AD schema was introduced. You can seen that attribute via adsiedit, but you can’t actually view the photo anywhere. You have to programatically import, export, view the photo.

As for that plugin, I did see it. I didn’t go with it for 3 reasons. First, since openfire now supports avatar via AD nateively, I don’t have to rely on a 3rd part plugin that isn’t officially supported by this community. Second, I like everything for a user profile being stored in AD, not a mix of AD and the mysql db. Thirdly, I like being in control of the photos and not allowing staff to set them, this way I can control the quality and professionalism of the photos.

Thanks.

Thanks a lot Ryan!

Could you help me with that vbs script?: How can I run the script? I suppose I need some kind of interpreter or something like that… or not?

Thanks in advance,

JJ.-

http://www.dameware.com/products/dntu/

store Photo in win2000 and win2003 AD

Ok so I saw the later post about Dameware NT Utilities. I tried the application to place a jpeg in AD 2003. It seems to work, but Spark does not show the avatar. Any ideas? I did add the photos tags to my openfire.xml. My vcard mapping info is below:

<vcard-mapping><![CDATA[

<vCard xmlns=“vcard-temp”>

<N>

<N><FAMILY></FAMILY><GIVEN></GIVEN><MIDDLE/></N>

</N>

<EMAIL>

<INTERNET/>

<USERID></USERID>

</EMAIL>

<FN></FN>

<ADR>

<HOME/>

<STREET></STREET>

<PCODE></PCODE>

<CTRY></CTRY>
</ADR> <ADR>
<WORK/> <STREET></STREET> <LOCALITY></LOCALITY> <REGION></REGION> <PCODE></PCODE> <CTRY></CTRY>

</ADR>

<TEL>

<HOME/>

<VOICE/>

<NUMBER></NUMBER>

</TEL>

<TEL>

<HOME/>

<CELL/>

<NUMBER></NUMBER>
</TEL> <TEL>
<WORK/> <VOICE/> <NUMBER></NUMBER>
</TEL> <TEL>
<WORK/> <CELL/> <NUMBER></NUMBER>

</TEL>

<TEL>

<WORK/>

<FAX/>

<NUMBER></NUMBER>

</TEL>

<TEL>

<WORK/>

<PAGER/>

<NUMBER></NUMBER>

</TEL>

<TITLE></TITLE>

<ORG>

<ORGNAME></ORGNAME>

<ORGUNIT></ORGUNIT>

</ORG>

<URL></URL>

<PHOTO>

<TYPE>image/jpeg</TYPE>

<BINVAL></BINVAL>

</PHOTO>

</vCard>]]></vcard-mapping>

<BINVAL></BINVAL>

try <BINVAL></BINVAL>

Thank you that did it. I can see it as a usefull tool. I do not think we will use it though, as we don’t care if people use personalized avatars. We found that the feature actually led to a more rapid acceptance of of the IM environment.

Todd, I tried this plugin before, but it doesn´t work wery well for me… I have users in AD and Openfire DB in Oracle. When you load Avatar from Spark, avatars are not stored in Oracle DB so if you close Spark you lose Avatar…

What version of openfire have you installed? I would prefer to store Avatars in Openfire DB rather than in AD Database… but I´m afraid we will have to wait a little bit more until this featyure is supported…

Regards,

JJ.-

I have the plugin working correctly on Openfire 3.3.2 and 3.4.1. I do not use oracle though.

Thanks! Great tool!