Skip to content

Commit 3337970

Browse files
author
Richard Jones
committed
remember where we came from when logging in (patch [SF#1312889])
1 parent 502a5a0 commit 3337970

File tree

4 files changed

+8
-1
lines changed

4 files changed

+8
-1
lines changed

CHANGES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Feature:
88
- added Xapian indexer; replaces standard indexers if Xapian is available
99
- mailgw subject parsing has configurable levels of strictness
1010
- nosy messages may be sent individually to all recipients
11+
- remember where we came from when logging in (sf patch 1312889)
1112

1213

1314
2005-10-07 0.8.5

roundup/cgi/actions.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#$Id: actions.py,v 1.48 2005-07-07 06:46:09 richard Exp $
1+
#$Id: actions.py,v 1.49 2005-10-07 04:49:48 richard Exp $
22

33
import re, cgi, StringIO, urllib, Cookie, time, random, csv
44

@@ -888,6 +888,10 @@ def handle(self):
888888
# set the session cookie
889889
self.client.set_cookie(self.client.user)
890890

891+
# If we came from someplace, go back there
892+
if self.form.has_key('__came_from'):
893+
raise exceptions.Redirect, self.form['__came_from'].value
894+
891895
def verifyLogin(self, username, password):
892896
# make sure the user exists
893897
try:

templates/classic/html/page.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ <h2><span metal:define-slot="body_title">body title</span></h2>
101101
<input size="10" type="password" name="__login_password"><br>
102102
<input type="hidden" name="@action" value="Login">
103103
<input type="submit" value="Login" i18n:attributes="value"><br>
104+
<input type="hidden" name="__came_from" tal:attributes="value string:${request/base}${request/env/PATH_INFO}">
104105
<span tal:replace="structure request/indexargs_form" />
105106
<a href="user?@template=register"
106107
tal:condition="python:request.user.hasPermission('Create', 'user')"

templates/minimal/html/page.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ <h2><span metal:define-slot="body_title">body title</span></h2>
4242
<input size="10" type="password" name="__login_password"><br>
4343
<input type="hidden" name="@action" value="Login">
4444
<input type="submit" value="Login" i18n:attributes="value">
45+
<input type="hidden" name="__came_from" tal:attributes="value string:${request/base}${request/env/PATH_INFO}">
4546
<span tal:replace="structure request/indexargs_form" />
4647
</form>
4748
<a tal:condition="python:request.user.hasPermission('Web Registration')"

0 commit comments

Comments
 (0)