X-Git-Url: https://git.adam-barratt.org.uk/?p=mirror%2Fuserdir-ldap.git;a=blobdiff_plain;f=ud-useradd;h=fcda26f055120a3ec93e97dd172cc6ea8c26bdf7;hp=d14edee2e4b7cb6818f292717a9e6a67a97f91ff;hb=HEAD;hpb=db0949115e2a549d3e8f5a71852422b853327293 diff --git a/ud-useradd b/ud-useradd index d14edee..fcda26f 100755 --- a/ud-useradd +++ b/ud-useradd @@ -51,7 +51,7 @@ def ShouldIgnoreID(uid): # search through all UIDs. def GetFreeID(l): Attrs = l.search_s(BaseBaseDn,ldap.SCOPE_SUBTREE, - "uidNumber=*",["uidNumber", "gidNumber", "uid"]); + "(|(uidNumber=*)(gidNumber=*))",["uidNumber", "gidNumber", "uid"]); HighestUID = 0; gids = []; uids = []; @@ -390,7 +390,7 @@ if Update == 1 and ForceMail == 0: # Send the Welcome message print "Sending Welcome Email" -templatepath = TemplatesDir + "/welcome-message-%d" % int(gidNumber) +templatepath = TemplatesDir + "/welcome-message-%s" % supplementaryGid if not os.path.exists(templatepath): templatepath = TemplatesDir + "/welcome-message" Reply = TemplateSubst(Subst,open(templatepath, "r").read())