diff roundup/password.py @ 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 83f33642d220
children
line wrap: on
line diff
--- 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/