Re: [xwiki-users] Automatic forward to user page after login?
Thanks a lot. But maybe I made it confused, English is not my mother language. In fact what I need is that after the user entering username/password and click the log-in button, the next page should be the user's profile page. For example, after entering username/password the user Admin click log-in, then the coming page should be http://localhost:8080/xwiki/bin/view/XWiki/Admin The problem is that before log-in, we can't get the username and user profile page URL in global.vm because we don't know which user will exactly log-in. --------------------------------------------------
------------------------------
Message: 3 Date: Thu, 6 Mar 2008 12:38:01 +0100 From: "Dan" <[email protected]> Subject: [xwiki-users] Automatic forward to user page after login? To: <[email protected]> Message-ID: <[email protected]> Content-Type: text/plain; charset="gb2312"
Hello, all Currently after login, the user will be forwarded to the former page. Is it possible to automatically forward the user to his own page? Shall I modify some .vm templates or I have to do java coding? Please kindly give some instructions. Thanks a lot.
#set($logouturl = $xwiki.getURL("XWiki.XWikiLogout","logout", "xredirect=$xwiki.getURL('XWiki.RedirectUser')")) And then edit the document XWiki.RedirectUser and put in there: $response.sendRedirect($xwiki.getURL($context.user)) Dan wrote:
Thanks a lot. But maybe I made it confused, English is not my mother language. In fact what I need is that after the user entering username/password and click the log-in button, the next page should be the user's profile page. For example, after entering username/password the user Admin click log-in, then the coming page should be http://localhost:8080/xwiki/bin/view/XWiki/Admin The problem is that before log-in, we can't get the username and user profile page URL in global.vm because we don't know which user will exactly log-in.
--------------------------------------------------
------------------------------
Message: 3 Date: Thu, 6 Mar 2008 12:38:01 +0100 From: "Dan" <[email protected]> Subject: [xwiki-users] Automatic forward to user page after login? To: <[email protected]> Message-ID: <[email protected]> Content-Type: text/plain; charset="gb2312"
Hello, all Currently after login, the user will be forwarded to the former page. Is it possible to automatically forward the user to his own page? Shall I modify some .vm templates or I have to do java coding? Please kindly give some instructions. Thanks a lot.
Hi Dan, Dan wrote:
Thanks a lot. But maybe I made it confused, English is not my mother language.
It is not your fault! You clearly said "login", no "logout". Sorry!
In fact what I need is that after the user entering username/password and click the log-in button, the next page should be the user's profile page. For example, after entering username/password the user Admin click log-in, then the coming page should be http://localhost:8080/xwiki/bin/view/XWiki/Admin The problem is that before log-in, we can't get the username and user profile page URL in global.vm because we don't know which user will exactly log-in.
I guess this must be done by hacking the same template. Let me take a look. Once you hit the login button, you already has the needed information. I keep guessing the the value to be considered is $loginurl instead of $logouturl... #set($loginurl = $xwiki.getURL("XWiki.XWikiLogin", "login", "xredirect=$xwiki.getURLEncoded($logredir)")) <a class="glink" href="$!loginurl" id="headerlogin">$!msg.get("login")</a>#sep() I will try to have this done and come back if I am able to get this done. Cheers, Ricardo -- Ricardo RodrÃguez Your EPEC Network ICT Team
And by that of course I mean: #set($loginurl = $xwiki.getURL("XWiki.XWikiLogin","login", "xredirect=$xwiki.getURL('XWiki.RedirectUser')")) Sergiu Dumitriu wrote:
#set($logouturl = $xwiki.getURL("XWiki.XWikiLogout","logout", "xredirect=$xwiki.getURL('XWiki.RedirectUser')"))
And then edit the document XWiki.RedirectUser and put in there:
$response.sendRedirect($xwiki.getURL($context.user))
Dan wrote:
Thanks a lot. But maybe I made it confused, English is not my mother language. In fact what I need is that after the user entering username/password and click the log-in button, the next page should be the user's profile page. For example, after entering username/password the user Admin click log-in, then the coming page should be http://localhost:8080/xwiki/bin/view/XWiki/Admin The problem is that before log-in, we can't get the username and user profile page URL in global.vm because we don't know which user will exactly log-in.
--------------------------------------------------
------------------------------
Message: 3 Date: Thu, 6 Mar 2008 12:38:01 +0100 From: "Dan" <[email protected]> Subject: [xwiki-users] Automatic forward to user page after login? To: <[email protected]> Message-ID: <[email protected]> Content-Type: text/plain; charset="gb2312"
Hello, all Currently after login, the user will be forwarded to the former page. Is it possible to automatically forward the user to his own page? Shall I modify some .vm templates or I have to do java coding? Please kindly give some instructions. Thanks a lot.
participants (3)
-
[Ricardo Rodriguez] Your EPEC Network ICT Team -
Dan -
Sergiu Dumitriu