Skip to content

Commit 7f60ba3

Browse files
author
Roche Compaan
committed
Links in page header are now consistent with default sort order.
Fixed bugs: - When login failed the list of issues were still rendered. - User was redirected to index page and not to his destination url if his first login attempt failed.
1 parent 531952b commit 7f60ba3

File tree

1 file changed

+18
-11
lines changed

1 file changed

+18
-11
lines changed

roundup/cgi_client.py

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1616
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1717
#
18-
# $Id: cgi_client.py,v 1.71 2001-11-30 20:28:10 rochecompaan Exp $
18+
# $Id: cgi_client.py,v 1.72 2001-11-30 20:47:58 rochecompaan Exp $
1919

2020
__doc__ = """
2121
WWW request handler (also used in the stand-alone server).
@@ -111,7 +111,7 @@ def pagehead(self, title, message=None):
111111
if self.user not in (None, 'anonymous'):
112112
userid = self.db.user.lookup(self.user)
113113
user_info = _('''
114-
<a href="issue?assignedto=%(userid)s&status=-1,unread,deferred,chatting,need-eg,in-progress,testing,done-cbb&:filter=status,assignedto&:sort=activity&:columns=id,activity,status,title,assignedto&:group=priority&show_customization=1">My Issues</a> |
114+
<a href="issue?assignedto=%(userid)s&status=-1,unread,deferred,chatting,need-eg,in-progress,testing,done-cbb&:filter=status,assignedto&:sort=-activity&:columns=id,activity,status,title,assignedto&:group=priority&show_customization=1">My Issues</a> |
115115
<a href="user%(userid)s">My Details</a> | <a href="logout">Logout</a>
116116
''')%locals()
117117
else:
@@ -135,9 +135,9 @@ def pagehead(self, title, message=None):
135135
<td align=right valign=bottom>%(user_name)s</td></tr>
136136
<tr class="location-bar">
137137
<td align=left>All
138-
<a href="issue?status=-1,unread,deferred,chatting,need-eg,in-progress,testing,done-cbb&:sort=activity&:filter=status&:columns=id,activity,status,title,assignedto&:group=priority&show_customization=1">Issues</a>
138+
<a href="issue?status=-1,unread,deferred,chatting,need-eg,in-progress,testing,done-cbb&:sort=-activity&:filter=status&:columns=id,activity,status,title,assignedto&:group=priority&show_customization=1">Issues</a>
139139
| Unassigned
140-
<a href="issue?assignedto=-1&status=-1,unread,deferred,chatting,need-eg,in-progress,testing,done-cbb&:sort=activity&:filter=status,assignedto&:columns=id,activity,status,title,assignedto&:group=priority&show_customization=1">Issues</a>
140+
<a href="issue?assignedto=-1&status=-1,unread,deferred,chatting,need-eg,in-progress,testing,done-cbb&:sort=-activity&:filter=status,assignedto&:columns=id,activity,status,title,assignedto&:group=priority&show_customization=1">Issues</a>
141141
%(add_links)s
142142
%(admin_links)s</td>
143143
<td align=right>%(user_info)s</td>
@@ -634,7 +634,7 @@ def login(self, message=None, newuser_form=None, action='index'):
634634
if self.user is None and self.ANONYMOUS_REGISTER == 'deny':
635635
self.write('</table>')
636636
self.pagefoot()
637-
return
637+
return 1
638638
values = {'realname': '', 'organisation': '', 'address': '',
639639
'phone': '', 'username': '', 'password': '', 'confirm': ''}
640640
if newuser_form is not None:
@@ -680,13 +680,16 @@ def login_action(self, message=None):
680680
except KeyError:
681681
name = self.user
682682
self.make_user_anonymous()
683-
return self.login(message=_('No such user "%(name)s"')%locals())
683+
action = self.form['__destination_url'].value
684+
return self.login(message=_('No such user "%(name)s"')%locals(),
685+
action=action)
684686

685687
# and that the password is correct
686688
pw = self.db.user.get(uid, 'password')
687689
if password != self.db.user.get(uid, 'password'):
688690
self.make_user_anonymous()
689-
return self.login(message=_('Incorrect password'))
691+
action = self.form['__destination_url'].value
692+
return self.login(message=_('Incorrect password'), action=action)
690693

691694
self.set_cookie(self.user, password)
692695
return None # make it explicit
@@ -914,8 +917,8 @@ def pagehead(self, title, message=None):
914917
if self.user not in (None, 'anonymous'):
915918
userid = self.db.user.lookup(self.user)
916919
user_info = _('''
917-
<a href="issue?assignedto=%(userid)s&status=-1,unread,deferred,chatting,need-eg,in-progress,testing,done-cbb&:filter=status,assignedto&:sort=activity&:columns=id,activity,status,title,assignedto&:group=priority&show_customization=1">My Issues</a> |
918-
<a href="support?assignedto=%(userid)s&status=-1,unread,deferred,chatting,need-eg,in-progress,testing,done-cbb&:filter=status,assignedto&:sort=activity&:columns=id,activity,status,title,assignedto&:group=customername&show_customization=1">My Support</a> |
920+
<a href="issue?assignedto=%(userid)s&status=-1,unread,deferred,chatting,need-eg,in-progress,testing,done-cbb&:filter=status,assignedto&:sort=-activity&:columns=id,activity,status,title,assignedto&:group=priority&show_customization=1">My Issues</a> |
921+
<a href="support?assignedto=%(userid)s&status=-1,unread,deferred,chatting,need-eg,in-progress,testing,done-cbb&:filter=status,assignedto&:sort=-activity&:columns=id,activity,status,title,assignedto&:group=customername&show_customization=1">My Support</a> |
919922
<a href="user%(userid)s">My Details</a> | <a href="logout">Logout</a>
920923
''')%locals()
921924
else:
@@ -943,8 +946,8 @@ def pagehead(self, title, message=None):
943946
<a href="issue?status=-1,unread,deferred,chatting,need-eg,in-progress,testing,done-cbb&:sort=activity&:filter=status&:columns=id,activity,status,title,assignedto&:group=priority&show_customization=1">Issues</a>,
944947
<a href="support?status=-1,unread,deferred,chatting,need-eg,in-progress,testing,done-cbb&:sort=activity&:filter=status&:columns=id,activity,status,title,assignedto&:group=customername&show_customization=1">Support</a>
945948
| Unassigned
946-
<a href="issue?assignedto=-1&status=-1,unread,deferred,chatting,need-eg,in-progress,testing,done-cbb&:sort=activity&:filter=status,assignedto&:columns=id,activity,status,title,assignedto&:group=priority&show_customization=1">Issues</a>,
947-
<a href="support?assignedto=-1&status=-1,unread,deferred,chatting,need-eg,in-progress,testing,done-cbb&:sort=activity&:filter=status,assignedto&:columns=id,activity,status,title,assignedto&:group=customername&show_customization=1">Support</a>
949+
<a href="issue?assignedto=-1&status=-1,unread,deferred,chatting,need-eg,in-progress,testing,done-cbb&:sort=-activity&:filter=status,assignedto&:columns=id,activity,status,title,assignedto&:group=priority&show_customization=1">Issues</a>,
950+
<a href="support?assignedto=-1&status=-1,unread,deferred,chatting,need-eg,in-progress,testing,done-cbb&:sort=-activity&:filter=status,assignedto&:columns=id,activity,status,title,assignedto&:group=customername&show_customization=1">Support</a>
948951
%(add_links)s
949952
%(admin_links)s</td>
950953
<td align=right>%(user_info)s</td>
@@ -1024,6 +1027,10 @@ def parsePropsFromForm(db, cl, form, nodeid=0):
10241027

10251028
#
10261029
# $Log: not supported by cvs2svn $
1030+
# Revision 1.71 2001/11/30 20:28:10 rochecompaan
1031+
# Property changes are now completely traceable, whether changes are
1032+
# made through the web or by email
1033+
#
10271034
# Revision 1.70 2001/11/30 00:06:29 richard
10281035
# Converted roundup/cgi_client.py to use _()
10291036
# Added the status file, I18N_PROGRESS.txt

0 commit comments

Comments
 (0)