You must tell us what is this file? A custom file per user? where did this file come from? Do you want this file attached to profile user? Etc. Your file is in your ldap ilike users photo:? #-# [Since 8.1M2, XWikiLDAPAuthServiceImpl] #-# On every login update photo from LDAP to XWiki avatar otherwise photo will not be updated. #-# - 0: never #-# - 1: at each authentication #-# The default is 0 # xwiki.authentication.ldap.update_photo=0
Anyway you can add custom velocity code here: /bin/edit/XWiki/XWikiUserProfileSheet?editor=wiki (I don't know it it is a clean way, it depend of your use case desired) -------------------------------------------- En date de : Mar 29.11.16, m...@ow2.org <m...@ow2.org> a écrit : Objet: Re: [xwiki-users] API/Scripting : create user and attach some files to its profile À: "XWiki Users" <users@xwiki.org> Date: Mardi 29 novembre 2016, 9h00 Hi Pascal, Thanks for the tip :) It answers to the "how to add a field" part of my question. But it doesn't answer about attaching file to the profile. The main issue I see here is the account is created on login. Or maybe there might be a hook system so we can trigger something when the account is created( ie, to attach files to the profile) ? Cheers, Le 28/11/2016 à 08:46, Pascal BASTIEN a écrit : > Hello, > > I added some others attributes (I don't know if you can do the same with file) > Add some attributes here: /bin/edit/XWiki/XWikiUsers?editor=class > e.g. myaddress > (disabled it to prevent your user modified it) > > Add this field "myaddress" on the sheet: /bin/view/XWiki/AdminUserProfileSheet > and finally add it in xwiki.cfg: > #-# retrieve the following fields from LDAP and store them in the XWiki user object (xwiki-attribute=ldap-attribute) > xwiki.authentication.ldap.fields_mapping=last_name=sn,first_name=givenName,email=xxxxx....cut....,myaddress=street > and choose a value for this setting: > #-# On every login update the mapped attributes from LDAP to XWiki otherwise this happens only once when the XWiki > #-# account is created. > #-# - 0: only when creating user > #-# - 1: at each authentication > #-# The default is 0 > xwiki.authentication.ldap.update_user=1 > > > (eventually add a XWiki.TranslationDocumentClass to translate myaddress attribute) > > > Pascal BASTIEN > > -------------------------------------------- > En date de : Ven 25.11.16, m...@ow2.org <m...@ow2.org> a écrit : > > Objet: [xwiki-users] API/Scripting : create user and attach some files to its profile > À: "XWiki Users" <users@xwiki.org> > Date: Vendredi 25 novembre 2016, 12h37 > > Hi, > > I'm working on a registration system around xwiki. > > The basic workflow is the user is created in a LDAP > directory at > registration time. Then the user can login to xwiki. > It's only upon the first successful login to xwiki that the > user's xwiki > profile is created in xwiki database. > > Now here is my point : how could I prepare the user profile > *before* he > gets connected ? For example I would be able to attach some > files to > XWiki.<username> and why not some others attributes. > > Is anyone already achieved this ? > > Cheers > _______________________________________________ > users mailing list > users@xwiki.org > http://lists.xwiki.org/mailman/listinfo/users > >