ud-useradd: If we do not have a template for a specific group, use the general purpos...
authorPeter Palfrader <peter@palfrader.org>
Fri, 8 Jan 2010 23:16:37 +0000 (00:16 +0100)
committerPeter Palfrader <peter@palfrader.org>
Fri, 8 Jan 2010 23:16:37 +0000 (00:16 +0100)
debian/changelog
ud-useradd

index 3270cc8..cbf03df 100644 (file)
@@ -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 <weasel@debian.org>  Sat, 09 Jan 2010 00:15:34 +0100
+ -- Peter Palfrader <weasel@debian.org>  Sat, 09 Jan 2010 00:16:26 +0100
 
 userdir-ldap (0.3.75) unstable; urgency=low
 
index c183dca..ee04983 100755 (executable)
@@ -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);