On 08/10/2010 09:46 AM, Simerpreet Singh wrote:
Hi,
Iam working on creating a custom login page but did't find any help
regarding backend login functionality.i copied HTML from login.vm on my
new page,set action of form to $xwiki.getURL("XWiki.XWikiLogin") but
how can i redirect bact to my space if login details are incorrect or
how can i redirect to next page if login succesfull.
I used below script on top of login page.changed url's according but
did't work
#if($context.user!="XWiki.XWikiGuest")
#if($request.xredirect)
$response.sendRedirect($request.xredirect)
#else
$response.sendRedirect($xwiki.getURL("Main.WebHome"))
#end
#elseif($doc.fullName != "XWiki.XWikiLogin")
#set($qs = "")
#set($qs = $request.queryString)
#if(!$request.getParameter("xredirect"))
#set($qs = "xredirect=$util.encodeURI($doc.getURL('view'))&${qs}")
#end
$response.sendRedirect($xwiki.getURL("XWiki.XWikiLogin", "login",
$qs))
#else
###
### Login page
###
###
If you're trying to use a different page for logging in (other than
XWiki.XWikiLogin), you must edit WEB-INF/xwiki.cfg and add something like:
xwiki.authentication.loginpage=/xwiki/bin/login/XWiki/XWikiLogin
Does this solve your problem?
--
Sergiu Dumitriu
http://purl.org/net/sergiu/