[Astpp-commit] SF.net SVN: astpp:[2250] trunk
Brought to you by:
darrenkw
From: <dar...@us...> - 2009-05-16 00:39:10
|
Revision: 2250 http://astpp.svn.sourceforge.net/astpp/?rev=2250&view=rev Author: darrenkw Date: 2009-05-16 00:38:57 +0000 (Sat, 16 May 2009) Log Message: ----------- Fixed the code that emails out account details on account/device creation. Modified Paths: -------------- trunk/scripts/astpp-common.pl trunk/web_interface/astpp-admin.cgi Modified: trunk/scripts/astpp-common.pl =================================================================== --- trunk/scripts/astpp-common.pl 2009-05-15 23:57:25 UTC (rev 2249) +++ trunk/scripts/astpp-common.pl 2009-05-16 00:38:57 UTC (rev 2250) @@ -541,13 +541,15 @@ To => $vars->{email}, From => $config->{company_email}, Bcc => $config->{company_email}, - Subject => 'VOIP Account Created', + Subject => 'VOIP Device Account Created', 'X-Mailer' => "Mail::Sendmail version $Mail::Sendmail::VERSION", ); $mail{'Message : '} = "Attention: $vars->{title} $vars->{first} $vars->{last}\n" . "A new device has been enabled on your account. Here\n" . "is the necessary configuration information.\n\n" + . "Username: $vars->{extension}\n" + . "Password: $vars->{secret}\n\n" . "------- $config->{company_name} Configuration Info --------\n"; if ( $vars->{type} eq "SIP" ) { @@ -628,6 +630,7 @@ if ( sendmail %mail ) { print STDERR "Mail sent OK.\n" } else { print STDERR "Error sending mail: $Mail::Sendmail::error \n" } print STDERR "\n\$Mail::Sendmail::log says:\n", $Mail::Sendmail::log; + print STDERR $mail{'Message : '}; } # Send an email when on calling card creation. This needs to be updated and moved to templates which reside in the database and can be Modified: trunk/web_interface/astpp-admin.cgi =================================================================== --- trunk/web_interface/astpp-admin.cgi 2009-05-15 23:57:25 UTC (rev 2249) +++ trunk/web_interface/astpp-admin.cgi 2009-05-16 00:38:57 UTC (rev 2250) @@ -2310,6 +2310,8 @@ $params->{posttoexternal} ); } if ( $config->{email} == 1 && $params->{accounttype} == 0 ) { + $params->{extension} = $params->{number}; + $params->{secret} = $params->{accountpassword}; &email_add_user( $astpp_db, '', $config, $params ); } my $timestamp = &prettytimestamp; @@ -2408,6 +2410,12 @@ $params, $accountinfo->{cc} ); $status .= "<br>"; + if ( $config->{email} == 1 && $params->{accounttype} == 0 ) { + $params->{extension} = $name; + $params->{secret} = $params->{accountpassword}; + &email_add_device( $astpp_db, '', $config, $params ); + print STDERR "Sent Device Generation Email\n"; + } } if ( $config->{users_dids_amp} == 1 ) { my $name = @@ -2420,6 +2428,12 @@ $params, $accountinfo->{cc} ); $status .= "<br>"; + if ( $config->{email} == 1 && $params->{accounttype} == 0 ) { + $params->{extension} = $name; + $params->{secret} = $params->{accountpassword}; + &email_add_device( $astpp_db, '', $config, $params ); + print STDERR "Sent Device Generation Email\n"; + } } if ( $config->{openser} == 1 ) { $status .= $status .= @@ -2427,6 +2441,12 @@ $params->{accountpassword}, $params->{context}, $params->{number}, $params ); $status .= "<br>"; + if ( $config->{email} == 1 && $params->{accounttype} == 0 ) { + $params->{extension} = $name; + $params->{secret} = $params->{accountpassword}; + &email_add_device( $astpp_db, '', $config, $params ); + print STDERR "Sent Device Generation Email\n"; + } } if ( $config->{users_dids_freeswitch} == 1 ) { my $name = @@ -2437,6 +2457,12 @@ $params->{accountpassword}, $params->{number}, $params, $accountinfo->{cc} ); $status .= "<br>"; + if ( $config->{email} == 1 && $params->{accounttype} == 0 ) { + $params->{extension} = $name; + $params->{secret} = $params->{accountpassword}; + &email_add_device( $astpp_db, '', $config, $params ); + print STDERR "Sent Device Generation Email\n"; + } } } if ( $params->{IAX2} ) { @@ -2453,6 +2479,12 @@ $params, $accountinfo->{cc} ); $status .= "<br>"; + if ( $config->{email} == 1 && $params->{accounttype} == 0 ) { + $params->{extension} = $name; + $params->{secret} = $params->{accountpassword}; + &email_add_device( $astpp_db, '', $config, $params ); + print STDERR "Sent Device Generation Email\n"; + } } if ( $config->{users_dids_rt} == 1 ) { my $name = &finduniqueiax_rt( $params->{number} ); @@ -2463,6 +2495,12 @@ $params, $accountinfo->{cc} ); $status .= "<br>"; + if ( $config->{email} == 1 && $params->{accounttype} == 0 ) { + $params->{extension} = $name; + $params->{secret} = $params->{accountpassword}; + &email_add_device( $astpp_db, '', $config, $params ); + print STDERR "Sent Device Generation Email\n"; + } } } ### End of Device creation support This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |