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