[Limacute-commit] r207 - trunk/tools/csv2ldap
jhf at projects.linpro.no
jhf at projects.linpro.no
Thu Jun 21 11:04:16 CEST 2007
Author: jhf
Date: 2007-06-21 11:04:15 +0200 (Thu, 21 Jun 2007)
New Revision: 207
Modified:
trunk/tools/csv2ldap/csv2ldap.py
Log:
Added support for cleartext passwords.
Modified: trunk/tools/csv2ldap/csv2ldap.py
===================================================================
--- trunk/tools/csv2ldap/csv2ldap.py 2007-06-19 07:17:58 UTC (rev 206)
+++ trunk/tools/csv2ldap/csv2ldap.py 2007-06-21 09:04:15 UTC (rev 207)
@@ -51,6 +51,7 @@
parser = OptionParser()
parser.add_option("--dry",action="store_true",default=False,help="Print actions, don't do them")
+parser.add_option("--cleartext",action="store_true",default=False,help="Store passwords as cleartext in ldap.")
parser.add_option("--log", metavar="PATH",default="csv2ldap.log",type="string",help="The path to the log file.")
parser.add_option("--csv", metavar="PATH",type="string",help="""The path to the csv file with users.
The file must be comma separated, the first line must contain headers.
@@ -224,7 +225,10 @@
password = generate_random()
user['password'] = password
log("Made random password %(password)s for user %(mail)s" % user)
- user['userPassword'] = digest_password(user['password'])
+ if options.cleartext:
+ user['userPassword'] = user['password']
+ else:
+ user['userPassword'] = digest_password(user['password'])
del(user['password'])
# Ensure proper objectClass
user['objectClass']=['top','inetOrgPerson','kolabInetOrgPerson']
More information about the Limacute-commit
mailing list