X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2Fcust_main.pm;h=2d7dae41ff7a3399da2c150cc9816479743a0471;hp=0379f7f71224bd4b176719864762921097dc8ab8;hb=5928d6721ca5328d9a687d914296a2dcc3156a11;hpb=0b9841bf3fea52f423242313afc2cc058d6e6a46 diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm index 0379f7f71..2d7dae41f 100644 --- a/FS/FS/cust_main.pm +++ b/FS/FS/cust_main.pm @@ -191,15 +191,17 @@ but until then, here's an example: use Tie::RefHash; tie %hash, 'Tie::RefHash'; #this part is important - %hash = { + %hash = ( $cust_pkg => [ $svc_acct ], - }; + ... + ); $cust_main->insert( \%hash ); =cut sub insert { my $self = shift; + my @param = @_; local $SIG{HUP} = 'IGNORE'; local $SIG{INT} = 'IGNORE'; @@ -239,8 +241,8 @@ sub insert { return $error; } - if ( @_ ) { - my $cust_pkgs = shift; + if ( @param ) { + my $cust_pkgs = shift @param; foreach my $cust_pkg ( keys %$cust_pkgs ) { $cust_pkg->custnum( $self->custnum ); $error = $cust_pkg->insert; @@ -606,6 +608,9 @@ sub bill { my $setup = 0; unless ( $cust_pkg->setup ) { my $setup_prog = $part_pkg->getfield('setup'); + $setup_prog =~ /^(.*)$/ #presumably trusted + or die "Illegal setup for package ". $cust_pkg->pkgnum. ": $setup_prog"; + $setup_prog = $1; my $cpt = new Safe; #$cpt->permit(); #what is necessary? $cpt->share(qw( $cust_pkg )); #can $cpt now use $cust_pkg methods? @@ -627,6 +632,9 @@ sub bill { ( $cust_pkg->getfield('bill') || 0 ) < $time ) { my $recur_prog = $part_pkg->getfield('recur'); + $recur_prog =~ /^(.*)$/ #presumably trusted + or die "Illegal recur for package ". $cust_pkg->pkgnum. ": $recur_prog"; + $recur_prog = $1; my $cpt = new Safe; #$cpt->permit(); #what is necessary? $cpt->share(qw( $cust_pkg )); #can $cpt now use $cust_pkg methods? @@ -1117,7 +1125,7 @@ sub check_invoicing_list { =head1 VERSION -$Id: cust_main.pm,v 1.12 2001-04-23 07:12:44 ivan Exp $ +$Id: cust_main.pm,v 1.14 2001-06-03 10:51:54 ivan Exp $ =head1 BUGS