if Res == "":
break;
+Attrs = l.search_s(BaseDn,ldap.SCOPE_ONELEVEL,"keyfingerprint=" + Keys[0][1]);
+if len(Attrs) != 0:
+ print "*** This key already belongs to",GetAttr(Attrs[0],"uid");
+ account = GetAttr(Attrs[0],"uid");
+
# Try to get a uniq account name
Update=0
while 1:
print "Randomizing and encrypting password"
Password = GenPass();
Pass = HashPass(Password);
- print "PASS: ", Password;
# Use GPG to encrypt it, pass the fingerprint to ID it
CryptedPass = GPGEncrypt("Your new password is '" + Password + "'\n",\
Subst["__PRIVATE__"] = privsub;
Subst["__EMAIL__"] = email;
Subst["__PASSWORD__"] = CryptedPass;
-Subst["__LISTPASS__"] = string.strip(open(pwd.getpwuid(os.getuid())[5]+"/.debian-lists_passwd","r").read());
+#Subst["__LISTPASS__"] = string.strip(open(pwd.getpwuid(os.getuid())[5]+"/.debian-lists_passwd","r").read());
# Generate the LDAP request
Rec = [(ldap.MOD_REPLACE,"uid",account),