+ Attrs[0][1]["userpassword"] = [Pass];
+ continue;
+
+ # Randomize password
+ if Response == 'R' and RootMode == 1:
+ Resp = raw_input("Randomize Users Password? [no/yes]");
+ if Resp != "yes":
+ continue;
+
+ # Generate a random password
+ try:
+ Password = GenPass();
+ Pass = HashPass(Password);
+ except:
+ print "%s: %s\n" %(sys.exc_type,sys.exc_value);
+ raw_input("Press a key");
+ continue;
+
+ print "Setting password..";
+ Pass = "{crypt}" + Pass;
+ l.modify_s(UserDn,[(ldap.MOD_REPLACE,"userpassword",Pass)]);
+ Attrs[0][1]["userpassword"] = [Pass];