diff options
author | ivan <ivan> | 2008-01-13 21:14:19 +0000 |
---|---|---|
committer | ivan <ivan> | 2008-01-13 21:14:19 +0000 |
commit | f49f11d4c3c4ba9480cc5c9acfaa606a5ba73ad1 (patch) | |
tree | 2104b5d1a05433756d3b91ee436cfaa8c24ab464 /httemplate/misc/unapply-cust_credit.cgi | |
parent | 2d53d2ebdce80d0f0dc7f75ccf506a06c2f852f9 (diff) |
ACLs
Diffstat (limited to 'httemplate/misc/unapply-cust_credit.cgi')
-rwxr-xr-x | httemplate/misc/unapply-cust_credit.cgi | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/httemplate/misc/unapply-cust_credit.cgi b/httemplate/misc/unapply-cust_credit.cgi index f8fa63268..ed739ac1b 100755 --- a/httemplate/misc/unapply-cust_credit.cgi +++ b/httemplate/misc/unapply-cust_credit.cgi @@ -1,19 +1,20 @@ -% -% -%#untaint crednum -%my($query) = $cgi->keywords; -%$query =~ /^(\d+)$/ || die "Illegal crednum"; -%my $crednum = $1; -% -%my $cust_credit = qsearchs('cust_credit', { 'crednum' => $crednum } ); -%my $custnum = $cust_credit->custnum; -% -%foreach my $cust_credit_bill ( $cust_credit->cust_credit_bill ) { -% my $error = $cust_credit_bill->delete; -% errorpage($error) if $error; -%} -% -%print $cgi->redirect($p. "view/cust_main.cgi?". $custnum); -% -% +<% $cgi->redirect($p. "view/cust_main.cgi?". $custnum) %> +<%init> +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right('Unapply credit'); + +#untaint crednum +my($query) = $cgi->keywords; +$query =~ /^(\d+)$/ || die "Illegal crednum"; +my $crednum = $1; + +my $cust_credit = qsearchs('cust_credit', { 'crednum' => $crednum } ); +my $custnum = $cust_credit->custnum; + +foreach my $cust_credit_bill ( $cust_credit->cust_credit_bill ) { + my $error = $cust_credit_bill->delete; + errorpage($error) if $error; +} + +</%init> |