3 # $Id: expire_pkg.cgi,v 1.2 1998-12-17 09:12:44 ivan Exp $
6 # http://server.name/path/expire_pkg.cgi
8 # Note: Should be run setuid freeside as user nobody
11 # ivan@voicenet.com 97-jul-29
13 # ivan@sisd.com 98-mar-17 FS::Search->FS::Record
15 # Changes to allow page to work at a relative position in server
16 # bmccane@maxbaud.net 98-apr-3
18 # $Log: expire_pkg.cgi,v $
19 # Revision 1.2 1998-12-17 09:12:44 ivan
20 # s/CGI::(Request|Base)/CGI.pm/;
26 use CGI::Carp qw(fatalsToBrowser);
27 use FS::UID qw(cgisuidsetup);
28 use FS::CGI qw(popurl eidiot);
29 use FS::Record qw(qsearchs);
35 #untaint date & pkgnum
38 if ( $cgi->param('date') ) {
39 str2time($cgi->param('date')) =~ /^(\d+)$/ or die "Illegal date";
45 $cgi->param('pkgnum') =~ /^(\d+)$/ or die "Illegal pkgnum";
48 my($cust_pkg) = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum});
49 my(%hash)=$cust_pkg->hash;
51 my($new)=create FS::cust_pkg ( \%hash );
52 my($error) = $new->replace($cust_pkg);
53 &eidiot($error) if $error;
55 print $cgi->redirect(popurl(2). "view/cust_main.cgi?".$cust_pkg->getfield('custnum'));