3 # $Id: expire_pkg.cgi,v 1.3 1999-01-19 05:14:05 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.3 1999-01-19 05:14:05 ivan
20 # for mod_perl: no more top-level my() variables; use vars instead
21 # also the last s/create/new/;
23 # Revision 1.2 1998/12/17 09:12:44 ivan
24 # s/CGI::(Request|Base)/CGI.pm/;
28 use vars qw ( $cgi $date $pkgnum $cust_pkg %hash $new $error );
31 use CGI::Carp qw(fatalsToBrowser);
32 use FS::UID qw(cgisuidsetup);
33 use FS::CGI qw(popurl eidiot);
34 use FS::Record qw(qsearchs);
40 #untaint date & pkgnum
42 if ( $cgi->param('date') ) {
43 str2time($cgi->param('date')) =~ /^(\d+)$/ or die "Illegal date";
49 $cgi->param('pkgnum') =~ /^(\d+)$/ or die "Illegal pkgnum";
52 $cust_pkg = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum});
53 %hash = $cust_pkg->hash;
55 $new = new FS::cust_pkg ( \%hash );
56 $error = $new->replace($cust_pkg);
57 &eidiot($error) if $error;
59 print $cgi->redirect(popurl(2). "view/cust_main.cgi?".$cust_pkg->getfield('custnum'));