diff options
author | ivan <ivan> | 2002-02-18 08:39:21 +0000 |
---|---|---|
committer | ivan <ivan> | 2002-02-18 08:39:21 +0000 |
commit | 32e8c2a2a58428acd539d880357c76720334c011 (patch) | |
tree | 37cdbbbc6ae6c2c83fc2364c32892f63dfc1fd39 /FS/FS/part_bill_event.pm | |
parent | 412e2892a324cdd838f4a790102359adcc9b7400 (diff) |
safe web demo operation! closes: Bug#217
fix bug in edit/part_pkg: s/bkg/pkg/
edit/part_pkg.cgi - plan <SELECT> is now properly stick on errors, closes: Bug#323
Diffstat (limited to 'FS/FS/part_bill_event.pm')
-rw-r--r-- | FS/FS/part_bill_event.pm | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/FS/FS/part_bill_event.pm b/FS/FS/part_bill_event.pm index fb1daa20b..70c8a56ec 100644 --- a/FS/FS/part_bill_event.pm +++ b/FS/FS/part_bill_event.pm @@ -3,6 +3,7 @@ package FS::part_bill_event; use strict; use vars qw( @ISA ); use FS::Record qw( qsearch qsearchs ); +use FS::Conf; @ISA = qw(FS::Record); @@ -114,6 +115,28 @@ sub check { $self->weight(0) unless $self->weight; + my $conf = new FS::Conf; + if ( $conf->exists('safe-part_bill_event') ) { + my $error = $self->ut_anything('eventcode'); + return $error if $error; + + my $c = $self->eventcode; + + $c =~ /^\s*\$cust_main\->(suspend|cancel|invoicing_list_addpost|bill|collect)\(\);\s*("";)?\s*$/ + + or $c =~ /^\s*\$cust_bill\->(comp|realtime_card|realtime_card_cybercash|batch_card|send)\(\);\s*$/ + + or $c =~ /^\s*\$cust_main\->apply_payments; \$cust_main->apply_credits; "";\s*$/ + + or $c =~ /^\s*\$cust_main\->charge\( \s*\d*\.?\d*\s*,\s*\'[\w \!\@\#\$\%\&\(\)\-\+\;\:\"\,\.\?\/]*\'\s*\);\s*$/ + + or do { + #log + return "illegal eventcode: $c"; + }; + + } + $self->ut_numbern('eventpart') || $self->ut_enum('payby', [qw( CARD BILL COMP )] ) || $self->ut_text('event') |