changeset 1616:6d1af2e441f4 maint-0.5

email registered users shouldn't be able to log in [SF#714673]
author Richard Jones <richard@users.sourceforge.net>
date Thu, 24 Apr 2003 07:51:52 +0000
parents d4f4061e6d1d
children 0b30d6f0ec24
files CHANGES.txt roundup/mailgw.py roundup/password.py
diffstat 3 files changed, 12 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/CHANGES.txt	Thu Apr 24 06:58:05 2003 +0000
+++ b/CHANGES.txt	Thu Apr 24 07:51:52 2003 +0000
@@ -11,6 +11,7 @@
 - fixed rdbms email address lookup (case insensitivity)
 - email file attachments added to issue files list (sf bug 711501)
 - added socket timeout to attempt to prevent stuck processes (sf bug 665487)
+- email registered users shouldn't be able to log in (sf bug 714673)
 
 
 2003-02-27 0.5.6
--- a/roundup/mailgw.py	Thu Apr 24 06:58:05 2003 +0000
+++ b/roundup/mailgw.py	Thu Apr 24 07:51:52 2003 +0000
@@ -73,7 +73,7 @@
 an exception, the original message is bounced back to the sender with the
 explanatory message given in the exception. 
 
-$Id: mailgw.py,v 1.104.2.2 2003-04-23 12:10:51 richard Exp $
+$Id: mailgw.py,v 1.104.2.3 2003-04-24 07:49:31 richard Exp $
 '''
 
 import string, re, os, mimetools, cStringIO, smtplib, socket, binascii, quopri
@@ -839,12 +839,12 @@
         # attach the files to the issue
         if nodeid:
             # extend the existing files list
-            fileprop = cl.get(nodeid, 'file')
+            fileprop = cl.get(nodeid, 'files')
             fileprop.extend(files)
             props['files'] = fileprop
         else:
             # pre-load the files list
-            props['files'] = fileprop
+            props['files'] = files
 
 
         # 
@@ -931,7 +931,8 @@
     # couldn't match address or username, so create a new user
     if create:
         return db.user.create(username=address, address=address,
-            realname=realname, roles=db.config.NEW_EMAIL_USER_ROLES)
+            realname=realname, roles=db.config.NEW_EMAIL_USER_ROLES,
+            password=password.Password(password.generatePassword()))
     else:
         return 0
 
--- a/roundup/password.py	Thu Apr 24 06:58:05 2003 +0000
+++ b/roundup/password.py	Thu Apr 24 07:51:52 2003 +0000
@@ -15,13 +15,13 @@
 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
 # 
-# $Id: password.py,v 1.8 2002-12-18 23:57:09 richard Exp $
+# $Id: password.py,v 1.8.2.1 2003-04-24 07:49:33 richard Exp $
 
 __doc__ = """
 Password handling (encoding, decoding).
 """
 
-import sha, re, string
+import sha, re, string, random
 try:
     import crypt
 except:
@@ -48,6 +48,10 @@
         raise ValueError, 'Unknown encryption scheme "%s"'%scheme
     return s
 
+def generatePassword(length=8):
+    chars = string.letters+string.digits
+    return ''.join([random.choice(chars) for x in range(length)])
+
 class Password:
     '''The class encapsulates a Password property type value in the database. 
 

Roundup Issue Tracker: http://roundup-tracker.org/