summaryrefslogtreecommitdiff
path: root/httemplate/misc
diff options
context:
space:
mode:
authorivan <ivan>2002-01-30 14:18:09 +0000
committerivan <ivan>2002-01-30 14:18:09 +0000
commit1fd6d8cf5d7854860ef4fd10ed89828e0c04ec39 (patch)
treecaee70f2707d97a43e21ea4253afe728ea6f421a /httemplate/misc
parentea0d3938b57a079ce4aa6db0cae316e3ac6da654 (diff)
remove
use Module; and $cgi = new CGI; &cgisuidsetup(); from all templates. should work better under Mason.
Diffstat (limited to 'httemplate/misc')
-rwxr-xr-xhttemplate/misc/bill.cgi23
-rwxr-xr-xhttemplate/misc/cancel-unaudited.cgi28
-rwxr-xr-xhttemplate/misc/cancel_pkg.cgi25
-rwxr-xr-xhttemplate/misc/catchall.cgi28
-rwxr-xr-xhttemplate/misc/delete-customer.cgi21
-rwxr-xr-xhttemplate/misc/expire_pkg.cgi26
-rwxr-xr-xhttemplate/misc/link.cgi27
-rwxr-xr-xhttemplate/misc/print-invoice.cgi26
-rwxr-xr-xhttemplate/misc/process/catchall.cgi21
-rwxr-xr-xhttemplate/misc/process/delete-customer.cgi23
-rwxr-xr-xhttemplate/misc/process/link.cgi26
-rwxr-xr-xhttemplate/misc/susp_pkg.cgi22
-rwxr-xr-xhttemplate/misc/unsusp_pkg.cgi22
13 files changed, 81 insertions, 237 deletions
diff --git a/httemplate/misc/bill.cgi b/httemplate/misc/bill.cgi
index 48da25562..731309585 100755
--- a/httemplate/misc/bill.cgi
+++ b/httemplate/misc/bill.cgi
@@ -1,27 +1,14 @@
+<!-- $Id: bill.cgi,v 1.5 2002-01-30 14:18:09 ivan Exp $ -->
<%
-#<!-- $Id: bill.cgi,v 1.4 2001-10-15 12:16:42 ivan Exp $ -->
-
-use strict;
-use vars qw( $cgi $query $custnum $cust_main $error );
-use CGI;
-use CGI::Carp qw(fatalsToBrowser);
-use FS::UID qw(cgisuidsetup);
-#use FS::CGI qw(popurl eidiot);
-use FS::CGI qw(popurl idiot);
-use FS::Record qw(qsearchs);
-use FS::cust_main;
-
-$cgi = new CGI;
-&cgisuidsetup($cgi);
#untaint custnum
-($query) = $cgi->keywords;
+my($query) = $cgi->keywords;
$query =~ /^(\d*)$/;
-$custnum = $1;
-$cust_main = qsearchs('cust_main',{'custnum'=>$custnum});
+my $custnum = $1;
+my $cust_main = qsearchs('cust_main',{'custnum'=>$custnum});
die "Can't find customer!\n" unless $cust_main;
-$error = $cust_main->bill(
+my $error = $cust_main->bill(
# 'time'=>$time
);
#&eidiot($error) if $error;
diff --git a/httemplate/misc/cancel-unaudited.cgi b/httemplate/misc/cancel-unaudited.cgi
index 9b90967d9..3e2bd07db 100755
--- a/httemplate/misc/cancel-unaudited.cgi
+++ b/httemplate/misc/cancel-unaudited.cgi
@@ -1,28 +1,16 @@
-<%
-#<!-- $Id: cancel-unaudited.cgi,v 1.2 2001-08-21 02:31:56 ivan Exp $ -->
-
-use strict;
-use vars qw( $cgi $query $svcnum $svc_acct $cust_svc $error $dbh );
-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_svc;
-use FS::svc_acct;
-
-$cgi = new CGI;
-$dbh = &cgisuidsetup($cgi);
+<!-- $Id: cancel-unaudited.cgi,v 1.3 2002-01-30 14:18:09 ivan Exp $ -->
+
+my $dbh = dbh;
#untaint svcnum
-($query) = $cgi->keywords;
+my($query) = $cgi->keywords;
$query =~ /^(\d+)$/;
-$svcnum = $1;
+my $svcnum = $1;
-$svc_acct = qsearchs('svc_acct',{'svcnum'=>$svcnum});
+my $svc_acct = qsearchs('svc_acct',{'svcnum'=>$svcnum});
die "Unknown svcnum!" unless $svc_acct;
-$cust_svc = qsearchs('cust_svc',{'svcnum'=>$svcnum});
+my $cust_svc = qsearchs('cust_svc',{'svcnum'=>$svcnum});
&eidiot(qq!This account has already been audited. Cancel the
<A HREF="!. popurl(2). qq!view/cust_pkg.cgi?! . $cust_svc->getfield('pkgnum') .
qq!pkgnum"> package</A> instead.!)
@@ -36,7 +24,7 @@ local $SIG{TSTP} = 'IGNORE';
local $FS::UID::AutoCommit = 0;
-$error = $svc_acct->cancel;
+my $error = $svc_acct->cancel;
&myeidiot($error) if $error;
$error = $svc_acct->delete;
&myeidiot($error) if $error;
diff --git a/httemplate/misc/cancel_pkg.cgi b/httemplate/misc/cancel_pkg.cgi
index 8129463ae..1513ef05e 100755
--- a/httemplate/misc/cancel_pkg.cgi
+++ b/httemplate/misc/cancel_pkg.cgi
@@ -1,29 +1,16 @@
+<!-- $Id: cancel_pkg.cgi,v 1.3 2002-01-30 14:18:09 ivan Exp $ -->
<%
-#<!-- $Id: cancel_pkg.cgi,v 1.2 2001-08-21 02:31:56 ivan Exp $ -->
-use strict;
-use vars qw ( $cgi $query $pkgnum $cust_pkg $error );
-use CGI;
-use CGI::Carp qw(fatalsToBrowser);
-use FS::UID qw(cgisuidsetup);
-use FS::CGI qw(eidiot popurl);
-use FS::Record qw(qsearchs);
-use FS::CGI qw(popurl eidiot);
-use FS::cust_pkg;
-
-$cgi = new CGI;
-&cgisuidsetup($cgi);
-
#untaint pkgnum
-($query) = $cgi->keywords;
+my($query) = $cgi->keywords;
$query =~ /^(\d+)$/ || die "Illegal pkgnum";
-$pkgnum = $1;
+my $pkgnum = $1;
-$cust_pkg = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum});
+my $cust_pkg = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum});
-$error = $cust_pkg->cancel;
+my $error = $cust_pkg->cancel;
eidiot($error) if $error;
-print $cgi->redirect(popurl(2). "view/cust_main.cgi?".$cust_pkg->getfield('custnum'));
+print $cgi->redirect($p. "view/cust_main.cgi?".$cust_pkg->getfield('custnum'));
%>
diff --git a/httemplate/misc/catchall.cgi b/httemplate/misc/catchall.cgi
index 3aafd0d49..a8d865780 100755
--- a/httemplate/misc/catchall.cgi
+++ b/httemplate/misc/catchall.cgi
@@ -1,24 +1,9 @@
+<!-- $Id: catchall.cgi,v 1.5 2002-01-30 14:18:09 ivan Exp $ -->
<%
-#<!-- $Id: catchall.cgi,v 1.4 2001-10-30 14:54:07 ivan Exp $ -->
-
-use strict;
-use vars qw( $conf $cgi $action $svcnum $svc_domain $pkgnum $svcpart
- $part_svc $query %email $p1 $domain $catchall );
-use CGI;
-use CGI::Carp qw(fatalsToBrowser);
-use FS::UID qw(cgisuidsetup);
-use FS::CGI qw(header popurl);
-use FS::Record qw(qsearch qsearchs fields);
-use FS::svc_acct;
-use FS::svc_domain;
-use FS::svc_forward;
-use FS::Conf;
-
-$cgi = new CGI;
-&cgisuidsetup($cgi);
-
-$conf = new FS::Conf;
+my $conf = new FS::Conf;
+
+my($svc_domain, $svcnum, $pkgnum, $svcpart, $part_svc);
if ( $cgi->param('error') ) {
$svc_domain = new FS::svc_domain ( {
map { $_, scalar($cgi->param($_)) } fields('svc_domain')
@@ -51,6 +36,7 @@ if ( $cgi->param('error') ) {
}
}
+my %email;
if ($pkgnum) {
#find all possible user svcnums (and emails)
@@ -93,7 +79,7 @@ if ($pkgnum) {
# add an absence of a catchall
$email{0} = "(none)";
-$p1 = popurl(1);
+my $p1 = popurl(1);
print header("Domain Catchall Edit", '');
print qq!<FONT SIZE="+1" COLOR="#ff0000">Error: !, $cgi->param('error'),
@@ -117,7 +103,7 @@ print qq!<INPUT TYPE="hidden" NAME="pkgnum" VALUE="$pkgnum">!;
#svcpart
print qq!<INPUT TYPE="hidden" NAME="svcpart" VALUE="$svcpart">!;
-($domain,$catchall)=(
+my($domain,$catchall)=(
$svc_domain->domain,
$svc_domain->catchall,
);
diff --git a/httemplate/misc/delete-customer.cgi b/httemplate/misc/delete-customer.cgi
index d3e7c798f..18f6e8529 100755
--- a/httemplate/misc/delete-customer.cgi
+++ b/httemplate/misc/delete-customer.cgi
@@ -1,31 +1,20 @@
+<!-- $Id: delete-customer.cgi,v 1.6 2002-01-30 14:18:09 ivan Exp $ -->
<%
-#<!-- $Id: delete-customer.cgi,v 1.5 2001-10-30 14:54:07 ivan Exp $ -->
-use strict;
-use vars qw( $cgi $conf $query $custnum $new_custnum $cust_main );
-use CGI;
-use CGI::Carp qw(fatalsToBrowser);
-use FS::UID qw(cgisuidsetup);
-use FS::CGI qw(header popurl);
-use FS::Record qw(qsearch qsearchs);
-use FS::cust_main;
-
-$cgi = new CGI;
-cgisuidsetup($cgi);
-
-$conf = new FS::Conf;
+my $conf = new FS::Conf;
die "Customer deletions not enabled" unless $conf->exists('deletecustomers');
+my($custnum, $new_custnum);
if ( $cgi->param('error') ) {
$custnum = $cgi->param('custnum');
$new_custnum = $cgi->param('new_custnum');
} else {
- ($query) = $cgi->keywords;
+ my($query) = $cgi->keywords;
$query =~ /^(\d+)$/ or die "Illegal query: $query";
$custnum = $1;
$new_custnum = '';
}
-$cust_main = qsearchs( 'cust_main', { 'custnum' => $custnum } )
+my $cust_main = qsearchs( 'cust_main', { 'custnum' => $custnum } )
or die "Customer not found: $custnum";
print header('Delete customer');
diff --git a/httemplate/misc/expire_pkg.cgi b/httemplate/misc/expire_pkg.cgi
index 21e220d18..739fb517f 100755
--- a/httemplate/misc/expire_pkg.cgi
+++ b/httemplate/misc/expire_pkg.cgi
@@ -1,21 +1,9 @@
+<!-- $Id: expire_pkg.cgi,v 1.3 2002-01-30 14:18:09 ivan Exp $ -->
<%
-#<!-- $Id: expire_pkg.cgi,v 1.2 2001-08-21 02:31:56 ivan Exp $ -->
-
-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 +12,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'));
diff --git a/httemplate/misc/link.cgi b/httemplate/misc/link.cgi
index 801b92006..3bcb5d978 100755
--- a/httemplate/misc/link.cgi
+++ b/httemplate/misc/link.cgi
@@ -1,16 +1,7 @@
+<!-- $Id: link.cgi,v 1.5 2002-01-30 14:18:09 ivan Exp $ -->
<%
-#<!-- $Id: link.cgi,v 1.4 2001-10-30 14:54:07 ivan Exp $ -->
-use strict;
-use vars qw ( %link_field $cgi $pkgnum $svcpart $query $part_svc $svc $svcdb
- $link_field );
-use CGI;
-use CGI::Carp qw(fatalsToBrowser);
-use FS::UID qw(cgisuidsetup);
-use FS::CGI qw(popurl header);
-use FS::Record qw(qsearchs);
-
-%link_field = (
+my %link_field = (
'svc_acct' => 'username',
'svc_domain' => 'domain',
'svc_acct_sm' => '',
@@ -18,19 +9,17 @@ use FS::Record qw(qsearchs);
'svc_wo' => '',
);
-$cgi = new CGI;
-cgisuidsetup($cgi);
-
-($query) = $cgi->keywords;
+my($query) = $cgi->keywords;
+my($pkgnum, $svcpart) = ('', '');
foreach $_ (split(/-/,$query)) { #get & untaint pkgnum & svcpart
$pkgnum=$1 if /^pkgnum(\d+)$/;
$svcpart=$1 if /^svcpart(\d+)$/;
}
-$part_svc = qsearchs('part_svc',{'svcpart'=>$svcpart});
-$svc = $part_svc->getfield('svc');
-$svcdb = $part_svc->getfield('svcdb');
-$link_field = $link_field{$svcdb};
+my $part_svc = qsearchs('part_svc',{'svcpart'=>$svcpart});
+my $svc = $part_svc->getfield('svc');
+my $svcdb = $part_svc->getfield('svcdb');
+my $link_field = $link_field{$svcdb};
print header("Link to existing $svc"),
qq!<FORM ACTION="!, popurl(1), qq!process/link.cgi" METHOD=POST>!;
diff --git a/httemplate/misc/print-invoice.cgi b/httemplate/misc/print-invoice.cgi
index a6cb05230..aec7cb39c 100755
--- a/httemplate/misc/print-invoice.cgi
+++ b/httemplate/misc/print-invoice.cgi
@@ -1,26 +1,14 @@
+<!-- $Id: print-invoice.cgi,v 1.3 2002-01-30 14:18:09 ivan Exp $ -->
<%
-#<!-- $Id: print-invoice.cgi,v 1.2 2001-08-21 02:31:56 ivan Exp $ -->
-use strict;
-use vars qw($conf $cgi $lpr $query $invnum $cust_bill $custnum );
-use CGI;
-use CGI::Carp qw(fatalsToBrowser);
-use FS::UID qw(cgisuidsetup);
-use FS::CGI qw(popurl);
-use FS::Record qw(qsearchs);
-use FS::cust_bill;
-
-$cgi = new CGI;
-&cgisuidsetup($cgi);
-
-$conf = new FS::Conf;
-$lpr = $conf->config('lpr');
+my $conf = new FS::Conf;
+my $lpr = $conf->config('lpr');
#untaint invnum
-($query) = $cgi->keywords;
+my($query) = $cgi->keywords;
$query =~ /^(\d*)$/;
-$invnum = $1;
-$cust_bill = qsearchs('cust_bill',{'invnum'=>$invnum});
+my $invnum = $1;
+my $cust_bill = qsearchs('cust_bill',{'invnum'=>$invnum});
die "Can't find invoice!\n" unless $cust_bill;
open(LPR,"|$lpr") or die "Can't open $lpr: $!";
@@ -29,7 +17,7 @@ die "Can't find invoice!\n" unless $cust_bill;
or die $! ? "Error closing $lpr: $!"
: "Exit status $? from $lpr";
-$custnum = $cust_bill->getfield('custnum');
+my $custnum = $cust_bill->getfield('custnum');
print $cgi->redirect(popurl(2). "view/cust_main.cgi?$custnum#history");
diff --git a/httemplate/misc/process/catchall.cgi b/httemplate/misc/process/catchall.cgi
index 6b1147633..cf6f8d751 100755
--- a/httemplate/misc/process/catchall.cgi
+++ b/httemplate/misc/process/catchall.cgi
@@ -1,26 +1,14 @@
+<!--$Id: catchall.cgi,v 1.3 2002-01-30 14:18:09 ivan Exp $ -->
<%
-#<!--$Id: catchall.cgi,v 1.2 2001-08-21 02:31:56 ivan Exp $ -->
-
-use strict;
-use vars qw( $cgi $svcnum $old $new $error );
-use CGI;
-use CGI::Carp qw(fatalsToBrowser);
-use FS::UID qw(cgisuidsetup);
-use FS::Record qw(qsearchs fields);
-use FS::svc_domain;
-use FS::CGI qw(popurl);
$FS::svc_domain::whois_hack=1;
-$cgi = new CGI;
-cgisuidsetup($cgi);
-
$cgi->param('svcnum') =~ /^(\d*)$/ or die "Illegal svcnum!";
-$svcnum =$1;
+my $svcnum =$1;
-$old = qsearchs('svc_domain',{'svcnum'=>$svcnum}) if $svcnum;
+my $old = qsearchs('svc_domain',{'svcnum'=>$svcnum}) if $svcnum;
-$new = new FS::svc_domain ( {
+my $new = new FS::svc_domain ( {
map {
($_, scalar($cgi->param($_)));
} ( fields('svc_domain'), qw( pkgnum svcpart ) )
@@ -28,6 +16,7 @@ $new = new FS::svc_domain ( {
$new->setfield('action' => 'M');
+my $error;
if ( $svcnum ) {
$error = $new->replace($old);
} else {
diff --git a/httemplate/misc/process/delete-customer.cgi b/httemplate/misc/process/delete-customer.cgi
index 4be52004b..6f26c8107 100755
--- a/httemplate/misc/process/delete-customer.cgi
+++ b/httemplate/misc/process/delete-customer.cgi
@@ -1,23 +1,12 @@
+<!-- $Id: delete-customer.cgi,v 1.3 2002-01-30 14:18:09 ivan Exp $ -->
<%
-#<!-- $Id: delete-customer.cgi,v 1.2 2001-08-21 02:31:56 ivan Exp $ -->
-use strict;
-use vars qw ( $cgi $conf $custnum $new_custnum $cust_main $error );
-use CGI;
-use CGI::Carp qw(fatalsToBrowser);
-use FS::UID qw(cgisuidsetup);
-use FS::Record qw(qsearchs);
-use FS::CGI qw(popurl);
-use FS::cust_main;
-
-$cgi = new CGI;
-cgisuidsetup($cgi);
-
-$conf = new FS::Conf;
+my $conf = new FS::Conf;
die "Customer deletions not enabled" unless $conf->exists('deletecustomers');
$cgi->param('custnum') =~ /^(\d+)$/;
-$custnum = $1;
+my $custnum = $1;
+my $new_custnum;
if ( $cgi->param('new_custnum') ) {
$cgi->param('new_custnum') =~ /^(\d+)$/
or die "Illegal new customer number: ". $cgi->param('new_custnum');
@@ -25,10 +14,10 @@ if ( $cgi->param('new_custnum') ) {
} else {
$new_custnum = '';
}
-$cust_main = qsearchs( 'cust_main', { 'custnum' => $custnum } )
+my $cust_main = qsearchs( 'cust_main', { 'custnum' => $custnum } )
or die "Customer not found: $custnum";
-$error = $cust_main->delete($new_custnum);
+my $error = $cust_main->delete($new_custnum);
if ( $error ) {
$cgi->param('error', $error);
diff --git a/httemplate/misc/process/link.cgi b/httemplate/misc/process/link.cgi
index 6b34e8a5d..80a5de81f 100755
--- a/httemplate/misc/process/link.cgi
+++ b/httemplate/misc/process/link.cgi
@@ -1,24 +1,12 @@
+<!-- $Id: link.cgi,v 1.3 2002-01-30 14:18:09 ivan Exp $ -->
<%
-#<!-- $Id: link.cgi,v 1.2 2001-08-21 02:31:56 ivan Exp $ -->
-
-use strict;
-use vars qw ( $cgi $old $new $error $pkgnum $svcpart $svcnum );
-use CGI;
-use CGI::Carp qw(fatalsToBrowser);
-use FS::CGI qw(popurl idiot eidiot);
-use FS::UID qw(cgisuidsetup);
-use FS::cust_svc;
-use FS::Record qw(qsearchs);
-
-$cgi = new CGI;
-cgisuidsetup($cgi);
$cgi->param('pkgnum') =~ /^(\d+)$/;
-$pkgnum = $1;
+my $pkgnum = $1;
$cgi->param('svcpart') =~ /^(\d+)$/;
-$svcpart = $1;
+my $svcpart = $1;
$cgi->param('svcnum') =~ /^(\d*)$/;
-$svcnum = $1;
+my $svcnum = $1;
unless ( $svcnum ) {
my($part_svc) = qsearchs('part_svc',{'svcpart'=>$svcpart});
@@ -29,15 +17,15 @@ unless ( $svcnum ) {
$svcnum=$svc_acct->svcnum;
}
-$old = qsearchs('cust_svc',{'svcnum'=>$svcnum});
+my $old = qsearchs('cust_svc',{'svcnum'=>$svcnum});
die "svcnum not found!" unless $old;
-$new = new FS::cust_svc ({
+my $new = new FS::cust_svc ({
'svcnum' => $svcnum,
'pkgnum' => $pkgnum,
'svcpart' => $svcpart,
});
-$error = $new->replace($old);
+my $error = $new->replace($old);
unless ($error) {
#no errors, so let's view this customer.
diff --git a/httemplate/misc/susp_pkg.cgi b/httemplate/misc/susp_pkg.cgi
index 602314436..efc2f9bba 100755
--- a/httemplate/misc/susp_pkg.cgi
+++ b/httemplate/misc/susp_pkg.cgi
@@ -1,26 +1,14 @@
+<!-- $Id: susp_pkg.cgi,v 1.3 2002-01-30 14:18:09 ivan Exp $ -->
<%
-#<!-- $Id: susp_pkg.cgi,v 1.2 2001-08-21 02:31:56 ivan Exp $ -->
-use strict;
-use vars qw( $cgi $query $pkgnum $cust_pkg $error );
-use CGI;
-use CGI::Carp qw(fatalsToBrowser);
-use FS::UID qw(cgisuidsetup);
-use FS::Record qw(qsearchs);
-use FS::CGI qw(popurl eidiot);
-use FS::cust_pkg;
-
-$cgi = new CGI;
-&cgisuidsetup($cgi);
-
#untaint pkgnum
-($query) = $cgi->keywords;
+my ($query) = $cgi->keywords;
$query =~ /^(\d+)$/ || die "Illegal pkgnum";
-$pkgnum = $1;
+my $pkgnum = $1;
-$cust_pkg = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum});
+my $cust_pkg = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum});
-$error = $cust_pkg->suspend;
+my $error = $cust_pkg->suspend;
&eidiot($error) if $error;
print $cgi->redirect(popurl(2). "view/cust_main.cgi?".$cust_pkg->getfield('custnum'));
diff --git a/httemplate/misc/unsusp_pkg.cgi b/httemplate/misc/unsusp_pkg.cgi
index 8e1b5261b..00f3a08b3 100755
--- a/httemplate/misc/unsusp_pkg.cgi
+++ b/httemplate/misc/unsusp_pkg.cgi
@@ -1,26 +1,14 @@
+<!-- $Id: unsusp_pkg.cgi,v 1.3 2002-01-30 14:18:09 ivan Exp $ -->
<%
-#<!-- $Id: unsusp_pkg.cgi,v 1.2 2001-08-21 02:31:56 ivan Exp $ -->
-use strict;
-use vars qw( $cgi $query $pkgnum $cust_pkg $error );
-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 pkgnum
-($query) = $cgi->keywords;
+my ($query) = $cgi->keywords;
$query =~ /^(\d+)$/ || die "Illegal pkgnum";
-$pkgnum = $1;
+my $pkgnum = $1;
-$cust_pkg = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum});
+my $cust_pkg = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum});
-$error = $cust_pkg->unsuspend;
+my $error = $cust_pkg->unsuspend;
&eidiot($error) if $error;
print $cgi->redirect(popurl(2). "view/cust_main.cgi?".$cust_pkg->getfield('custnum'));