From: Peter Palfrader Date: Fri, 8 Jan 2010 23:16:37 +0000 (+0100) Subject: ud-useradd: If we do not have a template for a specific group, use the general purpos... X-Git-Tag: userdir-ldap-0.3.76~13 X-Git-Url: https://git.adam-barratt.org.uk/?p=mirror%2Fuserdir-ldap.git;a=commitdiff_plain;h=738c966170c4374b4dfdab6adafd1ec0c85f16bb ud-useradd: If we do not have a template for a specific group, use the general purpose template file (welcome-message). --- diff --git a/debian/changelog b/debian/changelog index 3270cc8..cbf03df 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,8 +3,10 @@ userdir-ldap (0.3.76xXx) unstable; urgency=low * ud-generate: Export groups even if nobody has that group as a supplementary group, as long as there are users that have it as a primary group. + * ud-useradd: If we do not have a template for a specific group, use the + general purpose template file (welcome-message). - -- Peter Palfrader Sat, 09 Jan 2010 00:15:34 +0100 + -- Peter Palfrader Sat, 09 Jan 2010 00:16:26 +0100 userdir-ldap (0.3.75) unstable; urgency=low diff --git a/ud-useradd b/ud-useradd index c183dca..ee04983 100755 --- a/ud-useradd +++ b/ud-useradd @@ -326,7 +326,10 @@ if Update == 1 and ForceMail == 0: # Send the Welcome message print "Sending Welcome Email" -Reply = TemplateSubst(Subst,open(TemplatesDir + "/welcome-message-%d" % int(gidNumber), "r").read()) +templatepath = TemplatesDir + "/welcome-message-%d" % int(gidNumber) +if not os.path.exists(templatepath): + templatepath = TemplatesDir + "/welcome-message" +Reply = TemplateSubst(Subst,open(templatepath, "r").read()) Child = os.popen("/usr/sbin/sendmail -t","w"); #Child = os.popen("cat","w"); Child.write(Reply);