Skip to content

Commit 3c4886f

Browse files
author
Richard Jones
committed
allow blank passwords again [SF#619714]
1 parent e183610 commit 3c4886f

File tree

7 files changed

+25
-14
lines changed

7 files changed

+25
-14
lines changed

CHANGES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ are given with the most recent entry first.
1313
- https URLs from config now recognised as valid (sf bug 619829)
1414
- nicer display of tracker list in roundup-server (sf bug 619769)
1515
- fixed some missed renaming instance -> tracker (sf bug 619769)
16+
- allow blank passwords again (sf bug 619714)
1617

1718

1819
2002-10-02 0.5.0

doc/customizing.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Customising Roundup
33
===================
44

5-
:Version: $Revision: 1.52 $
5+
:Version: $Revision: 1.53 $
66

77
.. This document borrows from the ZopeBook section on ZPT. The original is at:
88
http://www.zope.org/Documentation/Books/ZopeBook/current/ZPT.stx
@@ -580,6 +580,10 @@ Example Scenarios
580580
<option tal:condition="python:request.user.hasPermission('Closer')"
581581
value="resolved">Resolved</option>
582582

583+
**don't give users who register through email web access**
584+
Create a new Role called "Email User" which has all the Permissions of the
585+
normal "User" Role minus the "Web Access" Permission. This will allow users
586+
to send in emails to the tracker, but not access the web interface.
583587

584588

585589
Web Interface

roundup/backends/back_anydbm.py

Lines changed: 3 additions & 3 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: back_anydbm.py,v 1.88 2002-10-07 00:52:51 richard Exp $
18+
#$Id: back_anydbm.py,v 1.89 2002-10-08 04:11:14 richard Exp $
1919
'''
2020
This module defines a backend that saves the hyperdatabase in a database
2121
chosen by anydbm. It is guaranteed to always be available in python
@@ -366,7 +366,7 @@ def serialise(self, classname, node):
366366
# get the property spec
367367
prop = properties[k]
368368

369-
if isinstance(prop, Password):
369+
if isinstance(prop, Password) and v is not None:
370370
d[k] = str(v)
371371
elif isinstance(prop, Date) and v is not None:
372372
d[k] = v.serialise()
@@ -397,7 +397,7 @@ def unserialise(self, classname, node):
397397
d[k] = date.Date(v)
398398
elif isinstance(prop, Interval) and v is not None:
399399
d[k] = date.Interval(v)
400-
elif isinstance(prop, Password):
400+
elif isinstance(prop, Password) and v is not None:
401401
p = password.Password()
402402
p.unpack(v)
403403
d[k] = p

roundup/backends/back_sqlite.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $Id: back_sqlite.py,v 1.6 2002-09-27 01:04:38 richard Exp $
1+
# $Id: back_sqlite.py,v 1.7 2002-10-08 04:11:16 richard Exp $
22
__doc__ = '''
33
See https://pysqlite.sourceforge.net/ for pysqlite info
44
'''
@@ -155,7 +155,7 @@ def unserialise(self, classname, node):
155155
d[k] = date.Date(v)
156156
elif isinstance(prop, Interval) and v is not None:
157157
d[k] = date.Interval(v)
158-
elif isinstance(prop, Password):
158+
elif isinstance(prop, Password) and v is not None:
159159
p = password.Password()
160160
p.unpack(v)
161161
d[k] = p

roundup/backends/rdbms_common.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $Id: rdbms_common.py,v 1.21 2002-10-07 00:52:51 richard Exp $
1+
# $Id: rdbms_common.py,v 1.22 2002-10-08 04:11:16 richard Exp $
22
''' Relational database (SQL) backend common code.
33
44
Basics:
@@ -699,7 +699,7 @@ def serialise(self, classname, node):
699699
# get the property spec
700700
prop = properties[k]
701701

702-
if isinstance(prop, Password):
702+
if isinstance(prop, Password) and v is not None:
703703
d[k] = str(v)
704704
elif isinstance(prop, Date) and v is not None:
705705
d[k] = v.serialise()
@@ -730,7 +730,7 @@ def unserialise(self, classname, node):
730730
d[k] = date.Date(v)
731731
elif isinstance(prop, Interval) and v is not None:
732732
d[k] = date.Interval(v)
733-
elif isinstance(prop, Password):
733+
elif isinstance(prop, Password) and v is not None:
734734
p = password.Password()
735735
p.unpack(v)
736736
d[k] = p

roundup/cgi/client.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $Id: client.py,v 1.50 2002-10-07 00:52:51 richard Exp $
1+
# $Id: client.py,v 1.51 2002-10-08 04:11:17 richard Exp $
22

33
__doc__ = """
44
WWW request handler (also used in the stand-alone server).
@@ -525,7 +525,8 @@ def loginAction(self):
525525
# make sure we're allowed to be here
526526
if not self.loginPermission():
527527
self.make_user_anonymous()
528-
raise Unauthorised, _("You do not have permission to login")
528+
self.error_message.append(_("You do not have permission to login"))
529+
return
529530

530531
# now we're OK, re-open the database for real, using the user
531532
self.opendb(self.user)
@@ -536,7 +537,12 @@ def loginAction(self):
536537
def verifyPassword(self, userid, password):
537538
''' Verify the password that the user has supplied
538539
'''
539-
return password == self.db.user.get(self.userid, 'password')
540+
stored = self.db.user.get(self.userid, 'password')
541+
if password == stored:
542+
return 1
543+
if not password and not stored:
544+
return 1
545+
return 0
540546

541547
def loginPermission(self):
542548
''' Determine whether the user has permission to log in.

roundup/roundupdb.py

Lines changed: 2 additions & 2 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: roundupdb.py,v 1.70 2002-10-08 03:27:24 richard Exp $
18+
# $Id: roundupdb.py,v 1.71 2002-10-08 04:11:13 richard Exp $
1919

2020
__doc__ = """
2121
Extending hyperdb with types specific to issue-tracking.
@@ -291,7 +291,7 @@ def email_signature(self, nodeid, msgid):
291291
# then append a trailing slash if it is missing
292292
base = self.db.config.TRACKER_WEB
293293
if (not isinstance(base , type('')) or
294-
not base.startswith('http://'):
294+
not base.startswith('http://') or
295295
not base.startswith('https://')):
296296
base = "Configuration Error: TRACKER_WEB isn't a " \
297297
"fully-qualified URL"

0 commit comments

Comments
 (0)