Description
It is a bit confusing (not much) if you become redirected to a wiki with ?action=login and you are already logged in. You get the login form shown on the page.
Steps to reproduce
Example
Component selection
- general
Details
MoinMoin Version |
1.8, 1.9 |
OS and Version |
|
Python Version |
|
Server Setup |
|
Server Details |
|
Language you are using the wiki in (set in the browser/UserPreferences) |
|
Workaround
Discussion
- We should modify the login action by checking if the user is already logged in.
- Maybe the very first question should be "who or what is redirecting you to ...?action=login although you are already logged in?". If that is not moin, we could just close this bug.
Some of my users do add to a welcoming page a hint. Please login for further ... The macro Action is used for pointing to the login form.
RenatoSilva - I think the whole point is that whatever stuff is redirecting you to the login action, it is pointless to display a login form. Also, rather than just redirecting back to the page, Moin could show a notice like "You are already logged in", just like when you subscribe or quicklink twice.
vote +1 -- ReimarBauer 2009-11-29 19:08:19
RenatoSilva - I propose applying one of the patches below.
- This one displays a message informing the user that he is already logged in (better approach in my opinion): This one silently redirects the user to the underlying page:
1 --- MoinMoin/action/login.py 2009-11-30 07:36:21 +0000 2 +++ MoinMoin/action/login.py 2009-11-30 07:36:13 +0000 3 @@ -68,6 +68,10 @@ 4 request.theme.add_msg(msg, "error") 5 return self.page.send_page() 6 7 + elif request.user.valid: # inform the user he's already logged in 8 + request.theme.add_msg(_('You are already logged in.')) 9 + Page(request, self.pagename).send_page() 10 + 11 else: # show login form 12 request.theme.send_title(_("Login"), pagename=self.pagename) 13 # Start content (important for RTL support)
1 --- MoinMoin/action/login.py 2009-11-29 00:04:19 +0000 2 +++ MoinMoin/action/login.py 2009-11-29 00:04:13 +0000 3 @@ -68,6 +68,10 @@ 4 request.theme.add_msg(msg, "error") 5 return self.page.send_page() 6 7 + elif request.user.valid: # user already logged in, redirect to the underlying page 8 + url = Page(request, self.pagename).url(request) 9 + request.http_redirect(url) 10 + 11 else: # show login form 12 request.theme.send_title(_("Login"), pagename=self.pagename) 13 # Start content (important for RTL support)
Did you check whether handle_multistage needs changes?
RenatoSilva - It is only called if the user submitted the login form, which is only displayed when the user is not logged in. Therefore there is no check to do.
- This one displays a message informing the user that he is already logged in (better approach in my opinion):
Plan
- Priority:
- Assigned to:
- Status: