X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=ud-useradd;h=419ae6ad625d6642060bd35b97fa91b893568acc;hb=0817bf289487078799dd6c6967795e744726cb92;hp=415b58026d0f31fbd845d6f9fa837a0a68fabf4f;hpb=7140eb079539afc12a2227e248c99eeb3a3cb483;p=mirror%2Fuserdir-ldap.git diff --git a/ud-useradd b/ud-useradd index 415b580..419ae6a 100755 --- a/ud-useradd +++ b/ud-useradd @@ -57,22 +57,7 @@ for (switch, val) in options: elif (switch == '-a'): userdir_gpg.GPGKeyRings = OldGPGKeyRings; -print "Accessing LDAP directory as '" + AdminUser + "'"; -while (1): - Password = getpass(AdminUser + "'s password: "); - - if len(Password) == 0: - sys.exit(0) - - l = ldap.open(LDAPServer); - UserDn = "uid=" + AdminUser + "," + BaseDn; - - # Connect to the ldap server - try: - l.simple_bind_s(UserDn,Password); - except ldap.INVALID_CREDENTIALS: - continue - break +l = passwdAccessLDAP(LDAPServer, BaseDn, AdminUser) # Locate the key of the user we are adding SetKeyrings(["/org/keyring.debian.org/keyrings/debian-keyring.gpg"]) @@ -112,7 +97,7 @@ uidNumber = 0; # Decide if we should use IDEA encryption UsePGP2 = 0; while len(Keys[0][1]) < 40: - Res = raw_input("Use PGP2.x compatibility [no]? "); + Res = raw_input("Use PGP2.x compatibility [No/yes]? "); if Res == "yes": UsePGP2 = 1; break; @@ -175,7 +160,7 @@ if Res != "": # GID Res = raw_input("Group ID Number [" + gidNumber + "]? "); if Res != "": - gidNumber = Group2GID(Res); + gidNumber = Group2GID(l, Res); # UID if uidNumber == 0: