summaryrefslogtreecommitdiff
path: root/FS
diff options
context:
space:
mode:
authorivan <ivan>2002-11-06 04:23:22 +0000
committerivan <ivan>2002-11-06 04:23:22 +0000
commit4014161f196408567c02ce3fe5a0cd3c27f633c7 (patch)
treec181eea1d09ee04626c8c25c7f73998b9493e023 /FS
parent928c6b2dbe79b079eb79eca941bc8f1e24dd5795 (diff)
safe regex for sqlradius hour/data billing, closes: Bug#474
Diffstat (limited to 'FS')
-rw-r--r--FS/FS/part_pkg.pm6
1 files changed, 2 insertions, 4 deletions
diff --git a/FS/FS/part_pkg.pm b/FS/FS/part_pkg.pm
index e914636e4..f290420df 100644
--- a/FS/FS/part_pkg.pm
+++ b/FS/FS/part_pkg.pm
@@ -218,6 +218,8 @@ sub check {
or $r =~ /^my \$min = \$cust_pkg\->seconds_since\(\$cust_pkg\->bill \|\| 0\) \/ 60 \- \s*\d*\.?\d*\s*; \$min = 0 if \$min < 0; \s*\d*\.?\d*\s* \+ \s*\d*\.?\d*\s* \* \$min;\s*$/
+ or $r =~ /^my \$last_bill = \$cust_pkg\->last_bill; my \$hours = \$cust_pkg\->seconds_since_sqlradacct\(\$last_bill, \$sdate \) \/ 3600 - \s*\d\.?\d*\s*; \$hours = 0 if \$hours < 0; my \$input = \$cust_pkg\->attribute_since_sqlradacct\(\$last_bill, \$sdate, "AcctInputOctets" \) \/ 1048576; my \$output = \$cust_pkg\->attribute_since_sqlradacct\(\$last_bill, \$sdate, "AcctOutputOctets" \) \/ 1048576; my \$total = \$input \+ \$output \- \s*\d\.?\d*\s*; \$total = 0 if \$total < 0; my \$input = \$input - \s*\d\.?\d*\s*; \$input = 0 if \$input < 0; my \$output = \$output - \s*\d\.?\d*\s*; \$output = 0 if \$output < 0; \s*\d\.?\d*\s* \+ \s*\d\.?\d*\s* \* \$hours \+ \s*\d\.?\d*\s* \* \$input \+ \s*\d\.?\d*\s* \* \$output \+ \s*\d\.?\d*\s* \* \$total *;\s*$/
+
or do {
#log!
return "illegal recur: $r";
@@ -295,10 +297,6 @@ sub payby {
=back
-=head1 VERSION
-
-$Id: part_pkg.pm,v 1.16 2002-06-10 01:39:50 khoff Exp $
-
=head1 BUGS
The delete method is unimplemented.