From 7d61d061817c90f10e02296e47fdd587ac76173f Mon Sep 17 00:00:00 2001 From: ivan Date: Thu, 17 Dec 1998 09:12:49 +0000 Subject: s/CGI::(Request|Base)/CGI.pm/; --- htdocs/misc/expire_pkg.cgi | 45 +++++++++++++++------------------------------ 1 file changed, 15 insertions(+), 30 deletions(-) (limited to 'htdocs/misc/expire_pkg.cgi') diff --git a/htdocs/misc/expire_pkg.cgi b/htdocs/misc/expire_pkg.cgi index 163516627..e921c7218 100755 --- a/htdocs/misc/expire_pkg.cgi +++ b/htdocs/misc/expire_pkg.cgi @@ -1,6 +1,6 @@ #!/usr/bin/perl -Tw # -# expire_pkg.cgi: Expire a package +# $Id: expire_pkg.cgi,v 1.2 1998-12-17 09:12:44 ivan Exp $ # # Usage: post form to: # http://server.name/path/expire_pkg.cgi @@ -14,29 +14,35 @@ # # Changes to allow page to work at a relative position in server # bmccane@maxbaud.net 98-apr-3 +# +# $Log: expire_pkg.cgi,v $ +# Revision 1.2 1998-12-17 09:12:44 ivan +# s/CGI::(Request|Base)/CGI.pm/; +# use strict; use Date::Parse; -use CGI::Request; +use CGI; use CGI::Carp qw(fatalsToBrowser); use FS::UID qw(cgisuidsetup); +use FS::CGI qw(popurl eidiot); use FS::Record qw(qsearchs); use FS::cust_pkg; -my($req) = new CGI::Request; -&cgisuidsetup($req->cgi); +my($cgi) = new CGI; +&cgisuidsetup($cgi); #untaint date & pkgnum my($date); -if ( $req->param('date') ) { - str2time($req->param('date')) =~ /^(\d+)$/ or die "Illegal date"; +if ( $cgi->param('date') ) { + str2time($cgi->param('date')) =~ /^(\d+)$/ or die "Illegal date"; $date=$1; } else { $date=''; } -$req->param('pkgnum') =~ /^(\d+)$/ or die "Illegal pkgnum"; +$cgi->param('pkgnum') =~ /^(\d+)$/ or die "Illegal pkgnum"; my($pkgnum)=$1; my($cust_pkg) = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum}); @@ -44,28 +50,7 @@ my(%hash)=$cust_pkg->hash; $hash{expire}=$date; my($new)=create FS::cust_pkg ( \%hash ); my($error) = $new->replace($cust_pkg); -&idiot($error) if $error; - -$req->cgi->redirect("../view/cust_main.cgi?".$cust_pkg->getfield('custnum')); +&eidiot($error) if $error; -sub idiot { - my($error)=@_; - SendHeaders(); - print < - - Error expiring package - - -
-

Error expiring package

-
-
- There has been an error expiring this package: $error - - - -END - exit; -} +print $cgi->redirect(popurl(2). "view/cust_main.cgi?".$cust_pkg->getfield('custnum')); -- cgit v1.2.1