diff options
author | ivan <ivan> | 2002-04-07 05:56:09 +0000 |
---|---|---|
committer | ivan <ivan> | 2002-04-07 05:56:09 +0000 |
commit | 44e3eff0aa6e7bdb7f4ecd9ee1ddf141e1b68af3 (patch) | |
tree | 6a636ec1d2984f18a97515ef54969c4c9a641e8c /fs_signup | |
parent | fca110eff969104793774ed717985e91c53f5318 (diff) |
working message catalogs (not used for enough yet)
- almost (but not quite) closes Bug#385 - still have to catalog the
backend things triggered by signup server.
Diffstat (limited to 'fs_signup')
-rwxr-xr-x | fs_signup/FS-SignupClient/cgi/signup.cgi | 17 | ||||
-rwxr-xr-x | fs_signup/fs_signup_server | 5 |
2 files changed, 17 insertions, 5 deletions
diff --git a/fs_signup/FS-SignupClient/cgi/signup.cgi b/fs_signup/FS-SignupClient/cgi/signup.cgi index 7cf4230e6..46621d1e8 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.18 2002-04-07 00:00:40 ivan Exp $ +# $Id: signup.cgi,v 1.19 2002-04-07 05:56:08 ivan Exp $ use strict; use vars qw( @payby $cgi $locales $packages $pops $init_data $error @@ -120,15 +120,22 @@ if ( defined $cgi->param('magic') ) { $error = ''; if ( $cgi->param('_password') ne $cgi->param('_password2') ) { - $error = "Passwords don't match"; #msgcat + $error = $init_data->{msgcat}{passwords_dont_match}; #msgcat $password = ''; $password2 = ''; } else { $password2 = $cgi->param('_password2'); - if ( $payby eq 'CARD' && $cgi->param('CARD_type') - && cardtype($payinfo) ne $cgi->param('CARD_type') ) { - $error = 'Not an '. $cgi->param('CARD_type'). '| - is: |'. cardtype($payinfo). '|'; #msgcat + if ( $payby eq 'CARD' && $cgi->param('CARD_type') ) { + $payinfo =~ s/\D//g; + + $payinfo =~ /^(\d{13,16})$/ + or $error ||= $init_data->{msgcat}{invalid_card}; #. $self->payinfo; + $payinfo = $1; + validate($payinfo) + or $error ||= $init_data->{msgcat}{invalid_card}; #. $self->payinfo; + cardtype($payinfo) eq $cgi->param('CARD_type') + or $error ||= $init_data->{msgcat}{not_a}. $cgi->param('CARD_type'); } $error ||= new_customer ( { diff --git a/fs_signup/fs_signup_server b/fs_signup/fs_signup_server index b902d9ff4..f3030e9ae 100755 --- a/fs_signup/fs_signup_server +++ b/fs_signup/fs_signup_server @@ -13,6 +13,7 @@ use FS::Conf; use FS::Record qw( qsearch qsearchs ); use FS::cust_main_county; use FS::cust_main; +use FS::msgcat qw(gettext); use vars qw( $opt $Debug ); @@ -67,6 +68,10 @@ while (1) { 'payby' => [ $conf->config('signup_server-payby') ], + 'msgcat' => { map { $_=>gettext($_) } qw( + passwords_dont_match invalid_card unknown_card_type not_a + ) } + }; warn "[fs_signup_server] Sending init data...\n" if $Debug; |