Skip to content

Commit 9f5e53e

Browse files
committed
- allow user to recover account password using an entry in the
Alternate E-mail addresses list. See: http://psf.upfronthosting.co.za/roundup/meta/issue564 for description. Merge request at: https://sourceforge.net/p/roundup/code/merge-requests/1/ Patch supplied by kinggreedy. Applied/tested by John Rouillard It makes this work: Click "Lost your login?" link Enter an alternate address in the email address block. Submit. Get an email sent to alternate address with a one time reset url. Go to that url. Before patch, email with new password was sent to the address "E-mail address" for the user and not to the alternate address. After the patch, the email with new password is sent to the "validated" (against the alternate address list) alternate address supplied by the user.
2 parents 12daa8f + 55b809f commit 9f5e53e

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

CHANGES.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,12 @@ Features:
6767
assignedto. Use exclude=['assignedto'] to prevent the
6868
indexargs_form from generating a confliciting assignedto field
6969
which lists all users regardless of the role.]
70+
- allow user to recover account password using an entry in the
71+
Alternate E-mail addresses list. See:
72+
http://psf.upfronthosting.co.za/roundup/meta/issue564
73+
for description. Merge request at:
74+
https://sourceforge.net/p/roundup/code/merge-requests/1/
75+
Patch supplied by kinggreedy. Applied/tested by John Rouillard
7076

7177
Fixed:
7278

roundup/cgi/actions.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -704,6 +704,9 @@ def handle(self):
704704
"to show up erroneously, please check your email)"))
705705
return
706706

707+
# pull the additional email address if exist
708+
uaddress = otks.get(otk, 'uaddress', default=None)
709+
707710
# re-open the database as "admin"
708711
if self.user != 'admin':
709712
self.client.opendb('admin')
@@ -726,8 +729,11 @@ def handle(self):
726729
return
727730

728731
# user info
729-
address = self.db.user.get(uid, 'address')
730732
name = self.db.user.get(uid, 'username')
733+
if uaddress is None:
734+
address = self.db.user.get(uid, 'address')
735+
else:
736+
address = uaddress
731737

732738
# send the email
733739
tracker_name = self.db.config.TRACKER_NAME
@@ -770,7 +776,7 @@ def handle(self):
770776
otk = ''.join([random.choice(chars) for x in range(32)])
771777
while otks.exists(otk):
772778
otk = ''.join([random.choice(chars) for x in range(32)])
773-
otks.set(otk, uid=uid)
779+
otks.set(otk, uid=uid, uaddress=address)
774780
self.db.commit()
775781

776782
# send the email

0 commit comments

Comments
 (0)