diff options
Diffstat (limited to 'pinyadmin/sbin')
-rwxr-xr-x | pinyadmin/sbin/newuser | 18 |
1 files changed, 18 insertions, 0 deletions
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 <<END; +To: $dest +Subject: Creating piny account $username +Content-type: text/plain; charset=us-ascii + +A new piny account ``$username'' has been created. + +Email: $email +END +close( MAIL ); + my @saltchars = ( 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z' , 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z' |