X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fmisc%2Fexpire_pkg.cgi;h=9e4ce8b620976a6ae26796d1c2a3436f6497d71d;hp=21e220d1800f76da585f9e0427bc471bc5a5cc1b;hb=23ec9b00410224868d6be1e47a0d72a6c8b3f6f5;hpb=3d671921441ba8422650b54435a1959ad1d4c71d diff --git a/httemplate/misc/expire_pkg.cgi b/httemplate/misc/expire_pkg.cgi index 21e220d18..9e4ce8b62 100755 --- a/httemplate/misc/expire_pkg.cgi +++ b/httemplate/misc/expire_pkg.cgi @@ -1,21 +1,8 @@ <% -# - -use strict; -use vars qw ( $cgi $date $pkgnum $cust_pkg %hash $new $error ); -use Date::Parse; -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; - -$cgi = new CGI; -&cgisuidsetup($cgi); #untaint date & pkgnum +my $date; if ( $cgi->param('date') ) { str2time($cgi->param('date')) =~ /^(\d+)$/ or die "Illegal date"; $date=$1; @@ -24,13 +11,13 @@ if ( $cgi->param('date') ) { } $cgi->param('pkgnum') =~ /^(\d+)$/ or die "Illegal pkgnum"; -$pkgnum = $1; +my $pkgnum = $1; -$cust_pkg = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum}); -%hash = $cust_pkg->hash; +my $cust_pkg = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum}); +my %hash = $cust_pkg->hash; $hash{expire}=$date; -$new = new FS::cust_pkg ( \%hash ); -$error = $new->replace($cust_pkg); +my $new = new FS::cust_pkg ( \%hash ); +my $error = $new->replace($cust_pkg); &eidiot($error) if $error; print $cgi->redirect(popurl(2). "view/cust_main.cgi?".$cust_pkg->getfield('custnum'));