From 68b72fa62aadbda4e48a4f9075b332583c5b5338 Mon Sep 17 00:00:00 2001 From: Julian Blake Kongslie Date: Wed, 27 Apr 2011 19:22:52 -0700 Subject: Notification emails for new users. --- pinyadmin/sbin/newuser | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'pinyadmin/sbin') diff --git a/pinyadmin/sbin/newuser b/pinyadmin/sbin/newuser index a6bcf4d..eeb5617 100755 --- a/pinyadmin/sbin/newuser +++ b/pinyadmin/sbin/newuser @@ -5,6 +5,7 @@ use warnings; use Email::Valid::Loose qw( ); +use Piny::Config; use Piny::User; my ( $email, $username, $password ); @@ -125,6 +126,23 @@ if ( not defined $password or $password eq "" ) { print "Password is undefi # Here on down is the actual creation code. +my $config = Piny::Config->new( ); +my $dest = $config->piny_newuseremail; + +unless( open( MAIL, "|/usr/lib/sendmail -t" ) ) { + die "Couldn't execute sendmail: $!\n"; +}; +print MAIL <