summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ANNOUCE.1.4.03
-rw-r--r--FS/FS/Conf.pm11
-rw-r--r--FS/FS/Record.pm14
-rw-r--r--FS/FS/cust_main.pm13
-rw-r--r--FS/FS/cust_main_invoice.pm15
-rw-r--r--FS/FS/svc_acct.pm17
-rw-r--r--FS/FS/svc_acct_pop.pm8
-rw-r--r--README.1.4.0pre122
-rwxr-xr-xbin/populate-msgcat51
-rwxr-xr-xfs_signup/FS-SignupClient/cgi/signup.cgi39
-rwxr-xr-xfs_signup/FS-SignupClient/cgi/signup.html18
-rw-r--r--fs_signup/FS-SignupClient/cgi/success.html7
-rwxr-xr-xfs_signup/fs_signup_server55
-rwxr-xr-xhttemplate/browse/msgcat.cgi2
-rw-r--r--httemplate/docs/signup.html32
-rw-r--r--httemplate/docs/upgrade8.html1
-rwxr-xr-xhttemplate/edit/msgcat.cgi7
-rw-r--r--httemplate/edit/process/msgcat.cgi1
18 files changed, 210 insertions, 86 deletions
diff --git a/ANNOUCE.1.4.0 b/ANNOUCE.1.4.0
index c1da9dd4c..86f48b6df 100644
--- a/ANNOUCE.1.4.0
+++ b/ANNOUCE.1.4.0
@@ -117,5 +117,6 @@ new export! (well, almost)
icradius groups (usergroup table if not radgroupreply & radgroupcheck)
-message catalogs (infrastructure, anyway)
+message catalogs (infrastructure, anyway) & anything which gets sent to a
+customer from the signup server should use message catalog
diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm
index 14dce1abf..0c41980ea 100644
--- a/FS/FS/Conf.pm
+++ b/FS/FS/Conf.pm
@@ -272,7 +272,7 @@ httemplate/docs/config.html
'key' => 'business-onlinepayment-description',
'section' => 'billing',
'description' => 'String passed as the description field to <a href="http://search.cpan.org/search?mode=module&query=Business%3A%3AOnlinePayment">Business::OnlinePayment</a>. Evaluated as a double-quoted perl string, with the following variables available: <code>$agent</code> (the agent name), and <code>$pkgs</code> (a comma-separated list of packages to which the invoiced being charged applies)',
- 'type' => 'textarea',
+ 'type' => 'text',
},
{
@@ -888,6 +888,15 @@ httemplate/docs/config.html
'type' => 'checkbox',
},
+ {
+ 'key' => 'signup_server-realtime',
+ 'section' => '',
+ 'description' => 'Run billing for signup server signups immediately, and suspend accounts which subsequently have a balance.',
+ 'type' => 'checkbox',
+ },
+
+
+
);
1;
diff --git a/FS/FS/Record.pm b/FS/FS/Record.pm
index ff967817a..acdebcadc 100644
--- a/FS/FS/Record.pm
+++ b/FS/FS/Record.pm
@@ -12,6 +12,7 @@ use DBI qw(:sql_types);
use DBIx::DBSchema 0.19;
use FS::UID qw(dbh checkruid getotaker datasrc driver_name);
use FS::SearchCache;
+use FS::msgcat qw(gettext);
@ISA = qw(Exporter);
@EXPORT_OK = qw(dbh fields hfields qsearch qsearchs dbdef jsearch);
@@ -825,7 +826,8 @@ false.
sub ut_text {
my($self,$field)=@_;
$self->getfield($field) =~ /^([\w \!\@\#\$\%\&\(\)\-\+\;\:\'\"\,\.\?\/]+)$/
- or return "Illegal or empty (text) $field: ". $self->getfield($field);
+ or return gettext('illegal_or_empty_text'). " $field: ".
+ $self->getfield($field);
$self->setfield($field,$1);
'';
}
@@ -841,7 +843,7 @@ May be null. If there is an error, returns the error, otherwise returns false.
sub ut_textn {
my($self,$field)=@_;
$self->getfield($field) =~ /^([\w \!\@\#\$\%\&\(\)\-\+\;\:\'\"\,\.\?\/]*)$/
- or return "Illegal (text) $field: ". $self->getfield($field);
+ or return gettext('illegal_text'). " $field: ". $self->getfield($field);
$self->setfield($field,$1);
'';
}
@@ -896,7 +898,7 @@ sub ut_phonen {
} elsif ( $country eq 'US' || $country eq 'CA' ) {
$phonen =~ s/\D//g;
$phonen =~ /^(\d{3})(\d{3})(\d{4})(\d*)$/
- or return "Illegal (phone) $field: ". $self->getfield($field);
+ or return gettext('illegal_phone'). " $field: ". $self->getfield($field);
$phonen = "$1-$2-$3";
$phonen .= " x$4" if $4;
$self->setfield($field,$phonen);
@@ -965,7 +967,7 @@ May not be null.
sub ut_name {
my( $self, $field ) = @_;
$self->getfield($field) =~ /^([\w \,\.\-\']+)$/
- or return "Illegal (name) $field: ". $self->getfield($field);
+ or return gettext('illegal_name'). " $field: ". $self->getfield($field);
$self->setfield($field,$1);
'';
}
@@ -980,12 +982,12 @@ sub ut_zip {
my( $self, $field, $country ) = @_;
if ( $country eq 'US' ) {
$self->getfield($field) =~ /\s*(\d{5}(\-\d{4})?)\s*$/
- or return "Illegal (zip) $field for country $country: ".
+ or return gettext('illegal_zip'). " $field for country $country: ".
$self->getfield($field);
$self->setfield($field,$1);
} else {
$self->getfield($field) =~ /^\s*(\w[\w\-\s]{2,8}\w)\s*$/
- or return "Illegal (zip) $field: ". $self->getfield($field);
+ or return gettext('illegal_zip'). " $field: ". $self->getfield($field);
$self->setfield($field,$1);
}
'';
diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm
index 499d149a6..e1a51732f 100644
--- a/FS/FS/cust_main.pm
+++ b/FS/FS/cust_main.pm
@@ -26,6 +26,7 @@ use FS::queue;
use FS::part_pkg;
use FS::part_bill_event;
use FS::cust_bill_event;
+use FS::msgcat qw(gettext);
@ISA = qw( FS::Record );
@@ -643,12 +644,13 @@ sub check {
my $payinfo = $self->payinfo;
$payinfo =~ s/\D//g;
$payinfo =~ /^(\d{13,16})$/
- or return "Illegal credit card number: ". $self->payinfo;
+ or return gettext('invalid_catd'); # . ": ". $self->payinfo;
$payinfo = $1;
$self->payinfo($payinfo);
validate($payinfo)
- or return "Illegal credit card number: ". $self->payinfo;
- return "Unknown card type" if cardtype($self->payinfo) eq "Unknown";
+ or return gettext('invalid_catd'); # . ": ". $self->payinfo;
+ return gettext('unknown_card_type')
+ if cardtype($self->payinfo) eq "Unknown";
} elsif ( $self->payby eq 'BILL' ) {
@@ -690,7 +692,7 @@ sub check {
$self->payname( $self->first. " ". $self->getfield('last') );
} else {
$self->payname =~ /^([\w \,\.\-\']+)$/
- or return "Illegal billing name: ". $self->payname;
+ or return gettext('illegal_name'). " payname: ". $self->payname;
$self->payname($1);
}
@@ -1153,6 +1155,9 @@ sub collect {
qsearch('part_bill_event', { 'payby' => $self->payby,
'disabled' => '', } )
) {
+
+ last unless $cust_bill->owed > 0; #don't run subsequent events if owed=0
+
warn "calling invoice event (". $part_bill_event->eventcode. ")\n"
if $Debug;
my $cust_main = $self; #for callback
diff --git a/FS/FS/cust_main_invoice.pm b/FS/FS/cust_main_invoice.pm
index ebbadc6d9..b82e2e732 100644
--- a/FS/FS/cust_main_invoice.pm
+++ b/FS/FS/cust_main_invoice.pm
@@ -7,6 +7,7 @@ use FS::Record qw( qsearchs );
use FS::Conf;
use FS::cust_main;
use FS::svc_acct;
+use FS::msgcat qw(gettext);
@ISA = qw( FS::Record );
@@ -111,10 +112,12 @@ sub check {
=item checkdest
-Checks the dest field only. If it finds that the account ends in the
-same domain configured as the B<domain> configuration file, it will change the
-invoice destination from an email address to a service number (see
-L<FS::svc_acct>).
+Checks the dest field only.
+
+#If it finds that the account ends in the
+#same domain configured as the B<domain> configuration file, it will change the
+#invoice destination from an email address to a service number (see
+#L<FS::svc_acct>).
=cut
@@ -140,7 +143,7 @@ sub checkdest {
# }
$self->dest("$1\@$2");
} else {
- return "Illegal destination!";
+ return gettext("illegal_email_invoice_address");
}
''; #no error
@@ -167,7 +170,7 @@ sub address {
=head1 VERSION
-$Id: cust_main_invoice.pm,v 1.10 2002-02-10 17:02:37 ivan Exp $
+$Id: cust_main_invoice.pm,v 1.11 2002-04-10 13:42:48 ivan Exp $
=head1 BUGS
diff --git a/FS/FS/svc_acct.pm b/FS/FS/svc_acct.pm
index 8e25f6afc..030ffbe19 100644
--- a/FS/FS/svc_acct.pm
+++ b/FS/FS/svc_acct.pm
@@ -28,6 +28,7 @@ use FS::svc_domain;
use FS::raddb;
use FS::queue;
use FS::radius_usergroup;
+use FS::msgcat qw(gettext);
@ISA = qw( FS::svc_Common );
@@ -262,7 +263,7 @@ sub insert {
$error = $self->check;
return $error if $error;
- return "Username ". $self->username. " in use"
+ return gettext('username_in_use'). ": ". $self->username
if qsearchs( 'svc_acct', { 'username' => $self->username,
'domsvc' => $self->domsvc,
} );
@@ -1088,24 +1089,24 @@ sub check {
my $ulen = $usernamemax || $self->dbdef_table->column('username')->length;
if ( $username_uppercase ) {
$recref->{username} =~ /^([a-z0-9_\-\.\&]{$usernamemin,$ulen})$/i
- or return "Illegal username: ". $recref->{username};
+ or return gettext('illegal_username'). ": ". $recref->{username};
$recref->{username} = $1;
} else {
$recref->{username} =~ /^([a-z0-9_\-\.\&]{$usernamemin,$ulen})$/
- or return "Illegal username: ". $recref->{username};
+ or return gettext('illegal_username'). ": ". $recref->{username};
$recref->{username} = $1;
}
if ( $username_letterfirst ) {
- $recref->{username} =~ /^[a-z]/ or return "Illegal username";
+ $recref->{username} =~ /^[a-z]/ or return gettext('illegal_username');
} elsif ( $username_letter ) {
- $recref->{username} =~ /[a-z]/ or return "Illegal username";
+ $recref->{username} =~ /[a-z]/ or return gettext('illegal_username');
}
if ( $username_noperiod ) {
- $recref->{username} =~ /\./ and return "Illegal username";
+ $recref->{username} =~ /\./ and return gettext('illegal_username');
}
unless ( $username_ampersand ) {
- $recref->{username} =~ /\&/ and return "Illegal username";
+ $recref->{username} =~ /\&/ and return gettext('illegal_username');
}
$recref->{popnum} =~ /^(\d*)$/ or return "Illegal popnum: ".$recref->{popnum};
@@ -1221,7 +1222,7 @@ sub check {
$recref->{_password} = '!!';
} else {
#return "Illegal password";
- return "Illegal password: ". $recref->{_password};
+ return gettext('illegal_password'). ": ". $recref->{_password};
}
''; #no error
diff --git a/FS/FS/svc_acct_pop.pm b/FS/FS/svc_acct_pop.pm
index fa4f5c670..3c9ea0130 100644
--- a/FS/FS/svc_acct_pop.pm
+++ b/FS/FS/svc_acct_pop.pm
@@ -121,6 +121,8 @@ sub text {
=cut
+#horrible false laziness with signup.cgi (pull special-case for 0 & 1
+# pop code out from signup.cgi??)
sub popselector {
my( $popnum, $state ) = @_;
@@ -180,14 +182,16 @@ END
=head1 VERSION
-$Id: svc_acct_pop.pm,v 1.6 2001-12-18 06:29:30 ivan Exp $
+$Id: svc_acct_pop.pm,v 1.7 2002-04-10 13:42:48 ivan Exp $
=head1 BUGS
It should be renamed to part_pop.
popselector? putting web ui components in here? they should probably live
-somewhere else...
+somewhere else...
+
+popselector: pull special-case for 0 & 1 pop code out from signup.cgi
=head1 SEE ALSO
diff --git a/README.1.4.0pre12 b/README.1.4.0pre12
index 72353ba4c..ea1f95229 100644
--- a/README.1.4.0pre12
+++ b/README.1.4.0pre12
@@ -40,6 +40,8 @@ Run bin/dbdef-create again
Run bin/populate-msgcat
+Set the `locale' configuration option to `en_US'.
+
the mxmachines, nsmachines, arecords and cnamerecords configuration values have been deprecated. Use the defaultrecords configuration value instead.
New export code has landed! If you were using the icradiusmachines,
diff --git a/bin/populate-msgcat b/bin/populate-msgcat
index 51f04c10f..5d6e85aea 100755
--- a/bin/populate-msgcat
+++ b/bin/populate-msgcat
@@ -27,6 +27,8 @@ foreach my $msgcode ( keys %messages ) {
}
}
+print "Message catalog initialized sucessfully\n";
+
sub messages {
# 'msgcode' => {
@@ -51,6 +53,55 @@ sub messages {
'en_US' => 'Not a ',
},
+ 'empty_password' => {
+ 'en_US' => 'Empty password',
+ },
+
+ 'no_access_number_selected' => {
+ 'en_US' => 'No access number selected',
+ },
+
+ 'illegal_text' => {
+ 'en_US' => 'Illegal (text)',
+ #'en_US' => 'Only letters, numbers, spaces, and the following punctuation symbols are permitted: ! @ # $ % & ( ) - + ; : \' " , . ? / in field',
+ },
+
+ 'illegal_or_empty_text' => {
+ 'en_US' => 'Illegal or empty (text)',
+ #'en_US' => 'Only letters, numbers, spaces, and the following punctuation symbols are permitted: ! @ # $ % & ( ) - + ; : \' " , . ? / in required field',
+ },
+
+ 'illegal_username' => {
+ 'en_US' => 'Illegal username',
+ },
+
+ 'illegal_password' => {
+ 'en_US' => 'Illegal password',
+ },
+
+ 'username_in_use' => {
+ 'en_US' => 'Username in use',
+ },
+
+ 'illegal_email_invoice_address' => {
+ 'en_US' => 'Illegal email invoice address',
+ },
+
+ 'illegal_name' => {
+ 'en_US' => 'Illegal (name)',
+ #'en_US' => 'Only letters, numbers, spaces and the following punctuation symbols are permitted: , . - \' in field',
+ },
+
+ 'illegal_phone' => {
+ 'en_US' => 'Illegal (phone)',
+ #'en_US' => '',
+ },
+
+ 'illegal_zip' => {
+ 'en_US' => 'Illegal (zip)',
+ #'en_US' => '',
+ },
+
);
}
diff --git a/fs_signup/FS-SignupClient/cgi/signup.cgi b/fs_signup/FS-SignupClient/cgi/signup.cgi
index 46621d1e8..284237dbc 100755
--- a/fs_signup/FS-SignupClient/cgi/signup.cgi
+++ b/fs_signup/FS-SignupClient/cgi/signup.cgi
@@ -1,6 +1,6 @@
#!/usr/bin/perl -Tw
#
-# $Id: signup.cgi,v 1.19 2002-04-07 05:56:08 ivan Exp $
+# $Id: signup.cgi,v 1.20 2002-04-10 13:42:48 ivan Exp $
use strict;
use vars qw( @payby $cgi $locales $packages $pops $init_data $error
@@ -15,7 +15,7 @@ use vars qw( @payby $cgi $locales $packages $pops $init_data $error
);
use subs qw( print_form print_okay expselect signup_default success_default );
use CGI;
-use CGI::Carp qw(fatalsToBrowser);
+#use CGI::Carp qw(fatalsToBrowser);
use Text::Template;
use Business::CreditCard;
use HTTP::Headers::UserAgent 2.00;
@@ -230,13 +230,15 @@ sub print_okay {
or die "fatal: invalid password got past FS::SignupClient::new_customer";
my $password = $1;
( $cgi->param('first'). ' '. $cgi->param('last') ) =~ /^(.*)$/
- or die "fatal: invalid email_name got past FS::SignupCLient::new_customer";
+ or die "fatal: invalid email_name got past FS::SignupClient::new_customer";
my $email_name = $1;
my $pop = pop_info($cgi->param('popnum'))
or die "fatal: invalid popnum got past FS::SignupClient::new_customer";
( $ac, $exch, $loc ) = ( $pop->{'ac'}, $pop->{'exch'}, $pop->{'loc'} );
+ my $pkg = ( grep { $_->{'pkgpart'} eq $pkgpart } @$packages )[0]->{'pkg'};
+
if ( $ieak_template
&& $user_agent->platform eq 'ia32'
&& $user_agent->os =~ /^win/
@@ -277,6 +279,12 @@ sub pop_info {
sub popselector {
my( $popnum, $state ) = @_;
+ return '<INPUT TYPE="hidden" NAME="popnum" VALUE="">' unless @$pops;
+ return $pops->[0]{city}. ', '. $pops->[0]{state}.
+ ' ('. $pops->[0]{ac}. ')/'. $pops->[0]{exch}.
+ '<INPUT TYPE="hidden" NAME="popnum" VALUE="'. $pops->[0]{popnum}. '">'
+ if scalar(@$pops) == 1;
+
my %pop = ();
push @{ $pop{$_->{state}} }, $_ foreach @$pops;
@@ -359,6 +367,13 @@ sub success_default { #html to use if you don't specify a success file
<HTML><HEAD><TITLE>Signup successful</TITLE></HEAD>
<BODY BGCOLOR="#e8e8e8"><FONT SIZE=7>Signup successful</FONT><BR><BR>
Thanks for signing up!
+<BR><BR>
+Signup information for <%= $email_name %>:
+<BR><BR>
+Username: <%= $username %><BR>
+Password: <%= $password %><BR>
+Access number: (<%= $ac %>) / $exch - $local<BR>
+Package: <%= $pkg %><BR>
</BODY></HTML>
END
}
@@ -515,13 +530,11 @@ Contact Information
</TR>
<TR>
<TD ALIGN="right">Password</TD>
- <TD><INPUT TYPE="password" NAME="_password" VALUE="<%= $password %>">
- (blank to generate)</TD>
+ <TD><INPUT TYPE="password" NAME="_password" VALUE="<%= $password %>"></TD>
</TR>
<TR>
<TD ALIGN="right">Re-enter Password</TD>
- <TD><INPUT TYPE="password" NAME="_password2" VALUE="<%= $password2 %>">
- </TD>
+ <TD><INPUT TYPE="password" NAME="_password2" VALUE="<%= $password2 %>"></TD>
</TR>
<%=
if ( $init_data->{'security_phrase'} ) {
@@ -536,10 +549,14 @@ ENDOUT
$OUT .= '<INPUT TYPE="hidden" NAME="sec_phrase" VALUE="">';
}
%>
-<TR>
- <TD ALIGN="right">Access number</TD>
- <TD><%= popselector($popnum) %></TD>
-</TR>
+<%=
+ if ( scalar(@$pops) ) {
+ $OUT .= '<TR><TD ALIGN="right">Access number</TD><TD>'.
+ popselector($popnum). '</TD></TR>';
+ } else {
+ $OUT .= popselector($popnum);
+ }
+%>
</TABLE>
<BR><BR><INPUT TYPE="submit" VALUE="Signup">
</FORM></BODY></HTML>
diff --git a/fs_signup/FS-SignupClient/cgi/signup.html b/fs_signup/FS-SignupClient/cgi/signup.html
index 5d2f2d9c9..6c601410c 100755
--- a/fs_signup/FS-SignupClient/cgi/signup.html
+++ b/fs_signup/FS-SignupClient/cgi/signup.html
@@ -148,13 +148,11 @@ Contact Information
</TR>
<TR>
<TD ALIGN="right">Password</TD>
- <TD><INPUT TYPE="password" NAME="_password" VALUE="<%= $password %>">
- (blank to generate)</TD>
+ <TD><INPUT TYPE="password" NAME="_password" VALUE="<%= $password %>"></TD>
</TR>
<TR>
<TD ALIGN="right">Re-enter Password</TD>
- <TD><INPUT TYPE="password" NAME="_password2" VALUE="<%= $password2 %>">
- </TD>
+ <TD><INPUT TYPE="password" NAME="_password2" VALUE="<%= $password2 %>"></TD>
</TR>
<%=
if ( $init_data->{'security_phrase'} ) {
@@ -169,10 +167,14 @@ ENDOUT
$OUT .= '<INPUT TYPE="hidden" NAME="sec_phrase" VALUE="">';
}
%>
-<TR>
- <TD ALIGN="right">Access number</TD>
- <TD><%= popselector($popnum) %></TD>
-</TR>
+<%=
+ if ( scalar(@$pops) ) {
+ $OUT .= '<TR><TD ALIGN="right">Access number</TD><TD>'.
+ popselector($popnum). '</TD></TR>';
+ } else {
+ $OUT .= popselector($popnum);
+ }
+%>
</TABLE>
<BR><BR><INPUT TYPE="submit" VALUE="Signup">
</FORM></BODY></HTML>
diff --git a/fs_signup/FS-SignupClient/cgi/success.html b/fs_signup/FS-SignupClient/cgi/success.html
index 6bc2d1fd7..0119b3b5e 100644
--- a/fs_signup/FS-SignupClient/cgi/success.html
+++ b/fs_signup/FS-SignupClient/cgi/success.html
@@ -1,4 +1,11 @@
<HTML><HEAD><TITLE>Signup successful</TITLE></HEAD>
<BODY BGCOLOR="#e8e8e8"><FONT SIZE=7>Signup successful</FONT><BR><BR>
Thanks for signing up!
+<BR><BR>
+Signup information for <%= $email_name %>:
+<BR><BR>
+Username: <%= $username %><BR>
+Password: <%= $password %><BR>
+Access number: (<%= $ac %>) / $exch - $local<BR>
+Package: <%= $pkg %><BR>
</BODY></HTML>
diff --git a/fs_signup/fs_signup_server b/fs_signup/fs_signup_server
index 871bbdf1b..ebf424cd7 100755
--- a/fs_signup/fs_signup_server
+++ b/fs_signup/fs_signup_server
@@ -47,6 +47,7 @@ while (1) {
warn "[fs_signup_server] Connecting to $machine...\n" if $Debug;
sshopen2($machine,$reader,$writer,$fs_signupd);
+ my @pops = qsearch('svc_acct_pop',{} );
my $init_data = {
#'_protocol' => 'signup',
@@ -63,7 +64,7 @@ while (1) {
qsearch( 'part_pkg', { 'disabled' => '' } )
],
- 'svc_acct_pop' => [ map { $_->hashref } qsearch ('svc_acct_pop',{} ) ],
+ 'svc_acct_pop' => [ map { $_->hashref } @pops ],
'security_phrase' => $conf->exists('security_phrase'),
@@ -96,8 +97,9 @@ while (1) {
#things that aren't necessary in base class, but are for signup server
#return "Passwords don't match"
# if $hashref->{'_password'} ne $hashref->{'_password2'}
- $error ||= "Empty password" unless $signup_data->{'_password'};
- $error ||= "No POP selected" unless $signup_data->{'popnum'};
+ $error ||= gettext('empty_password') unless $signup_data->{'_password'};
+ $error ||= gettext('no_access_number_selected')
+ unless $signup_data->{'popnum'} || !scalar(@pops);
#shares some stuff with htdocs/edit/process/cust_main.cgi... take any
# common that are still here and library them.
@@ -150,11 +152,30 @@ while (1) {
use Tie::RefHash;
tie my %hash, 'Tie::RefHash';
%hash = ( $cust_pkg => [ $svc_acct ] );
- $error ||= $cust_main->insert( \%hash, \@invoicing_list );
+ $error ||= $cust_main->insert( \%hash, \@invoicing_list ); #msgcat
warn "[fs_signup_server] Sending results...\n" if $Debug;
print $writer $error, "\n";
+ if ( $conf->config('signup_server-realtime') ) {
+
+ my $bill_error = $cust_main->bill;
+ warn "[fs_signup_server] error billing new customer: $bill_error"
+ if $bill_error;
+
+ $cust_main->apply_payments;
+ $cust_main->apply_credits;
+
+ $bill_error = $cust_main->collect;
+ warn "[fs_signup_server] error collecting from new customer: $bill_error"
+ if $bill_error;
+
+ if ( $cust_main->balance ) {
+ #should check list for errors...
+ $cust_main->suspend;
+ }
+ }
+
if ( $error && $conf->config('signup_server-email') ) {
warn "[fs_signup_server] Sending email...\n" if $Debug;
@@ -171,18 +192,20 @@ while (1) {
"Date: ". time2str("%a, %d %b %Y %X %z", time),
"Subject: FREESIDE NOTIFICATION: Signup Server",
] );
- my $message = new Mail::Internet (
- 'Header' => $header,
- 'Body' => [
- "This is an automatic message from your Freeside installation\n",
- "informing you a customer has signed up via the signup server:\n",
- "\n",
- 'custnum: '. $cust_main->custnum. "\n",
- 'Name : '. $cust_main->last. ", ". $cust_main->first. "\n",
- 'Agent : '. $cust_main->agent->agent. "\n",
- "\n",
- ],
- );
+ my $body = [
+ "This is an automatic message from your Freeside installation\n",
+ "informing you a customer has signed up via the signup server:\n",
+ "\n",
+ 'custnum: '. $cust_main->custnum. "\n",
+ 'Name : '. $cust_main->last. ", ". $cust_main->first. "\n",
+ 'Agent : '. $cust_main->agent->agent. "\n",
+ "\n",
+ ];
+ if ( $cust_main->balance ) {
+ push @$body,
+ "This customer has an outstanding balance and has been suspended.\n";
+ }
+ my $message = new Mail::Internet ( 'Header' => $header, 'Body' => $body );
$!=0;
$message->smtpsend( Host => $smtpmachine )
or $message->smtpsend( Host => $smtpmachine, Debug => 1 )
diff --git a/httemplate/browse/msgcat.cgi b/httemplate/browse/msgcat.cgi
index 774473b36..d4adf9f1a 100755
--- a/httemplate/browse/msgcat.cgi
+++ b/httemplate/browse/msgcat.cgi
@@ -1,7 +1,7 @@
<!-- mason kludge -->
<%
-print header("Message catalog", menubar(
+print header("View Message catalog", menubar(
'Main Menu' => $p,
'Edit message catalog' => $p. "edit/msgcat.cgi",
)), '<BR>';
diff --git a/httemplate/docs/signup.html b/httemplate/docs/signup.html
index 117cf2947..5168f47d6 100644
--- a/httemplate/docs/signup.html
+++ b/httemplate/docs/signup.html
@@ -35,28 +35,22 @@ Then:
</ul>
Optional:
<ul>
- <li>If you create a <b>/usr/local/freeside/ieak.template</b> file on the external machine, it will be sent to IE users with MIME type <i>application/x-Internet-signup</i>. This file will be processed with <a href="http://search.cpan.org/doc/MJD/Text-Template-1.23/Template.pm">Text::Template</a> with the following variables available:
- <ul>
- <li>$ac - area code of selected POP
- <li>$exch - exchange of selected POP
- <li>$loc - local part of selected POP
- <li>$username
- <li>$password
- <li>$email_name - first and last name
- </ul>
+ <li>If you create a <b>/usr/local/freeside/ieak.template</b> file on the external machine, it will be sent to IE users with MIME type <i>application/x-Internet-signup</i>. This file will be processed with <a href="http://search.cpan.org/doc/MJD/Text-Template-1.23/Template.pm">Text::Template</a> with the variables listed below available.
(an example file is included as <b>fs_signup/ieak.template</b>) See the <a href="http://www.microsoft.com/windows/ieak/techinfo/deploy/60/en/toc.asp">IEAK documentation</a> for more information.
- <li>If you create a <b>/usr/local/freeside/cck.template</b> file on the external machine, the variables defined will be sent to Netscape users with MIME type <i>application/x-netscape-autoconfigure-dialer-v2</i>. This file will be processed with <a href="http://search.cpan.org/doc/MJD/Text-Template-1.23/Template.pm">Text::Template</a> with the following variables available:
- <ul>
- <li>$ac - area code of selected POP
- <li>$exch - exchange of selected POP
- <li>$loc - local part of selected POP
- <li>$username
- <li>$password
- <li>$email_name - first and last name
- </ul>
+ <li>If you create a <b>/usr/local/freeside/cck.template</b> file on the external machine, the variables defined will be sent to Netscape users with MIME type <i>application/x-netscape-autoconfigure-dialer-v2</i>. This file will be processed with <a href="http://search.cpan.org/doc/MJD/Text-Template-1.23/Template.pm">Text::Template</a> with the variables listed below available.
(an example file is included as <b>fs_signup/cck.template</b>). See the <a href="http://help.netscape.com/products/client/mc/acctproc4.html">Netscape documentation</a> for more information.
- <li>If you create a <b>/usr/local/freeside/signup.html</b> file on the external machine, it will be used as a template for the form HTML. This requires the template to be constructed appropriately; probably best to start with the example file included as <b>fs_signup/FS-SignupClient/cgi/signup.html</b>.
<li>If you create a <b>/usr/local/freeside/success.html</b> file on the external machine, it will be used as the success HTML page. Although template substiutions are available, a regular HTML file will work fine here, unlike signup.html. An example file is included as <b>fs_signup/FS-SignupClient/cgi/success.html</b>
+ <li>Variable substitutions available in <b>ieak.template</b>, <b>cck.template</b> and <b>success.html</b>:
+ <ul>
+ <li>$ac - area code of selected POP
+ <li>$exch - exchange of selected POP
+ <li>$loc - local part of selected POP
+ <li>$username
+ <li>$password
+ <li>$email_name - first and last name
+ <li>$pkg - package name
+ </ul>
+ <li>If you create a <b>/usr/local/freeside/signup.html</b> file on the external machine, it will be used as a template for the form HTML. This requires the template to be constructed appropriately; probably best to start with the example file included as <b>fs_signup/FS-SignupClient/cgi/signup.html</b>.
<li>If there are any entries in the <i>prepay_credit</i> table, a user can enter a string matching the <b>identifier</i> column to receive the credit specified in the <b>amount</b> column, and/or the time specified in the <b>seconds</b> column (for use with the <a href="session.html">session monitor</a>), after which that <b>identifier</b> is no longer valid. This can be used to implement pre-paid "calling card" type signups. The <i>bin/generate-prepay</i> script can be used to populate the <i>prepay_credit</i> table.
</ul>
</body>
diff --git a/httemplate/docs/upgrade8.html b/httemplate/docs/upgrade8.html
index a7b5853b3..d1b13fe9c 100644
--- a/httemplate/docs/upgrade8.html
+++ b/httemplate/docs/upgrade8.html
@@ -325,6 +325,7 @@ ALTER TABLE cust_refund DROP COLUMN crednum;
<li><b>IMPORTANT</b>: run bin/create-history-tables
<li><b>IMPORTANT: After running bin/create-history-tables</b>, run bin/dbdef-create again.
<li>set the <a href="../config/config.cgi#username_policy">user_policy configuration value</a> as appropriate for your site.
+ <li>set the <a href="../config/config.cgi#locale">locale configuration value</a> to en_US.
<li>the mxmachines, nsmachines, arecords and cnamerecords configuration values have been deprecated. Set the <a href="../config/config.cgi#defaultrecords">defaultrecords configuration value</a> instead.
<li>Create the `/usr/local/etc/freeside/cache.<i>datasrc</i>' directory
(owned by the freeside user).
diff --git a/httemplate/edit/msgcat.cgi b/httemplate/edit/msgcat.cgi
index 5d256c05b..ee9b1c6b3 100755
--- a/httemplate/edit/msgcat.cgi
+++ b/httemplate/edit/msgcat.cgi
@@ -1,11 +1,12 @@
<!-- mason kludge -->
<%
-print header("Message catalog", menubar(
+print header("Edit Message catalog", menubar(
# 'Main Menu' => $p,
)), '<BR>';
-print qq!<FONT SIZE="+1" COLOR="#ff0000">Error: !. $cgi->param('error')
+print qq!<FONT SIZE="+1" COLOR="#ff0000">Error: !. $cgi->param('error').
+ '</FONT><BR><BR>'
if $cgi->param('error');
my $widget = new HTML::Widgets::SelectLayers(
@@ -28,7 +29,7 @@ my $widget = new HTML::Widgets::SelectLayers(
'<TR><TD>'. $msgcat->msgnum. '</TD><TD>'. $msgcat->msgcode. '</TD>'.
'<TD><INPUT TYPE="text" SIZE=32 '.
qq! NAME="!. $msgcat->msgnum. '" '.
- qq!VALUE="!. $msgcat->msg. qq!"></TD>!;
+ qq!VALUE="!. ($cgi->param($msgcat->msgnum)||$msgcat->msg). qq!"></TD>!;
unless ( $layer eq 'en_US' ) {
my $en_msgcat = qsearchs('msgcat', {
'locale' => 'en_US',
diff --git a/httemplate/edit/process/msgcat.cgi b/httemplate/edit/process/msgcat.cgi
index ab30f06b5..1f94f6668 100644
--- a/httemplate/edit/process/msgcat.cgi
+++ b/httemplate/edit/process/msgcat.cgi
@@ -3,6 +3,7 @@
my $error;
foreach my $param ( grep { /^\d+$/ } $cgi->param ) {
my $old = qsearchs('msgcat', { msgnum=>$param } );
+ next if $old->msg eq $cgi->param($param); #no need to update identical records
my $new = new FS::msgcat { $old->hash };
$new->msg($cgi->param($param));
$error = $new->replace($old);