[xwiki-dev] registration of new users in xwiki from external application : appropriate rights not set
Sergiu Dumitriu
sergiu.dumitriu at gmail.com
Fri Apr 20 09:06:48 CEST 2007
Hi,
The double action="" attribute is a mistake. The missing attribute value
means that the form is submitted to the same URL. The registration should
work, unless you don't have the right to register new users. The login
action returns some cookies, which must be kept and passed with the
registration request.
Sergiu
On 4/19/07, Thomas Krämer <tk at ontopica.de> wrote:
>
> Hi Dumitriu,
>
> I tried the REST approach, as you depicted
> > This approach seems to be OK. But you can also use a REST approach,
> > meaning that you learn how does the registration form work, then create
> > a fake request (GET or POST, which one is easier). If registration is
> > not public, then you also need to send some authentication tokens
> > (cookies).
> >
>
> I use the common httpclient to imitate a users behavior.
> I can succesfully login as a user, doing a PostMethod with
> "/xwiki/bin/loginsubmit/XWiki/XWikiLogin"
> This is not what a users sees in his browsers adress bar, but what
> appears in the form in the html source.
>
> But, calling the registration page
> http://localhost:8080/xwiki/bin/register/XWiki/Register ,
> setting the parameters to a new request (on the same httpclient object)
>
> PostMethod registerMethod = new PostMethod(registerUrl);
> loginPost.addParameter("template", "XWiki.XWikiUserTemplate");
> loginPost.addParameter("register", "1");
> loginPost.addParameter("register_first_name", "");
> loginPost.addParameter("register_last_name", "");
> loginPost.addParameter("register2_password", "875656");
> loginPost.addParameter("register_password", "875656");
> loginPost.addParameter("register_email", "gzt6 at web.de");
> loginPost.addParameter("xwikiname", "horatio");
> loginPost.addParameter("submit", "register");
> loginPost.addParameter("Register", "1");
>
> does not work.
>
> Why is that so?
>
> Examining the source, i was wondering, why there is no action in the
> html form:
>
>
> <form id="register" name="register" action="" action="" method="post">
>
>
> What is the reason for that?
> What is the URL i have to set to a PostMethod?
> And: Why does the action attribute appear twice in the form?
>
>
>
> Yours
>
> Thomas
>
>
> Btw: Congrats to RC1, you've all been probably quite busy theese days.
> Great work!
>
Thanks.
--
http://purl.org/net/sergiu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.xwiki.org/pipermail/devs/attachments/20070420/9f8c094e/attachment.htm
More information about the devs
mailing list