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