CreateUserFromLDAP in LDAPAuthServiceImpl

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

CreateUserFromLDAP in LDAPAuthServiceImpl

Philippe Legrain
Hi,

In the LdapAuthServiceImpl , as far as I understand it, everytime a user is authentified, the method CreateUserFromLDAP is called, wich in turn creates a user page in the wiki.  The creation is done regardless of wether te page already exists or not in the wiki, increasing its version number upon every call to authenticate (which is called quite often).

I tried to do use the doc.isNew() method to try to avoid creating a user page when it already exists, but the isNew appear to always return false after the doc creation using this line:
XWikiDocument doc = context.getWiki ().getDocument(fullwikiname, context);

Is that correct? Is there a way to avoid updating the user's document upon every authentification?

Thanks,

Philippe Legrain


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: CreateUserFromLDAP in LDAPAuthServiceImpl

Ludovic Dubost

Well we could check that the fields have not changed and not save it in
this case.
Checking isNew() is not necessarly a good idea (it should work though)
because some data might have changed.
A patch is welcome.

Ludovic

Philippe Legrain a écrit :

> Hi,
>
> In the LdapAuthServiceImpl , as far as I understand it, everytime a
> user is authentified, the method CreateUserFromLDAP is called, wich in
> turn creates a user page in the wiki.  The creation is done regardless
> of wether te page already exists or not in the wiki, increasing its
> version number upon every call to authenticate (which is called quite
> often).
>
> I tried to do use the doc.isNew() method to try to avoid creating a
> user page when it already exists, but the isNew appear to always
> return false after the doc creation using this line:
> XWikiDocument doc = context.getWiki ().getDocument(fullwikiname, context);
>
> Is that correct? Is there a way to avoid updating the user's document
> upon every authentification?
>
> Thanks,
>
> Philippe Legrain
> ------------------------------------------------------------------------
>
>
> --
> You receive this message as a subscriber of the [hidden email] mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
>  

--
Ludovic Dubost
XPertNet: http://www.xpertnet.fr/
Blog: http://www.ludovic.org/blog/
XWiki: http://www.xwiki.com
Skype: ldubost AIM: nvludo Yahoo: ludovic




--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws