From 738c966170c4374b4dfdab6adafd1ec0c85f16bb Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Sat, 9 Jan 2010 00:16:37 +0100 Subject: [PATCH] ud-useradd: If we do not have a template for a specific group, use the general purpose template file (welcome-message). --- debian/changelog | 4 +++- ud-useradd | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) 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); -- 2.20.1