3 # $Id: unsusp_pkg.cgi,v 1.4 1999-01-19 05:14:09 ivan Exp $
5 # Usage: susp_pkg.cgi pkgnum
6 # http://server.name/path/susp_pkg.cgi pkgnum
8 # Note: Should be run setuid freeside as user nobody
10 # probably should generalize this to do cancels, suspensions, unsuspensions, etc.
12 # ivan@voicenet.com 97-feb-27
14 # now redirects to enter comments
15 # ivan@voicenet.com 97-may-8
18 # ivan@voicenet.com 97-jul-21
20 # FS::Search -> FS::Record ivan@sisd.com 98-mar-17
22 # Changes to allow page to work at a relative position in server
23 # bmccane@maxbaud.net 98-apr-3
25 # $Log: unsusp_pkg.cgi,v $
26 # Revision 1.4 1999-01-19 05:14:09 ivan
27 # for mod_perl: no more top-level my() variables; use vars instead
28 # also the last s/create/new/;
30 # Revision 1.3 1998/12/23 03:05:25 ivan
31 # $cgi->keywords instead of $cgi->query_string
33 # Revision 1.2 1998/12/17 09:12:49 ivan
34 # s/CGI::(Request|Base)/CGI.pm/;
38 use vars qw( $cgi $query $pkgnum $cust_pkg $error );
40 use CGI::Carp qw(fatalsToBrowser);
41 use FS::UID qw(cgisuidsetup);
42 use FS::CGI qw(popurl eidiot);
43 use FS::Record qw(qsearchs);
50 ($query) = $cgi->keywords;
51 $query =~ /^(\d+)$/ || die "Illegal pkgnum";
54 $cust_pkg = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum});
56 $error = $cust_pkg->unsuspend;
57 &eidiot($error) if $error;
59 print $cgi->redirect(popurl(2). "view/cust_main.cgi?".$cust_pkg->getfield('custnum'));