blob: f57f11ff50b5e189eb72f7b988816ce93ae8151f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
<%init>
#untaint reasonnum, and set up new reason if appropriate
my $reasonnum = $cgi->param('reasonnum');
$reasonnum =~ /^(-?\d+)$/ or die "Illegal reasonnum";
$reasonnum = $1;
my $error;
if ($reasonnum == -1) {
my $new_reason = FS::reason->new({
map { $_ => scalar( $cgi->param("reasonnum_new_$_") ) }
qw( reason_type reason unsuspend_pkgpart unsuspend_hold unused_credit
feepart fee_on_unsuspend fee_hold )
}); # not sanitizing them here, but check() will do it
$error = $new_reason->insert;
$reasonnum = $new_reason->reasonnum;
}
return ($reasonnum, $error);
</%init>
|