diff roundup/password.py @ 2098:18addf2a8596

Implemented proper datatypes in mysql and postgresql backends... ...(well, sqlite too, but that doesn't care). Probably should use BOOLEAN instead of INTEGER for the Boolean props. Need to fix a bizzaro MySQL error (gee, how unusual) Need to finish MySQL migration from "version 1" database schemas.
author Richard Jones <richard@users.sourceforge.net>
date Mon, 22 Mar 2004 07:45:40 +0000
parents fc52d57c6c3e
children c9e52addda42
line wrap: on
line diff
--- a/roundup/password.py	Mon Mar 22 00:28:04 2004 +0000
+++ b/roundup/password.py	Mon Mar 22 07:45:40 2004 +0000
@@ -15,7 +15,7 @@
 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
 # 
-# $Id: password.py,v 1.11 2004-02-11 23:55:08 richard Exp $
+# $Id: password.py,v 1.12 2004-03-22 07:45:39 richard Exp $
 
 """Password handling (encoding, decoding).
 """
@@ -82,13 +82,15 @@
     default_scheme = 'SHA'        # new encryptions use this scheme
     pwre = re.compile(r'{(\w+)}(.+)')
 
-    def __init__(self, plaintext=None, scheme=None):
+    def __init__(self, plaintext=None, scheme=None, encrypted=None):
         '''Call setPassword if plaintext is not None.'''
         if scheme is None:
             scheme = self.default_scheme
         if plaintext is not None:
             self.password = encodePassword(plaintext, self.default_scheme)
             self.scheme = self.default_scheme
+        elif encrypted is not None:
+            self.unpack(encrypted)
         else:
             self.password = None
             self.scheme = self.default_scheme

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