X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fmisc%2Fcust_main-cancel.cgi;h=d29e4f5fc0091a61bf39c93aeb76e75469445b46;hb=7ba67eedde17e00f1a8e753790d3386a81cc759a;hp=526e128a4cc1776ac27ac7abba6df734976e2b47;hpb=c0567c688084e89fcd11bf82348b6c418f1254ac;p=freeside.git diff --git a/httemplate/misc/cust_main-cancel.cgi b/httemplate/misc/cust_main-cancel.cgi index 526e128a4..d29e4f5fc 100755 --- a/httemplate/misc/cust_main-cancel.cgi +++ b/httemplate/misc/cust_main-cancel.cgi @@ -1,16 +1,23 @@ -<% +% +% +%my $custnum; +%my $ban = ''; +%if ( $cgi->param('custnum') =~ /^(\d+)$/ ) { +% $custnum = $1; +% $ban = $cgi->param('ban'); +%} else { +% my($query) = $cgi->keywords; +% $query =~ /^(\d+)$/ || die "Illegal custnum"; +% $custnum = $1; +%} +% +%my $cust_main = qsearchs('cust_main', { 'custnum' => $custnum } ); +% +%my @errors = $cust_main->cancel( 'ban' => $ban ); +%eidiot(join(' / ', @errors)) if scalar(@errors); +% +%#print $cgi->redirect($p. "view/cust_main.cgi?". $cust_main->custnum); +%print $cgi->redirect($p); +% +% -#untaint custnum -my($query) = $cgi->keywords; -$query =~ /^(\d+)$/ || die "Illegal custnum"; -my $custnum = $1; - -my $cust_main = qsearchs('cust_main', { 'custnum' => $custnum } ); - -my $error = $cust_main->cancel; -eidiot($error) if $error; - -#print $cgi->redirect($p. "view/cust_main.cgi?". $cust_main->custnum); -print $cgi->redirect($p); - -%>