[xwiki-devs] Redirect to a space
Hi How can i redirect the users after login to a space ? I`m looking at login.vm but i have no clue to do this Thanks
Hi Bruno, On Tue, Jul 22, 2008 at 6:14 PM, Bruno Amaro Almeida <[email protected]> wrote:
How can i redirect the users after login to a space ?
The page where the user is redirected is specified in the field named xredirect. So, in login.vm, you need to change the line <div class="hidden"><input type="hidden" name="xredirect" value="$!request.xredirect"/> to <div class="hidden"><input type="hidden" name="xredirect" value="$xwiki.getURL('MySpace.WebHome')"/>
Hi Thanks, that work! But, can i get the value of username and password , so that way, decide where to redirect ? Many thanks for your help Marta! Marta Girdea wrote:
Hi Bruno,
On Tue, Jul 22, 2008 at 6:14 PM, Bruno Amaro Almeida <[email protected]> wrote:
How can i redirect the users after login to a space ?
The page where the user is redirected is specified in the field named xredirect.
So, in login.vm, you need to change the line <div class="hidden"><input type="hidden" name="xredirect" value="$!request.xredirect"/>
to
<div class="hidden"><input type="hidden" name="xredirect" value="$xwiki.getURL('MySpace.WebHome')"/> _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
On Tue, Jul 22, 2008 at 11:34 PM, Bruno Amaro Almeida <[email protected]> wrote:
But, can i get the value of username and password , so that way, decide where to redirect ?
I guess the easiest solution is to redirect to a page that will perform another redirect, established according to the authenticated user (however, this means double redirect, not very efficient). So: - in login.vm , the value of xredirect should be set to $xwiki.getURL('Main.GetUserRedirect') (for example) - the Main.GetUserRedirect should contain something like this: ------------------------------------------------------------------ #set($redirect = 'Default.Page') #if($context.user == 'XWiki.me') #set($redirect='My.Page') #elseif($context.user == 'XWiki.you') #set($redirect='Your.Page') #elseif(..... ... #end ## or a more intelligent way to determine the target page $response.sendRedirect($xwiki.getURL($redirect)) ------------------------------------------------------------------ Another solution is to use a javascript listener to change the xredirect field from the login form just before submit.
Hi Marta, Bruno, How can I set the xredirect parameter from a custom authentication class written in Java that extends XwikiAuthServiceImpl? When a user is loged by my custom authentication I want she/he to redirect in a particular Space. Many thanks! -- View this message in context: http://xwiki.475771.n2.nabble.com/Redirect-to-a-space-tp576893p7585562.html Sent from the XWiki- Dev mailing list archive at Nabble.com.
Here is en example in another authenticator: https://github.com/xwiki-contrib/sandbox/blob/master/authenticators/xwiki-au... On Tue, Jun 4, 2013 at 10:27 AM, jordiduran <[email protected]> wrote:
Hi Marta, Bruno,
How can I set the xredirect parameter from a custom authentication class written in Java that extends XwikiAuthServiceImpl?
When a user is loged by my custom authentication I want she/he to redirect in a particular Space.
Many thanks!
-- View this message in context: http://xwiki.475771.n2.nabble.com/Redirect-to-a-space-tp576893p7585562.html Sent from the XWiki- Dev mailing list archive at Nabble.com. _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
-- Thomas Mortagne
Hi Thomas, thank you for your speediness! I'll take a look. Many thanks! -- View this message in context: http://xwiki.475771.n2.nabble.com/Redirect-to-a-space-tp576893p7585567.html Sent from the XWiki- Dev mailing list archive at Nabble.com.
participants (4)
-
Bruno Amaro Almeida -
jordiduran -
Marta Girdea -
Thomas Mortagne