X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=ud-useradd;h=f5c1fbcf8b48805a364672e75b6cd329bf98e1f0;hb=c626017071b2de3c4623df898dcf0e16f25e7272;hp=e128a9bdf88032e94bb2ee2acfedb2c9909574dd;hpb=299412a1f71d10d071eb3d4833d0649b47911b79;p=mirror%2Fuserdir-ldap.git diff --git a/ud-useradd b/ud-useradd index e128a9b..f5c1fbc 100755 --- a/ud-useradd +++ b/ud-useradd @@ -19,7 +19,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -import string, re, time, ldap, getopt, sys, os, pwd; +import re, time, ldap, getopt, sys, os, pwd; from userdir_ldap import *; from userdir_gpg import *; @@ -70,7 +70,7 @@ for (switch, val) in options: l = passwdAccessLDAP(LDAPServer, BaseDn, AdminUser) # Locate the key of the user we are adding -SetKeyrings(["/org/keyring.debian.org/keyrings/debian-keyring.gpg"]) +SetKeyrings(ConfModule.add_keyrings.split(":")) while (1): Foo = raw_input("Who are you going to add (for a GPG search)? "); if Foo == "": @@ -248,8 +248,7 @@ sys.stdout.flush(); if Update == 0: # New account Details = [("uid",account), - ("objectClass", - ("top","inetOrgPerson","debianAccount","shadowAccount","debianDeveloper")), + ("objectClass", UserObjectClasses), ("uidNumber",str(uidNumber)), ("gidNumber",str(gidNumber)), ("gecos",FullName+",,,,"), @@ -271,7 +270,7 @@ if Update == 0: #Add user group if needed, then the actual user: if UserGroup == 1: Dn = "gid=" + account + "," + BaseDn; - l.add_s(Dn,[("gid",account), ("gidNumber",str(gidNumber)), ("objectClass",("top", "debianGroup"))]); + l.add_s(Dn,[("gid",account), ("gidNumber",str(gidNumber)), ("objectClass", GroupObjectClasses)]) l.add_s(Dn,Details); else: @@ -307,7 +306,7 @@ if Update == 1 and ForceMail == 0: # Send the Welcome message print "Sending Welcome Email" -Reply = TemplateSubst(Subst,open(TemplatesDir+"/welcome-message-"+gidNumber,"r").read()); +Reply = TemplateSubst(Subst,open(TemplatesDir + "/welcome-message-%d" % gidNumber, "r").read()) Child = os.popen("/usr/sbin/sendmail -t","w"); #Child = os.popen("cat","w"); Child.write(Reply);