RT# 81183 Fix crash processing payment with new payment method
[freeside.git] / httemplate / misc / unsusp_pkg.cgi
1 %if ( $error ) {
2 %  errorpage($error);
3 %} else {
4 <% $cgi->redirect(
5      -uri    => popurl(2). "view/cust_main.cgi?show=packages;custnum=$custnum",
6      -cookie => CGI::Cookie->new( -name    => 'freeside_status',
7                                   -value   => mt('Package unsuspended'),
8                                   -expires => '+5m',
9                                 ),
10    )
11 %>
12 %}
13 <%init>
14
15 die "access denied"
16   unless $FS::CurrentUser::CurrentUser->access_right('Unsuspend customer package');
17
18 #untaint pkgnum
19 my ($query) = $cgi->keywords;
20 $query =~ /^(\d+)$/ || die "Illegal pkgnum";
21 my $pkgnum = $1;
22
23 my $cust_pkg = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum});
24
25 my $error = $cust_pkg->unsuspend;
26
27 my $custnum = $cust_pkg->custnum;
28
29 </%init>