summaryrefslogtreecommitdiff
path: root/httemplate/misc/unsusp_pkg.cgi
blob: ad7effcb37c2bea73969e4a6887275d40c8b4244 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
%if ( $error ) {
%  errorpage($error);
%} else {
%  my $cookie = CGI::Cookie->new( -name    => 'freeside_status',
%                                 -value   => mt('Package unsuspended'),
%                                 -expires => '+5m',
%                               );
% #$r->headers_out->add( 'Set-Cookie' => $cookie->as_string );
<% $cgi->redirect(
     -uri => popurl(2). "view/cust_main.cgi?show=packages;custnum=".$cust_pkg->getfield('custnum'),
     -cookie => $cookie
  )
%>
%}
<%init>

die "access denied"
  unless $FS::CurrentUser::CurrentUser->access_right('Unsuspend customer package');

#untaint pkgnum
my ($query) = $cgi->keywords;
$query =~ /^(\d+)$/ || die "Illegal pkgnum";
my $pkgnum = $1;

my $cust_pkg = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum});

my $error = $cust_pkg->unsuspend;

</%init>