3 # $Id: expire_pkg.cgi,v 1.1 2001-07-30 07:36:04 ivan Exp $
6 # http://server.name/path/expire_pkg.cgi
9 # ivan@voicenet.com 97-jul-29
11 # ivan@sisd.com 98-mar-17 FS::Search->FS::Record
13 # Changes to allow page to work at a relative position in server
14 # bmccane@maxbaud.net 98-apr-3
16 # $Log: expire_pkg.cgi,v $
17 # Revision 1.1 2001-07-30 07:36:04 ivan
20 # Revision 1.4 1999/02/28 00:03:50 ivan
21 # removed misleading comments
23 # Revision 1.3 1999/01/19 05:14:05 ivan
24 # for mod_perl: no more top-level my() variables; use vars instead
25 # also the last s/create/new/;
27 # Revision 1.2 1998/12/17 09:12:44 ivan
28 # s/CGI::(Request|Base)/CGI.pm/;
32 use vars qw ( $cgi $date $pkgnum $cust_pkg %hash $new $error );
35 use CGI::Carp qw(fatalsToBrowser);
36 use FS::UID qw(cgisuidsetup);
37 use FS::CGI qw(popurl eidiot);
38 use FS::Record qw(qsearchs);
44 #untaint date & pkgnum
46 if ( $cgi->param('date') ) {
47 str2time($cgi->param('date')) =~ /^(\d+)$/ or die "Illegal date";
53 $cgi->param('pkgnum') =~ /^(\d+)$/ or die "Illegal pkgnum";
56 $cust_pkg = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum});
57 %hash = $cust_pkg->hash;
59 $new = new FS::cust_pkg ( \%hash );
60 $error = $new->replace($cust_pkg);
61 &eidiot($error) if $error;
63 print $cgi->redirect(popurl(2). "view/cust_main.cgi?".$cust_pkg->getfield('custnum'));