From e1eb06c05b654a4533bab0e034e87a8de99015cc Mon Sep 17 00:00:00 2001 From: cvs2git Date: Mon, 12 Oct 1998 07:03:12 +0000 Subject: This commit was manufactured by cvs2svn to create tag 'freeside_current'. --- htdocs/browse/agent.cgi | 72 ----- htdocs/browse/agent_type.cgi | 81 ------ htdocs/browse/cust_main_county.cgi | 65 ----- htdocs/browse/part_pkg.cgi | 81 ------ htdocs/browse/part_referral.cgi | 57 ---- htdocs/browse/part_svc.cgi | 81 ------ htdocs/browse/svc_acct_pop.cgi | 63 ----- htdocs/docs/admin.html | 6 - htdocs/docs/billing.html | 40 --- htdocs/docs/config.html | 38 --- htdocs/docs/export.html | 39 --- htdocs/docs/index.html | 23 -- htdocs/docs/install.html | 56 ---- htdocs/docs/legacy.html | 34 --- htdocs/docs/passwd.html | 16 -- htdocs/docs/schema.html | 205 --------------- htdocs/docs/trouble.html | 41 --- htdocs/docs/upgrade.html | 24 -- htdocs/docs/upgrade2.html | 11 - htdocs/edit/agent.cgi | 77 ------ htdocs/edit/agent_type.cgi | 75 ------ htdocs/edit/cust_credit.cgi | 97 ------- htdocs/edit/cust_main.cgi | 214 --------------- htdocs/edit/cust_main_county-expand.cgi | 49 ---- htdocs/edit/cust_main_county.cgi | 66 ----- htdocs/edit/cust_pay.cgi | 76 ------ htdocs/edit/cust_pkg.cgi | 137 ---------- htdocs/edit/part_pkg.cgi | 102 ------- htdocs/edit/part_referral.cgi | 66 ----- htdocs/edit/part_svc.cgi | 148 ----------- htdocs/edit/process/agent.cgi | 53 ---- htdocs/edit/process/agent_type.cgi | 83 ------ htdocs/edit/process/cust_credit.cgi | 70 ----- htdocs/edit/process/cust_main.cgi | 102 ------- htdocs/edit/process/cust_main_county-expand.cgi | 71 ----- htdocs/edit/process/cust_main_county.cgi | 38 --- htdocs/edit/process/cust_pay.cgi | 57 ---- htdocs/edit/process/cust_pkg.cgi | 73 ----- htdocs/edit/process/part_pkg.cgi | 79 ------ htdocs/edit/process/part_referral.cgi | 45 ---- htdocs/edit/process/part_svc.cgi | 47 ---- htdocs/edit/process/svc_acct.cgi | 87 ------ htdocs/edit/process/svc_acct_pop.cgi | 43 --- htdocs/edit/process/svc_acct_sm.cgi | 80 ------ htdocs/edit/process/svc_domain.cgi | 78 ------ htdocs/edit/svc_acct.cgi | 191 -------------- htdocs/edit/svc_acct_pop.cgi | 67 ----- htdocs/edit/svc_acct_sm.cgi | 219 --------------- htdocs/edit/svc_domain.cgi | 120 --------- htdocs/images/mid-logo.gif | Bin 10606 -> 0 bytes htdocs/images/small-logo.gif | Bin 5426 -> 0 bytes htdocs/index.html | 96 ------- htdocs/misc/bill.cgi | 66 ----- htdocs/misc/cancel-unaudited.cgi | 85 ------ htdocs/misc/cancel_pkg.cgi | 54 ---- htdocs/misc/expire_pkg.cgi | 71 ----- htdocs/misc/link.cgi | 72 ----- htdocs/misc/print-invoice.cgi | 57 ---- htdocs/misc/process/link.cgi | 73 ----- htdocs/misc/susp_pkg.cgi | 68 ----- htdocs/misc/unsusp_pkg.cgi | 68 ----- htdocs/search/cust_bill.cgi | 46 ---- htdocs/search/cust_bill.html | 21 -- htdocs/search/cust_main-payinfo.html | 21 -- htdocs/search/cust_main.cgi | 235 ----------------- htdocs/search/cust_main.html | 36 --- htdocs/search/cust_pkg.cgi | 122 --------- htdocs/search/svc_acct.cgi | 186 ------------- htdocs/search/svc_acct.html | 21 -- htdocs/search/svc_acct_sm.cgi | 128 --------- htdocs/search/svc_acct_sm.html | 23 -- htdocs/search/svc_domain.cgi | 139 ---------- htdocs/search/svc_domain.html | 22 -- htdocs/view/cust_bill.cgi | 79 ------ htdocs/view/cust_main.cgi | 336 ------------------------ htdocs/view/cust_pkg.cgi | 181 ------------- htdocs/view/svc_acct.cgi | 172 ------------ htdocs/view/svc_acct_sm.cgi | 114 -------- htdocs/view/svc_domain.cgi | 76 ------ 79 files changed, 6411 deletions(-) delete mode 100755 htdocs/browse/agent.cgi delete mode 100755 htdocs/browse/agent_type.cgi delete mode 100755 htdocs/browse/cust_main_county.cgi delete mode 100755 htdocs/browse/part_pkg.cgi delete mode 100755 htdocs/browse/part_referral.cgi delete mode 100755 htdocs/browse/part_svc.cgi delete mode 100755 htdocs/browse/svc_acct_pop.cgi delete mode 100644 htdocs/docs/admin.html delete mode 100644 htdocs/docs/billing.html delete mode 100644 htdocs/docs/config.html delete mode 100644 htdocs/docs/export.html delete mode 100644 htdocs/docs/index.html delete mode 100644 htdocs/docs/install.html delete mode 100644 htdocs/docs/legacy.html delete mode 100644 htdocs/docs/passwd.html delete mode 100644 htdocs/docs/schema.html delete mode 100644 htdocs/docs/trouble.html delete mode 100644 htdocs/docs/upgrade.html delete mode 100644 htdocs/docs/upgrade2.html delete mode 100755 htdocs/edit/agent.cgi delete mode 100755 htdocs/edit/agent_type.cgi delete mode 100755 htdocs/edit/cust_credit.cgi delete mode 100755 htdocs/edit/cust_main.cgi delete mode 100755 htdocs/edit/cust_main_county-expand.cgi delete mode 100755 htdocs/edit/cust_main_county.cgi delete mode 100755 htdocs/edit/cust_pay.cgi delete mode 100755 htdocs/edit/cust_pkg.cgi delete mode 100755 htdocs/edit/part_pkg.cgi delete mode 100755 htdocs/edit/part_referral.cgi delete mode 100755 htdocs/edit/part_svc.cgi delete mode 100755 htdocs/edit/process/agent.cgi delete mode 100755 htdocs/edit/process/agent_type.cgi delete mode 100755 htdocs/edit/process/cust_credit.cgi delete mode 100755 htdocs/edit/process/cust_main.cgi delete mode 100755 htdocs/edit/process/cust_main_county-expand.cgi delete mode 100755 htdocs/edit/process/cust_main_county.cgi delete mode 100755 htdocs/edit/process/cust_pay.cgi delete mode 100755 htdocs/edit/process/cust_pkg.cgi delete mode 100755 htdocs/edit/process/part_pkg.cgi delete mode 100755 htdocs/edit/process/part_referral.cgi delete mode 100755 htdocs/edit/process/part_svc.cgi delete mode 100755 htdocs/edit/process/svc_acct.cgi delete mode 100755 htdocs/edit/process/svc_acct_pop.cgi delete mode 100755 htdocs/edit/process/svc_acct_sm.cgi delete mode 100755 htdocs/edit/process/svc_domain.cgi delete mode 100755 htdocs/edit/svc_acct.cgi delete mode 100755 htdocs/edit/svc_acct_pop.cgi delete mode 100755 htdocs/edit/svc_acct_sm.cgi delete mode 100755 htdocs/edit/svc_domain.cgi delete mode 100644 htdocs/images/mid-logo.gif delete mode 100644 htdocs/images/small-logo.gif delete mode 100755 htdocs/index.html delete mode 100755 htdocs/misc/bill.cgi delete mode 100755 htdocs/misc/cancel-unaudited.cgi delete mode 100755 htdocs/misc/cancel_pkg.cgi delete mode 100755 htdocs/misc/expire_pkg.cgi delete mode 100755 htdocs/misc/link.cgi delete mode 100755 htdocs/misc/print-invoice.cgi delete mode 100755 htdocs/misc/process/link.cgi delete mode 100755 htdocs/misc/susp_pkg.cgi delete mode 100755 htdocs/misc/unsusp_pkg.cgi delete mode 100755 htdocs/search/cust_bill.cgi delete mode 100755 htdocs/search/cust_bill.html delete mode 100755 htdocs/search/cust_main-payinfo.html delete mode 100755 htdocs/search/cust_main.cgi delete mode 100755 htdocs/search/cust_main.html delete mode 100755 htdocs/search/cust_pkg.cgi delete mode 100755 htdocs/search/svc_acct.cgi delete mode 100755 htdocs/search/svc_acct.html delete mode 100755 htdocs/search/svc_acct_sm.cgi delete mode 100755 htdocs/search/svc_acct_sm.html delete mode 100755 htdocs/search/svc_domain.cgi delete mode 100755 htdocs/search/svc_domain.html delete mode 100755 htdocs/view/cust_bill.cgi delete mode 100755 htdocs/view/cust_main.cgi delete mode 100755 htdocs/view/cust_pkg.cgi delete mode 100755 htdocs/view/svc_acct.cgi delete mode 100755 htdocs/view/svc_acct_sm.cgi delete mode 100755 htdocs/view/svc_domain.cgi (limited to 'htdocs') diff --git a/htdocs/browse/agent.cgi b/htdocs/browse/agent.cgi deleted file mode 100755 index cf5f2281f..000000000 --- a/htdocs/browse/agent.cgi +++ /dev/null @@ -1,72 +0,0 @@ -#!/usr/bin/perl -Tw -# -# agent.cgi: browse agent -# -# ivan@sisd.com 97-dec-12 -# -# changes to allow pages to load from a relative location in the web tree. -# bmccane@maxbaud.net 98-mar-25 -# -# changed 'type' to 'atype' because type is reserved word in Pg6.3 -# bmccane@maxbaud.net 98-apr-3 -# -# agent type was linking to wrong cgi ivan@sisd.com 98-jul-18 -# -# lose background, FS::CGI ivan@sisd.com 98-sep-2 - -use strict; -use CGI::Base; -use FS::UID qw(cgisuidsetup swapuid); -use FS::Record qw(qsearch qsearchs); -use FS::CGI qw(header menubar); - -my($cgi) = new CGI::Base; -$cgi->get; - -&cgisuidsetup($cgi); - -SendHeaders(); # one guess. -print header('Agent Listing', menubar( - 'Main Menu' => '../', - 'Add new agent' => '../edit/agent.cgi' -)), < - Click on agent number to edit. - - - - - - - - -END - -my($agent); -foreach $agent ( sort { - $a->getfield('agentnum') <=> $b->getfield('agentnum') -} qsearch('agent',{}) ) { - my($hashref)=$agent->hashref; - my($typenum)=$hashref->{typenum}; - my($agent_type)=qsearchs('agent_type',{'typenum'=>$typenum}); - my($atype)=$agent_type->getfield('atype'); - print < - - - - - - -END - -} - -print < - - - -END - diff --git a/htdocs/browse/agent_type.cgi b/htdocs/browse/agent_type.cgi deleted file mode 100755 index 5f05bd514..000000000 --- a/htdocs/browse/agent_type.cgi +++ /dev/null @@ -1,81 +0,0 @@ -#!/usr/bin/perl -Tw -# -# agent_type.cgi: browse agent_type -# -# ivan@sisd.com 97-dec-10 -# -# Changes to allow page to work at a relative position in server -# Changes to make "Packages" display 2-wide in table (old way was too vertical) -# bmccane@maxbaud.net 98-apr-3 -# -# lose background, FS::CGI ivan@sisd.com 98-sep-2 - -use strict; -use CGI::Base; -use FS::UID qw(cgisuidsetup swapuid); -use FS::Record qw(qsearch qsearchs); -use FS::CGI qw(header menubar); - -my($cgi) = new CGI::Base; -$cgi->get; - -&cgisuidsetup($cgi); - -SendHeaders(); # one guess. - -print header("Agent Type Listing", menubar( - 'Main Menu' => '../', - 'Add new agent type' => "../edit/agent_type.cgi", -)), <Click on agent type number to edit. -
Agent #AgentTypeFreq. (unimp.)Prog. (unimp.)
- $hashref->{agentnum}$hashref->{agent}$atype$hashref->{freq}$hashref->{prog}
- - - - - -END - -my($agent_type); -foreach $agent_type ( sort { - $a->getfield('typenum') <=> $b->getfield('typenum') -} qsearch('agent_type',{}) ) { - my($hashref)=$agent_type->hashref; - my(@type_pkgs)=qsearch('type_pkgs',{'typenum'=> $hashref->{typenum} }); - my($rowspan)=scalar(@type_pkgs); - $rowspan = int($rowspan/2+0.5) ; - print < - - -END - - my($type_pkgs); - my($tdcount) = -1 ; - foreach $type_pkgs ( @type_pkgs ) { - my($pkgpart)=$type_pkgs->getfield('pkgpart'); - my($part_pkg) = qsearchs('part_pkg',{'pkgpart'=> $pkgpart }); - print qq!! if ($tdcount == 0) ; - $tdcount = 0 if ($tdcount == -1) ; - print qq!"; - $tdcount ++ ; - if ($tdcount == 2) - { - print qq!\n! ; - $tdcount = 0 ; - } - } - - print ""; -} - -print <
Type #TypePackages
- $hashref->{typenum} - $hashref->{atype}
!, - $part_pkg->getfield('pkg'),"
- - - -END - diff --git a/htdocs/browse/cust_main_county.cgi b/htdocs/browse/cust_main_county.cgi deleted file mode 100755 index d615198c9..000000000 --- a/htdocs/browse/cust_main_county.cgi +++ /dev/null @@ -1,65 +0,0 @@ -#!/usr/bin/perl -Tw -# -# cust_main_county.cgi: browse cust_main_county -# -# ivan@sisd.com 97-dec-13 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 -# -# lose background, FS::CGI ivan@sisd.com 98-sep-2 - -use strict; -use CGI::Base; -use FS::UID qw(cgisuidsetup swapuid); -use FS::Record qw(qsearch qsearchs); -use FS::CGI qw(header menubar); - -my($cgi) = new CGI::Base; -$cgi->get; - -&cgisuidsetup($cgi); - -SendHeaders(); # one guess. -print header("Tax Rate Listing", menubar( - 'Main Menu' => '../', - 'Edit tax rates' => "../edit/cust_main_county.cgi", -)),<Click on expand to specify tax rates by county. -

- - - - - -END - -my($cust_main_county); -foreach $cust_main_county ( qsearch('cust_main_county',{}) ) { - my($hashref)=$cust_main_county->hashref; - print < - -END - - print ""; - - print <$hashref->{tax}% - -END - -} - -print < - - - -END - diff --git a/htdocs/browse/part_pkg.cgi b/htdocs/browse/part_pkg.cgi deleted file mode 100755 index e5ff31e9e..000000000 --- a/htdocs/browse/part_pkg.cgi +++ /dev/null @@ -1,81 +0,0 @@ -#!/usr/bin/perl -Tw -# -# part_svc.cgi: browse part_pkg -# -# ivan@sisd.com 97-dec-5,9 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 -# -# lose background, FS::CGI ivan@sisd.com 98-sep-2 - -use strict; -use CGI::Base; -use FS::UID qw(cgisuidsetup swapuid); -use FS::Record qw(qsearch qsearchs); -use FS::CGI qw(header menubar); - -my($cgi) = new CGI::Base; -$cgi->get; - -&cgisuidsetup($cgi); - -SendHeaders(); # one guess. - -print header("Package Part Listing",menubar( - 'Main Menu' => '../', - 'Add new package' => "../edit/part_pkg.cgi", -)), <Click on package part number to edit. -
StateCountyTax
$hashref->{state}", $hashref->{county} - ? $hashref->{county} - : qq!(ALL) !. - qq!expand! - , "
- - - - - - - - - - -END - -my($part_pkg); -foreach $part_pkg ( sort { - $a->getfield('pkgpart') <=> $b->getfield('pkgpart') -} qsearch('part_pkg',{}) ) { - my($hashref)=$part_pkg->hashref; - my(@pkg_svc)=grep $_->getfield('quantity'), - qsearch('pkg_svc',{'pkgpart'=> $hashref->{pkgpart} }); - my($rowspan)=scalar(@pkg_svc); - print < - - - - - - -END - - my($pkg_svc); - foreach $pkg_svc ( @pkg_svc ) { - my($svcpart)=$pkg_svc->getfield('svcpart'); - my($part_svc) = qsearchs('part_svc',{'svcpart'=> $svcpart }); - print qq!\n"; - } - - print ""; -} - -print <
Part #PackageCommentSetup FeeFreq.Recur. FeeServiceQuan.
- $hashref->{pkgpart} - $hashref->{pkg}$hashref->{comment}$hashref->{setup}$hashref->{freq}$hashref->{recur}!, - $part_svc->getfield('svc'),"", - $pkg_svc->getfield('quantity'),"
- - - -END - diff --git a/htdocs/browse/part_referral.cgi b/htdocs/browse/part_referral.cgi deleted file mode 100755 index b16fa896d..000000000 --- a/htdocs/browse/part_referral.cgi +++ /dev/null @@ -1,57 +0,0 @@ -#!/usr/bin/perl -Tw -# -# part_referral.cgi: Browse part_referral -# -# ivan@sisd.com 98-feb-23 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 -# -# lose background, FS::CGI ivan@sisd.com 98-sep-2 - -use strict; -use CGI::Base; -use FS::UID qw(cgisuidsetup swapuid); -use FS::Record qw(qsearch); -use FS::CGI qw(header menubar); - -my($cgi) = new CGI::Base; -$cgi->get; - -&cgisuidsetup($cgi); - -SendHeaders(); # one guess. -print header("Referral Listing", menubar( - 'Main Menu' => '../', - 'Add new referral' => "../edit/part_referral.cgi", -)), <Click on referral number to edit. - - - - - -END - -my($part_referral); -foreach $part_referral ( sort { - $a->getfield('refnum') <=> $b->getfield('refnum') -} qsearch('part_referral',{}) ) { - my($hashref)=$part_referral->hashref; - print < - - - -END - -} - -print < - - - -END - diff --git a/htdocs/browse/part_svc.cgi b/htdocs/browse/part_svc.cgi deleted file mode 100755 index 71a556421..000000000 --- a/htdocs/browse/part_svc.cgi +++ /dev/null @@ -1,81 +0,0 @@ -#!/usr/bin/perl -Tw -# -# part_svc.cgi: browse part_svc -# -# ivan@sisd.com 97-nov-14, 97-dec-9 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 -# -# lose background, FS::CGI ivan@sisd.com 98-sep-2 - -use strict; -use CGI::Base; -use FS::UID qw(cgisuidsetup swapuid); -use FS::Record qw(qsearch); -use FS::part_svc qw(fields); -use FS::CGI qw(header menubar); - -my($cgi) = new CGI::Base; -$cgi->get; - -&cgisuidsetup($cgi); - -SendHeaders(); # one guess. -print header('Service Part Listing', menubar( - 'Main Menu' => '../', - 'Add new service' => "../edit/part_svc.cgi", -)),<Click on service part number to edit. -
Referral #Referral
- $hashref->{refnum}$hashref->{referral}
- - - - - - - - -END - -my($part_svc); -foreach $part_svc ( sort { - $a->getfield('svcpart') <=> $b->getfield('svcpart') -} qsearch('part_svc',{}) ) { - my($hashref)=$part_svc->hashref; - my($svcdb)=$hashref->{svcdb}; - my(@rows)= - grep $hashref->{${svcdb}.'__'.$_.'_flag'}, - map { /^${svcdb}__(.*)$/; $1 } - grep ! /_flag$/, - grep /^${svcdb}__/, - fields('part_svc') - ; - my($rowspan)=scalar(@rows); - print < - - - -END - my($row); - foreach $row ( @rows ) { - my($flag)=$part_svc->getfield($svcdb.'__'.$row.'_flag'); - print ""; - } -print ""; -} - -print < - - - -END - diff --git a/htdocs/browse/svc_acct_pop.cgi b/htdocs/browse/svc_acct_pop.cgi deleted file mode 100755 index a8a3a9224..000000000 --- a/htdocs/browse/svc_acct_pop.cgi +++ /dev/null @@ -1,63 +0,0 @@ -#!/usr/bin/perl -Tw -# -# svc_acct_pop.cgi: browse pops -# -# ivan@sisd.com 98-mar-8 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 -# -# lose background, FS::CGI ivan@sisd.com 98-sep-2 - -use strict; -use CGI::Base; -use FS::UID qw(cgisuidsetup swapuid); -use FS::Record qw(qsearch qsearchs); -use FS::CGI qw(header menubar); - -my($cgi) = new CGI::Base; -$cgi->get; - -&cgisuidsetup($cgi); - -SendHeaders(); # one guess. -print header('POP Listing', menubar( - 'Main Menu' => '../', - 'Add new POP' => "../edit/svc_acct_pop.cgi", -)), <Click on pop number to edit. -
Part #ServiceTableFieldActionValue
- $hashref->{svcpart} - $hashref->{svc}$hashref->{svcdb}$row"; - if ( $flag eq "D" ) { print "Default"; } - elsif ( $flag eq "F" ) { print "Fixed"; } - else { print "(Unknown!)"; } - print "",$part_svc->getfield($svcdb."__".$row),"
- - - - - - - -END - -my($svc_acct_pop); -foreach $svc_acct_pop ( sort { - $a->getfield('popnum') <=> $b->getfield('popnum') -} qsearch('svc_acct_pop',{}) ) { - my($hashref)=$svc_acct_pop->hashref; - print < - - - - - - -END - -} - -print < - - - -END - diff --git a/htdocs/docs/admin.html b/htdocs/docs/admin.html deleted file mode 100644 index 8adddbe92..000000000 --- a/htdocs/docs/admin.html +++ /dev/null @@ -1,6 +0,0 @@ - - Administration - - -

Administration

- diff --git a/htdocs/docs/billing.html b/htdocs/docs/billing.html deleted file mode 100644 index 02bfbd783..000000000 --- a/htdocs/docs/billing.html +++ /dev/null @@ -1,40 +0,0 @@ - - Billing - - -

Billing

- The bin/bill script can be run daily to bill all customers. Usage: bill [ -c [ i ] ] [ -d date ] [ -b ] -
    -
  • -c: Turn on collecting (you probably want this). -
  • -i: Real-time billing (as opposed to bacth billing). Only relevant for credit cards. Not available without modifying site_perl/Bill.pm -
  • -d: Pretend it is date (parsed by Date::Parse) -
  • -b: N/A -
- Printing should be configured on your freeside machine to print invoices. -

Batch credit card processing -
    -
  • After this script is run, a credit card batch will be in the cust_pay_batch table. Export this table to your credit card batching. -
  • When your batch completes, erase the cust_pay_batch records in that batch and add any necessary paymants to the cust_pay table. Example code to add payments is: -
    use FS::cust_pay;
    -
    -# loop over all records in batch
    -
    -my $payment=create FS::cust_pay (
    -  'invnum' => $invnum,
    -  'paid' => $paid,
    -  '_date' => $_date,
    -  'payby' => $payby,
    -  'payinfo' => $payinfo,
    -  'paybatch' => $paybatch,
    -);
    -
    -my $error=$payment->insert;
    -if ( $error ) {
    -  #process error
    -}
    -
    -# end loop
    -
    -All fields except paybatch are contained in the cust_pay_batch table. You can use paybatch field to track particular batches and/or particular transactions within a batch. -
- diff --git a/htdocs/docs/config.html b/htdocs/docs/config.html deleted file mode 100644 index 9b8002601..000000000 --- a/htdocs/docs/config.html +++ /dev/null @@ -1,38 +0,0 @@ - - Configuration files - - -

Configuration files

-Configuration files and directories are located in `/var/spool/freeside/conf'. -
    -
  • address - Your company name and address, four lines. -
  • bsdshellmachines - Your BSD flavored shell (and mail) machines, one per line. This enables export of `/etc/passwd' and `/etc/master.passwd'. -
  • cybercash2 - CyberCash v2 support, four lines: paymentserverhost, paymentserverport, paymentserversecret, and transaction type (`mauthonly' or `mauthcapture'). CCLib.pm is required. -
  • cybercash3.2 - CyberCash v3.2 support. Two lines: the full path and name of your merchant_conf file, and the transaction type (`mauthonly' or `mauthcapture'). CCMckLib3_2.pm, CCMckDirectLib3_2.pm and CCMckErrno3_2 are required. -
  • domain - Your domain name. -
  • erpcdmachines - Your ERPCD authenticaion machines, one per line. This enables export of `/usr/annex/acp_passwd' and `/usr/annex/acp_dialup'. -
  • home - For new users, prefixed to usrename to create a directory name. Should have a leading but not a trailing slash. -
  • lpr - Print command for paper invoices, for example `lpr -h'. -
  • nismachines - Your NIS master (not slave master) machines, one per line. This enables export of `/etc/global/passwd' and `/etc/global/shadow'. -
  • qmailmachines - Your qmail machines, one per line. This enables export of `/var/qmail/control/virtualdomains', `/var/qmail/control/recipientmap', and `/var/qmail/control/rcpthosts'. The existance of this file (even if empty) also turns on user `.qmail-extension' file maintenance in conjunction with `shellmachine'. -
  • radiusmachines - Your RADIUS authentication machines, one per line. This enables export of `/etc/raddb/users'. -
  • registries - Directory which contains domain registry information. Each registry is a directory. -
      -
    • registries/internic - Currently the only supported registry -
        -
      • registries/internic/from - Email address from which InterNIC domain registrations are sent. -
      • regestries/internic/nameservers - The nameservers for InterNIC domain registrations, one per line. Each line contains an IP address and hostname, separated by whitespace. -
      • registries/internic/tech_contact - Technical contact NIC handle for domain registrations. -
      • registries/internic/template - Template for InterNIC domain registrations with special markup. A suitable copy of the InterNIC domain template v4.0 is in `fs-x.y.z/etc/domain-template.txt'. -
      • registries/internic/to - Email address to which InterNIC domain registrations are sent. -
      -
    -
  • secrets - Three lines: Database engine datasource (for example, `DBI:mysql:freeside' or `DBI:Pg:dbname=freeside'), username, and password. This file should not be world readable. -
  • sendmailmachines - Your sendmail machines, one per line. This enables export of `/etc/virtusertable' and `/etc/sendmail.cw'. -
  • shellmachine - A single machine with user home directories mounted. This enables home directory creation, renaming and archiving/deletion. In conjunction with `qmailmachines', it also enables `.qmail-extension' file maintenance. -
  • shellmachines - Your Linux and System V flavored shell (and mail) machines, one per line. This enables export of `/etc/passwd' and `/etc/shadow' files. -
  • shells - Legal shells (think /etc/shells). You probably want to `cut -d: -f7 /etc/passwd | sort | uniq' initially so that importing doesn't fail with `Illegal shell' errors, then remove any special entries afterwords. A blank line specifies that an empty shell is permitted. -
  • smtpmachine - SMTP relay for Freeside's outgoing mail. -
- - diff --git a/htdocs/docs/export.html b/htdocs/docs/export.html deleted file mode 100644 index f760b97dd..000000000 --- a/htdocs/docs/export.html +++ /dev/null @@ -1,39 +0,0 @@ - - File exporting - - -

File exporting

-
    -
  • bin/svc_acct.export will create UNIX `passwd', `shadow' and `master.passwd' files, ERPCD `acp_passwd' and `acp_dialup' files and a RADIUS `users' file in the `/var/spool/freeside/export' directory. Using the appropriate configuration files, you can export these files to your remote machines unattended; see below. -
      -
    • shellmachines - passwd and shadow are copied to the remote machine as /etc/passwd.new and /etc/shadow.net and then moved to /etc/passwd and /etc/shadow if no errors occur. -
    • bsdshellmachines - passwd and master.passwd are copied to the remote machine as /etc/passwd.new and /etc/master.passwd.new and moved to /etc/passwd and /etc/master.passwd if no errors occur. -
    • nismachines - passwd and shadow are copied to the `/etc/global' directory on the remote machine. If no errors occur, the command `( cd /var/yp; make; )' is executed on the remote machine. -
    • erpcdmachines - acp_passwd and acp_dialup are copied to the `/usr/annex' directory on the remote machine. If no errors occur, the command `( kill -USR1 `cat /usr/annex/erpcd.pid` )' is executed on the remote machine. -
    • radiusmachines - users is copied to the `/etc/raddb' directory on the remote machine. If no errors occur, the command `( builddbm )' is executed on the remote machine. -
    -
  • site_perl/svc_acct.pm - If a shellmachine is defined, users can be created, modified and deleted remotely; see below. -
      -
    • The command `useradd -d homedir -s shell -u uid username' is executed when a user is added. -
    • The command `userdel username' is executed with a user is deleted. -
    • If a user's home directory changes, the command `[ -d old_homedir && ( chmod u+t old_homedir; umask 022; mkdir new_homedir; cd old_homedir; find . -depth -print | cpio -pdm new_homedir; chmod u-t new_homedir; chown -R uid.gid new_homedir; rm -rf old_homedir )' is executed. -
    -
  • bin/svc_acct_sm.export will create Qmail `rcpthosts', `recipientmap' and `virtualdomains' files and Sendmail `virtusertable' and `sendmail.cw' files in the `/var/spool/freeside/export' directory. Using the appropriate configuration files, you can export these files to your remote machines unattemded; see below. -
      -
    • qmailmachines - recipientmap, virtualdomains and rcpthosts are copied to the `/var/qmail/control' directory on the remote machine. Note: If you imported qmail configuration files, run the generated `/var/spool/freeside/export/virtualdomains.FIX' on a machine with your user home directories before exporting qmail configuration files. -
    • shellmachine - The command `[ -e homedir/.qmail-default ] || { touch homedir/.qmail-default; chown uid.gid homedir/.qmail-default; }' will be run on this machine for users in the virtualdomains file. -
    • sendmailmachines - sendmail.cw and virtusertable are copied to the remote machine as /etc/sendmail.cw.new and /etc/virtusertable.new and moved to /etc/sendmail.cw and /etc/virtusertable if no errors occur. -
    -
  • site_perl/svc_acct_sm.pm - If the qmailmachines configuration file exists and a shellmachine is defined, user `.qmail-' files can be updated. -
      -
    • The command `[ -e homedir/.qmail-domain-default ] || { touch homedir/.qmail-domain-default; chown uid.gid homedir/.qmail-domain-default; }' is run. -
    -
-
Unattended remote login - Freeside can login to remote machines unattended using SSH. This can pose a security risk if not configured correctly, and will allow an intruder who breaks into your freeside machine full access to your remote machines. Do not use this feature unless you understand what you are doing! -
    -
  • As the freeside user (on your freeside machine), generate an authentication key using ssh-keygen. Since this is for unattended operation, you need to use a blank passphrase. -
  • Append the newly-created identity.pub file to root's authorized_keys on the remote machine(s). -
- - - diff --git a/htdocs/docs/index.html b/htdocs/docs/index.html deleted file mode 100644 index 20051ca4d..000000000 --- a/htdocs/docs/index.html +++ /dev/null @@ -1,23 +0,0 @@ - - Documentation - - -

Documentation

- - diff --git a/htdocs/docs/install.html b/htdocs/docs/install.html deleted file mode 100644 index c4784ebf6..000000000 --- a/htdocs/docs/install.html +++ /dev/null @@ -1,56 +0,0 @@ - - Installation - - -

Installation

-Before installing, you need: - -Install the Freeside distribution: -
    -
  • Add the user `freeside' to your system. -
  • Add the freeside database to your database engine. (with MySQL) (with PostgreSQL) -
  • Allow the freeside user full access to the freeside database. (with MySQL) (with PostgreSQL) -
  • Unpack the tarball:
    gunzip -c fs-x.y.z.tar.gz | tar xvf -
    -
  • Copy or link fs-x.y.z/site_perl to FS in your site_perl directory. (try `perl -V' if unsure)
    mkdir /usr/local/lib/site_perl/FS
    -cp fs-x.y.z/site_perl/* /usr/local/lib/site_perl/FS
    or
    ln -s /full/path/to/fs-x.y.z/site_perl /usr/local/lib/site_perl/FS
    -
  • Copy or link fs-x.y.z/htdocs to your web server's document space.
    mkdir /usr/local/apache/htdocs/freeside
    -cp -r fs-x.y.z/htdocs/* /usr/local/apache/htdocs/freeside
    or
    ln -s /full/path/to/fs-x.y.z/htdocs /usr/local/apache/htdocs/freeside
    -
  • Restrict access to this web interface. (with Apache) -
  • Enable CGI execution for files with the `.cgi' extension. (with Apache) -
  • Set ownership and permissions for the web interface. Your system should support secure setuid scripts or Perl's emulation, see perlsec: Security Bugs for information and workarounds. -
    cd /usr/local/apache/htdocs/freeside
    -chown -R freeside .
    -chmod 4755 browse/*.cgi edit/*.cgi edit/process/*.cgi misc/*.cgi misc/process/*.cgi search/*.cgi view/*.cgi
    -
  • Create the base Freeside directory `/var/spool/freeside', and the subdirectories `conf', `counters', and `export'.
    mkdir /var/spool/freeside
    -mkdir /var/spool/freeside/conf
    -mkdir /var/spool/freeside/counters
    -mkdir /var/spool/freeside/export
    -chown -R freeside /var/spool/freeside
    -
  • Create the necessary configuration files. -
  • Run bin/fs-setup to create the database tables. -
- diff --git a/htdocs/docs/legacy.html b/htdocs/docs/legacy.html deleted file mode 100644 index 40e09cb3c..000000000 --- a/htdocs/docs/legacy.html +++ /dev/null @@ -1,34 +0,0 @@ - - Importing legacy data - - -

Importing legacy data

-
    -
  • bin/svc_acct.import - Import `passwd', ( `shadow' or `master.passwd' ) and RADIUS `users'. Before running bin/svc_acct.import, you need services (with table svc_acct) as follows: -
      -
    • Most accounts probably have entries in passwd and users (with Port-Limit nonexistant or 1) -
    • Some accounts have entries in passwd and users, but with Port-Limit 2 (or more) -
    • Some accounts might have entries in users only (Port-Limit 1) -
    • Some accounts might have entries in users only (Port-Limit >= 2) -
    • POP mail accounts have entries in passwd only, and have a particular shell. -
    • Everything else in passwd is a shell account. -
    -
  • bin/svc_acct_sm.import - Import qmail ( `virtualdomains' and `rcpthosts' ), or sendmail ( `virtusertable' and `sendmail.cw' ) files. Before running bin/svc_acct_sm.import, you need services as follows: -
      -
    • Domain (table svc_acct) -
    • Mail alias (table svc_acct_sm) -
    -
  • Importing customer data -
      -
    • Manually -
        -
      • Add a new customer -
      • Add one or more packages for this customer -
      • Enter a package by clicking on the package number -
      • Pick the `Link to existing' option -
      -
    • Batch - You will need to write a script to import your particular legacy data. You can use eg/TEMPLATE_cust_main.import as a starting point. -
    -
- - diff --git a/htdocs/docs/passwd.html b/htdocs/docs/passwd.html deleted file mode 100644 index a8f8151e2..000000000 --- a/htdocs/docs/passwd.html +++ /dev/null @@ -1,16 +0,0 @@ - - fs_passwd - - -

fs_passwd

-You may use fs_passwd/fs_passwd as a "passwd", "chfn" and "chsh" replacement on your shell machine(s) to cause password, gecos and shell changes to update your freeside machine. This can pose a security risk if not configured correctly. Do not use this feature unless you understand what you are doing! -

Currently it is assumed that the the crypt(3) function in the C library is the same on the Freeside machine as on the target machine. -
    -
  • Create a freeside account on the shell machine(s). -
  • Append the identity.pub from the freeside user on your freeside machine to the authorized_keys file of the newly created freeside user on the shell machine(s). -
  • Copy fs_passwd/fs_passwd to /usr/local/bin on the shell machine(s). (chown freeside, chmod 4755). You may link it to passwd, chfn and chsh as well. -
  • Copy fs_passwd/fs_passwdd to /usr/local/sbin on the shell machine(s). (chown freeside, chmod 500) -
  • Create /usr/local/freeside on the shell machine(s). (chown freeside, chmod 700) -
  • Run an iteration of "fs_passwd/fs_passwd_server shell.machine" as the freeside user for each shell machine (this is a daemon process). -
- diff --git a/htdocs/docs/schema.html b/htdocs/docs/schema.html deleted file mode 100644 index 5a296ec83..000000000 --- a/htdocs/docs/schema.html +++ /dev/null @@ -1,205 +0,0 @@ - - Schema reference - - -

Schema reference

-
    -
  • agent - Agents are resellers of your service. Agents may be limited to a subset of your full offerings (via their agent type). -
      -
    • agentnum - primary key -
    • agent - name of this agent -
    • typenum - agent type -
    • prog - (unimplemented) -
    • freq - (unimplemented) -
    -
  • agent_type - Agent types define groups of packages that you can then assign to particular agents. -
      -
    • typenum - primary key -
    • atype - name of this agent type -
    -
  • cust_bill - Invoices -
      -
    • invnum - primary key -
    • custnum - customer -
    • _date -
    • charged - amount of this invoice -
    • owed - amount still outstanding on this invoice -
    • printed - how many times this invoice has been printed automatically -
    -
  • cust_bill_pkg - Invoice line items -
      -
    • invnum - (multiple) key -
    • pkgnum - package -
    • setup - setup fee -
    • recur - recurring fee -
    • sdate - starting date -
    • edate - ending date -
    -
  • cust_credit - Credits -
      -
    • crednum - primary key -
    • custnum - customer -
    • amount - amount credited -
    • credited - amount still outstanding (not yet refunded) on this credit -
    • _date -
    • otaker - order taker -
    • reason -
    -
  • cust_main - Customers -
      -
    • custnum - primary key -
    • agentnum - agent -
    • refnum - referral -
    • first - name -
    • last - name -
    • ss - social security number -
    • company -
    • address1 -
    • address2 -
    • city -
    • county -
    • state -
    • zip -
    • country -
    • daytime - phone -
    • night - phone -
    • payby - CARD, BILL, or COMP -
    • payinfo - card number, P.O.#, or comp issuer -
    • paydate - expiration date -
    • payname - billing name (name on card) -
    • tax - tax exempt, Y or null -
    • otaker - order taker -
    -
  • cust_main_county - Tax rates -
      -
    • taxnum - primary key -
    • state -
    • county -
    • tax - % rate -
    -
  • cust_pay - Payments -
      -
    • paynum - primary key -
    • invnum - invoice -
    • paid - amount -
    • _date -
    • payby - CARD, BILL, or COMP -
    • payinfo - card number, P.O.#, or comp issuer -
    • paybatch - text field for tracking card processor batches -
    -
  • cust_pay_batch - Pending batch -
      -
    • trancode - 77 for charges -
    • cardnum -
    • exp - card expiration -
    • amount -
    • invnum - invoice -
    • custnum - customer -
    • payname - name on card -
    • first - name -
    • last - name -
    • address1 -
    • address2 -
    • city -
    • state -
    • zip -
    • country -
    -
  • cust_pkg - Customer billing items -
      -
    • pkgnum - primary key -
    • custnum - customer -
    • pkgpart - Package definition -
    • setup - date -
    • bill - next bill date -
    • susp - (past) suspension date -
    • expire - (future) cancellation date -
    • cancel - (past) cancellation date -
    • otaker - order taker -
    -
  • cust_refund - Refunds -
      -
    • refundnum - primary key -
    • crednum - credit -
    • refund - amount -
    • _date -
    • payby - CARD, BILL or COMP -
    • payinfo - card number, P.O.#, or comp issuer -
    • otaker - order taker -
    -
  • cust_svc - Customer services - -
  • part_pkg - Package definitions -
      -
    • pkgpart - primary key -
    • pkg - package name -
    • comment - non-customer visable package comment -
    • setup - setup fee -
    • freq - recurring frequency (months) -
    • recur - recurring fee -
    -
  • part_referral - Referral listing -
      -
    • refnum
    • - primary key -
    • referral
    • - referral -
    -
  • part_svc - Service definitions -
      -
    • svcpart - primary key -
    • svc - name of this service -
    • svcdb - table used for this service: svc_acct, svc_acct_sm, svc_domain, svc_charge or svc_wo -
    • table__field - Default or fixed value for field in table -
    • table__field_flag - null, D or F -
    -
  • pkg_svc - -
  • svc_acct - Accounts -
      -
    • svcnum - primary key -
    • username -
    • _password -
    • popnum - Point of Presence -
    • uid -
    • gid -
    • finger - GECOS -
    • dir -
    • shell -
    • quota - (unimplementd) -
    • slipip - IP address -
    • radius_Radius_Attribute - Radius-Attribute -
    -
  • svc_acct_pop - Points of Presence -
      -
    • popnum - primary key -
    • city -
    • state -
    • ac - area code -
    • exch - exchange -
    -
  • svc_acct_sm - Domain mail aliases - -
  • svc_domain - Domains - -
  • type_pkgs - -
- diff --git a/htdocs/docs/trouble.html b/htdocs/docs/trouble.html deleted file mode 100644 index 2cf6d4e71..000000000 --- a/htdocs/docs/trouble.html +++ /dev/null @@ -1,41 +0,0 @@ - - Troubleshooting - - -

Troubleshooting

-
    -
  • When troubleshooting the web interface, helpful information is often in your web server's error log. -
  • Internet Explorer will not work with Freeside's HTML interface. -Netscape, -Lynx, and -Emacs/W3, -among others, should work fine. -
  • If bin/svc_acct.import fails with an "Out of memory!" error using MySQL, upgrede MySQL and recompile the Perl DBD. There was a memory leak in some older versions of MySQL. -
  • If you get tons of errors in your web server's error log like this: -
    -Ambiguous use of value => resolved to "value" =>
    -at /usr/lib/perl5/site_perl/File/CounterFile.pm line 132.
    -
    - This clutters up your log files but is otherwise harmless. Upgrade to the latest File::CounterFile. -
  • If you get an Internal Server Error when adding or editing, but find that the update has occured, and you get something like the following in your web server's error log: -
    -access to /your/path/edit/process/some_table.cgi failed for
    -machine.domain.tld, reason: malformed header from script.
    -Bad header=HTTP/1.0 302 Moved Temporarily
    -
    - Then you forgot to apply this patch as mentioned in the New Installation section of the documentation. -
  • If you get errors like this: -
    -UID.pm: Can't open /var/spool/freeside/conf/secrets: Permission denied 
    -at /your/path/site_perl/FS/UID.pm line 26.
    -BEGIN failed--compilation aborted at
    -/your/path/edit/process/part_svc.cgi line 15.
    -
    - Then the scripts are not running setuid freeside. If you were editing -the files, it is possible you inadvertantly removed the setuid bit. -As mentioned in the New Installation section of the documentation, set ownership and permissions for the web interface. Your system should support secure setuid scripts or Perl's emulation, see perlsec: Security Bugs for information and workarounds. -
    cd /usr/local/apache/htdocs/freeside
    -chown -R freeside .
    -chmod 4755 browse/*.cgi edit/*.cgi edit/process/*.cgi misc/*.cgi misc/process/*.cgi search/*.cgi view/*.cgi
    -
- diff --git a/htdocs/docs/upgrade.html b/htdocs/docs/upgrade.html deleted file mode 100644 index d2201f601..000000000 --- a/htdocs/docs/upgrade.html +++ /dev/null @@ -1,24 +0,0 @@ - - Upgrading to 1.1.x - - -

Upgrading to 1.1.x

-
    -
  • Back up your data and current Freeside installation. -
  • Unpack a copy of the 1.0.0 distribution in a separate location. -
  • Diff your current installation against the 1.0.0 distribution. -
  • Apply all the diffs you found above, if applicable. -
  • Apply (at least) the following changes to your database: -
    -ALTER TABLE cust_main CHANGE ss ss char(11) NULL;
    -ALTER TABLE cust_main CHANGE day daytime varchar(20) NULL;
    -ALTER TABLE svc_acct CHANGE password _password varchar(25) NOT NULL;
    -ALTER TABLE part_svc CHANGE svc_acct__password svc_acct___password varchar(25) NULL;
    -ALTER TABLE part_svc CHANGE svc_acct__password_flag svc_acct___password_flag char(1) NULL;
    -ALTER TABLE agent_type CHANGE type atype varchar(80) NOT NULL;
    -
    -
  • Optionally change the field lengths and types to match a 1.1.x install; see `bin/fs-setup'. -
  • Create the necessary configuration files, -
  • Copy or symlink htdocs and site_perl to the new 1.1.x copies. -
  • Run bin/dbdef-create. This file uses MySQL-specific syntax. If you are running a different database engine you will need to modify it slightly. - diff --git a/htdocs/docs/upgrade2.html b/htdocs/docs/upgrade2.html deleted file mode 100644 index 4bf7ea45a..000000000 --- a/htdocs/docs/upgrade2.html +++ /dev/null @@ -1,11 +0,0 @@ - - Upgrading to 1.1.3 - - -

    Upgrading to 1.1.3 from 1.1.x

    -
      -
    • If migrating from 1.0.0, see these instructions first. -
    • Back up your data and current Freeside installation. -
    • If applicable, create the new configuration files: lpr, cybercash2, cybercash3.2 -
    • Copy or symlink htdocs and site_perl to the new copies. - diff --git a/htdocs/edit/agent.cgi b/htdocs/edit/agent.cgi deleted file mode 100755 index 5bd116528..000000000 --- a/htdocs/edit/agent.cgi +++ /dev/null @@ -1,77 +0,0 @@ -#!/usr/bin/perl -Tw -# -# agent.cgi: Add/Edit agent (output form) -# -# ivan@sisd.com 97-dec-12 -# -# Changes to allow page to work at a relative position in server -# Changed 'type' to 'atype' because Pg6.3 reserves the type word -# bmccane@maxbaud.net 98-apr-3 -# -# use FS::CGI, added inline documentation ivan@sisd.com 98-jul-12 - -use strict; -use CGI::Base; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearch qsearchs); -use FS::agent; -use FS::CGI qw(header menubar); - -my($cgi) = new CGI::Base; -$cgi->get; - -&cgisuidsetup($cgi); - -SendHeaders(); # one guess. - -my($agent,$action); -if ( $cgi->var('QUERY_STRING') =~ /^(\d+)$/ ) { #editing - $agent=qsearchs('agent',{'agentnum'=>$1}); - $action='Edit'; -} else { #adding - $agent=create FS::agent {}; - $action='Add'; -} -my($hashref)=$agent->hashref; - -print header("$action Agent", menubar( - 'Main Menu' => '../', - 'View all agents' => '../browse/agent.cgi', -)), '
      '; - -print qq!!, - "Agent #", $hashref->{agentnum} ? $hashref->{agentnum} : "(NEW)"; - -print < -Agent -Agent type -Program (unimplemented) - -END - -print qq!
      !; - -print < - - -END - diff --git a/htdocs/edit/agent_type.cgi b/htdocs/edit/agent_type.cgi deleted file mode 100755 index b9fff4530..000000000 --- a/htdocs/edit/agent_type.cgi +++ /dev/null @@ -1,75 +0,0 @@ -#!/usr/bin/perl -Tw -# -# agent_type.cgi: Add/Edit agent type (output form) -# -# ivan@sisd.com 97-dec-10 -# -# Changes to allow page to work at a relative position in server -# Changed 'type' to 'atype' because Pg6.3 reserves the type word -# bmccane@maxbaud.net 98-apr-3 -# -# use FS::CGI, added inline documentation ivan@sisd.com 98-jul-12 - -use strict; -use CGI::Base; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearch qsearchs); -use FS::agent_type; -use FS::CGI qw(header menubar); - -my($cgi) = new CGI::Base; -$cgi->get; - -&cgisuidsetup($cgi); - -SendHeaders(); # one guess. - -my($agent_type,$action); -if ( $cgi->var('QUERY_STRING') =~ /^(\d+)$/ ) { #editing - $agent_type=qsearchs('agent_type',{'typenum'=>$1}); - $action='Edit'; -} else { #adding - $agent_type=create FS::agent_type {}; - $action='Add'; -} -my($hashref)=$agent_type->hashref; - -print header("$action Agent Type", menubar( - 'Main Menu' => '../', - 'View all agent types' => '../browse/agent_type.cgi', -)), ''; - -print qq!!, - "Agent Type #", $hashref->{typenum} ? $hashref->{typenum} : "(NEW)"; - -print <Type -

      Select which packages agents of this type may sell to customers

      -END - -my($part_pkg); -foreach $part_pkg ( qsearch('part_pkg',{}) ) { - print qq!
      $agent_type->getfield('typenum'), - 'pkgpart' => $part_pkg->getfield('pkgpart'), - }) - ? 'CHECKED ' - : '', - qq!"VALUE="ON"> !,$part_pkg->getfield('pkg') - ; -} - -print qq!
      !; - -print < - - -END - diff --git a/htdocs/edit/cust_credit.cgi b/htdocs/edit/cust_credit.cgi deleted file mode 100755 index 75ef21208..000000000 --- a/htdocs/edit/cust_credit.cgi +++ /dev/null @@ -1,97 +0,0 @@ -#!/usr/bin/perl -Tw -# -# cust_credit.cgi: Add a credit (output form) -# -# Usage: cust_credit.cgi custnum [ -paybatch ] -# http://server.name/path/cust_credit?custnum [ -paybatch ] -# -# Note: Should be run setuid root as user nobody. -# -# some hooks in here for modifications as well as additions, but needs (lots) more work. -# also see process/cust_credit.cgi, the script that processes the form. -# -# ivan@voicenet.com 96-dec-05 -# -# paybatch field, differentiates between credits & credits+refunds by commandline -# ivan@voicenet.com 96-dec-08 -# -# added (but commented out) sprintf("%.2f" in amount field. Hmm. -# ivan@voicenet.com 97-jan-3 -# -# paybatch stuff thrown out - has checkbox now instead. -# (well, sort of. still passed around for backward compatability and possible editing hook) -# ivan@voicenet.com 97-apr-21 -# -# rewrite ivan@sisd.com 98-mar-16 - -use strict; -use Date::Format; -use CGI::Base qw(:DEFAULT :CGI); #CGI module -use FS::UID qw(cgisuidsetup getotaker); - -my($cgi) = new CGI::Base; -$cgi->get; -cgisuidsetup($cgi); - -#untaint custnum -$QUERY_STRING =~ /^(\d+)$/; -my($custnum)=$1; - -#untaint otaker -my($otaker)=getotaker; - -SendHeaders(); # one guess. -print < - - Post Credit - - -
      -

      Post Credit

      -
      - -
      -END
      -
      -#crednum
      -my($crednum)="";
      -print qq!Credit #!, $crednum ? $crednum : " (NEW)", qq!!;
      -
      -#custnum
      -print qq!\nCustomer #$custnum!;
      -
      -#paybatch
      -print qq!!;
      -
      -#date
      -my($date)=time;
      -print qq!\nDate: !, time2str("%D",$date), qq!!;
      -
      -#amount
      -my($amount)='';
      -print qq!\nAmount \$!;
      -
      -#refund?
      -#print qq! Also post refund!;
      -
      -#otaker (hidden)
      -print qq!!;
      -
      -#reason
      -my($reason)='';
      -print qq!\nReason !;
      -
      -print <
      -
      -
      -END - -print < - - -END - diff --git a/htdocs/edit/cust_main.cgi b/htdocs/edit/cust_main.cgi deleted file mode 100755 index 14556010c..000000000 --- a/htdocs/edit/cust_main.cgi +++ /dev/null @@ -1,214 +0,0 @@ -#!/usr/bin/perl -Tw -# -# cust_main.cgi: Edit a customer (output form) -# -# Usage: cust_main.cgi custnum -# http://server.name/path/cust_main.cgi?custnum -# -# Note: Should be run setuid freeside as user nobody. -# -# ivan@voicenet.com 96-nov-29 -> 96-dec-04 -# -# Blank custnum for new customer. -# ivan@voicenet.com 96-dec-16 -# -# referral defaults to blank, to force people to pick something -# ivan@voicenet.com 97-jun-4 -# -# rewrote for new API -# ivan@voicenet.com 97-jul-28 -# -# new customer is null, not '#' -# otaker gotten from &getotaker instead of $ENV{REMOTE_USER} -# ivan@sisd.com 97-nov-12 -# -# cgisuidsetup($cgi); -# no need for old_ fields. -# now state+county is a select field (took out PA hack) -# used autoloaded $cust_main->field methods -# ivan@sisd.com 97-dec-17 -# -# fixed quoting problems ivan@sisd.com 98-feb-23 -# -# paydate sql update ivan@sisd.com 98-mar-5 -# -# Changes to allow page to work at a relative position in server -# Changed 'day' to 'daytime' because Pg6.3 reserves the day word -# Added test for paydate in mm-dd-yyyy format for Pg6.3 default format -# bmccane@maxbaud.net 98-apr-3 -# -# fixed one missed day->daytime ivan@sisd.com 98-jul-13 - -use strict; -use CGI::Base; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup getotaker); -use FS::Record qw(qsearch qsearchs); -use FS::cust_main; - -my($cgi) = new CGI::Base; -$cgi->get; - -cgisuidsetup($cgi); - -SendHeaders(); # one guess. - -#get record -my($custnum,$action,$cust_main); -if ( $cgi->var('QUERY_STRING') =~ /^(\d+)$/ ) { #editing - $custnum=$1; - $cust_main = qsearchs('cust_main',{'custnum'=>$custnum}); - $action='Edit'; -} else { - $custnum=''; - $cust_main = create FS::cust_main ( {} ); - $cust_main->setfield('otaker',&getotaker); - $cust_main->setfield('country','US'); - $action='Add'; -} - -print < - - Customer $action - - -
      -

      Customer $action

      -
      - -
      -END
      -
      -print qq!!,
      -      qq!Customer #!;
      -print $custnum ? $custnum : " (NEW)" , "";
      -
      -#agentnum
      -my($agentnum)=$cust_main->agentnum || 1; #set to first agent by default
      -my(@agents) = qsearch('agent',{});
      -print qq!\n\nAgent # ";
      -
      -#referral
      -#unless ($custnum) {
      -  my($refnum)=$cust_main->refnum || 0; #to avoid "arguement not numeric" error
      -  my(@referrals) = qsearch('part_referral',{});
      -  print qq!\nReferral ";
      -#}
      -
      -my($last,$first,$ss,$company,$address1,$address2,$city)=(
      -  $cust_main->last,
      -  $cust_main->first,
      -  $cust_main->ss,
      -  $cust_main->company,
      -  $cust_main->address1,
      -  $cust_main->address2,
      -  $cust_main->city,
      -);
      -
      -print < (first)  SS# 
      -Company 
      -Address 
      -        
      -City   State (county) ";
      -
      -my($zip,$country,$daytime,$night,$fax)=(
      -  $cust_main->zip,
      -  $cust_main->country,
      -  $cust_main->daytime,
      -  $cust_main->night,
      -  $cust_main->fax,
      -);
      -
      -print <
      -Country: $country
      -
      -Phone (daytime)  (night)  (fax)
      -
      -END
      -
      -my(%payby)=(
      -  'CARD' => "Credit card    ",
      -  'BILL' => "Billing    ",
      -  'COMP' => "Complimentary",
      -);
      -for (qw(CARD BILL COMP)) {
      -  print qq!payby eq "$_");
      -  print qq!>$payby{$_}!;
      -}
      -
      -
      -my($payinfo,$payname,$otaker)=(
      -  $cust_main->payinfo,
      -  $cust_main->payname,
      -  $cust_main->otaker,
      -);
      -
      -my($paydate);
      -if ( $cust_main->paydate =~ /^(\d{4})-(\d{2})-\d{2}$/ ) {
      -  $paydate="$2/$1"
      -} elsif ( $cust_main->paydate =~ /^(\d{2})-\d{2}-(\d{4}$)/ ) {
      -  $paydate="$1/$2"
      -}
      -else {
      -  $paydate='';
      -}
      -
      -print <
      -END
      -
      -print qq!Exp. date (MM/YY or MM/YYYY)    Billing name \ntax eq "Y";
      -print qq!> Tax Exempt!;
      -
      -print <$otaker
      -
      -END - -print qq!
      !; - -print < - - -END - diff --git a/htdocs/edit/cust_main_county-expand.cgi b/htdocs/edit/cust_main_county-expand.cgi deleted file mode 100755 index 59ff7043a..000000000 --- a/htdocs/edit/cust_main_county-expand.cgi +++ /dev/null @@ -1,49 +0,0 @@ -#!/usr/bin/perl -Tw -# -# cust_main_county-expand.cgi: Expand a state into counties (output form) -# -# ivan@sisd.com 97-dec-16 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 -# -# lose background, FS::CGI ivan@sisd.com 98-sep-2 - -use strict; -use CGI::Base; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearch qsearchs); -use FS::CGI qw(header menubar); - -my($cgi) = new CGI::Base; -$cgi->get; - -&cgisuidsetup($cgi); - -SendHeaders(); # one guess. - -$cgi->var('QUERY_STRING') =~ /^(\d+)$/ - or die "Illegal taxnum!"; -my($taxnum)=$1; - -my($cust_main_county)=qsearchs('cust_main_county',{'taxnum'=>$taxnum}); -die "Can't expand entry!" if $cust_main_county->getfield('county'); - -print header("Tax Rate (expand state)", menubar( - 'Main Menu' => '../', -)), < - - Separate counties by - line - (rumor has it broken on some browsers) or - whitespace. -
      -
      - - - - -END - diff --git a/htdocs/edit/cust_main_county.cgi b/htdocs/edit/cust_main_county.cgi deleted file mode 100755 index 904d58346..000000000 --- a/htdocs/edit/cust_main_county.cgi +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/perl -Tw -# -# cust_main_county.cgi: Edit tax rates (output form) -# -# ivan@sisd.com 97-dec-13-16 -# -# Changes to allow page to work at a relative position in server -# Changed tax field to accept 6 chars (MO uses 6.1%) -# bmccane@maxbaud.net 98-apr-3 -# -# lose background, FS::CGI ivan@sisd.com 98-sep-2 - -use strict; -use CGI::Base; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearch qsearchs); -use FS::CGI qw(header menubar); - -my($cgi) = new CGI::Base; -$cgi->get; - -&cgisuidsetup($cgi); - -SendHeaders(); # one guess. - -print header("Edit tax rates", menubar( - 'Main Menu' => '../', -)),< -
POP #CityStateArea codeExchange
- $hashref->{popnum}$hashref->{city}$hashref->{state}$hashref->{ac}$hashref->{exch}
- - - - - -END - -my($cust_main_county); -foreach $cust_main_county ( qsearch('cust_main_county',{}) ) { - my($hashref)=$cust_main_county->hashref; - print < - -END - - print ""; - - print qq!!; -END - -} - -print < - - - - - -END - diff --git a/htdocs/edit/cust_pay.cgi b/htdocs/edit/cust_pay.cgi deleted file mode 100755 index a6cb204d1..000000000 --- a/htdocs/edit/cust_pay.cgi +++ /dev/null @@ -1,76 +0,0 @@ -#!/usr/bin/perl -Tw -# -# cust_pay.cgi: Add a payment (output form) -# -# Usage: cust_pay.cgi invnum -# http://server.name/path/cust_pay.cgi?invnum -# -# Note: Should be run setuid as user nobody. -# -# some hooks for modifications as well as additions, but needs work. -# -# ivan@voicenet.com 96-dec-11 -# -# rewrite ivan@sisd.com 98-mar-16 - -use strict; -use Date::Format; -use CGI::Base qw(:DEFAULT :CGI); -use FS::UID qw(cgisuidsetup); - -my($cgi) = new CGI::Base; -$cgi->get; -cgisuidsetup($cgi); - -#untaint invnum -$QUERY_STRING =~ /^(\d+)$/; -my($invnum)=$1; - -SendHeaders(); # one guess. -print < - - Enter payment - - -
-

Enter payment

-
-
-
-END
-
-#invnum
-print qq!Invoice #$invnum!;
-
-#date
-my($date)=time;
-print qq!
Date: !, time2str("%D",$date), qq!!; - -#paid -print qq!
Amount \$!; - -#payby -my($payby)="BILL"; -print qq!
Payby: $payby!; - -#payinfo (check # now as payby="BILL" hardcoded.. what to do later?) -my($payinfo)=""; -print qq!
Check #!; - -#paybatch -print qq!!; - -print < -
-
-END - -print < - - -END - diff --git a/htdocs/edit/cust_pkg.cgi b/htdocs/edit/cust_pkg.cgi deleted file mode 100755 index d7f143db4..000000000 --- a/htdocs/edit/cust_pkg.cgi +++ /dev/null @@ -1,137 +0,0 @@ -#!/usr/bin/perl -Tw -# -# cust_pkg.cgi: Add/edit packages (output form) -# -# this is for changing packages around, not editing things within the package -# -# Usage: cust_pkg.cgi custnum -# http://server.name/path/cust_pkg.cgi?custnum -# -# Note: Should be run setuid freeside as user nobody -# -# started with /sales/add/cust_pkg.cgi, which added packages -# ivan@voicenet.com 97-jan-5, 97-mar-21 -# -# Rewrote for new API -# ivan@voicenet.com 97-jul-7 -# -# FS::Search is no more, &cgisuidsetup needs $cgi, ivan@sisd.com 98-mar-7 -# -# Changes to allow page to work at a relative position in server -# Changed to display packages 2-wide in a table -# bmccane@maxbaud.net 98-apr-3 -# -# fixed a pretty cool bug from above which caused a visual glitch ivan@sisd.com -# 98-jun-1 - -use strict; -use CGI::Base qw(:DEFAULT :CGI); # CGI module -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup getotaker); -use FS::Record qw(qsearch qsearchs); - -my($cgi) = new CGI::Base; -$cgi->get; -&cgisuidsetup($cgi); - -my(%pkg,%comment); -foreach (qsearch('part_pkg', {})) { - $pkg{ $_ -> getfield('pkgpart') } = $_->getfield('pkg'); - $comment{ $_ -> getfield('pkgpart') } = $_->getfield('comment'); -} - -#untaint custnum -$QUERY_STRING =~ /^(\d+)$/; -my($custnum)=$1; - -my($otaker)=&getotaker; - -SendHeaders(); -print < - - Add/Edit Packages - - -
-

Add/Edit Packages

-
- -
-END - -#custnum -print qq!!; - -#current packages (except cancelled packages) -my(@cust_pkg) = grep ! $_->getfield('cancel'), - qsearch('cust_pkg',{'custnum'=>$custnum}); - -if (@cust_pkg) { - print <Current packages -These are packages the customer currently has. Select those packages you -wish to remove (if any).

-END - - my ($count) = 0 ; - print qq!
StateCountyTax
$hashref->{state}", $hashref->{county} - ? $hashref->{county} - : '(ALL)' - , "%
! ; - foreach (@cust_pkg) { - print qq!! if ($count ==0) ; - my($pkgnum,$pkgpart)=( $_->getfield('pkgnum'), $_->getfield('pkgpart') ); - print qq!\n!, - #now you've got to admit this bug was pretty cool - qq!$pkgnum: $pkg{$pkgpart} - $comment{$pkgpart}\n!; - $count ++ ; - if ($count == 2) - { - $count = 0 ; - print qq!\n! ; - } - } - print qq!
!, - #qq!$pkgnum: $pkg{$pkgpart} - $comment{$pkgpart}
! ; - - print "


"; -} - -print <New packages -These are packages the customer can purchase. Specify the quantity to add -of each package.

-END - -my($cust_main)=qsearchs('cust_main',{'custnum'=>$custnum}); -my($agent)=qsearchs('agent',{'agentnum'=> $cust_main->agentnum }); - -my($type_pkgs); -my ($count) = 0 ; -print qq!
! ; -foreach $type_pkgs ( qsearch('type_pkgs',{'typenum'=> $agent->typenum }) ) { - my($pkgpart)=$type_pkgs->pkgpart; - print qq!! if ($count == 0) ; - print < - - $pkgpart: $pkg{$pkgpart} - $comment{$pkgpart}\n -END - $count ++ ; - if ($count == 2) - { - print qq!\n! ; - $count = 0 ; - } -} -print qq!
! ; - -#otaker -print qq!\n!; - -#submit -print qq!

\n!; - -print < - - -END diff --git a/htdocs/edit/part_pkg.cgi b/htdocs/edit/part_pkg.cgi deleted file mode 100755 index 9fe739bb7..000000000 --- a/htdocs/edit/part_pkg.cgi +++ /dev/null @@ -1,102 +0,0 @@ -#!/usr/bin/perl -Tw -# -# part_pkg.cgi: Add/Edit package (output form) -# -# ivan@sisd.com 97-dec-10 -# -# Changes to allow page to work at a relative position in server -# Changed to display services 2-wide in table -# bmccane@maxbaud.net 98-apr-3 -# -# use FS::CGI, added inline documentation ivan@sisd.com 98-jul-12 - -use strict; -use CGI::Base; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearch qsearchs); -use FS::part_pkg; -use FS::pkg_svc; -use FS::CGI qw(header menubar); - -my($cgi) = new CGI::Base; -$cgi->get; - -&cgisuidsetup($cgi); - -SendHeaders(); # one guess. - -my($part_pkg,$action); -if ( $cgi->var('QUERY_STRING') =~ /^(\d+)$/ ) { #editing - $part_pkg=qsearchs('part_pkg',{'pkgpart'=>$1}); - $action='Edit'; -} else { #adding - $part_pkg=create FS::part_pkg {}; - $action='Add'; -} -my($hashref)=$part_pkg->hashref; - -print header("$action Package Definition", menubar( - 'Main Menu' => '../', - 'View all packages' => '../browse/part_pkg.cgi', -)), ''; - -print qq!!, - "Package Part #", $hashref->{pkgpart} ? $hashref->{pkgpart} : "(NEW)"; - -print < -Package (customer-visable) -Comment (customer-hidden) -Setup fee for this package -Recurring fee for this package -Frequency (months) of recurring fee - - - -Enter the quantity of each service this package includes.

- - -END - -my($part_svc); -my($count) = 0 ; -foreach $part_svc ( qsearch('part_svc',{}) ) { - - my($svcpart)=$part_svc->getfield('svcpart'); - my($pkg_svc)=qsearchs('pkg_svc',{ - 'pkgpart' => $part_pkg->getfield('pkgpart'), - 'svcpart' => $svcpart, - }) || create FS::pkg_svc({ - 'pkgpart' => $part_pkg->getfield('pkgpart'), - 'svcpart' => $svcpart, - 'quantity' => 0, - }); - next unless $pkg_svc; - - print qq!! if $count == 0 ; - print qq!!, - qq!"; - $count ++ ; - if ($count == 2) - { - print qq!! ; - $count = 0 ; - } -} -print qq!! if ($count != 0) ; - -print "
Quan.ServiceQuan.Service
!, $part_svc->getfield('svc'), "
"; - -print qq!
!; - -print < - - -END - diff --git a/htdocs/edit/part_referral.cgi b/htdocs/edit/part_referral.cgi deleted file mode 100755 index f29802239..000000000 --- a/htdocs/edit/part_referral.cgi +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/perl -Tw -# -# agent.cgi: Add/Edit referral (output form) -# -# ivan@sisd.com 98-feb-23 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 -# -# confisuing typo on submit button ivan@sisd.com 98-jun-14 -# -# lose background, FS::CGI ivan@sisd.com 98-sep-2 - -use strict; -use CGI::Base; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearch qsearchs); -use FS::part_referral; -use FS::CGI qw(header menubar); - -my($cgi) = new CGI::Base; -$cgi->get; - -&cgisuidsetup($cgi); - -SendHeaders(); # one guess. - -my($part_referral,$action); -if ( $cgi->var('QUERY_STRING') =~ /^(\d+)$/ ) { #editing - $part_referral=qsearchs('part_referral',{'refnum'=>$1}); - $action='Edit'; -} else { #adding - $part_referral=create FS::part_referral {}; - $action='Add'; -} -my($hashref)=$part_referral->hashref; - -print header("$action Referral", menubar( - 'Main Menu' => '../', - 'View all referrals' => "../browse/part_referral.cgi", -)), < -END - -#display - -print qq!!, - "Referral #", $hashref->{refnum} ? $hashref->{refnum} : "(NEW)"; - -print < -Referral - -END - -print qq!
!; - -print < - - -END - diff --git a/htdocs/edit/part_svc.cgi b/htdocs/edit/part_svc.cgi deleted file mode 100755 index 491c013fe..000000000 --- a/htdocs/edit/part_svc.cgi +++ /dev/null @@ -1,148 +0,0 @@ -#!/usr/bin/perl -Tw -# -# part_svc.cgi: Add/Edit service (output form) -# -# ivan@sisd.com 97-nov-14 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 -# -# use FS::CGI, added inline documentation ivan@sisd.com 98-jul-12 - -use strict; -use CGI::Base; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearchs); -use FS::part_svc qw(fields); -use FS::CGI qw(header menubar); - -my($cgi) = new CGI::Base; -$cgi->get; - -&cgisuidsetup($cgi); - -SendHeaders(); # one guess. - -my($part_svc,$action); -if ( $cgi->var('QUERY_STRING') =~ /^(\d+)$/ ) { #editing - $part_svc=qsearchs('part_svc',{'svcpart'=>$1}); - $action='Edit'; -} else { #adding - $part_svc=create FS::part_svc {}; - $action='Add'; -} -my($hashref)=$part_svc->hashref; - -print header("$action Service Definition", menubar( - 'Main Menu' => '../', - 'View all services' => '../browse/part_svc.cgi', -)), ''; - - - -print qq!!, - "Service Part #", $hashref->{svcpart} ? $hashref->{svcpart} : "(NEW)"; - -print < -Service -Table
Off"; - print qq!Default "; - print qq!Fixed "; - print qq!
!, - ""; - $ptmp=''; - } -} -print ""; - -print qq!\n

!; - -print < - - -END - diff --git a/htdocs/edit/process/agent.cgi b/htdocs/edit/process/agent.cgi deleted file mode 100755 index 5d1ce3232..000000000 --- a/htdocs/edit/process/agent.cgi +++ /dev/null @@ -1,53 +0,0 @@ -#!/usr/bin/perl -Tw -# -# process/agent.cgi: Edit agent (process form) -# -# ivan@sisd.com 97-dec-12 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 -# -# lose background, FS::CGI ivan@sisd.com 98-sep-2 - -use strict; -use CGI::Request; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearch qsearchs); -use FS::agent qw(fields); -use FS::CGI qw(idiot); - -my($req)=new CGI::Request; # create form object - -&cgisuidsetup($req->cgi); - -my($agentnum)=$req->param('agentnum'); - -my($old)=qsearchs('agent',{'agentnum'=>$agentnum}) if $agentnum; - -#unmunge typenum -$req->param('typenum') =~ /^(\d+)(:.*)?$/; -$req->param('typenum',$1); - -my($new)=create FS::agent ( { - map { - $_, $req->param($_); - } fields('agent') -} ); - -my($error); -if ( $agentnum ) { - $error=$new->replace($old); -} else { - $error=$new->insert; - $agentnum=$new->getfield('agentnum'); -} - -if ( $error ) { - &idiot($error); -} else { - #$req->cgi->redirect("../../view/agent.cgi?$agentnum"); - #$req->cgi->redirect("../../edit/agent.cgi?$agentnum"); - $req->cgi->redirect("../../browse/agent.cgi"); -} - diff --git a/htdocs/edit/process/agent_type.cgi b/htdocs/edit/process/agent_type.cgi deleted file mode 100755 index 43f129fd5..000000000 --- a/htdocs/edit/process/agent_type.cgi +++ /dev/null @@ -1,83 +0,0 @@ -#!/usr/bin/perl -Tw -# -# process/agent_type.cgi: Edit agent type (process form) -# -# ivan@sisd.com 97-dec-11 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 -# -# lose background, FS::CGI ivan@sisd.com 98-sep-2 - -use strict; -use CGI::Request; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearch qsearchs); -use FS::agent_type qw(fields); -use FS::type_pkgs; -use FS::CGI qw(idiot); - -my($req)=new CGI::Request; -&cgisuidsetup($req->cgi); - -my($typenum)=$req->param('typenum'); -my($old)=qsearchs('agent_type',{'typenum'=>$typenum}) if $typenum; - -my($new)=create FS::agent_type ( { - map { - $_, $req->param($_); - } fields('agent_type') -} ); - -my($error); -if ( $typenum ) { - $error=$new->replace($old); -} else { - $error=$new->insert; - $typenum=$new->getfield('typenum'); -} - -if ( $error ) { - idiot($error); - exit; -} - -my($part_pkg); -foreach $part_pkg (qsearch('part_pkg',{})) { - my($pkgpart)=$part_pkg->getfield('pkgpart'); - - my($type_pkgs)=qsearchs('type_pkgs',{ - 'typenum' => $typenum, - 'pkgpart' => $pkgpart, - }); - if ( $type_pkgs && ! $req->param("pkgpart$pkgpart") ) { - my($d_type_pkgs)=$type_pkgs; #need to save $type_pkgs for below. - $error=$d_type_pkgs->del; #FS::Record not FS::type_pkgs, - #so ->del not ->delete. hmm. hmm. - if ( $error ) { - idiot($error); - exit; - } - - } elsif ( $req->param("pkgpart$pkgpart") - && ! $type_pkgs - ) { - #ok to clobber it now (but bad form nonetheless?) - $type_pkgs=create FS::type_pkgs ({ - 'typenum' => $typenum, - 'pkgpart' => $pkgpart, - }); - $error= $type_pkgs->insert; - if ( $error ) { - idiot($error); - exit; - } - } - -} - -#$req->cgi->redirect("../../view/agent_type.cgi?$typenum"); -#$req->cgi->redirect("../../edit/agent_type.cgi?$typenum"); -$req->cgi->redirect("../../browse/agent_type.cgi"); - diff --git a/htdocs/edit/process/cust_credit.cgi b/htdocs/edit/process/cust_credit.cgi deleted file mode 100755 index e660b4c78..000000000 --- a/htdocs/edit/process/cust_credit.cgi +++ /dev/null @@ -1,70 +0,0 @@ -#!/usr/bin/perl -Tw -# -# process/cust_credit.cgi: Add a credit (process form) -# -# Usage: post form to: -# http://server.name/path/cust_credit.cgi -# -# Note: Should be run setuid root as user nobody. -# -# ivan@voicenet.com 96-dec-05 -> 96-dec-08 -# -# post a refund if $new_paybatch -# ivan@voicenet.com 96-dec-08 -# -# refunds are no longer applied against a specific payment (paybatch) -# paybatch field removed -# ivan@voicenet.com 97-apr-22 -# -# rewrite ivan@sisd.com 98-mar-16 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 - -use strict; -use CGI::Request; -use FS::UID qw(cgisuidsetup getotaker); -use FS::cust_credit; - -my($req)=new CGI::Request; # create form object -cgisuidsetup($req->cgi); - -$req->param('custnum') =~ /^(\d*)$/ or die "Illegal custnum!"; -my($custnum)=$1; - -$req->param('otaker',getotaker); - -my($new) = create FS::cust_credit ( { - map { - $_, $req->param($_); - } qw(custnum _date amount otaker reason) -} ); - -my($error); -$error=$new->insert; -&idiot($error) if $error; - -#no errors, no refund, so view our credit. -$req->cgi->redirect("../../view/cust_main.cgi?$custnum#history"); - -sub idiot { - my($error)=@_; - CGI::Base::SendHeaders(); # one guess - print < - - Error posting credit/refund - - -
-

Error posting credit/refund

-
- Your update did not occur because of the following error: -

$error -

Hit the Back button in your web browser, correct this mistake, and press the Post button again. - - -END - -} - diff --git a/htdocs/edit/process/cust_main.cgi b/htdocs/edit/process/cust_main.cgi deleted file mode 100755 index 7664dfcb8..000000000 --- a/htdocs/edit/process/cust_main.cgi +++ /dev/null @@ -1,102 +0,0 @@ -#!/usr/bin/perl -Tw -# -# process/cust_main.cgi: Edit a customer (process form) -# -# Usage: post form to: -# http://server.name/path/cust_main.cgi -# -# Note: Should be run setuid root as user nobody. -# -# ivan@voicenet.com 96-dec-04 -# -# added referral check -# ivan@voicenet.com 97-jun-4 -# -# rewrote for new API -# ivan@voicenet.com 97-jul-28 -# -# same as above (again) and clean up some stuff ivan@sisd.com 98-feb-23 -# -# Changes to allow page to work at a relative position in server -# Changed 'day' to 'daytime' because Pg6.3 reserves the day word -# bmccane@maxbaud.net 98-apr-3 - -use strict; -use CGI::Request; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearchs); -use FS::cust_main; - -my($req)=new CGI::Request; # create form object - -&cgisuidsetup($req->cgi); - -#create new record object - -#unmunge agentnum -$req->param('agentnum', - (split(/:/, ($req->param('agentnum'))[0] ))[0] -); - -#unmunge tax -$req->param('tax','') unless defined($req->param('tax')); - -#unmunge refnum -$req->param('refnum', - (split(/:/, ($req->param('refnum'))[0] ))[0] -); - -#unmunge state/county -$req->param('state') =~ /^(\w+)( \((\w+)\))?$/; -$req->param('state', $1); -$req->param('county', $3 || ''); - -my($new) = create FS::cust_main ( { - map { - $_, $req->param("$_") || '' - } qw(custnum agentnum last first ss company address1 address2 city county - state zip country daytime night fax payby payinfo paydate payname tax - otaker refnum) -} ); - -if ( $new->custnum eq '' ) { - - my($error)=$new->insert; - &idiot($error) if $error; - -} else { #create old record object - - my($old) = qsearchs( 'cust_main', { 'custnum', $new->custnum } ); - &idiot("Old record not found!") unless $old; - my($error)=$new->replace($old); - &idiot($error) if $error; - -} - -my($custnum)=$new->custnum; -$req->cgi->redirect("../../view/cust_main.cgi?$custnum#cust_main"); - -sub idiot { - my($error)=@_; - CGI::Base::SendHeaders(); # one guess - print < - - Error updating customer information - - -

-

Error updating customer information

-
- Your update did not occur because of the following error: -

$error -

Hit the Back button in your web browser, correct this mistake, and submit the form again. - - -END - - exit; - -} - diff --git a/htdocs/edit/process/cust_main_county-expand.cgi b/htdocs/edit/process/cust_main_county-expand.cgi deleted file mode 100755 index a821560c6..000000000 --- a/htdocs/edit/process/cust_main_county-expand.cgi +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/perl -Tw -# -# process/cust_main_county-expand.cgi: Expand counties (process form) -# -# ivan@sisd.com 97-dec-16 -# -# Changes to allow page to work at a relative position in server -# Added import of datasrc from UID.pm for Pg6.3 -# Default tax to 0.0 if using Pg6.3 -# bmccane@maxbaud.net 98-apr-3 -# -# lose background, FS::CGI -# undo default tax to 0.0 if using Pg6.3: comes from pre-expanded record -# for that state -#ivan@sisd.com 98-sep-2 - -use strict; -use CGI::Request; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup datasrc); -use FS::Record qw(qsearch qsearchs); -use FS::cust_main_county; -use FS::CGI qw(eidiot); - -my($req)=new CGI::Request; # create form object - -&cgisuidsetup($req->cgi); - -$req->param('taxnum') =~ /^(\d+)$/ or die "Illegal taxnum!"; -my($taxnum)=$1; -my($cust_main_county)=qsearchs('cust_main_county',{'taxnum'=>$taxnum}) - or die ("Unknown taxnum!"); - -my(@counties); -if ( $req->param('delim') eq 'n' ) { - @counties=split(/\n/,$req->param('counties')); -} elsif ( $req->param('delim') eq 's' ) { - @counties=split(/\s+/,$req->param('counties')); -} else { - die "Illegal delim!"; -} - -@counties=map { - /^\s*([\w\- ]+)\s*$/ or eidiot("Illegal county"); - $1; -} @counties; - -my($county); -foreach ( @counties) { - my(%hash)=$cust_main_county->hash; - my($new)=create FS::cust_main_county \%hash; - $new->setfield('taxnum',''); - $new->setfield('county',$_); - #if (datasrc =~ m/Pg/) - #{ - # $new->setfield('tax',0.0); - #} - my($error)=$new->insert; - die $error if $error; -} - -unless ( qsearch('cust_main',{ - 'state' => $cust_main_county->getfield('state'), - 'county' => $cust_main_county->getfield('county'), -} ) ) { - my($error)=($cust_main_county->delete); - die $error if $error; -} - -$req->cgi->redirect("../../edit/cust_main_county.cgi"); - diff --git a/htdocs/edit/process/cust_main_county.cgi b/htdocs/edit/process/cust_main_county.cgi deleted file mode 100755 index 58eaa63ce..000000000 --- a/htdocs/edit/process/cust_main_county.cgi +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/perl -Tw -# -# process/agent.cgi: Edit cust_main_county (process form) -# -# ivan@sisd.com 97-dec-16 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 -# -# lose background, FS::CGI ivan@sisd.com 98-sep-2 - -use strict; -use CGI::Request; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearch qsearchs); -use FS::cust_main_county; -use FS::CGI qw(eidiot); - -my($req)=new CGI::Request; # create form object - -&cgisuidsetup($req->cgi); - -foreach ( $req->params ) { - /^tax(\d+)$/ or die "Illegal form $_!"; - my($taxnum)=$1; - my($old)=qsearchs('cust_main_county',{'taxnum'=>$taxnum}) - or die "Couldn't find taxnum $taxnum!"; - next unless $old->getfield('tax') ne $req->param("tax$taxnum"); - my(%hash)=$old->hash; - $hash{tax}=$req->param("tax$taxnum"); - my($new)=create FS::cust_main_county \%hash; - my($error)=$new->replace($old); - eidiot($error) if $error; -} - -$req->cgi->redirect("../../browse/cust_main_county.cgi"); - diff --git a/htdocs/edit/process/cust_pay.cgi b/htdocs/edit/process/cust_pay.cgi deleted file mode 100755 index 9ec97532b..000000000 --- a/htdocs/edit/process/cust_pay.cgi +++ /dev/null @@ -1,57 +0,0 @@ -#!/usr/bin/perl -Tw -# -# process/cust_pay.cgi: Add a payment (process form) -# -# Usage: post form to: -# http://server.name/path/cust_pay.cgi -# -# Note: Should be run setuid root as user nobody. -# -# ivan@voicenet.com 96-dec-11 -# -# rewrite ivan@sisd.com 98-mar-16 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 - -use strict; -use CGI::Request; -use FS::UID qw(cgisuidsetup); -use FS::cust_pay qw(fields); - -my($req)=new CGI::Request; -&cgisuidsetup($req->cgi); - -$req->param('invnum') =~ /^(\d*)$/ or die "Illegal svcnum!"; -my($invnum)=$1; - -my($new) = create FS::cust_pay ( { - map { - $_, $req->param($_); - } qw(invnum paid _date payby payinfo paybatch) -} ); - -my($error); -$error=$new->insert; - -if ($error) { #error! - CGI::Base::SendHeaders(); # one guess - print < - - Error posting payment - - -

-

Error posting payment

-
- Your update did not occur because of the following error: -

$error -

Hit the Back button in your web browser, correct this mistake, and press the Post button again. - - -END -} else { #no errors! - $req->cgi->redirect("../../view/cust_bill.cgi?$invnum"); -} - diff --git a/htdocs/edit/process/cust_pkg.cgi b/htdocs/edit/process/cust_pkg.cgi deleted file mode 100755 index 6f5bc875a..000000000 --- a/htdocs/edit/process/cust_pkg.cgi +++ /dev/null @@ -1,73 +0,0 @@ -#!/usr/bin/perl -Tw -# -# process/cust_pkg.cgi: Add/edit packages (process form) -# -# this is for changing packages around, not for editing things within the -# package -# -# Usage: post form to: -# http://server.name/path/cust_pkg.cgi -# -# Note: Should be run setuid root as user nobody. -# -# ivan@voicenet.com 97-mar-21 - 97-mar-24 -# -# rewrote for new API -# ivan@voicenet.com 97-jul-7 - 15 -# -# &cgisuidsetup($cgi) ivan@sisd.com 98-mar-7 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 - -use strict; -use CGI::Request; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::cust_pkg; - -my($req)=new CGI::Request; # create form object - -&cgisuidsetup($req->cgi); - -#untaint custnum -$req->param('new_custnum') =~ /^(\d+)$/; -my($custnum)=$1; - -my(@remove_pkgnums) = map { - /^(\d+)$/ or die "Illegal remove_pkg value!"; - $1; -} $req->param('remove_pkg'); - -my(@pkgparts); -my($pkgpart); -foreach $pkgpart ( map /^pkg(\d+)$/ ? $1 : (), $req->params ) { - my($num_pkgs)=$req->param("pkg$pkgpart"); - while ( $num_pkgs-- ) { - push @pkgparts,$pkgpart; - } -} - -my($error) = FS::cust_pkg::order($custnum,\@pkgparts,\@remove_pkgnums); - -if ($error) { - CGI::Base::SendHeaders(); - print < - - Error updating packages - - -

-

Error updating packages

-
- Your update did not occur because of the following error: -

$error -

Hit the Back button in your web browser, correct this mistake, and submit the form again. - - -END -} else { - $req->cgi->redirect("../../view/cust_main.cgi?$custnum#cust_pkg"); -} - diff --git a/htdocs/edit/process/part_pkg.cgi b/htdocs/edit/process/part_pkg.cgi deleted file mode 100755 index 7d787819a..000000000 --- a/htdocs/edit/process/part_pkg.cgi +++ /dev/null @@ -1,79 +0,0 @@ -#!/usr/bin/perl -Tw -# -# process/part_pkg.cgi: Edit package definitions (process form) -# -# ivan@sisd.com 97-dec-10 -# -# don't update non-changing records in part_svc (causing harmless but annoying -# "Records identical" errors). ivan@sisd.com 98-feb-19 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 -# -# Added `|| 0 ' when getting quantity off web page ivan@sisd.com 98-jun-4 -# -# lose background, FS::CGI ivan@sisd.com 98-sep-2 - -use strict; -use CGI::Request; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearch qsearchs); -use FS::part_pkg qw(fields); -use FS::pkg_svc; -use FS::CGI qw(eidiot); - -my($req)=new CGI::Request; # create form object - -&cgisuidsetup($req->cgi); - -my($pkgpart)=$req->param('pkgpart'); - -my($old)=qsearchs('part_pkg',{'pkgpart'=>$pkgpart}) if $pkgpart; - -my($new)=create FS::part_pkg ( { - map { - $_, $req->param($_); - } fields('part_pkg') -} ); - -if ( $pkgpart ) { - my($error)=$new->replace($old); - eidiot($error) if $error; -} else { - my($error)=$new->insert; - eidiot($error) if $error; - $pkgpart=$new->getfield('pkgpart'); -} - -my($part_svc); -foreach $part_svc (qsearch('part_svc',{})) { -# don't update non-changing records in part_svc (causing harmless but annoying -# "Records identical" errors). ivan@sisd.com 98-jan-19 - #my($quantity)=$req->param('pkg_svc'. $part_svc->getfield('svcpart')), - my($quantity)=$req->param('pkg_svc'. $part_svc->svcpart) || 0, - my($old_pkg_svc)=qsearchs('pkg_svc',{ - 'pkgpart' => $pkgpart, - 'svcpart' => $part_svc->getfield('svcpart'), - }); - my($old_quantity)=$old_pkg_svc ? $old_pkg_svc->quantity : 0; - next unless $old_quantity != $quantity; #!here - my($new_pkg_svc)=create FS::pkg_svc({ - 'pkgpart' => $pkgpart, - 'svcpart' => $part_svc->getfield('svcpart'), - #'quantity' => $req->param('pkg_svc'. $part_svc->getfield('svcpart')), - 'quantity' => $quantity, - }); - if ($old_pkg_svc) { - my($error)=$new_pkg_svc->replace($old_pkg_svc); - eidiot($error) if $error; - } else { - my($error)=$new_pkg_svc->insert; - eidiot($error) if $error; - } -} - -#$req->cgi->redirect("../../view/part_pkg.cgi?$pkgpart"); -#$req->cgi->redirect("../../edit/part_pkg.cgi?$pkgpart"); -$req->cgi->redirect("../../browse/part_pkg.cgi"); - diff --git a/htdocs/edit/process/part_referral.cgi b/htdocs/edit/process/part_referral.cgi deleted file mode 100755 index 08a4c01d0..000000000 --- a/htdocs/edit/process/part_referral.cgi +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/perl -Tw -# -# process/part_referral.cgi: Edit referrals (process form) -# -# ivan@sisd.com 98-feb-23 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 -# -# lose background, FS::CGI ivan@sisd.com 98-sep-2 - -use strict; -use CGI::Request; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearchs); -use FS::part_referral qw(fields); -use FS::CGI qw(eidiot); -use FS::CGI qw(eidiot); - -my($req)=new CGI::Request; # create form object - -&cgisuidsetup($req->cgi); - -my($refnum)=$req->param('refnum'); - -my($new)=create FS::part_referral ( { - map { - $_, $req->param($_); - } fields('part_referral') -} ); - -if ( $refnum ) { - my($old)=qsearchs('part_referral',{'refnum'=>$refnum}); - eidiot("(Old) Record not found!") unless $old; - my($error)=$new->replace($old); - eidiot($error) if $error; -} else { - my($error)=$new->insert; - eidiot($error) if $error; -} - -$refnum=$new->getfield('refnum'); -$req->cgi->redirect("../../browse/part_referral.cgi"); - diff --git a/htdocs/edit/process/part_svc.cgi b/htdocs/edit/process/part_svc.cgi deleted file mode 100755 index 0f0fbc6e8..000000000 --- a/htdocs/edit/process/part_svc.cgi +++ /dev/null @@ -1,47 +0,0 @@ -#!/usr/bin/perl -Tw -# -# process/part_svc.cgi: Edit service definitions (process form) -# -# ivan@sisd.com 97-nov-14 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 -# -# lose background, FS::CGI ivan@sisd.com 98-sep-2 - -use strict; -use CGI::Request; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearchs); -use FS::part_svc qw(fields); -use FS::CGI qw(eidiot); - -my($req)=new CGI::Request; # create form object - -&cgisuidsetup($req->cgi); - -my($svcpart)=$req->param('svcpart'); - -my($old)=qsearchs('part_svc',{'svcpart'=>$svcpart}) if $svcpart; - -my($new)=create FS::part_svc ( { - map { - $_, $req->param($_); -# } qw(svcpart svc svcdb) - } fields('part_svc') -} ); - -if ( $svcpart ) { - my($error)=$new->replace($old); - eidiot($error) if $error; -} else { - my($error)=$new->insert; - eidiot($error) if $error; - $svcpart=$new->getfield('svcpart'); -} - -#$req->cgi->redirect("../../view/part_svc.cgi?$svcpart"); -#$req->cgi->redirect("../../edit/part_svc.cgi?$svcpart"); -$req->cgi->redirect("../../browse/part_svc.cgi"); - diff --git a/htdocs/edit/process/svc_acct.cgi b/htdocs/edit/process/svc_acct.cgi deleted file mode 100755 index 8d77ba703..000000000 --- a/htdocs/edit/process/svc_acct.cgi +++ /dev/null @@ -1,87 +0,0 @@ -#!/usr/bin/perl -Tw -# -# process/svc_acct.cgi: Add/edit a customer (process form) -# -# Usage: post form to: -# http://server.name/path/svc_acct.cgi -# -# Note: Should br run setuid root as user nobody. -# -# ivan@voicenet.com 96-dec-18 -# -# Changed /u to /u2 -# ivan@voicenet.com 97-may-6 -# -# rewrote for new API -# ivan@voicenet.com 97-jul-17 - 21 -# -# no FS::Search, FS::svc_acct creates FS::cust_svc record, used for adding -# and editing ivan@sisd.com 98-mar-8 -# -# Changes to allow page to work at a relative position in server -# Changed 'password' to '_password' because Pg6.3 reserves the password word -# bmccane@maxbaud.net 98-apr-3 - -use strict; -use CGI::Request; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearchs); -use FS::svc_acct; - -my($req) = new CGI::Request; # create form object -&cgisuidsetup($req->cgi); - -$req->param('svcnum') =~ /^(\d*)$/ or die "Illegal svcnum!"; -my($svcnum)=$1; - -my($old)=qsearchs('svc_acct',{'svcnum'=>$svcnum}) if $svcnum; - -#unmunge popnum -$req->param('popnum', (split(/:/, $req->param('popnum') ))[0] ); - -#unmunge passwd -if ( $req->param('_password') eq '*HIDDEN*' ) { - $req->param('_password',$old->getfield('_password')); -} - -my($new) = create FS::svc_acct ( { - map { - $_, $req->param($_); - } qw(svcnum pkgnum svcpart username _password popnum uid gid finger dir - shell quota slipip) -} ); - -if ( $svcnum ) { - my($error) = $new->replace($old); - &idiot($error) if $error; -} else { - my($error) = $new->insert; - &idiot($error) if $error; - $svcnum = $new->getfield('svcnum'); -} - -#no errors, view account -$req->cgi->redirect("../../view/svc_acct.cgi?" . $svcnum ); - -sub idiot { - my($error)=@_; - CGI::Base::SendHeaders(); # one guess - print < - - Error adding/updating account - - -

-

Error adding/updating account

-
- Your update did not occur because of the following error: -

$error -

Hit the Back button in your web browser, correct this mistake, and submit the form again. - - -END - exit; -} - diff --git a/htdocs/edit/process/svc_acct_pop.cgi b/htdocs/edit/process/svc_acct_pop.cgi deleted file mode 100755 index 18d7940b4..000000000 --- a/htdocs/edit/process/svc_acct_pop.cgi +++ /dev/null @@ -1,43 +0,0 @@ -#!/usr/bin/perl -Tw -# -# process/svc_acct_pop.cgi: Edit POP (process form) -# -# ivan@sisd.com 98-mar-8 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 -# -# lose background, FS::CGI ivan@sisd.com 98-sep-2 - -use strict; -use CGI::Request; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearch qsearchs); -use FS::svc_acct_pop qw(fields); -use FS::CGI qw(eidiot); - -my($req)=new CGI::Request; # create form object - -&cgisuidsetup($req->cgi); - -my($popnum)=$req->param('popnum'); - -my($old)=qsearchs('svc_acct_pop',{'popnum'=>$popnum}) if $popnum; - -my($new)=create FS::svc_acct_pop ( { - map { - $_, $req->param($_); - } fields('svc_acct_pop') -} ); - -if ( $popnum ) { - my($error)=$new->replace($old); - eidiot($error) if $error; -} else { - my($error)=$new->insert; - eidiot($error) if $error; - $popnum=$new->getfield('popnum'); -} -$req->cgi->redirect("../../browse/svc_acct_pop.cgi"); - diff --git a/htdocs/edit/process/svc_acct_sm.cgi b/htdocs/edit/process/svc_acct_sm.cgi deleted file mode 100755 index 9ad546bf4..000000000 --- a/htdocs/edit/process/svc_acct_sm.cgi +++ /dev/null @@ -1,80 +0,0 @@ -#!/usr/bin/perl -Tw -# -# process/svc_acct_sm.cgi: Add/edit a mail alias (process form) -# -# Usage: post form to: -# http://server.name/path/svc_acct_sm.cgi -# -# Note: Should br run setuid root as user nobody. -# -# lots of crufty stuff from svc_acct still in here, and modifications are (unelegantly) disabled. -# -# ivan@voicenet.com 97-jan-6 -# -# enabled modifications -# -# ivan@voicenet.com 97-may-7 -# -# fixed removal of cust_svc record on modifications! -# ivan@voicenet.com 97-jun-5 -# -# rewrite ivan@sisd.com 98-mar-15 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 - -use strict; -use CGI::Request; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearchs); -use FS::svc_acct_sm; - -my($req)=new CGI::Request; # create form object -cgisuidsetup($req->cgi); - -$req->param('svcnum') =~ /^(\d*)$/ or die "Illegal svcnum!"; -my($svcnum)=$1; - -my($old)=qsearchs('svc_acct_sm',{'svcnum'=>$svcnum}) if $svcnum; - -#unmunge domsvc and domuid -$req->param('domsvc',(split(/:/, $req->param('domsvc') ))[0] ); -$req->param('domuid',(split(/:/, $req->param('domuid') ))[0] ); - -my($new) = create FS::svc_acct_sm ( { - map { - ($_, scalar($req->param($_))); - } qw(svcnum pkgnum svcpart domuser domuid domsvc) -} ); - -my($error); -if ( $svcnum ) { - $error = $new->replace($old); -} else { - $error = $new->insert; - $svcnum = $new->getfield('svcnum'); -} - -unless ($error) { - $req->cgi->redirect("../../view/svc_acct_sm.cgi?$svcnum"); -} else { - CGI::Base::SendHeaders(); # one guess - print < - - Error adding/editing mail alias - - -

-

Error adding/editing mail alias

-
- Your update did not occur because of the following error: -

$error -

Hit the Back button in your web browser, correct this mistake, and submit the form again. - - -END - -} - diff --git a/htdocs/edit/process/svc_domain.cgi b/htdocs/edit/process/svc_domain.cgi deleted file mode 100755 index 0782772dd..000000000 --- a/htdocs/edit/process/svc_domain.cgi +++ /dev/null @@ -1,78 +0,0 @@ -#!/usr/bin/perl -Tw -# -# process/svc_domain.cgi: Add a domain (process form) -# -# Usage: post form to: -# http://server.name/path/svc_domain.cgi -# -# Note: Should br run setuid root as user nobody. -# -# lots of yucky stuff in this one... bleachlkjhui! -# -# ivan@voicenet.com 97-jan-6 -# -# kludged for new domain template 3.5 -# ivan@voicenet.com 97-jul-24 -# -# moved internic bits to svc_domain.pm ivan@sisd.com 98-mar-14 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 - -use strict; -use CGI::Request; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearchs); -use FS::svc_domain; - -#remove this to actually test the domains! -$FS::svc_domain::whois_hack = 1; - -my($req) = new CGI::Request; -&cgisuidsetup($req->cgi); - -$req->param('svcnum') =~ /^(\d*)$/ or die "Illegal svcnum!"; -my($svcnum)=$1; - -my($new) = create FS::svc_domain ( { - map { - $_, $req->param($_); - } qw(svcnum pkgnum svcpart domain action purpose) -} ); - -my($error); -if ($req->param('legal') ne "Yes") { - $error = "Customer did not agree to be bound by NSI's ". - qq!!. - "Domain Name Resgistration Agreement"; -} elsif ($req->param('svcnum')) { - $error="Can't modify a domain!"; -} else { - $error=$new->insert; - $svcnum=$new->svcnum; -} - -unless ($error) { - $req->cgi->redirect("../../view/svc_domain.cgi?$svcnum"); -} else { - CGI::Base::SendHeaders(); # one guess - print < - - Error adding domain - - -

-

Error adding domain

-
- Your update did not occur because of the following error: -

$error -

Hit the Back button in your web browser, correct this mistake, and submit the form again. - - -END - -} - - diff --git a/htdocs/edit/svc_acct.cgi b/htdocs/edit/svc_acct.cgi deleted file mode 100755 index 61d0fdc28..000000000 --- a/htdocs/edit/svc_acct.cgi +++ /dev/null @@ -1,191 +0,0 @@ -#!/usr/bin/perl -Tw -# -# svc_acct.cgi: Add/edit account (output form) -# -# Usage: svc_acct.cgi {svcnum} | pkgnum{pkgnum}-svcpart{svcpart} -# http://server.name/path/svc_acct.cgi? {svcnum} | pkgnum{pkgnum}-svcpart{svcpart} -# -# Note: Should be run setuid freeside as user nobody -# -# ivan@voicenet.com 96-dec-18 -# -# rewrite ivan@sisd.com 98-mar-8 -# -# Changes to allow page to work at a relative position in server -# Changed 'password' to '_password' because Pg6.3 reserves the password word -# bmccane@maxbaud.net 98-apr-3 -# -# use conf/shells and dbdef username length ivan@sisd.com 98-jul-13 - -use strict; -use CGI::Base qw(:DEFAULT :CGI); -use FS::UID qw(cgisuidsetup getotaker); -use FS::Record qw(qsearch qsearchs); -use FS::svc_acct qw(fields); - -my($shells)="/var/spool/freeside/conf/shells"; -open(SHELLS,$shells) or die "Can't open $shells: $!"; -my(@shells)=map { - /^([\/\w]*)$/ or die "Illegal shell in conf/shells!"; - $1; -} grep $_ !~ /^#/, ; - -my($cgi) = new CGI::Base; -$cgi->get; -&cgisuidsetup($cgi); - -my($action,$svcnum,$svc_acct,$pkgnum,$svcpart,$part_svc); - -if ( $QUERY_STRING =~ /^(\d+)$/ ) { #editing - - $svcnum=$1; - $svc_acct=qsearchs('svc_acct',{'svcnum'=>$svcnum}) - or die "Unknown (svc_acct) svcnum!"; - - my($cust_svc)=qsearchs('cust_svc',{'svcnum'=>$svcnum}) - or die "Unknown (cust_svc) svcnum!"; - - $pkgnum=$cust_svc->pkgnum; - $svcpart=$cust_svc->svcpart; - - $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart}); - die "No part_svc entry!" unless $part_svc; - - $action="Edit"; - -} else { #adding - - $svc_acct=create FS::svc_acct({}); - - foreach $_ (split(/-/,$QUERY_STRING)) { - $pkgnum=$1 if /^pkgnum(\d+)$/; - $svcpart=$1 if /^svcpart(\d+)$/; - } - $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart}); - die "No part_svc entry!" unless $part_svc; - - $svcnum=''; - - #set gecos - my($cust_pkg)=qsearchs('cust_pkg',{'pkgnum'=>$pkgnum}); - if ($cust_pkg) { - my($cust_main)=qsearchs('cust_main',{'custnum'=> $cust_pkg->custnum } ); - $svc_acct->setfield('finger', - $cust_main->getfield('first') . " " . $cust_main->getfield('last') - ) ; - } - - #set fixed and default fields from part_svc - my($field); - foreach $field ( fields('svc_acct') ) { - if ( $part_svc->getfield('svc_acct__'. $field. '_flag') ne '' ) { - $svc_acct->setfield($field,$part_svc->getfield('svc_acct__'. $field) ); - } - } - - $action="Add"; - -} - -my($svc)=$part_svc->getfield('svc'); - -my($otaker)=getotaker; - -my($username,$password)=( - $svc_acct->username, - $svc_acct->_password ? "*HIDDEN*" : '', -); - -my($ulen)=$svc_acct->dbdef_table->column('username')->length; -my($ulen2)=$ulen+2; - -SendHeaders(); -print < - - $action $svc account - - -

-

$action $svc account

-

- - - - -Username: - -
Password: - -(blank to generate) -END - -#pop -my($popnum)=$svc_acct->popnum || 0; -if ( $part_svc->svc_acct__popnum_flag eq "F" ) { - print qq!!; -} else { - print qq!
POP: "; -} - -my($uid,$gid,$finger,$dir)=( - $svc_acct->uid, - $svc_acct->gid, - $svc_acct->finger, - $svc_acct->dir, -); - -print < - -
GECOS: - -END - -my($shell)=$svc_acct->shell; -if ( $part_svc->svc_acct__shell_flag eq "F" ) { - print qq!!; -} else { - print qq!
Shell: "; -} - -my($quota,$slipip)=( - $svc_acct->quota, - $svc_acct->slipip, -); - -print qq!!; - -if ( $part_svc->svc_acct__slipip_flag eq "F" ) { - print qq!!; -} else { - print qq!
IP: !; -} - -#submit -print qq!

!; - -print < - - -END - - diff --git a/htdocs/edit/svc_acct_pop.cgi b/htdocs/edit/svc_acct_pop.cgi deleted file mode 100755 index 46d803f07..000000000 --- a/htdocs/edit/svc_acct_pop.cgi +++ /dev/null @@ -1,67 +0,0 @@ -#!/usr/bin/perl -Tw -# -# svc_acct_pop.cgi: Add/Edit pop (output form) -# -# ivan@sisd.com 98-mar-8 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 -# -# lose background, FS::CGI ivan@sisd.com 98-sep-2 - -use strict; -use CGI::Base; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearch qsearchs); -use FS::svc_acct_pop; -use FS::CGI qw(header menubar); - -my($cgi) = new CGI::Base; -$cgi->get; - -&cgisuidsetup($cgi); - -SendHeaders(); # one guess. - -my($svc_acct_pop,$action); -if ( $cgi->var('QUERY_STRING') =~ /^(\d+)$/ ) { #editing - $svc_acct_pop=qsearchs('svc_acct_pop',{'popnum'=>$1}); - $action='Edit'; -} else { #adding - $svc_acct_pop=create FS::svc_acct_pop {}; - $action='Add'; -} -my($hashref)=$svc_acct_pop->hashref; - -print header("$action POP", menubar( - 'Main Menu' => '../', - 'View all POPs' => "../browse/svc_acct_pop.cgi", -)), < -END - -#display - -print qq!!, - "POP #", $hashref->{popnum} ? $hashref->{popnum} : "(NEW)"; - -print < -City -State -Area Code -Exchange - -END - -print qq!
!; - -print < - - -END - diff --git a/htdocs/edit/svc_acct_sm.cgi b/htdocs/edit/svc_acct_sm.cgi deleted file mode 100755 index 45a8eb8fc..000000000 --- a/htdocs/edit/svc_acct_sm.cgi +++ /dev/null @@ -1,219 +0,0 @@ -#!/usr/bin/perl -Tw -# -# svc_acct_sm.cgi: Add/edit a mail alias (output form) -# -# Usage: svc_acct_sm.cgi {svcnum} | pkgnum{pkgnum}-svcpart{svcpart} -# http://server.name/path/svc_acct_sm.cgi? {svcnum} | pkgnum{pkgnum}-svcpart{svcpart} -# -# use {svcnum} for edit, pkgnum{pkgnum}-svcpart{svcpart} for add -# -# Note: Should be run setuid freeside as user nobody. -# -# should error out in a more CGI-friendly way, and should have more error checking (sigh). -# -# ivan@voicenet.com 97-jan-5 -# -# added debugging code; fixed CPU-sucking problem with trying to edit an (unaudited) mail alias (no pkgnum) -# -# ivan@voicenet.com 97-may-7 -# -# fixed uid selection -# ivan@voicenet.com 97-jun-4 -# -# uid selection across _CUSTOMER_, not just _PACKAGE_ -# -# ( i need to be rewritten with fast searches) -# -# ivan@voicenet.com 97-oct-3 -# -# added fast searches in some of the places where it is sorely needed... -# I see DBI::mysql in your future... -# ivan@voicenet.com 97-oct-23 -# -# rewrite ivan@sisd.com 98-mar-15 -# -# /var/spool/freeside/conf/domain ivan@sisd.com 98-jul-26 - -use strict; -use CGI::Base qw(:DEFAULT :CGI); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearch qsearchs); -use FS::svc_acct_sm qw(fields); - -my($conf_domain)="/var/spool/freeside/conf/domain"; -open(DOMAIN,$conf_domain) or die "Can't open $conf_domain: $!"; -my($mydomain)=map { - /^(.*)$/ or die "Illegal line in $conf_domain!"; #yes, we trust the file - $1 -} grep $_ !~ /^(#|$)/, ; -close DOMAIN; - -my($cgi) = new CGI::Base; -$cgi->get; -&cgisuidsetup($cgi); - -SendHeaders(); # one guess. - -my($action,$svcnum,$svc_acct_sm,$pkgnum,$svcpart,$part_svc); -if ( $QUERY_STRING =~ /^(\d+)$/ ) { #editing - - $svcnum=$1; - $svc_acct_sm=qsearchs('svc_acct_sm',{'svcnum'=>$svcnum}) - or die "Unknown (svc_acct_sm) svcnum!"; - - my($cust_svc)=qsearchs('cust_svc',{'svcnum'=>$svcnum}) - or die "Unknown (cust_svc) svcnum!"; - - $pkgnum=$cust_svc->pkgnum; - $svcpart=$cust_svc->svcpart; - - $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart}); - die "No part_svc entry!" unless $part_svc; - - $action="Edit"; - -} else { #adding - - $svc_acct_sm=create FS::svc_acct_sm({}); - - foreach $_ (split(/-/,$QUERY_STRING)) { #get & untaint pkgnum & svcpart - $pkgnum=$1 if /^pkgnum(\d+)$/; - $svcpart=$1 if /^svcpart(\d+)$/; - } - $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart}); - die "No part_svc entry!" unless $part_svc; - - $svcnum=''; - - #set fixed and default fields from part_svc - my($field); - foreach $field ( fields('svc_acct_sm') ) { - if ( $part_svc->getfield('svc_acct_sm__'. $field. '_flag') ne '' ) { - $svc_acct_sm->setfield($field,$part_svc->getfield('svc_acct_sm__'. $field) ); - } - } - - $action='Add'; - -} - -my(%username,%domain); -if ($pkgnum) { - - #find all possible uids (and usernames) - - my($u_part_svc,@u_acct_svcparts); - foreach $u_part_svc ( qsearch('part_svc',{'svcdb'=>'svc_acct'}) ) { - push @u_acct_svcparts,$u_part_svc->getfield('svcpart'); - } - - my($cust_pkg)=qsearchs('cust_pkg',{'pkgnum'=>$pkgnum}); - my($custnum)=$cust_pkg->getfield('custnum'); - my($i_cust_pkg); - foreach $i_cust_pkg ( qsearch('cust_pkg',{'custnum'=>$custnum}) ) { - my($cust_pkgnum)=$i_cust_pkg->getfield('pkgnum'); - my($acct_svcpart); - foreach $acct_svcpart (@u_acct_svcparts) { #now find the corresponding - #record(s) in cust_svc ( for this - #pkgnum ! ) - my($i_cust_svc); - foreach $i_cust_svc ( qsearch('cust_svc',{'pkgnum'=>$cust_pkgnum,'svcpart'=>$acct_svcpart}) ) { - my($svc_acct)=qsearchs('svc_acct',{'svcnum'=>$i_cust_svc->getfield('svcnum')}); - $username{$svc_acct->getfield('uid')}=$svc_acct->getfield('username'); - } - } - } - - #find all possible domains (and domsvc's) - - my($d_part_svc,@d_acct_svcparts); - foreach $d_part_svc ( qsearch('part_svc',{'svcdb'=>'svc_domain'}) ) { - push @d_acct_svcparts,$d_part_svc->getfield('svcpart'); - } - - foreach $i_cust_pkg ( qsearch('cust_pkg',{'custnum'=>$custnum}) ) { - my($cust_pkgnum)=$i_cust_pkg->getfield('pkgnum'); - my($acct_svcpart); - foreach $acct_svcpart (@d_acct_svcparts) { - my($i_cust_svc); - foreach $i_cust_svc ( qsearch('cust_svc',{'pkgnum'=>$cust_pkgnum,'svcpart'=>$acct_svcpart}) ) { - my($svc_domain)=qsearch('svc_domain',{'svcnum'=>$i_cust_svc->getfield('svcnum')}); - $domain{$svc_domain->getfield('svcnum')}=$svc_domain->getfield('domain'); - } - } - } - -} elsif ( $action eq 'Edit' ) { - - my($svc_acct)=qsearchs('svc_acct',{'uid'=>$svc_acct_sm->domuid}); - $username{$svc_acct_sm->uid} = $svc_acct->username; - - my($svc_domain)=qsearchs('svc_domain',{'svcnum'=>$svc_acct_sm->domsvc}); - $domain{$svc_acct_sm->domsvc} = $svc_domain->domain; - -} else { - die "\$action eq Add, but \$pkgnum is null!\n"; -} - -print < - - Mail Alias $action - - -
-

Mail Alias $action

-
- -END - -#display - - #formatting - print "
";
-
-#svcnum
-print qq!!;
-print qq!Service #!, $svcnum ? $svcnum : " (NEW)", "";
-
-#pkgnum
-print qq!!;
- 
-#svcpart
-print qq!!;
-
-my($domuser,$domsvc,$domuid)=(
-  $svc_acct_sm->domuser,
-  $svc_acct_sm->domsvc,
-  $svc_acct_sm->domuid,
-);
-
-#domuser
-print qq!\n\nMail to  ( * for anything )!;
-
-#domsvc
-print qq! \@ ";
-
-#uid
-print qq!\nforwards to \@$mydomain mailbox.";
-
-	#formatting
-	print "
\n"; - -print qq!
!; - -print < - - -END - diff --git a/htdocs/edit/svc_domain.cgi b/htdocs/edit/svc_domain.cgi deleted file mode 100755 index 0717a2c09..000000000 --- a/htdocs/edit/svc_domain.cgi +++ /dev/null @@ -1,120 +0,0 @@ -#!/usr/bin/perl -Tw -# -# svc_domain.cgi: Add domain (output form) -# -# Usage: svc_domain.cgi pkgnum{pkgnum}-svcpart{svcpart} -# http://server.name/path/svc_domain.cgi?pkgnum{pkgnum}-svcpart{svcpart} -# -# Note: Should be run setuid freeside as user nobody -# -# ivan@voicenet.com 97-jan-5 -> 97-jan-6 -# -# changes for domain template 3.5 -# ivan@voicenet.com 97-jul-24 -# -# rewrite ivan@sisd.com 98-mar-14 -# -# no GOV in instructions ivan@sisd.com 98-jul-17 - -use strict; -use CGI::Base qw(:DEFAULT :CGI); -use FS::UID qw(cgisuidsetup getotaker); -use FS::Record qw(qsearch qsearchs); -use FS::svc_domain qw(fields); - -my($cgi) = new CGI::Base; -$cgi->get; -&cgisuidsetup($cgi); - -my($action,$svcnum,$svc_domain,$pkgnum,$svcpart,$part_svc); - -if ( $QUERY_STRING =~ /^(\d+)$/ ) { #editing - - $svcnum=$1; - $svc_domain=qsearchs('svc_domain',{'svcnum'=>$svcnum}) - or die "Unknown (svc_domain) svcnum!"; - - my($cust_svc)=qsearchs('cust_svc',{'svcnum'=>$svcnum}) - or die "Unknown (cust_svc) svcnum!"; - - $pkgnum=$cust_svc->pkgnum; - $svcpart=$cust_svc->svcpart; - - $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart}); - die "No part_svc entry!" unless $part_svc; - - $action="Edit"; - -} else { #adding - - $svc_domain=create FS::svc_domain({}); - - foreach $_ (split(/-/,$QUERY_STRING)) { - $pkgnum=$1 if /^pkgnum(\d+)$/; - $svcpart=$1 if /^svcpart(\d+)$/; - } - $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart}); - die "No part_svc entry!" unless $part_svc; - - $svcnum=''; - - #set fixed and default fields from part_svc - my($field); - foreach $field ( fields('svc_domain') ) { - if ( $part_svc->getfield('svc_domain__'. $field. '_flag') ne '' ) { - $svc_domain->setfield($field,$part_svc->getfield('svc_domain__'. $field) ); - } - } - - $action="Add"; - -} - -my($svc)=$part_svc->getfield('svc'); - -my($otaker)=getotaker; - -my($domain)=( - $svc_domain->domain, -); - -SendHeaders(); -print < - - $action $svc - - -
-

$action $svc

-

- - - - - New -
Transfer - -

Customer agrees to be bound by NSI's - -Domain Name Registration Agreement - -

Domain -
Purpose/Description: -

-
    -
  • COM is for commercial, for-profit organziations -
  • ORG is for miscellaneous, usually, non-profit organizations -
  • NET is for network infrastructure machines and organizations -
  • EDU is for 4-year, degree granting institutions - -
-US state and local government agencies, schools, libraries, museums, and individuals should register under the US domain. See RFC 1480 for a complete description of the US domain -and registration procedures. -

GOV registrations are limited to top-level US Federal Government agencies (see RFC 1816). - - - -END - diff --git a/htdocs/images/mid-logo.gif b/htdocs/images/mid-logo.gif deleted file mode 100644 index 4ceb3add5..000000000 Binary files a/htdocs/images/mid-logo.gif and /dev/null differ diff --git a/htdocs/images/small-logo.gif b/htdocs/images/small-logo.gif deleted file mode 100644 index a8e9c5763..000000000 Binary files a/htdocs/images/small-logo.gif and /dev/null differ diff --git a/htdocs/index.html b/htdocs/index.html deleted file mode 100755 index de0667e59..000000000 --- a/htdocs/index.html +++ /dev/null @@ -1,96 +0,0 @@ - - - - Freeside Main Menu - - - - - -
-

- Silicon Interactive Software Design -

-
freeside main menu
-
- - Information - -
- Documentation - -

-
-

New Customer

-

Search

- -
  • - customers (by last name and/or company) - -
  • customers (by credit card number) -
  • accounts (by username) -
  • domains (by domain) -
  • mail aliases (by domain, and optionally username) -
  • invoices (by invoice number) -
  • -

    Browse

    - -
  • customers (by customer number) -
  • customers (by last name) -
  • customers (by company) -
  • packages (by package number) -
  • packages with unconfigured services (by package number) -
  • accounts (by service number) -
  • accounts (by username) -
  • accounts (by uid) -
  • unlinked accounts (by service number) -
  • unlinked accounts (by username) -
  • unlinked accounts (by uid) -
  • domains (by service number) -
  • domains (by domain) -
  • unlinked domains (by service number) -
  • unlinked domains (by domain) -
  • -

    Administration

    - -
  • - View/Edit services - - - Services are items you offer to your customers. -
  • - View/Edit packages - - - One or more services are grouped together into a package and - given pricing information. Customers purchase packages, not - services. -
  • - View/Edit agent types - - - Agent types define groups of packages that you can then assign - to particular agents. -
  • - View/Edit agents - - - Agents are resellers of your service. Agents may be limited - to a subset of your full offerings (via their agent type). -
    -
  • - View/Edit referrals - - - Where a customer heard about your service. Tracked for - informational purposes. -
    -
  • - View/Edit locales and tax rates - - - Change tax rates by state, or break down a state into counties - and assign different tax rates to each county. -
    -
  • - View/Edit POPs - - - Points of Presence -
  • - - - diff --git a/htdocs/misc/bill.cgi b/htdocs/misc/bill.cgi deleted file mode 100755 index d41f6d1c9..000000000 --- a/htdocs/misc/bill.cgi +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/perl -Tw -# -# s/FS:Search/FS::Record/ and cgisuidsetup($cgi) ivan@sisd.com 98-mar-13 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 - -use strict; -use CGI::Base qw(:DEFAULT :CGI); -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearchs); -use FS::Bill; - -my($cgi) = new CGI::Base; -$cgi->get; -&cgisuidsetup($cgi); - -#untaint custnum -$QUERY_STRING =~ /^(\d*)$/; -my($custnum)=$1; -my($cust_main)=qsearchs('cust_main',{'custnum'=>$custnum}); -die "Can't find customer!\n" unless $cust_main; - -# ? -bless($cust_main,"FS::Bill"); - -my($error); - -$error = $cust_main->bill( -# 'time'=>$time - ); -&idiot($error) if $error; - -$error = $cust_main->collect( -# 'invoice-time'=>$time, -# 'batch_card'=> 'yes', - 'batch_card'=> 'no', - 'report_badcard'=> 'yes', - ); -&idiot($error) if $error; - -$cgi->redirect("../view/cust_main.cgi?$custnum#history"); - -sub idiot { - my($error)=@_; - CGI::Base::SendHeaders(); # one guess - print < - - Error billing customer - - -
    -

    Error billing customer

    -
    - Your update did not occur because of the following error: -

    $error - - -END - - exit; - -} - diff --git a/htdocs/misc/cancel-unaudited.cgi b/htdocs/misc/cancel-unaudited.cgi deleted file mode 100755 index 929274f38..000000000 --- a/htdocs/misc/cancel-unaudited.cgi +++ /dev/null @@ -1,85 +0,0 @@ -#!/usr/bin/perl -Tw -# -# cancel-unaudited.cgi: Cancel an unaudited account -# -# Usage: cancel-unaudited.cgi svcnum -# http://server.name/path/cancel-unaudited.cgi pkgnum -# -# Note: Should be run setuid freeside as user nobody -# -# ivan@voicenet.com 97-apr-23 -# -# rewrote for new API -# ivan@voicenet.com 97-jul-21 -# -# Search->Record, cgisuidsetup($cgi) ivan@sids.com 98-mar-19 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 - -use strict; -use CGI::Base qw(:DEFAULT :CGI); # CGI module -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearchs); -use FS::cust_svc; -use FS::svc_acct; - -my($cgi) = new CGI::Base; -$cgi->get; -&cgisuidsetup($cgi); - -#untaint svcnum -$QUERY_STRING =~ /^(\d+)$/; -my($svcnum)=$1; - -my($svc_acct) = qsearchs('svc_acct',{'svcnum'=>$svcnum}); -&idiot("Unknown svcnum!") unless $svc_acct; - -my($cust_svc) = qsearchs('cust_svc',{'svcnum'=>$svcnum}); -&idiot(qq!This account has already been audited. Cancel the - package instead.!) - if $cust_svc->getfield('pkgnum') ne ''; - -local $SIG{HUP} = 'IGNORE'; -local $SIG{INT} = 'IGNORE'; -local $SIG{QUIT} = 'IGNORE'; -local $SIG{TERM} = 'IGNORE'; -local $SIG{TSTP} = 'IGNORE'; - -my($error); - -bless($svc_acct,"FS::svc_acct"); -$error = $svc_acct->cancel; -&idiot($error) if $error; -$error = $svc_acct->delete; -&idiot($error) if $error; - -bless($cust_svc,"FS::cust_svc"); -$error = $cust_svc->delete; -&idiot($error) if $error; - -$cgi->redirect("../"); - -sub idiot { - my($error)=@_; - SendHeaders(); - print < - - Error cancelling account - - -

    -

    Error cancelling account

    -
    -
    - There has been an error cancelling this acocunt: $error - - - -END - exit; -} - diff --git a/htdocs/misc/cancel_pkg.cgi b/htdocs/misc/cancel_pkg.cgi deleted file mode 100755 index 6702a0351..000000000 --- a/htdocs/misc/cancel_pkg.cgi +++ /dev/null @@ -1,54 +0,0 @@ -#!/usr/bin/perl -Tw -# -# cancel_pkg.cgi: Cancel a package -# -# Usage: cancel_pkg.cgi pkgnum -# http://server.name/path/cancel_pkg.cgi pkgnum -# -# Note: Should be run setuid freeside as user nobody -# -# IT DOESN'T RUN THE APPROPRIATE PROGRAMS YET!!!! -# -# probably should generalize this to do cancels, suspensions, unsuspensions, etc. -# -# ivan@voicenet.com 97-jan-2 -# -# still kludgy, but now runs /dbin/cancel $pkgnum -# ivan@voicenet.com 97-feb-27 -# -# doesn't run if pkgnum doesn't match regex -# ivan@voicenet.com 97-mar-6 -# -# now redirects to enter comments -# ivan@voicenet.com 97-may-8 -# -# rewrote for new API -# ivan@voicenet.com 97-jul-21 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 - -use strict; -use CGI::Base qw(:DEFAULT :CGI); # CGI module -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearchs); -use FS::cust_pkg; -use FS::CGI qw(idiot); - -my($cgi) = new CGI::Base; -$cgi->get; -&cgisuidsetup($cgi); - -#untaint pkgnum -$QUERY_STRING =~ /^(\d+)$/ || die "Illegal pkgnum"; -my($pkgnum)=$1; - -my($cust_pkg) = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum}); - -bless($cust_pkg,'FS::cust_pkg'); -my($error)=$cust_pkg->cancel; -idiot($error) if $error; - -$cgi->redirect("../view/cust_main.cgi?".$cust_pkg->getfield('custnum')); - diff --git a/htdocs/misc/expire_pkg.cgi b/htdocs/misc/expire_pkg.cgi deleted file mode 100755 index 163516627..000000000 --- a/htdocs/misc/expire_pkg.cgi +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/perl -Tw -# -# expire_pkg.cgi: Expire a package -# -# Usage: post form to: -# http://server.name/path/expire_pkg.cgi -# -# Note: Should be run setuid freeside as user nobody -# -# based on susp_pkg -# ivan@voicenet.com 97-jul-29 -# -# ivan@sisd.com 98-mar-17 FS::Search->FS::Record -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 - -use strict; -use Date::Parse; -use CGI::Request; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearchs); -use FS::cust_pkg; - -my($req) = new CGI::Request; -&cgisuidsetup($req->cgi); - -#untaint date & pkgnum - -my($date); -if ( $req->param('date') ) { - str2time($req->param('date')) =~ /^(\d+)$/ or die "Illegal date"; - $date=$1; -} else { - $date=''; -} - -$req->param('pkgnum') =~ /^(\d+)$/ or die "Illegal pkgnum"; -my($pkgnum)=$1; - -my($cust_pkg) = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum}); -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')); - -sub idiot { - my($error)=@_; - SendHeaders(); - print < - - Error expiring package - - -
    -

    Error expiring package

    -
    -
    - There has been an error expiring this package: $error - - - -END - exit; -} - diff --git a/htdocs/misc/link.cgi b/htdocs/misc/link.cgi deleted file mode 100755 index d1db000ec..000000000 --- a/htdocs/misc/link.cgi +++ /dev/null @@ -1,72 +0,0 @@ -#!/usr/bin/perl -Tw -# -# link: instead of adding a new account, link to an existing. (output form) -# -# Note: Should be run setuid freeside as user nobody -# -# ivan@voicenet.com 97-feb-5 -# -# rewrite ivan@sisd.com 98-mar-17 -# -# can also link on some other fields now (about time) ivan@sisd.com 98-jun-24 - -use strict; -use CGI::Base qw(:DEFAULT :CGI); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearchs); - -my(%link_field)=( - 'svc_acct' => 'username', - 'svc_domain' => 'domain', - 'svc_acct_sm' => '', - 'svc_charge' => '', - 'svc_wo' => '', -); - -my($cgi) = new CGI::Base; -$cgi->get; -cgisuidsetup($cgi); - -my($pkgnum,$svcpart); -foreach $_ (split(/-/,$QUERY_STRING)) { #get & untaint pkgnum & svcpart - $pkgnum=$1 if /^pkgnum(\d+)$/; - $svcpart=$1 if /^svcpart(\d+)$/; -} - -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}; - -CGI::Base::SendHeaders(); -print < - - Link to existing $svc account - - -
    -

    Link to existing $svc account

    -

    -
    -END - -if ( $link_field ) { - print < - - $link_field of existing service: -END -} else { - print qq!Service # of existing service: !; -} - -print < - -

    - - - -END - diff --git a/htdocs/misc/print-invoice.cgi b/htdocs/misc/print-invoice.cgi deleted file mode 100755 index 084dcc1c4..000000000 --- a/htdocs/misc/print-invoice.cgi +++ /dev/null @@ -1,57 +0,0 @@ -#!/usr/bin/perl -Tw -# -# just a kludge for now, since this duplicates in a way it shouldn't stuff from -# Bill.pm (like $lpr) ivan@sisd.com 98-jun-16 - -use strict; -use CGI::Base qw(:DEFAULT :CGI); -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearchs); -use FS::Invoice; - -my($lpr) = "|lpr -h"; - -my($cgi) = new CGI::Base; -$cgi->get; -&cgisuidsetup($cgi); - -#untaint invnum -$QUERY_STRING =~ /^(\d*)$/; -my($invnum)=$1; -my($cust_bill)=qsearchs('cust_bill',{'invnum'=>$invnum}); -die "Can't find invoice!\n" unless $cust_bill; - - bless($cust_bill,"FS::Invoice"); - open(LPR,$lpr) or die "Can't open $lpr: $!"; - print LPR $cust_bill->print_text; #( date ) - close LPR - or die $! ? "Error closing $lpr: $!" - : "Exit status $? from $lpr"; - -my($custnum)=$cust_bill->getfield('custnum'); - -$cgi->redirect("../view/cust_main.cgi?$custnum#history"); - -sub idiot { - my($error)=@_; - CGI::Base::SendHeaders(); # one guess - print < - - Error printing invoice - - -
    -

    Error printing invoice

    -
    - Your update did not occur because of the following error: -

    $error - - -END - - exit; - -} - diff --git a/htdocs/misc/process/link.cgi b/htdocs/misc/process/link.cgi deleted file mode 100755 index 23fb05386..000000000 --- a/htdocs/misc/process/link.cgi +++ /dev/null @@ -1,73 +0,0 @@ -#!/usr/bin/perl -Tw -# -# process/link.cgi: link to existing customer (process form) -# -# ivan@voicenet.com 97-feb-5 -# -# rewrite ivan@sisd.com 98-mar-18 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 -# -# can also link on some other fields now (about time) ivan@sisd.com 98-jun-24 - -use strict; -use CGI::Request; -use CGI::Carp qw(fatalsToBrowser); -use FS::CGI qw(idiot); -use FS::UID qw(cgisuidsetup); -use FS::cust_svc; -use FS::Record qw(qsearchs); - -my($req)=new CGI::Request; # create form object -cgisuidsetup($req->cgi); - -#$req->import_names('R'); #import CGI variables into package 'R'; - -$req->param('pkgnum') =~ /^(\d+)$/; my($pkgnum)=$1; -$req->param('svcpart') =~ /^(\d+)$/; my($svcpart)=$1; - -$req->param('svcnum') =~ /^(\d*)$/; my($svcnum)=$1; -unless ( $svcnum ) { - my($part_svc) = qsearchs('part_svc',{'svcpart'=>$svcpart}); - my($svcdb) = $part_svc->getfield('svcdb'); - $req->param('link_field') =~ /^(\w+)$/; my($link_field)=$1; - my($svc_acct)=qsearchs($svcdb,{$link_field => $req->param('link_value') }); - idiot("$link_field not found!") unless $svc_acct; - $svcnum=$svc_acct->svcnum; -} - -my($old)=qsearchs('cust_svc',{'svcnum'=>$svcnum}); -die "svcnum not found!" unless $old; -my($new)=create FS::cust_svc ({ - 'svcnum' => $svcnum, - 'pkgnum' => $pkgnum, - 'svcpart' => $svcpart, -}); - -my($error); -$error = $new->replace($old); - -unless ($error) { - #no errors, so let's view this customer. - $req->cgi->redirect("../../view/cust_pkg.cgi?$pkgnum"); -} else { - CGI::Base::SendHeaders(); # one guess - print < - - Error - - -

    -

    Error

    -
    - Your update did not occur because of the following error: -

    $error -

    Hit the Back button in your web browser, correct this mistake, and submit the form again. - - -END - -} - diff --git a/htdocs/misc/susp_pkg.cgi b/htdocs/misc/susp_pkg.cgi deleted file mode 100755 index 7b23caeb2..000000000 --- a/htdocs/misc/susp_pkg.cgi +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/perl -Tw -# -# susp_pkg.cgi: Suspend a package -# -# Usage: susp_pkg.cgi pkgnum -# http://server.name/path/susp_pkg.cgi pkgnum -# -# Note: Should be run setuid freeside as user nobody -# -# probably should generalize this to do cancels, suspensions, unsuspensions, etc. -# -# ivan@voicenet.com 97-feb-27 -# -# now redirects to enter comments -# ivan@voicenet.com 97-may-8 -# -# rewrote for new API -# ivan@voicenet.com 97-jul-21 -# -# FS::Search -> FS::Record ivan@sisd.com 98-mar-17 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 - -use strict; -use CGI::Base qw(:DEFAULT :CGI); # CGI module -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearchs); -use FS::cust_pkg; - -my($cgi) = new CGI::Base; -$cgi->get; -&cgisuidsetup($cgi); - -#untaint pkgnum -$QUERY_STRING =~ /^(\d+)$/ || die "Illegal pkgnum"; -my($pkgnum)=$1; - -my($cust_pkg) = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum}); - -bless($cust_pkg,'FS::cust_pkg'); -my($error)=$cust_pkg->suspend; -&idiot($error) if $error; - -$cgi->redirect("../view/cust_main.cgi?".$cust_pkg->getfield('custnum')); - -sub idiot { - my($error)=@_; - SendHeaders(); - print < - - Error suspending package - - -

    -

    Error suspending package

    -
    -
    - There has been an error suspending this package: $error - - - -END - exit; -} - diff --git a/htdocs/misc/unsusp_pkg.cgi b/htdocs/misc/unsusp_pkg.cgi deleted file mode 100755 index 2f340c6fa..000000000 --- a/htdocs/misc/unsusp_pkg.cgi +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/perl -Tw -# -# susp_pkg.cgi: Unsuspend a package -# -# Usage: susp_pkg.cgi pkgnum -# http://server.name/path/susp_pkg.cgi pkgnum -# -# Note: Should be run setuid freeside as user nobody -# -# probably should generalize this to do cancels, suspensions, unsuspensions, etc. -# -# ivan@voicenet.com 97-feb-27 -# -# now redirects to enter comments -# ivan@voicenet.com 97-may-8 -# -# rewrote for new API -# ivan@voicenet.com 97-jul-21 -# -# FS::Search -> FS::Record ivan@sisd.com 98-mar-17 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 - -use strict; -use CGI::Base qw(:DEFAULT :CGI); # CGI module -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearchs); -use FS::cust_pkg; - -my($cgi) = new CGI::Base; -$cgi->get; -&cgisuidsetup($cgi); - -#untaint pkgnum -$QUERY_STRING =~ /^(\d+)$/ || die "Illegal pkgnum"; -my($pkgnum)=$1; - -my($cust_pkg) = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum}); - -bless($cust_pkg,'FS::cust_pkg'); -my($error)=$cust_pkg->unsuspend; -&idiot($error) if $error; - -$cgi->redirect("../view/cust_main.cgi?".$cust_pkg->getfield('custnum')); - -sub idiot { - my($error)=@_; - SendHeaders(); - print < - - Error unsuspending package - - -
    -

    Error unsuspending package

    -
    -
    - There has been an error unsuspending this package: $error - - - -END - exit; -} - diff --git a/htdocs/search/cust_bill.cgi b/htdocs/search/cust_bill.cgi deleted file mode 100755 index 5be84b79e..000000000 --- a/htdocs/search/cust_bill.cgi +++ /dev/null @@ -1,46 +0,0 @@ -#!/usr/bin/perl -Tw -# -# cust_bill.cgi: Search for invoices (process form) -# -# Usage: post form to: -# http://server.name/path/cust_bill.cgi -# -# Note: Should be run setuid freeside as user nobody. -# -# ivan@voicenet.com 97-apr-4 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 - -use strict; -use CGI::Request; -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearchs); - -my($req)=new CGI::Request; -cgisuidsetup($req->cgi); - -$req->param('invnum') =~ /^\s*(FS-)?(\d+)\s*$/; -my($invnum)=$2; - -if ( qsearchs('cust_bill',{'invnum'=>$invnum}) ) { - $req->cgi->redirect("../view/cust_bill.cgi?$invnum"); #redirect -} else { #error - CGI::Base::SendHeaders(); # one guess - print < - - Invoice Search Error - - -
    -

    Invoice Search Error

    -
    - Invoice not found. -
    - - -END - -} - diff --git a/htdocs/search/cust_bill.html b/htdocs/search/cust_bill.html deleted file mode 100755 index 4adb40e4a..000000000 --- a/htdocs/search/cust_bill.html +++ /dev/null @@ -1,21 +0,0 @@ - - - Invoice Search - - -
    -

    Invoice Search

    -
    -
    -
    - Search for invoice #: - - -

    - -

    - -
    - - - diff --git a/htdocs/search/cust_main-payinfo.html b/htdocs/search/cust_main-payinfo.html deleted file mode 100755 index 92341ad13..000000000 --- a/htdocs/search/cust_main-payinfo.html +++ /dev/null @@ -1,21 +0,0 @@ - - - Customer Search - - -
    -

    Customer Search

    -
    -
    -
    - Search for Credit card #: - - - -

    - -

    -
    - - - diff --git a/htdocs/search/cust_main.cgi b/htdocs/search/cust_main.cgi deleted file mode 100755 index 70ce991f7..000000000 --- a/htdocs/search/cust_main.cgi +++ /dev/null @@ -1,235 +0,0 @@ -#!/usr/bin/perl -Tw -# -# process/cust_main.cgi: Search for customers (process form) -# -# Usage: post form to: -# http://server.name/path/cust_main.cgi -# -# Note: Should be run setuid freeside as user nobody. -# -# ivan@voicenet.com 96-dec-12 -# -# rewrite ivan@sisd.com 98-mar-4 -# -# now does browsing too ivan@sisd.com 98-mar-6 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 -# -# display total, use FS::CGI ivan@sisd.com 98-jul-17 - -use strict; -use CGI::Request; -use CGI::Carp qw(fatalsToBrowser); -use IO::Handle; -use IPC::Open2; -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearch qsearchs); -use FS::CGI qw(header idiot); - -my($fuzziness)=2; #fuzziness for fuzzy searches, see man agrep - #0-4: 0=no fuzz, 4=very fuzzy (too much fuzz!) - -my($req)=new CGI::Request; -&cgisuidsetup($req->cgi); - -my(@cust_main); -my($sortby); - -my($query)=$req->cgi->var('QUERY_STRING'); -if ( $query eq 'custnum' ) { - $sortby=\*custnum_sort; - @cust_main=qsearch('cust_main',{}); -} elsif ( $query eq 'last' ) { - $sortby=\*last_sort; - @cust_main=qsearch('cust_main',{}); -} elsif ( $query eq 'company' ) { - $sortby=\*company_sort; - @cust_main=qsearch('cust_main',{}); -} else { - &cardsearch if ($req->param('card_on') ); - &lastsearch if ($req->param('last_on') ); - &companysearch if ($req->param('company_on') ); -} - -if ( scalar(@cust_main) == 1 ) { - $req->cgi->redirect("../view/cust_main.cgi?". $cust_main[0]->custnum); - exit; -} elsif ( scalar(@cust_main) == 0 ) { - idiot "No matching customers found!\n"; - exit; -} else { - - my($total)=scalar(@cust_main); - CGI::Base::SendHeaders(); # one guess - print header("Customer Search Results",''), < - - Cust. # - Contact name - Company - -END - - my($lines)=16; - my($lcount)=$lines; - my(%saw,$cust_main); - foreach $cust_main ( - sort $sortby grep(!$saw{$_->custnum}++, @cust_main) - ) { - my($custnum,$last,$first,$company)=( - $cust_main->custnum, - $cust_main->getfield('last'), - $cust_main->getfield('first'), - $cust_main->company, - ); - print < - $custnum - $last, $first - $company - -END - if ($lcount-- == 0) { # lots of little tables instead of one big one - $lcount=$lines; - print < - - - - - -END - } - } - - print < - - - -END - -} - -# - -sub last_sort { - $a->getfield('last') cmp $b->getfield('last'); -} - -sub company_sort { - $a->getfield('company') cmp $b->getfield('company'); -} - -sub custnum_sort { - $a->getfield('custnum') <=> $b->getfield('custnum'); -} - -sub cardsearch { - - my($card)=$req->param('card'); - $card =~ s/\D//g; - $card =~ /^(\d{13,16})$/ or do { idiot "Illegal card number\n"; exit; }; - my($payinfo)=$1; - - push @cust_main, qsearch('cust_main',{'payinfo'=>$payinfo, 'payby'=>'CARD'}); - -} - -sub lastsearch { - my(%last_type); - foreach ( $req->param('last_type') ) { - $last_type{$_}++; - } - - $req->param('last_text') =~ /^([\w \,\.\-\']*)$/ - or do { idiot "Illegal last name"; exit; }; - my($last)=$1; - - if ( $last_type{'Exact'} - && ! $last_type{'Fuzzy'} - # && ! $last_type{'Sound-alike'} - ) { - - push @cust_main, qsearch('cust_main',{'last'=>$last}); - - } else { - - my(%last); - - my(@all_last)=map $_->getfield('last'), qsearch('cust_main',{}); - if ($last_type{'Fuzzy'}) { - my($reader,$writer) = ( new IO::Handle, new IO::Handle ); - open2($reader,$writer,'agrep',"-$fuzziness",'-i','-k', - substr($last,0,30)); - print $writer join("\n",@all_last),"\n"; - close $writer; - while (<$reader>) { - chop; - $last{$_}++; - } - close $reader; - } - - #if ($last_type{'Sound-alike'}) { - #} - - foreach ( keys %last ) { - push @cust_main, qsearch('cust_main',{'last'=>$_}); - } - - } - $sortby=\*last_sort; -} - -sub companysearch { - - my(%company_type); - foreach ( $req->param('company_type') ) { - $company_type{$_}++ - }; - - $req->param('company_text') =~ /^([\w \,\.\-\']*)$/ - or do { idiot "Illegal company"; exit; }; - my($company)=$1; - - if ( $company_type{'Exact'} - && ! $company_type{'Fuzzy'} - # && ! $company_type{'Sound-alike'} - ) { - - push @cust_main, qsearch('cust_main',{'company'=>$company}); - - } else { - - my(%company); - my(@all_company)=map $_->company, qsearch('cust_main',{}); - - if ($company_type{'Fuzzy'}) { - my($reader,$writer) = ( new IO::Handle, new IO::Handle ); - open2($reader,$writer,'agrep',"-$fuzziness",'-i','-k', - substr($company,0,30)); - print $writer join("\n",@all_company),"\n"; - close $writer; - while (<$reader>) { - chop; - $company{$_}++; - } - close $reader; - } - - #if ($company_type{'Sound-alike'}) { - #} - - foreach ( keys %company ) { - push @cust_main, qsearch('cust_main',{'company'=>$_}); - } - - } - $sortby=\*company_sort; - -} diff --git a/htdocs/search/cust_main.html b/htdocs/search/cust_main.html deleted file mode 100755 index 656943f9c..000000000 --- a/htdocs/search/cust_main.html +++ /dev/null @@ -1,36 +0,0 @@ - - - Customer Search - - -
    -

    Customer Search

    -
    -
    -
    - Search for last name: - - using search method(s): - -

    Search for company: - - using search methods(s): - -

    Note: Fuzzy searching can take a while. Please be patient. - - - -


    Explanation of search methods: -
      -
    • Fuzzy - Searches for matches that are close to your text. -
    • Exact - Finds exact matches only, but much faster than the other search methods. -
    - - - diff --git a/htdocs/search/cust_pkg.cgi b/htdocs/search/cust_pkg.cgi deleted file mode 100755 index 967068f5e..000000000 --- a/htdocs/search/cust_pkg.cgi +++ /dev/null @@ -1,122 +0,0 @@ -#!/usr/bin/perl -Tw -# -# cust_pkg.cgi: search/browse for packages -# -# based on search/svc_acct.cgi ivan@sisd.com 98-jul-17 - -use strict; -use CGI::Request; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearch qsearchs); -use FS::CGI qw(header idiot); - -my($req)=new CGI::Request; -&cgisuidsetup($req->cgi); - -my(@cust_pkg,$sortby); - -my($query)=$req->cgi->var('QUERY_STRING'); -#this tree is a little bit redundant -if ( $query eq 'pkgnum' ) { - $sortby=\*pkgnum_sort; - @cust_pkg=qsearch('cust_pkg',{}); -} elsif ( $query eq 'APKG_pkgnum' ) { - $sortby=\*pkgnum_sort; - - #perhaps this should go in cust_pkg as a qsearch-like constructor? - my($cust_pkg); - foreach $cust_pkg (qsearch('cust_pkg',{})) { - my($flag)=0; - my($pkg_svc); - PKG_SVC: - foreach $pkg_svc (qsearch('pkg_svc',{ 'pkgpart' => $cust_pkg->pkgpart })) { - if ( $pkg_svc->quantity - > scalar(qsearch('cust_svc',{ - 'pkgnum' => $cust_pkg->pkgnum, - 'svcpart' => $pkg_svc->svcpart, - })) - ) - { - $flag=1; - last PKG_SVC; - } - } - push @cust_pkg, $cust_pkg if $flag; - } -} else { - die "Empty QUERY_STRING!"; -} - -if ( scalar(@cust_pkg) == 1 ) { - my($pkgnum)=$cust_pkg[0]->pkgnum; - $req->cgi->redirect("../view/cust_pkg.cgi?$pkgnum"); - exit; -} elsif ( scalar(@cust_pkg) == 0 ) { #error - &idiot("No packages found"); - exit; -} else { - my($total)=scalar(@cust_pkg); - CGI::Base::SendHeaders(); # one guess - print header('Package Search Results',''), < -
    - - - - - -END - - my($lines)=16; - my($lcount)=$lines; - my(%saw,$cust_pkg); - foreach $cust_pkg ( - sort $sortby grep(!$saw{$_->pkgnum}++, @cust_pkg) - ) { - my($cust_main)=qsearchs('cust_main',{'custnum'=>$cust_pkg->custnum}); - my($pkgnum,$custnum,$name,$company)=( - $cust_pkg->pkgnum, - $cust_main->custnum, - $cust_main->last. ', '. $cust_main->first, - $cust_main->company, - ); - print < - - - - - -END - if ($lcount-- == 0) { # lots of little tables instead of one big one - $lcount=$lines; - print < -
    Cust. #Contact nameCompany -
    Package #Customer #NameCompany
    $pkgnum$custnum$name$company
    - - - - - - -END - } - } - - print < - - - -END - exit; - -} - -sub pkgnum_sort { - $a->getfield('pkgnum') <=> $b->getfield('pkgnum'); -} - diff --git a/htdocs/search/svc_acct.cgi b/htdocs/search/svc_acct.cgi deleted file mode 100755 index 250a741db..000000000 --- a/htdocs/search/svc_acct.cgi +++ /dev/null @@ -1,186 +0,0 @@ -#!/usr/bin/perl -Tw -# -# svc_acct.cgi: Search for customers (process form) -# -# Usage: post form to: -# http://server.name/path/svc_acct.cgi -# -# Note: Should be run setuid freeside as user nobody. -# -# loosely (sp?) based on search/cust_main.cgi -# -# ivan@voicenet.com 96-jan-3 -> 96-jan-4 -# -# rewrite (now does browsing too) ivan@sisd.com 98-mar-9 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 -# -# show unlinked accounts ivan@sisd.com 98-jun-22 -# -# use FS::CGI, show total ivan@sisd.com 98-jul-17 -# -# give service and customer info too ivan@sisd.com 98-aug-16 - -use strict; -use CGI::Request; # form processing module -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearch qsearchs); -use FS::CGI qw(header idiot); - -my($req)=new CGI::Request; # create form object -&cgisuidsetup($req->cgi); - -my(@svc_acct,$sortby); - -my($query)=$req->cgi->var('QUERY_STRING'); -#this tree is a little bit redundant -if ( $query eq 'svcnum' ) { - $sortby=\*svcnum_sort; - @svc_acct=qsearch('svc_acct',{}); -} elsif ( $query eq 'username' ) { - $sortby=\*username_sort; - @svc_acct=qsearch('svc_acct',{}); -} elsif ( $query eq 'uid' ) { - $sortby=\*uid_sort; - @svc_acct=grep $_->uid ne '', qsearch('svc_acct',{}); -} elsif ( $query eq 'UN_svcnum' ) { - $sortby=\*svcnum_sort; - @svc_acct = grep qsearchs('cust_svc',{ - 'svcnum' => $_->svcnum, - 'pkgnum' => '', - }), qsearch('svc_acct',{}); -} elsif ( $query eq 'UN_username' ) { - $sortby=\*username_sort; - @svc_acct = grep qsearchs('cust_svc',{ - 'svcnum' => $_->svcnum, - 'pkgnum' => '', - }), qsearch('svc_acct',{}); -} elsif ( $query eq 'UN_uid' ) { - $sortby=\*uid_sort; - @svc_acct = grep qsearchs('cust_svc',{ - 'svcnum' => $_->svcnum, - 'pkgnum' => '', - }), qsearch('svc_acct',{}); -} else { - &usernamesearch; -} - -if ( scalar(@svc_acct) == 1 ) { - my($svcnum)=$svc_acct[0]->svcnum; - $req->cgi->redirect("../view/svc_acct.cgi?$svcnum"); #redirect - exit; -} elsif ( scalar(@svc_acct) == 0 ) { #error - idiot("Account not found"); - exit; -} else { - my($total)=scalar(@svc_acct); - CGI::Base::SendHeaders(); # one guess - print header("Account Search Results",''), < - - - - - - - - - -END - - my($lines)=16; - my($lcount)=$lines; - my(%saw,$svc_acct); - foreach $svc_acct ( - sort $sortby grep(!$saw{$_->svcnum}++, @svc_acct) - ) { - my $cust_svc = qsearchs('cust_svc', { 'svcnum' => $svc_acct->svcnum }) - or die "No cust_svc record for svcnum ". $svc_acct->svcnum; - my $part_svc = qsearchs('part_svc', { 'svcpart' => $cust_svc->svcpart }) - or die "No part_svc record for svcpart ". $cust_svc->svcpart; - my($cust_pkg,$cust_main); - if ( $cust_svc->pkgnum ) { - $cust_pkg = qsearchs('cust_pkg', { 'pkgnum' => $cust_svc->pkgnum }) - or die "No cust_pkg record for pkgnum ". $cust_svc->pkgnum; - $cust_main = qsearchs('cust_main', { 'custnum' => $cust_pkg->custnum }) - or die "No cust_main record for custnum ". $cust_pkg->custnum; - } - my($svcnum,$username,$uid,$svc,$custnum,$last,$first,$company)=( - $svc_acct->svcnum, - $svc_acct->getfield('username'), - $svc_acct->getfield('uid'), - $part_svc->svc, - $cust_svc->pkgnum ? $cust_main->custnum : '', - $cust_svc->pkgnum ? $cust_main->getfield('last') : '', - $cust_svc->pkgnum ? $cust_main->getfield('first') : '', - $cust_svc->pkgnum ? $cust_main->company : '', - ); - my($pcustnum) = $custnum - ? "$custnum" - : "(unlinked)" - ; - my($pname) = $custnum ? "$last, $first" : ''; - print < - - - - -END - if ($lcount-- == 0) { # lots of little tables instead of one big one - $lcount=$lines; - print < -
    Package #Customer #NameCompany -
    Service #UsernameUIDServiceCustomer #Contact nameCompany
    $svcnum$username$uid$svc - $pcustnum - $pname - $company -
    - - - - - - - - - -END - } - } - - print < - - - -END - exit; - -} - -sub svcnum_sort { - $a->getfield('svcnum') <=> $b->getfield('svcnum'); -} - -sub username_sort { - $a->getfield('username') cmp $b->getfield('username'); -} - -sub uid_sort { - $a->getfield('uid') <=> $b->getfield('uid'); -} - -sub usernamesearch { - - $req->param('username') =~ /^([\w\d\-]{2,8})$/; #untaint username_text - my($username)=$1; - - @svc_acct=qsearch('svc_acct',{'username'=>$username}); - -} - - diff --git a/htdocs/search/svc_acct.html b/htdocs/search/svc_acct.html deleted file mode 100755 index 91291be99..000000000 --- a/htdocs/search/svc_acct.html +++ /dev/null @@ -1,21 +0,0 @@ - - - Account Search - - -
    -

    Account Search

    -
    -
    -
    - Search for username: - - -

    - - - -


    - - - diff --git a/htdocs/search/svc_acct_sm.cgi b/htdocs/search/svc_acct_sm.cgi deleted file mode 100755 index 3b1a4cf4e..000000000 --- a/htdocs/search/svc_acct_sm.cgi +++ /dev/null @@ -1,128 +0,0 @@ -#!/usr/bin/perl -Tw -# -# svc_acct_sm.cgi: Search for domains (process form) -# -# Usage: post form to: -# http://server.name/path/svc_domain.cgi -# -# Note: Should be run setuid freeside as user nobody. -# -# ivan@voicenet.com 96-mar-5 -# -# need to look at table in results to make it more readable -# -# ivan@voicenet.com -# -# rewrite ivan@sisd.com 98-mar-15 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 - -use strict; -use CGI::Request; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearch qsearchs); - -my($conf_domain)="/var/spool/freeside/conf/domain"; -open(DOMAIN,$conf_domain) or die "Can't open $conf_domain: $!"; -my($mydomain)=map { - /^(.*)$/ or die "Illegal line in $conf_domain!"; #yes, we trust the file - $1 -} grep $_ !~ /^(#|$)/, ; -close DOMAIN; - -my($req)=new CGI::Request; # create form object -&cgisuidsetup($req->cgi); - -$req->param('domuser') =~ /^([a-z0-9_\-]{0,32})$/; -my($domuser)=$1; - -$req->param('domain') =~ /^([\w\-\.]+)$/ or die "Illegal domain"; -my($svc_domain)=qsearchs('svc_domain',{'domain'=>$1}) - or die "Unknown domain"; -my($domsvc)=$svc_domain->svcnum; - -my(@svc_acct_sm); -if ($domuser) { - @svc_acct_sm=qsearch('svc_acct_sm',{ - 'domuser' => $domuser, - 'domsvc' => $domsvc, - }); -} else { - @svc_acct_sm=qsearch('svc_acct_sm',{'domsvc' => $domsvc}); -} - -if ( scalar(@svc_acct_sm) == 1 ) { - my($svcnum)=$svc_acct_sm[0]->svcnum; - $req->cgi->redirect("../view/svc_acct_sm.cgi?$svcnum"); #redirect -} elsif ( scalar(@svc_acct_sm) > 1 ) { - CGI::Base::SendHeaders(); - print < - - Mail Alias Search Results - - -
    -

    Mail Alias Search Results

    -
    Service #UserameUIDServiceCustomer #Contact nameCompany
    - - - - -END - - my($svc_acct_sm); - foreach $svc_acct_sm (@svc_acct_sm) { - my($svcnum,$domuser,$domuid,$domsvc)=( - $svc_acct_sm->svcnum, - $svc_acct_sm->domuser, - $svc_acct_sm->domuid, - $svc_acct_sm->domsvc, - ); - my($svc_domain)=qsearchs('svc_domain',{'svcnum'=>$domsvc}); - my($domain)=$svc_domain->domain; - my($svc_acct)=qsearchs('svc_acct',{'uid'=>$domuid}); - my($username)=$svc_acct->username; - my($svc_acct_svcnum)=$svc_acct->svcnum; - - print <\n \n -\n \n -END - - } - - print < - - - -END - -} else { #error - CGI::Base::SendHeaders(); # one guess - print < - - Mail Alias Search Error - - -
    -

    Mail Alias Search Error

    -
    - Mail Alias not found. -
    - - -END - -} - diff --git a/htdocs/search/svc_acct_sm.html b/htdocs/search/svc_acct_sm.html deleted file mode 100755 index 0719856db..000000000 --- a/htdocs/search/svc_acct_sm.html +++ /dev/null @@ -1,23 +0,0 @@ - - - Mail Alias Search - - -
    -

    Mail Alias Search

    -
    -
    -
    - Search for mail alias: - (opt.) @ - (req.) - -

    - - - -


    - - - - diff --git a/htdocs/search/svc_domain.cgi b/htdocs/search/svc_domain.cgi deleted file mode 100755 index d5277037b..000000000 --- a/htdocs/search/svc_domain.cgi +++ /dev/null @@ -1,139 +0,0 @@ -#!/usr/bin/perl -Tw -# -# svc_domain.cgi: Search for domains (process form) -# -# Usage: post form to: -# http://server.name/path/svc_domain.cgi -# -# Note: Should be run setuid freeside as user nobody. -# -# ivan@voicenet.com 97-mar-5 -# -# rewrite ivan@sisd.com 98-mar-14 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 -# -# display total, use FS::CGI now does browsing too ivan@sisd.com 98-jul-17 - -use strict; -use CGI::Request; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearch qsearchs); -use FS::CGI qw(header idiot); - -my($req)=new CGI::Request; -&cgisuidsetup($req->cgi); - -my(@svc_domain); -my($sortby); - -my($query)=$req->cgi->var('QUERY_STRING'); -if ( $query eq 'svcnum' ) { - $sortby=\*svcnum_sort; - @svc_domain=qsearch('svc_domain',{}); -} elsif ( $query eq 'domain' ) { - $sortby=\*domain_sort; - @svc_domain=qsearch('svc_domain',{}); -} elsif ( $query eq 'UN_svcnum' ) { - $sortby=\*svcnum_sort; - @svc_domain = grep qsearchs('cust_svc',{ - 'svcnum' => $_->svcnum, - 'pkgnum' => '', - }), qsearch('svc_domain',{}); -} elsif ( $query eq 'UN_domain' ) { - $sortby=\*domain_sort; - @svc_domain = grep qsearchs('cust_svc',{ - 'svcnum' => $_->svcnum, - 'pkgnum' => '', - }), qsearch('svc_domain',{}); -} else { - $req->param('domain') =~ /^([\w\-\.]+)$/; - my($domain)=$1; - push @svc_domain, qsearchs('svc_domain',{'domain'=>$domain}); -} - -if ( scalar(@svc_domain) == 1 ) { - $req->cgi->redirect("../view/svc_domain.cgi?". $svc_domain[0]->svcnum); - exit; -} elsif ( scalar(@svc_domain) == 0 ) { - idiot "No matching domains found!\n"; - exit; -} else { - CGI::Base::SendHeaders(); # one guess - - my($total)=scalar(@svc_domain); - CGI::Base::SendHeaders(); # one guess - print header("Domain Search Results",''), < -
    - - - - -END - - my($lines)=16; - my($lcount)=$lines; - my(%saw,$svc_domain); - foreach $svc_domain ( - sort $sortby grep(!$saw{$_->svcnum}++, @svc_domain) - ) { - my($svcnum,$domain)=( - $svc_domain->svcnum, - $svc_domain->domain, - ); - my($malias); - if ( qsearch('svc_acct_sm',{'domsvc'=>$svcnum}) ) { - $malias=( - qq||. - qq||. - qq||. - qq||. - qq|| - ); - } else { - $malias=''; - } - print < - - - - -END - if ($lcount-- == 0) { # lots of little tables instead of one big one - $lcount=$lines; - print < -
    Mail to
    (click here to view mail alias)
    Forwards to
    (click here to view account)
    -END - - print '', ( ($domuser eq '*') ? "(anything)" : $domuser ); - - print < $username\@$mydomain
    Service #Domain
    $svcnum$domain$malias
    - - - - - -END - } - } - - print < - - - -END - -} - -sub svcnum_sort { - $a->getfield('svcnum') <=> $b->getfield('svcnum'); -} - -sub domain_sort { - $a->getfield('domain') cmp $b->getfield('doimain'); -} - - diff --git a/htdocs/search/svc_domain.html b/htdocs/search/svc_domain.html deleted file mode 100755 index 533743ba2..000000000 --- a/htdocs/search/svc_domain.html +++ /dev/null @@ -1,22 +0,0 @@ - - - Domain Search - - -
    -

    Domain Search

    -
    -
    -
    - Search for domain: - - -

    - - - -


    - - - - diff --git a/htdocs/view/cust_bill.cgi b/htdocs/view/cust_bill.cgi deleted file mode 100755 index 96101d004..000000000 --- a/htdocs/view/cust_bill.cgi +++ /dev/null @@ -1,79 +0,0 @@ -#!/usr/bin/perl -Tw -# -# Usage: cust_bill.cgi invnum -# http://server.name/path/cust_bill.cgi?invnum -# -# Note: Should be run setuid freeside as user nobody. -# -# this is a quick & ugly hack which does little more than add some formatting to the ascii output from /dbin/print-invoice -# -# ivan@voicenet.com 96-dec-05 -# -# added navigation bar -# ivan@voicenet.com 97-jan-30 -# -# now uses Invoice.pm -# ivan@voicenet.com 97-jun-30 -# -# what to do if cust_bill search errors? -# ivan@voicenet.com 97-jul-7 -# -# s/FS::Search/FS::Record/; $cgisuidsetup($cgi); ivan@sisd.com 98-mar-14 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 -# -# also print 'printed' field ivan@sisd.com 98-jul-10 - -use strict; -use IO::File; -use CGI::Base qw(:DEFAULT :CGI); # CGI module -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearchs); -use FS::Invoice; - -my($cgi) = new CGI::Base; -$cgi->get; -&cgisuidsetup($cgi); - -#untaint invnum -$QUERY_STRING =~ /^(\d+)$/; -my($invnum)=$1; - -my($cust_bill) = qsearchs('cust_bill',{'invnum'=>$invnum}); -die "Invoice #$invnum not found!" unless $cust_bill; -my($custnum) = $cust_bill->getfield('custnum'); - -my($printed) = $cust_bill->printed; - -SendHeaders(); # one guess. -print < - - Invoice View - - -
    -

    Invoice View

    - View this customer (#$custnum) | Main menu -

    - -
    - Enter payments (check/cash) against this invoice -
    Reprint this invoice -

    (Printed $printed times) -
    -
    -END
    -
    -bless($cust_bill,"FS::Invoice");
    -print $cust_bill->print_text;
    -
    -	#formatting
    -	print <
    -  
    -
    -END
    -
    diff --git a/htdocs/view/cust_main.cgi b/htdocs/view/cust_main.cgi
    deleted file mode 100755
    index ca5fcd94f..000000000
    --- a/htdocs/view/cust_main.cgi
    +++ /dev/null
    @@ -1,336 +0,0 @@
    -#!/usr/bin/perl -Tw
    -#
    -# cust_main.cgi: View a customer
    -#
    -# Usage: cust_main.cgi custnum
    -#        http://server.name/path/cust_main.cgi?custnum
    -#
    -# Note: Should be run setuid freeside as user nobody.
    -#
    -# the payment history section could use some work, see below
    -# 
    -# ivan@voicenet.com 96-nov-29 -> 96-dec-11
    -#
    -# added navigation bar (go to main menu ;)
    -# ivan@voicenet.com 97-jan-30
    -#
    -# changes to the way credits/payments are applied (the links are here).
    -# ivan@voicenet.com 97-apr-21
    -#
    -# added debugging code to diagnose CPU sucking problem.
    -# ivan@voicenet.com 97-may-19
    -#
    -# CPU sucking problem was in comment code?  fixed?
    -# ivan@voicenet.com 97-may-22
    -#
    -# rewrote for new API
    -# ivan@voicenet.com 97-jul-22
    -#
    -# Changes to allow page to work at a relative position in server
    -# Changed 'day' to 'daytime' because Pg6.3 reserves the day word
    -#       bmccane@maxbaud.net     98-apr-3
    -#
    -# lose background, FS::CGI ivan@sisd.com 98-sep-2
    -
    -use strict;
    -use CGI::Base qw(:DEFAULT :CGI); # CGI module
    -use CGI::Carp qw(fatalsToBrowser);
    -use Date::Format;
    -use FS::UID qw(cgisuidsetup);
    -use FS::Record qw(qsearchs qsearch);
    -use FS::CGI qw(header menubar);
    -
    -my($cgi) = new CGI::Base;
    -$cgi->get;
    -&cgisuidsetup($cgi);
    -
    -SendHeaders(); # one guess.
    -print header("Customer View", menubar(
    -  'Main Menu' => '../',
    -)),<
    -END
    -
    -#untaint custnum & get customer record
    -$QUERY_STRING =~ /^(\d+)$/;
    -my($custnum)=$1;
    -my($cust_main)=qsearchs('cust_main',{'custnum'=>$custnum});
    -die "Customer not found!" unless $cust_main;
    -my($hashref)=$cust_main->hashref;
    -
    -#custnum
    -print "
    Customer #$custnum
    ", - qq!
    Customer Information | !, - qq!Comments | !, - qq!Packages | !, - qq!Payment History
    !; - -#bill now linke -print qq!
    !, - qq!Bill this customer now
    !; - -#formatting -print qq!
    Customer Information!, - qq!!, - qq!
    Edit this information
    !; - -#agentnum -my($agent)=qsearchs('agent',{ - 'agentnum' => $cust_main->getfield('agentnum') -} ); -die "Agent not found!" unless $agent; -print "
    Agent #" , $agent->getfield('agentnum') , ": " , - $agent->getfield('agent') , ""; - -#refnum -my($referral)=qsearchs('part_referral',{'refnum' => $cust_main->refnum}); -die "Referral not found!" unless $referral; -print "
    Referral #", $referral->refnum, ": ", - $referral->referral, "<\B>"; - -#last, first -print "

    ", $hashref->{'last'}, ", ", $hashref->{first}, ""; - -#ss -print " (SS# ", $hashref->{ss}, ")" if $hashref->{ss}; - -#company -print "
    ", $hashref->{company}, "" if $hashref->{company}; - -#address1 -print "
    ", $hashref->{address1}, ""; - -#address2 -print "
    ", $hashref->{address2}, "" if $hashref->{address2}; - -#city -print "
    ", $hashref->{city}, ""; - -#county -print " (", $hashref->{county}, " county)" if $hashref->{county}; - -#state -print ",", $hashref->{state}, ""; - -#zip -print " ", $hashref->{zip}, ""; - -#country -print "
    ", $hashref->{country}, "" - unless $hashref->{country} eq "US"; - -#daytime -print "

    ", $hashref->{daytime}, "" if $hashref->{daytime}; -print " (Day)" if $hashref->{daytime} && $hashref->{night}; - -#night -print "
    ", $hashref->{night}, "" if $hashref->{night}; -print " (Night)" if $hashref->{daytime} && $hashref->{night}; - -#fax -print "
    ", $hashref->{fax}, " (Fax)" if $hashref->{fax}; - -#payby/payinfo/paydate/payname -if ($hashref->{payby} eq "CARD") { - print "

    Card #", $hashref->{payinfo}, " Exp. ", - $hashref->{paydate}, ""; - print " (", $hashref->{payname}, ")" if $hashref->{payname}; -} elsif ($hashref->{payby} eq "BILL") { - print "

    Bill"; - print " on P.O. #", $hashref->{payinfo}, "" - if $hashref->{payinfo}; - print " until ", $hashref->{paydate}, "" - if $hashref->{paydate}; - print " to ", $hashref->{payname}, " at above address" - if $hashref->{payname}; -} elsif ($hashref->{payby} eq "COMP") { - print "

    Access complimentary"; - print " courtesy of ", $hashref->{payinfo}, "" - if $hashref->{payinfo}; - print " until ", $hashref->{paydate}, "" - if $hashref->{paydate}; -} else { - print "Unknown payment type ", $hashref->{payby}, "!"; -} - -#tax -print "
    (Tax exempt)" if $hashref->{tax}; - -#otaker -print "

    Order taken by ", $hashref->{otaker}, ""; - -#formatting -print qq!


    Packages!, - qq!
    Click on package number to view/edit package.!, - qq!
    Add/Edit packages!, - qq!

    !; - -#display packages - -#formatting -print qq!
    Service #Domain
    \n!, - qq!\n!, - qq!!, - qq!!, - qq!\n!; - -#get package info -my(@packages)=qsearch('cust_pkg',{'custnum'=>$custnum}); -my($package); -foreach $package (@packages) { - my($pref)=$package->hashref; - my($part_pkg)=qsearchs('part_pkg',{ - 'pkgpart' => $pref->{pkgpart} - } ); - print qq!!, - "", - "", - "", - "", - "", - "", - ""; -} - -#formatting -print "
    #Package!, - qq!Dates
    Setup!, - qq!Next bill!, - qq!Susp.Expire!, - qq!Cancel
    !, - $pref->{pkgnum}, qq!", $part_pkg->getfield('pkg'), " - ", - $part_pkg->getfield('comment'), "", - $pref->{setup} ? time2str("%D",$pref->{setup} ) : "" , - "", - $pref->{bill} ? time2str("%D",$pref->{bill} ) : "" , - "", - $pref->{susp} ? time2str("%D",$pref->{susp} ) : "" , - "", - $pref->{expire} ? time2str("%D",$pref->{expire} ) : "" , - "", - $pref->{cancel} ? time2str("%D",$pref->{cancel} ) : "" , - "
    "; - -#formatting -print qq!

    Payment History!, - qq!
    !, - qq!Click on invoice to view invoice/enter payment.
    !, - qq!!, - qq!Post Credit / Refund

    !; - -#get payment history -# -# major problem: this whole thing is way too sloppy. -# minor problem: the description lines need better formatting. - -my(@history); - -my(@bills)=qsearch('cust_bill',{'custnum'=>$custnum}); -my($bill); -foreach $bill (@bills) { - my($bref)=$bill->hashref; - push @history, - $bref->{_date} . qq!\tInvoice #! . $bref->{invnum} . - qq! (Balance \$! . $bref->{owed} . qq!)\t! . - $bref->{charged} . qq!\t\t\t!; - - my(@payments)=qsearch('cust_pay',{'invnum'=> $bref->{invnum} } ); - my($payment); - foreach $payment (@payments) { -# my($pref)=$payment->hashref; - my($date,$invnum,$payby,$payinfo,$paid)=($payment->getfield('_date'), - $payment->getfield('invnum'), - $payment->getfield('payby'), - $payment->getfield('payinfo'), - $payment->getfield('paid'), - ); - push @history, - "$date\tPayment, Invoice #$invnum ($payby $payinfo)\t\t$paid\t\t"; - } -} - -my(@credits)=qsearch('cust_credit',{'custnum'=>$custnum}); -my($credit); -foreach $credit (@credits) { - my($cref)=$credit->hashref; - push @history, - $cref->{_date} . "\tCredit #" . $cref->{crednum} . ", (Balance \$" . - $cref->{credited} . ") by " . $cref->{otaker} . " - " . - $cref->{reason} . "\t\t\t" . $cref->{amount} . "\t"; - - my(@refunds)=qsearch('cust_refund',{'crednum'=> $cref->{crednum} } ); - my($refund); - foreach $refund (@refunds) { - my($rref)=$refund->hashref; - push @history, - $rref->{_date} . "\tRefund, Credit #" . $rref->{crednum} . " (" . - $rref->{payby} . " " . $rref->{payinfo} . ") by " . - $rref->{otaker} . " - ". $rref->{reason} . "\t\t\t\t" . - $rref->{refund}; - } -} - - #formatting - print < - - - - - - - - - -END - -#display payment history - -my($balance)=0; -my($item); -foreach $item (sort keyfield_numerically @history) { - my($date,$desc,$charge,$payment,$credit,$refund)=split(/\t/,$item); - $charge ||= 0; - $payment ||= 0; - $credit ||= 0; - $refund ||= 0; - $balance += $charge - $payment; - $balance -= $credit - $refund; - - print "", - "", - "", - "", - "", - "", - "", - "\n"; -} - -#formatting -print "
    DateDescriptionChargePaymentIn-house
    Credit
    RefundBalance
    ",time2str("%D",$date),"$desc", - ( $charge ? "\$".sprintf("%.2f",$charge) : '' ), - "", - ( $payment ? "- \$".sprintf("%.2f",$payment) : '' ), - "", - ( $credit ? "- \$".sprintf("%.2f",$credit) : '' ), - "", - ( $refund ? "\$".sprintf("%.2f",$refund) : '' ), - "\$" . sprintf("%.2f",$balance), - "
    "; - -#end - -#formatting -print < - -END - -#subroutiens -sub keyfield_numerically { (split(/\t/,$a))[0] <=> (split(/\t/,$b))[0] ; } - diff --git a/htdocs/view/cust_pkg.cgi b/htdocs/view/cust_pkg.cgi deleted file mode 100755 index 04e38326a..000000000 --- a/htdocs/view/cust_pkg.cgi +++ /dev/null @@ -1,181 +0,0 @@ -#!/usr/bin/perl -Tw -# -# cust_pkg.cgi: View a package -# -# Usage: cust_pkg.cgi pkgnum -# http://server.name/path/cust_pkg.cgi?pkgnum -# -# Note: Should be run setuid freeside as user nobody. -# -# ivan@voicenet.com 96-dec-15 -# -# services section needs to be cleaned up, needs to display extraneous -# entries in cust_pkg! -# ivan@voicenet.com 96-dec-31 -# -# added navigation bar -# ivan@voicenet.com 97-jan-30 -# -# changed and fixed up suspension and cancel stuff, now you can't add -# services to a cancelled package -# ivan@voicenet.com 97-feb-27 -# -# rewrote for new API, still needs to be cleaned up! -# ivan@voicenet.com 97-jul-29 -# -# no FS::Search ivan@sisd.com 98-mar-7 - -use strict; -use Date::Format; -use CGI::Base qw(:DEFAULT :CGI); # CGI module -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearch qsearchs); - -my($cgi) = new CGI::Base; -$cgi->get; -&cgisuidsetup($cgi); - -my(%uiview,%uiadd); -my($part_svc); -foreach $part_svc ( qsearch('part_svc',{}) ) { - $uiview{$part_svc->svcpart}="../view/". $part_svc->svcdb . ".cgi"; - $uiadd{$part_svc->svcpart}="../edit/". $part_svc->svcdb . ".cgi"; -} - -SendHeaders(); # one guess. -print < - - Package View - - -
    -

    Package View

    -
    - -END - -#untaint pkgnum -$QUERY_STRING =~ /^(\d+)$/; -my($pkgnum)=$1; - -#get package record -my($cust_pkg)=qsearchs('cust_pkg',{'pkgnum'=>$pkgnum}); -die "No package!" unless $cust_pkg; -my($part_pkg)=qsearchs('part_pkg',{'pkgpart'=>$cust_pkg->getfield('pkgpart')}); - -#nav bar -my($custnum)=$cust_pkg->getfield('custnum'); -print qq!
    View this customer!, - qq! (#$custnum) | Main menu

    !; - -#print info -my($susp,$cancel,$expire)=( - $cust_pkg->getfield('susp'), - $cust_pkg->getfield('cancel'), - $cust_pkg->getfield('expire'), -); -print "
    Package #$pkgnum"; -print qq!
    Package Information!; -print qq! | Service Information! unless $cancel; -print qq!

    \n!; - -my($pkg,$comment)=($part_pkg->getfield('pkg'),$part_pkg->getfield('comment')); -print qq!
    Package Information!, - qq!!; -print qq!
    Edit this information
    !; -print "

    Package: $pkg - $comment"; - -my($setup,$bill)=($cust_pkg->getfield('setup'),$cust_pkg->getfield('bill')); -print "
    Setup: ", $setup ? time2str("%D",$setup) : "(Not setup)" ,""; -print "
    Next bill: ", $bill ? time2str("%D",$bill) : "" ,""; - -if ($susp) { - print "
    Suspended: ", time2str("%D",$susp), ""; - print qq! Unsuspend! unless $cancel; -} else { - print qq!
    Suspend! unless $cancel; -} - -if ($expire) { - print "
    Expire: ", time2str("%D",$expire), ""; -} - print < - -Expire (date): - -END - -if ($cancel) { - print "
    Cancelled: ", time2str("%D",$cancel), ""; -} else { - print qq!
    Cancel now!; -} - -#otaker -my($otaker)=$cust_pkg->getfield('otaker'); -print "

    Order taken by $otaker"; - -unless ($cancel) { - - #services - print <

    Service Information -
    Click on service to view/edit/add service.

    -
    Do NOT pick the "Link to existing" option unless you are auditing!!!
    -
    - -END - - #list of services this pkgpart includes - my($pkg_svc,%pkg_svc); - foreach $pkg_svc ( qsearch('pkg_svc',{'pkgpart'=> $cust_pkg->pkgpart }) ) { - $pkg_svc{$pkg_svc->svcpart} = $pkg_svc->quantity if $pkg_svc->quantity; - } - - #list of records from cust_svc - my($svcpart); - foreach $svcpart (sort {$a <=> $b} keys %pkg_svc) { - - my($svc)=qsearchs('part_svc',{'svcpart'=>$svcpart})->getfield('svc'); - - my(@cust_svc)=qsearch('cust_svc',{'pkgnum'=>$pkgnum, - 'svcpart'=>$svcpart, - }); - - my($enum); - for $enum ( 1 .. $pkg_svc{$svcpart} ) { - - my($cust_svc); - if ( $cust_svc=shift @cust_svc ) { - my($svcnum)=$cust_svc->svcnum; - print < -END - } else { - print < - - -END - } - - } - warn "WARNING: Leftover services pkgnum $pkgnum!" if @cust_svc;; - } - - print "
    Service(View) $svc
    - (Add) $svc - or - (Link to existing) $svc -
    "; - -} - -#formatting -print < - -END - diff --git a/htdocs/view/svc_acct.cgi b/htdocs/view/svc_acct.cgi deleted file mode 100755 index 7096c2fb1..000000000 --- a/htdocs/view/svc_acct.cgi +++ /dev/null @@ -1,172 +0,0 @@ -#!/usr/bin/perl -Tw -# -# View svc_acct records -# -# Usage: svc_acct.cgi svcnum -# http://server.name/path/svc_acct.cgi?svcnum -# -# Note: Should be run setuid freeside as user nobody. -# -# ivan@voicenet.com 96-dec-17 -# -# added link to send info -# ivan@voicenet.com 97-jan-4 -# -# added navigation bar and ability to change username, etc. -# ivan@voicenet.com 97-jan-30 -# -# activate 800 service -# ivan@voicenet.com 97-feb-10 -# -# modified navbar code (should be a subroutine?), added link to cancel account (only if not audited) -# ivan@voicenet.com 97-apr-16 -# -# INCOMPLETELY rewrote some things for new API -# ivan@voicenet.com 97-jul-29 -# -# FS::Search became FS::Record, use strict, etc. ivan@sisd.com 98-mar-9 -# -# Changes to allow page to work at a relative position in server -# Changed 'password' to '_password' because Pg6.3 reserves the password word -# bmccane@maxbaud.net 98-apr-3 -# -# /var/spool/freeside/conf/domain ivan@sisd.com 98-jul-17 -# -# displays arbitrary radius attributes ivan@sisd.com 98-aug-16 - -use strict; -use CGI::Base qw(:DEFAULT :CGI); -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearchs fields); - -my($conf_domain)="/var/spool/freeside/conf/domain"; -open(DOMAIN,$conf_domain) or die "Can't open $conf_domain: $!"; -my($mydomain)=map { - /^(.*)$/ or die "Illegal line in $conf_domain!"; #yes, we trust the file - $1; -} grep $_ !~ /^(#|$)/, ; - -my($cgi) = new CGI::Base; -$cgi->get; -&cgisuidsetup($cgi); - -#untaint svcnum -$QUERY_STRING =~ /^(\d+)$/; -my($svcnum)=$1; -my($svc_acct)=qsearchs('svc_acct',{'svcnum'=>$svcnum}); -die "Unkonwn svcnum" unless $svc_acct; - -my($cust_svc)=qsearchs('cust_svc',{'svcnum'=>$svcnum}); -my($pkgnum)=$cust_svc->getfield('pkgnum'); -my($cust_pkg,$custnum); -if ($pkgnum) { - $cust_pkg=qsearchs('cust_pkg',{'pkgnum'=>$pkgnum}); - $custnum=$cust_pkg->getfield('custnum'); -} - -my($part_svc)=qsearchs('part_svc',{'svcpart'=> $cust_svc->svcpart } ); -die "Unkonwn svcpart" unless $part_svc; - -SendHeaders(); # one guess. -print < - - Account View - - -

    Account View

    - -
    -END - -if ($pkgnum || $custnum) { - print <View this package (#$pkgnum) | -View this customer (#$custnum) | -END -} else { - print <Cancel this (unaudited)account | -END -} - -print <Main menu

    -Service #$svcnum -END - -print qq!
    Edit this information!; -#print qq!
    Send account information!; -print qq!

    General | Shell account | !; -print qq!SLIP/PPP account
    !; - -#formatting -print qq!
    General
    !; - -#svc -print "Service: ", $part_svc->svc, ""; - -#username -print "
    Username: ", $svc_acct->username, ""; - -#password -if (substr($svc_acct->_password,0,1) eq "*") { - print "
    Password: (Login disabled)
    "; -} else { - print "
    Password: (hidden)
    "; -} - -# popnum -> svc_acct_pop record -my($svc_acct_pop)=qsearchs('svc_acct_pop',{'popnum'=>$svc_acct->popnum}); - -#pop -print "POP: ", $svc_acct_pop->city, ", ", $svc_acct_pop->state, - " (", $svc_acct_pop->ac, ")/", $svc_acct_pop->exch, "<\B>" - if $svc_acct_pop; - -#shell account -print qq!
    !; -if ($svc_acct->uid ne '') { - print "Shell account"; - print "
    "; - print "Uid: ", $svc_acct->uid, ""; - print "
    Gid: ", $svc_acct->gid, ""; - - print qq!
    Finger name: !, $svc_acct->finger, qq!
    !; - - print "Home directory: ", $svc_acct->dir, "
    "; - - print "Shell: ", $svc_acct->shell, "
    "; - - print "Quota: ", $svc_acct->quota, " (unimplemented)"; -} else { - print "No shell account.
    "; -} - -# SLIP/PPP -print qq!
    !; -if ($svc_acct->slipip) { - print "SLIP/PPP account
    "; - print "IP address: ", ( $svc_acct->slipip eq "0.0.0.0" || $svc_acct->slipip eq '0e0' ) ? "(Dynamic)" : $svc_acct->slipip ,""; - my($attribute); - foreach $attribute ( grep /^radius_/, fields('svc_acct') ) { - #warn $attribute; - $attribute =~ /^radius_(.*)$/; - my($pattribute) = ($1); - $pattribute =~ s/_/-/g; - print "
    Radius $pattribute: ". $svc_acct->getfield($attribute), ""; - } -} else { - print "No SLIP/PPP account" -} - -print "
    "; - - #formatting - print < - -END - diff --git a/htdocs/view/svc_acct_sm.cgi b/htdocs/view/svc_acct_sm.cgi deleted file mode 100755 index 42623eefd..000000000 --- a/htdocs/view/svc_acct_sm.cgi +++ /dev/null @@ -1,114 +0,0 @@ -#!/usr/bin/perl -Tw -# -# View svc_acct_sm records -# -# Usage: svc_acct_sm.cgi svcnum -# http://server.name/path/svc_acct_sm.cgi?svcnum -# -# Note: Should be run setuid freeside as user nobody. -# -# based on view/svc_acct.cgi -# -# ivan@voicenet.com 97-jan-5 -# -# added navigation bar -# ivan@voicenet.com 97-jan-30 -# -# rewrite ivan@sisd.com 98-mar-15 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 -# -# /var/spool/freeside/conf/domain ivan@sisd.com 98-jul-17 - -use strict; -use CGI::Base qw(:DEFAULT :CGI); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearchs); - -my($conf_domain)="/var/spool/freeside/conf/domain"; -open(DOMAIN,$conf_domain) or die "Can't open $conf_domain: $!"; -my($mydomain)=map { - /^(.*)$/ or die "Illegal line in $conf_domain!"; #yes, we trust the file - $1 -} grep $_ !~ /^(#|$)/, ; -close DOMAIN; - -my($cgi) = new CGI::Base; -$cgi->get; -cgisuidsetup($cgi); - -#untaint svcnum -$QUERY_STRING =~ /^(\d+)$/; -my($svcnum)=$1; -my($svc_acct_sm)=qsearchs('svc_acct_sm',{'svcnum'=>$svcnum}); -die "Unknown svcnum" unless $svc_acct_sm; - -my($cust_svc)=qsearchs('cust_svc',{'svcnum'=>$svcnum}); -my($pkgnum)=$cust_svc->getfield('pkgnum'); -my($cust_pkg,$custnum); -if ($pkgnum) { - $cust_pkg=qsearchs('cust_pkg',{'pkgnum'=>$pkgnum}); - $custnum=$cust_pkg->getfield('custnum'); -} - -my($part_svc)=qsearchs('part_svc',{'svcpart'=> $cust_svc->svcpart } ); -die "Unkonwn svcpart" unless $part_svc; - -SendHeaders(); # one guess. -print < - - Mail Alias View - - -

    Mail Alias View

    -END -if ($pkgnum || $custnum) { - print <View this package (#$pkgnum) | -View this customer (#$custnum) | -END -} else { - print <Cancel this (unaudited)account | -END -} - -print <Main menu
    Service #$svcnum -

    Edit this information - -END - -my($domsvc,$domuid,$domuser)=( - $svc_acct_sm->domsvc, - $svc_acct_sm->domuid, - $svc_acct_sm->domuser, -); -my($svc) = $part_svc->svc; -my($svc_domain)=qsearchs('svc_domain',{'svcnum'=>$domsvc}); -my($domain)=$svc_domain->domain; -my($svc_acct)=qsearchs('svc_acct',{'uid'=>$domuid}); -my($username)=$svc_acct->username; - -#formatting -print qq!


    !; - -#svc -print "Service: $svc"; - -print "
    "; - -print qq!Mail to !, ( ($domuser eq '*') ? "(anything)" : $domuser ) , qq!\@$domain forwards to $username\@$mydomain mailbox.!; - -print "
    "; - - #formatting - print < - -END - diff --git a/htdocs/view/svc_domain.cgi b/htdocs/view/svc_domain.cgi deleted file mode 100755 index 78ff6ac0b..000000000 --- a/htdocs/view/svc_domain.cgi +++ /dev/null @@ -1,76 +0,0 @@ -#!/usr/bin/perl -Tw -# -# View svc_domain records -# -# Usage: svc_domain svcnum -# http://server.name/path/svc_domain.cgi?svcnum -# -# Note: Should be run setuid freeside as user nobody. -# -# ivan@voicenet.com 97-jan-6 -# -# rewrite ivan@sisd.com 98-mar-14 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 - -use strict; -use CGI::Base qw(:DEFAULT :CGI); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearchs); - -my($cgi) = new CGI::Base; -$cgi->get; -cgisuidsetup($cgi); - -#untaint svcnum -$QUERY_STRING =~ /^(\d+)$/; -my($svcnum)=$1; -my($svc_domain)=qsearchs('svc_domain',{'svcnum'=>$svcnum}); -die "Unknown svcnum" unless $svc_domain; -my($domain)=$svc_domain->domain; - -my($cust_svc)=qsearchs('cust_svc',{'svcnum'=>$svcnum}); -my($pkgnum)=$cust_svc->getfield('pkgnum'); -my($cust_pkg,$custnum); -if ($pkgnum) { - $cust_pkg=qsearchs('cust_pkg',{'pkgnum'=>$pkgnum}); - $custnum=$cust_pkg->getfield('custnum'); -} - -my($part_svc)=qsearchs('part_svc',{'svcpart'=> $cust_svc->svcpart } ); -die "Unkonwn svcpart" unless $part_svc; - -SendHeaders(); # one guess. -print < - - Domain View - - -

    Domain View

    - -
    -View this package (#$pkgnum) | -View this customer (#$custnum) | -Main menu

    - Service #$svcnum -
    -END - -print "
    "; -print "Service: ", $part_svc->svc, ""; -print "
    "; - -print qq!Domain name $domain.!; -print qq!

    View whois information.!; - -print "


    "; - - #formatting - print < - -END - -- cgit v1.2.1