Il giorno 23/dic/2014, alle ore 12:55, Jeremie
BOUSQUET <jeremie.bousquet(a)gmail.com> ha scritto:
Hello,
In ldap configuration, you can also have some fields synchronized with
xwiki users profiles [1].
It doesn't work for pictures (I think), in my case I have a script that
gets pictures bytes from ldap, save this as a picture attachment in wiki
user profile and associates the pic as user avatar (field with same name in
user profile). I do this in cron for users with ldap infos, and without
avatar already.
Br,
Jeremie
Hi Jeremie,
thanks for your help, I solved it now:
import com.sun.org.apache.xerces.internal.impl.dv.util.Base64;
...
if ( ! ( entry.dn.toUpperCase() =~ 'DEAKTIVIERT' ) ) {
print '|'
if ( entry.sn ) {
print entry.sn
}
if ( entry.givenname ) {
print " "
print entry.givenname
}
if ( entry.thumbnailphoto ) {
print " "
byte[] picture = entry.thumbnailphoto
print '{{html}} '
print '<img height="45"
src="data:image/jpeg;base64,'
print Base64.encode(picture);
print '">'
print '{{/html}}'
}
print '|'
if ( entry.title ) {
print entry.title
}
...
the missing links were
* {{html}} ... {{/html}} to insert plain html into an xwiki site
* the "inline" definition of the image, see
http://aktuell.de.selfhtml.org/artikel/grafik/inline-images/ (sry, german only)
Again, thanks.
Florian