X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fmisc%2Fdelete-customer.cgi;h=4302317371c39c42527b04e67c796db8ab7ac3d4;hb=f8e7f53109f36e3c649dc509b61c75c3c44fb519;hp=e1bcb89949c028bbfcd78a66f4d51e409aaf125f;hpb=8748a199e18236d696115661a36e87f583481662;p=freeside.git
diff --git a/httemplate/misc/delete-customer.cgi b/httemplate/misc/delete-customer.cgi
index e1bcb8994..430231737 100755
--- a/httemplate/misc/delete-customer.cgi
+++ b/httemplate/misc/delete-customer.cgi
@@ -1,46 +1,23 @@
+
<%
-#
-# $Id: delete-customer.cgi,v 1.2 2001-08-11 04:15:14 ivan Exp $
-#
-# $Log: delete-customer.cgi,v $
-# Revision 1.2 2001-08-11 04:15:14 ivan
-# better docs
-#
-# Revision 1.1 2001/07/30 07:36:04 ivan
-# templates!!!
-#
-# Revision 1.1 1999/04/15 16:44:36 ivan
-# delete customers
-#
-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 $cgi->header ( '-expires' => 'now' ), header('Delete customer');
+print header('Delete customer');
print qq!Error: !, $cgi->param('error'),
""
@@ -59,11 +36,25 @@ print <completely remove all traces of this customer record. This
is not what you want if this is a real customer who has simply
canceled service with you. For that, cancel all of the customer's packages.
-(you can optionally hide cancelled customers with the hidecancelledcustomers configuration file)
+(you can optionally hide cancelled customers with the hidecancelledcustomers configuration option)
Are you absolutely sure you want to delete this customer?