From: cvs2git Date: Wed, 2 Feb 2000 20:22:20 +0000 (+0000) Subject: This commit was manufactured by cvs2svn to create branch X-Git-Url: http://git.freeside.biz/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2Ffreeside_1_2_3_pci_mods;p=freeside.git This commit was manufactured by cvs2svn to create branch 'freeside_1_2_3_pci_mods'. --- 982d8d614ddcd9c5746f0bc7aa697f2337cc1adb diff --cc conf/registries/internic/from index dc36ae760,dc36ae760..000000000 deleted file mode 100644,100644 --- a/conf/registries/internic/from +++ /dev/null @@@ -1,1 -1,1 +1,0 @@@ --domreg@domain.tld diff --cc conf/registries/internic/nameservers index e1aa999f5,e1aa999f5..000000000 deleted file mode 100644,100644 --- a/conf/registries/internic/nameservers +++ /dev/null @@@ -1,3 -1,3 +1,0 @@@ --192.168.1.1 ns1.domain.tld --192.168.1.2 ns2.domain.tld --192.168.1.3 ns3.domain.tld diff --cc conf/registries/internic/tech_contact index 1e6fea0be,1e6fea0be..000000000 deleted file mode 100644,100644 --- a/conf/registries/internic/tech_contact +++ /dev/null @@@ -1,1 -1,1 +1,0 @@@ --A1 diff --cc conf/registries/internic/template index 8e4983ce2,8e4983ce2..000000000 deleted file mode 100644,100644 --- a/conf/registries/internic/template +++ /dev/null @@@ -1,231 -1,231 +1,0 @@@ --[ URL ftp://rs.internic.net/templates/domain-template.txt ] [ 03/98 ] -- --******* Please DO NOT REMOVE Version Number or Sections A-Q ******** -- --Domain Version Number: 4.0 -- --******* Email completed agreement to hostmaster@internic.net ******* -- -- NETWORK SOLUTIONS, INC. -- -- DOMAIN NAME REGISTRATION AGREEMENT -- -- --A. Introduction. This domain name registration agreement --("Registration Agreement") is submitted to NETWORK SOLUTIONS, INC. --("NSI") for the purpose of applying for and registering a domain name --on the Internet. If this Registration Agreement is accepted by NSI, --and a domain name is registered in NSI's domain name database and --assigned to the Registrant, Registrant ("Registrant") agrees to be --bound by the terms of this Registration Agreement and the terms of --NSI's Domain Name Dispute Policy ("Dispute Policy") which is --incorporated herein by reference and made a part of this Registration --Agreement. This Registration Agreement shall be accepted at the --offices of NSI. -- --B. Fees and Payments. -- --1) Registration or renewal (re-registration) date through March 31, 1998: --Registrant agrees to pay a registration fee of One Hundred United States --Dollars (US$100) as consideration for the registration of each new domain --name or Fifty United States Dollars (US$50) to renew (re-register) an --existing registration. --2) Registration or renewal date on and after April 1, 1998: Registrant --agrees to pay a registration fee of Seventy United States Dollars (US$70) --as consideration for the registration of each new domain name or the --applicable renewal (re-registration) fee (currently Thirty-Five United --States Dollars (US$35)) at the time of renewal (re-registration). --3) Period of Service: The non-refundable fee covers a period of two (2) --years for each new registration, and one (1) year for each renewal, --and includes any permitted modification(s) to the domain name record --during the covered period. --4) Payment: Payment is due to Network Solutions within thirty (30) --days from the date of the invoice. -- --C. Dispute Policy. Registrant agrees, as a condition to --submitting this Registration Agreement, and if the Registration --Agreement is accepted by NSI, that the Registrant shall be bound by --NSI's current Dispute Policy. The current version of the Dispute --Policy may be found at the InterNIC Registration Services web site: --"http://www.netsol.com/rs/dispute-policy.html". -- --D. Dispute Policy Changes or Modifications. Registrant agrees --that NSI, in its sole discretion, may change or modify the Dispute --Policy, incorporated by reference herein, at any time. Registrant --agrees that Registrant's maintaining the registration of a domain name --after changes or modifications to the Dispute Policy become effective --constitutes Registrant's continued acceptance of these changes or --modifications. Registrant agrees that if Registrant considers any such --changes or modifications to be unacceptable, Registrant may request --that the domain name be deleted from the domain name database. -- --E. Disputes. Registrant agrees that, if the registration of its --domain name is challenged by any third party, the Registrant will be --subject to the provisions specified in the Dispute Policy. -- --F. Agents. Registrant agrees that if this Registration Agreement --is completed by an agent for the Registrant, such as an ISP or --Administrative Contact/Agent, the Registrant is nonetheless bound as a --principal by all terms and conditions herein, including the Dispute --Policy. -- --G. Limitation of Liability. Registrant agrees that NSI shall have --no liability to the Registrant for any loss Registrant may incur in --connection with NSI's processing of this Registration Agreement, in --connection with NSI's processing of any authorized modification to the --domain name's record during the covered period, as a result of the --Registrant's ISP's failure to pay either the initial registration fee --or renewal fee, or as a result of the application of the provisions of --the Dispute Policy. Registrant agrees that in no event shall the --maximum liability of NSI under this Agreement for any matter exceed --Five Hundred United States Dollars (US$500). -- --H. Indemnity. Registrant agrees, in the event the Registration --Agreement is accepted by NSI and a subsequent dispute arises with any --third party, to indemnify and hold NSI harmless pursuant to the terms --and conditions contained in the Dispute Policy. -- --I. Breach. Registrant agrees that failure to abide by any --provision of this Registration Agreement or the Dispute Policy may be --considered by NSI to be a material breach and that NSI may provide a --written notice, describing the breach, to the Registrant. If, within --thirty (30) days of the date of mailing such notice, the Registrant --fails to provide evidence, which is reasonably satisfactory to NSI, --that it has not breached its obligations, then NSI may delete --Registrant's registration of the domain name. Any such breach by a --Registrant shall not be deemed to be excused simply because NSI did --not act earlier in response to that, or any other, breach by the --Registrant. -- --J. No Guaranty. Registrant agrees that, by registration of a --domain name, such registration does not confer immunity from objection --to either the registration or use of the domain name. -- --K. Warranty. Registrant warrants by submitting this Registration --Agreement that, to the best of Registrant's knowledge and belief, the --information submitted herein is true and correct, and that any future --changes to this information will be provided to NSI in a timely manner --according to the domain name modification procedures in place at that --time. Breach of this warranty will constitute a material breach. -- --L. Revocation. Registrant agrees that NSI may delete a --Registrant's domain name if this Registration Agreement, or subsequent --modification(s) thereto, contains false or misleading information, or --conceals or omits any information NSI would likely consider material --to its decision to approve this Registration Agreement. -- --M. Right of Refusal. NSI, in its sole discretion, reserves the --right to refuse to approve the Registration Agreement for any --Registrant. Registrant agrees that the submission of this Registration --Agreement does not obligate NSI to accept this Registration Agreement. --Registrant agrees that NSI shall not be liable for loss or damages --that may result from NSI's refusal to accept this Registration --Agreement. -- --N. Severability. Registrant agrees that the terms of this --Registration Agreement are severable. If any term or provision is --declared invalid, it shall not affect the remaining terms or --provisions which shall continue to be binding. -- --O. Entirety. Registrant agrees that this Registration Agreement --and the Dispute Policy is the complete and exclusive agreement between --Registrant and NSI regarding the registration of Registrant's domain --name. This Registration Agreement and the Dispute Policy supersede all --prior agreements and understandings, whether established by custom, --practice, policy, or precedent. -- --P. Governing Law. Registrant agrees that this Registration --Agreement shall be governed in all respects by and construed in --accordance with the laws of the Commonwealth of Virginia, United --States of America. By submitting this Registration Agreement, --Registrant consents to the exclusive jurisdiction and venue of the --United States District Court for the Eastern District of Virginia, --Alexandria Division. If there is no jurisdiction in the United States --District Court for the Eastern District of Virginia, Alexandria --Division, then jurisdiction shall be in the Circuit Court of Fairfax --County, Fairfax, Virginia. -- --Q. This is Domain Name Registration Agreement Version --Number 4.0. This Registration Agreement is only for registrations --under top-level domains: COM, ORG, NET, and EDU. By completing --and submitting this Registration Agreement for consideration and --acceptance by NSI, the Registrant agrees that he/she has read and --agrees to be bound by A through P above. -- -- --Authorization --0a. (N)ew (M)odify (D)elete....:###action### --0b. Auth Scheme................: --0c. Auth Info..................: -- --1. Comments...................:###purpose### -- --2. Complete Domain Name.......:###domain### -- --Organization Using Domain Name -- --3a. Organization Name..........:###company### --###LOOP### --3b. Street Address.............:###address### --###ENDLOOP### --3c. City.......................:###city### --3d. State......................:###state### --3e. Postal Code................:###zip### --3f. Country....................:###country### -- --Administrative Contact --4a. NIC Handle (if known)......: --4b. (I)ndividual (R)ole........:I --4c. Name (Last, First).........:###last###, ###first### --4d. Organization Name..........:###company### --###LOOP### --4e. Street Address.............:###address### --###ENDLOOP### --4f. City.......................:###city### --4g. State......................:###state### --4h. Postal Code................:###zip### --4i. Country....................:###country### --4j. Phone Number...............:###daytime### --4k. Fax Number.................:###fax### --4l. E-Mailbox..................:###email### -- --Technical Contact --5a. NIC Handle (if known)......:###tech_contact### --5b. (I)ndividual (R)ole........: --5c. Name (Last, First).........: --5d. Organization Name..........: --5e. Street Address.............: --5f. City.......................: --5g. State......................: --5h. Postal Code................: --5i. Country....................: --5j. Phone Number...............: --5k. Fax Number.................: --5l. E-Mailbox..................: -- --Billing Contact --6a. NIC Handle (if known)......: --6b. (I)ndividual (R)ole........: --6c. Name (Last, First).........: --6d. Organization Name..........: --6e. Street Address.............: --6f. City.......................: --6g. State......................: --6h. Postal Code................: --6i. Country....................: --6j. Phone Number...............: --6k. Fax Number.................: --6l. E-Mailbox..................: -- --Prime Name Server --7a. Primary Server Hostname....:###primary### --7b. Primary Server Netaddress..:###primary_ip### -- --Secondary Name Server(s) --###LOOP### --8a. Secondary Server Hostname..:###secondary### --8b. Secondary Server Netaddress:###secondary_ip### --###ENDLOOP### -- --END OF AGREEMENT -- diff --cc conf/registries/internic/to index c80f93c57,c80f93c57..000000000 deleted file mode 100644,100644 --- a/conf/registries/internic/to +++ /dev/null @@@ -1,1 -1,1 +1,0 @@@ --hostmaster@internic.net diff --cc eg/TEMPLATE_cust_main.import index 448186991,39a5785db..000000000 deleted file mode 100755,100755 --- a/eg/TEMPLATE_cust_main.import +++ /dev/null @@@ -1,208 -1,189 +1,0 @@@ --#!/usr/bin/perl -w -- --# Template for importing legacy customer data - # - # $Id: TEMPLATE_cust_main.import,v 1.3 1999-03-26 13:15:56 ivan Exp $ --# --# ivan@sisd.com 98-aug-17 - 20 - # - # $Log: TEMPLATE_cust_main.import,v $ - # Revision 1.3 1999-03-26 13:15:56 ivan - # s/create/new/, use all necessary FS::table_names to avoid warnings - # - # Revision 1.2 1998/12/16 05:29:45 ivan - # adminsuidsetup now need user - # -- --use strict; - use Date::Parse; --use FS::UID qw(adminsuidsetup datasrc); --use FS::Record qw(fields qsearch qsearchs); --use FS::cust_main; --use FS::cust_pkg; - use FS::cust_svc; - use FS::svc_acct; - use FS::pkg_svc; -use Date::Parse; -- - my $user = shift or die &usage; - adminsuidsetup $user; -adminsuidsetup; -- --# use these for the imported cust_main records (unless you have these in legacy --# data) --my($agentnum)=4; --my($refnum)=5; -- --# map from legacy billing data to pkgpart, maps imported field --# LegacyBillingData to pkgpart. your names and pkgparts will be different --my(%pkgpart)=( -- 'Employee' => 10, -- 'Business' => 11, -- 'Individual' => 12, -- 'Basic PPP' => 13, -- 'Slave' => 14, -- 'Co-Located Server' => 15, -- 'Virtual Web' => 16, -- 'Perk Mail' => 17, -- 'Credit Hold' => 18, --); -- --my($file)="legacy_file"; -- --open(CLIENT,$file) -- or die "Can't open $file: $!"; -- --# put a tab-separated header atop the file, or define @fields --# (use these names or change them below) --# --# for cust_main --# custnum - unique --# last - (name) --# first - (name) --# company --# address1 --# address2 --# city --# state --# zip --# country --# daytime - (phone) --# night - (phone) --# fax --# payby - CARD, BILL or COMP --# payinfo - Credit card #, P.O. # or COMP authorization --# paydate - Expiration --# tax - 'Y' for tax exempt --# for cust_pkg --# LegacyBillingData - maps via %pkgpart above to a pkgpart --# for svc_acct --# username -- --my($header); --$header=; --chop $header; --my(@fields)=map { /^\s*(.*[^\s]+)\s*$/; $1 } split(/\t/,$header); --#print join("\n",@fields); -- --my($error); --my($link,$line)=(0,0); --while () { -- chop; -- next if /^[\s\t]*$/; #skip any blank lines -- -- #define %svc hash for this record -- my(@record)=split(/\t/); -- my(%svc); -- foreach (@fields) { -- $svc{$_}=shift @record; -- } -- -- # might need to massage some data like this -- $svc{'payby'} =~ s/^Credit Card$/CARD/io; -- $svc{'payby'} =~ s/^Check$/BILL/io; -- $svc{'payby'} =~ s/^Cash$/BILL/io; -- $svc{'payby'} =~ s/^$/BILL/o; -- $svc{'First'} =~ s/&/and/go; -- $svc{'Zip'} =~ s/\s+$//go; -- - my($cust_main) = new FS::cust_main ( { - my($cust_main) = create FS::cust_main ( { -- 'custnum' => $svc{'custnum'}, -- 'agentnum' => $agentnum, -- 'last' => $svc{'last'}, -- 'first' => $svc{'first'}, -- 'company' => $svc{'company'}, -- 'address1' => $svc{'address1'}, -- 'address2' => $svc{'address2'}, -- 'city' => $svc{'city'}, -- 'state' => $svc{'state'}, -- 'zip' => $svc{'zip'}, -- 'country' => $svc{'country'}, -- 'daytime' => $svc{'daytime'}, -- 'night' => $svc{'night'}, -- 'fax' => $svc{'fax'}, -- 'payby' => $svc{'payby'}, -- 'payinfo' => $svc{'payinfo'}, -- 'paydate' => $svc{'paydate'}, -- 'payname' => $svc{'payname'}, -- 'tax' => $svc{'tax'}, -- 'refnum' => $refnum, -- } ); -- -- $error=$cust_main->insert; -- -- if ( $error ) { -- warn $cust_main->_dump; -- warn map "$_: ". $svc{$_}. "|\n", keys %svc; -- die $error; -- } -- - my($cust_pkg)=new FS::cust_pkg ( { - my($cust_pkg)=create FS::cust_pkg ( { -- 'custnum' => $svc{'custnum'}, -- 'pkgpart' => $pkgpart{$svc{'LegacyBillingData'}}, -- 'setup' => '', -- 'bill' => '', -- 'susp' => '', -- 'expire' => '', -- 'cancel' => '', -- } ); -- -- $error=$cust_pkg->insert; -- if ( $error ) { -- warn $svc{'LegacyBillingData'}; -- die $error; -- } -- -- unless ( $svc{'username'} ) { -- warn "Empty login"; -- } else { -- #find svc_acct record (imported with bin/svc_acct.import) for this username -- my($svc_acct)=qsearchs('svc_acct',{'username'=>$svc{'username'}}); -- unless ( $svc_acct ) { -- warn "username ", $svc{'username'}, " not found\n"; -- } else { -- #link to the cust_pkg record we created above -- -- #find cust_svc record for this svc_acct record -- my($o_cust_svc)=qsearchs('cust_svc',{ -- 'svcnum' => $svc_acct->svcnum, -- 'pkgnum' => '', -- } ); -- unless ( $o_cust_svc ) { -- warn "No unlinked cust_svc for svcnum ", $svc_acct->svcnum; -- } else { -- -- #make sure this svcpart is in pkgpart -- my($pkg_svc)=qsearchs('pkg_svc',{ -- 'pkgpart' => $pkgpart{$svc{'LegacyBillingData'}}, -- 'svcpart' => $o_cust_svc->svcpart, -- 'quantity' => 1, -- }); -- unless ( $pkg_svc ) { -- warn "login ", $svc{'username'}, ": No svcpart ", $o_cust_svc->svcpart, -- " for pkgpart ", $pkgpart{$svc{'Acct. Type'}}, "\n" ; -- } else { -- -- #create new cust_svc record linked to cust_pkg record - my($n_cust_svc) = new FS::cust_svc ({ - my($n_cust_svc) = create FS::cust_svc ({ -- 'svcnum' => $o_cust_svc->svcnum, -- 'pkgnum' => $cust_pkg->pkgnum, -- 'svcpart' => $pkg_svc->svcpart, -- }); -- my($error) = $n_cust_svc->replace($o_cust_svc); -- die $error if $error; -- $link++; -- } -- } -- } -- } -- -- $line++; -- --} -- --warn "\n$link of $line lines linked\n"; - - # --- -- - sub usage { - die "Usage:\n\n cust_main.import user\n"; - } diff --cc etc/acp_logfile-parse index 5e258991b,5e258991b..000000000 deleted file mode 100755,100755 --- a/etc/acp_logfile-parse +++ /dev/null @@@ -1,197 -1,197 +1,0 @@@ --#!/usr/bin/perl -- --### --# WHO WROTE THIS??? --### -- --#require "perldb.pl"; -- --# Compute SLIP/PPP log times --# Arguments -a Process entire file with totals --# -t Process only totals --# -f File to be processed if not current --# -d processing start date (default is entire file) --# -l to return all totals for dayuse --# -w name of tmp work file for dayuse --# user names -- --require "time.pl"; -- --$space=' '; -- --unless (@ARGV[0]) { -- print "Missing Arguments\n"; -- print "-a - entire file\n"; -- print "-t - totals only\n"; -- print "-f - file name to be processed\n"; -- print "-d - processing start date (yymmdd)\n"; -- print "-l - return totals for dayuse\n"; -- print "-w - tmp work file for dayuse\n"; -- exit; --} # end if test for missing arguments -- --$infile = "/usr/annex/acp_logfile"; --$tmpfile = "/tmp/ppp"; --$n = $#ARGV; --$start_yymmdd = ""; --for ($i = 0; $i <= $n; $i++) { -- if ($ARGV[$i] eq "-a") { -- $allflag = "true"; -- } -- elsif ($ARGV[$i] eq "-t") { -- $totalflag = "true"; -- } -- elsif ($ARGV[$i] eq "-f") { -- $i++; -- $infile = $ARGV[$i]; -- } -- elsif ($ARGV[$i] eq "-d") { -- $i++; -- $start_yymmdd = $ARGV[$i]; -- } #end start yymmdd -- elsif ($ARGV[$i] eq "-l") { -- $logflag = "true"; -- $totalflag = "true"; -- } # end log -- elsif ($ARGV[$i] eq "-w") { -- $i++; -- $tmpfile = $ARGV[$i]; -- } # end tmp file -- else { -- ($arg_user,$arg_yymmdd) = split (/:/, $ARGV[$i]); -- $ip_user_date {$arg_user} = $ARGV[$i]; -- $userflag = "true"; -- } # end else -- } # end for 1 = 1 to n -- --open (IN,$infile) -- || die "Can't open acp_logfile"; -- --NEXTUSER: while () { -- chop; -- ($add,$ether,$port,$date,$time,$type,$action,$user) = split(/:/); -- -- if ($logflag) { -- $start_yymmdd = ''; -- if ($ip_user_date{$user}) { -- ($ip_user, $start_yymmdd) = -- split (/:/, $ip_user_date{$user}); -- } # end get date -- } # end log flag -- if ($start_yymmdd) { -- if ($date < $start_yymmdd) { -- next NEXTUSER; -- } #end date compare -- } #end if date -- if ($userflag){ -- if (!$ip_user_date{$user}) { -- next NEXTUSER; -- } # end user test -- } # end by user or all -- if (($totalflag) || -- ($allflag) || -- ($ip_user_date{$user})) { -- if (($type eq 'ppp') || ($type eq 'slip')) { -- -- if ($action eq 'login') { -- $login{$user} = "$time:$date"; -- -- } -- elsif ($action eq 'logout') { -- if (!$login{$user}) { -- $login{$user} = "010101:$date"; -- } #end pad user if carry over -- ($stime,$sdate) = split(':',$login{$user}); -- $start = &annex2sec($stime); -- $end = &annex2sec($time); -- -- #If we went through midnight, add a day; -- if ($end < $start) {$end += 86400;} -- $timeon = $end - $start; -- -- $elapsed{$user} += $timeon; -- -- if (!$totalflag) { -- print (&fmt_user($user), -- ' ', &fmt_date($sdate), ' In: ', -- &fmt_time($stime),' Out: ', -- &fmt_time($time), -- ' Elapsed: ', &fmt_sec($timeon), "\n"); -- } # end total test -- } #end elsif action -- } # type = ppp of slip -- } # check arguments --} --close IN; -- --if ($logflag) { -- open (TMPPPP, ">$tmpfile") -- || die "Can't open ppp tmp file"; -- foreach $user ( sort((keys(%elapsed))) ) { -- $log_time = &fmt_sec($elapsed{$user}); -- $tmp = join (':', -- $user, -- $log_time); -- print (TMPPPP "$tmp\n"); -- } -- close (TMPPPP); --} -- else { -- print "\n\nTotal Time On For Period:\n"; -- print "-------------------------\n"; -- -- foreach $user ( sort((keys(%elapsed))) ) { -- print (&fmt_user($user), " ",&fmt_sec($elapsed{$user}), "\n"); -- } -- } --exit(0); -- --#------------------------------------------------------- --#--------------- Subroutines Start Here ---------------- --#------------------------------------------------------- -- --sub annex2sec { -- local($time) = @_; -- return( &time2sec( &break_annex($time) ) ); --} -- --sub fmt_date { -- local($date) = @_; -- -- return( substr($date,2,2).'/'.substr($date,4,2).'/'.substr($date,0,2) ); --} -- --sub fmt_time { -- local($time) = @_; -- local($s,$m,$h) = &break_annex($time); -- return ("$h:$m:$s"); --} -- -- --sub break_annex { -- local($time) = @_; -- local($h,$m,$s); -- -- $h=substr($time,0,2); -- $m=substr($time,2,2); -- $s=substr($time,4,2); -- -- return ($s,$m,$h); --} -- --sub fmt_sec { -- local(@t) = &sec2time(@_); -- @t[2] += (@t[3]*24); -- -- foreach $a (@t) { -- if ($a < 10) {$a = "0$a";} -- } -- -- return ("@t[2]:@t[1]:@t[0]"); --} -- --sub fmt_user { -- local($user) = @_; -- return( $user.substr($space,0,8 - length($user) ).' ' ); --} -- diff --cc etc/countries.txt index 73c3975ed,73c3975ed..000000000 deleted file mode 100644,100644 --- a/etc/countries.txt +++ /dev/null @@@ -1,239 -1,239 +1,0 @@@ --AFGHANISTAN AF AFG 004 --ALBANIA AL ALB 008 --ALGERIA DZ DZA 012 --AMERICAN SAMOA AS ASM 016 --ANDORRA AD AND 020 --ANGOLA AO AGO 024 --ANGUILLA AI AIA 660 --ANTARCTICA AQ ATA 010 --ANTIGUA AND BARBUDA AG ATG 028 --ARGENTINA AR ARG 032 --ARMENIA AM ARM 051 --ARUBA AW ABW 533 --AUSTRALIA AU AUS 036 --AUSTRIA AT AUT 040 --AZERBAIJAN AZ AZE 031 --BAHAMAS BS BHS 044 --BAHRAIN BH BHR 048 --BANGLADESH BD BGD 050 --BARBADOS BB BRB 052 --BELARUS BY BLR 112 --BELGIUM BE BEL 056 --BELIZE BZ BLZ 084 --BENIN BJ BEN 204 --BERMUDA BM BMU 060 --BHUTAN BT BTN 064 --BOLIVIA BO BOL 068 --BOSNIA AND HERZEGOWINA BA BIH 070 --BOTSWANA BW BWA 072 --BOUVET ISLAND BV BVT 074 --BRAZIL BR BRA 076 --BRITISH INDIAN OCEAN TERRITORY IO IOT 086 --BRUNEI DARUSSALAM BN BRN 096 --BULGARIA BG BGR 100 --BURKINA FASO BF BFA 854 --BURUNDI BI BDI 108 --CAMBODIA KH KHM 116 --CAMEROON CM CMR 120 --CANADA CA CAN 124 --CAPE VERDE CV CPV 132 --CAYMAN ISLANDS KY CYM 136 --CENTRAL AFRICAN REPUBLIC CF CAF 140 --CHAD TD TCD 148 --CHILE CL CHL 152 --CHINA CN CHN 156 --CHRISTMAS ISLAND CX CXR 162 --COCOS (KEELING) ISLANDS CC CCK 166 --COLOMBIA CO COL 170 --COMOROS KM COM 174 --CONGO CG COG 178 --COOK ISLANDS CK COK 184 --COSTA RICA CR CRI 188 --COTE D'IVOIRE CI CIV 384 --CROATIA (local name: Hrvatska) HR HRV 191 --CUBA CU CUB 192 --CYPRUS CY CYP 196 --CZECH REPUBLIC CZ CZE 203 --DENMARK DK DNK 208 --DJIBOUTI DJ DJI 262 --DOMINICA DM DMA 212 --DOMINICAN REPUBLIC DO DOM 214 --EAST TIMOR TP TMP 626 --ECUADOR EC ECU 218 --EGYPT EG EGY 818 --EL SALVADOR SV SLV 222 --EQUATORIAL GUINEA GQ GNQ 226 --ERITREA ER ERI 232 --ESTONIA EE EST 233 --ETHIOPIA ET ETH 231 --FALKLAND ISLANDS (MALVINAS) FK FLK 238 --FAROE ISLANDS FO FRO 234 --FIJI FJ FJI 242 --FINLAND FI FIN 246 --FRANCE FR FRA 250 --FRANCE, METROPOLITAN FX FXX 249 --FRENCH GUIANA GF GUF 254 --FRENCH POLYNESIA PF PYF 258 --FRENCH SOUTHERN TERRITORIES TF ATF 260 --GABON GA GAB 266 --GAMBIA GM GMB 270 --GEORGIA GE GEO 268 --GERMANY DE DEU 276 --GHANA GH GHA 288 --GIBRALTAR GI GIB 292 --GREECE GR GRC 300 --GREENLAND GL GRL 304 --GRENADA GD GRD 308 --GUADELOUPE GP GLP 312 --GUAM GU GUM 316 --GUATEMALA GT GTM 320 --GUINEA GN GIN 324 --GUINEA-BISSAU GW GNB 624 --GUYANA GY GUY 328 --HAITI HT HTI 332 --HEARD AND MC DONALD ISLANDS HM HMD 334 --HONDURAS HN HND 340 --HONG KONG HK HKG 344 --HUNGARY HU HUN 348 --ICELAND IS ISL 352 --INDIA IN IND 356 --INDONESIA ID IDN 360 --IRAN (ISLAMIC REPUBLIC OF) IR IRN 364 --IRAQ IQ IRQ 368 --IRELAND IE IRL 372 --ISRAEL IL ISR 376 --ITALY IT ITA 380 --JAMAICA JM JAM 388 --JAPAN JP JPN 392 --JORDAN JO JOR 400 --KAZAKHSTAN KZ KAZ 398 --KENYA KE KEN 404 --KIRIBATI KI KIR 296 --KOREA, DEMOCRATIC PEOPLE'S REPUBLIC OF KP PRK 408 --KOREA, REPUBLIC OF KR KOR 410 --KUWAIT KW KWT 414 --KYRGYZSTAN KG KGZ 417 --LAO PEOPLE'S DEMOCRATIC REPUBLIC LA LAO 418 --LATVIA LV LVA 428 --LEBANON LB LBN 422 --LESOTHO LS LSO 426 --LIBERIA LR LBR 430 --LIBYAN ARAB JAMAHIRIYA LY LBY 434 --LIECHTENSTEIN LI LIE 438 --LITHUANIA LT LTU 440 --LUXEMBOURG LU LUX 442 --MACAU MO MAC 446 --MACEDONIA, THE FORMER YUGOSLAV REPUBLIC OF MK MKD 807 --MADAGASCAR MG MDG 450 --MALAWI MW MWI 454 --MALAYSIA MY MYS 458 --MALDIVES MV MDV 462 --MALI ML MLI 466 --MALTA MT MLT 470 --MARSHALL ISLANDS MH MHL 584 --MARTINIQUE MQ MTQ 474 --MAURITANIA MR MRT 478 --MAURITIUS MU MUS 480 --MAYOTTE YT MYT 175 --MEXICO MX MEX 484 --MICRONESIA, FEDERATED STATES OF FM FSM 583 --MOLDOVA, REPUBLIC OF MD MDA 498 --MONACO MC MCO 492 --MONGOLIA MN MNG 496 --MONTSERRAT MS MSR 500 --MOROCCO MA MAR 504 --MOZAMBIQUE MZ MOZ 508 --MYANMAR MM MMR 104 --NAMIBIA NA NAM 516 --NAURU NR NRU 520 --NEPAL NP NPL 524 --NETHERLANDS NL NLD 528 --NETHERLANDS ANTILLES AN ANT 530 --NEW CALEDONIA NC NCL 540 --NEW ZEALAND NZ NZL 554 --NICARAGUA NI NIC 558 --NIGER NE NER 562 --NIGERIA NG NGA 566 --NIUE NU NIU 570 --NORFOLK ISLAND NF NFK 574 --NORTHERN MARIANA ISLANDS MP MNP 580 --NORWAY NO NOR 578 --OMAN OM OMN 512 --PAKISTAN PK PAK 586 --PALAU PW PLW 585 --PANAMA PA PAN 591 --PAPUA NEW GUINEA PG PNG 598 --PARAGUAY PY PRY 600 --PERU PE PER 604 --PHILIPPINES PH PHL 608 --PITCAIRN PN PCN 612 --POLAND PL POL 616 --PORTUGAL PT PRT 620 --PUERTO RICO PR PRI 630 --QATAR QA QAT 634 --REUNION RE REU 638 --ROMANIA RO ROM 642 --RUSSIAN FEDERATION RU RUS 643 --RWANDA RW RWA 646 --SAINT KITTS AND NEVIS KN KNA 659 --SAINT LUCIA LC LCA 662 --SAINT VINCENT AND THE GRENADINES VC VCT 670 --SAMOA WS WSM 882 --SAN MARINO SM SMR 674 --SAO TOME AND PRINCIPE ST STP 678 --SAUDI ARABIA SA SAU 682 --SENEGAL SN SEN 686 --SEYCHELLES SC SYC 690 --SIERRA LEONE SL SLE 694 --SINGAPORE SG SGP 702 --SLOVAKIA (Slovak Republic) SK SVK 703 --SLOVENIA SI SVN 705 --SOLOMON ISLANDS SB SLB 090 --SOMALIA SO SOM 706 --SOUTH AFRICA ZA ZAF 710 --SOUTH GEORGIA AND THE SOUTH SANDWICH ISLANDS GS SGS 239 --SPAIN ES ESP 724 --SRI LANKA LK LKA 144 --ST. HELENA SH SHN 654 --ST. PIERRE AND MIQUELON PM SPM 666 --SUDAN SD SDN 736 --SURINAME SR SUR 740 --SVALBARD AND JAN MAYEN ISLANDS SJ SJM 744 --SWAZILAND SZ SWZ 748 --SWEDEN SE SWE 752 --SWITZERLAND CH CHE 756 --SYRIAN ARAB REPUBLIC SY SYR 760 --TAIWAN, PROVINCE OF CHINA TW TWN 158 --TAJIKISTAN TJ TJK 762 --TANZANIA, UNITED REPUBLIC OF TZ TZA 834 --THAILAND TH THA 764 --TOGO TG TGO 768 --TOKELAU TK TKL 772 --TONGA TO TON 776 --TRINIDAD AND TOBAGO TT TTO 780 --TUNISIA TN TUN 788 --TURKEY TR TUR 792 --TURKMENISTAN TM TKM 795 --TURKS AND CAICOS ISLANDS TC TCA 796 --TUVALU TV TUV 798 --UGANDA UG UGA 800 --UKRAINE UA UKR 804 --UNITED ARAB EMIRATES AE ARE 784 --UNITED KINGDOM GB GBR 826 --UNITED STATES US USA 840 --UNITED STATES MINOR OUTLYING ISLANDS UM UMI 581 --URUGUAY UY URY 858 --UZBEKISTAN UZ UZB 860 --VANUATU VU VUT 548 --VATICAN CITY STATE (HOLY SEE) VA VAT 336 --VENEZUELA VE VEN 862 --VIET NAM VN VNM 704 --VIRGIN ISLANDS (BRITISH) VG VGB 092 --VIRGIN ISLANDS (U.S.) VI VIR 850 --WALLIS AND FUTUNA ISLANDS WF WLF 876 --WESTERN SAHARA EH ESH 732 --YEMEN YE YEM 887 --YUGOSLAVIA YU YUG 891 --ZAIRE ZR ZAR 180 --ZAMBIA ZM ZMB 894 --ZIMBABWE ZW ZWE 716 diff --cc etc/domain-template.txt index 8e4983ce2,8e4983ce2..000000000 deleted file mode 100644,100644 --- a/etc/domain-template.txt +++ /dev/null @@@ -1,231 -1,231 +1,0 @@@ --[ URL ftp://rs.internic.net/templates/domain-template.txt ] [ 03/98 ] -- --******* Please DO NOT REMOVE Version Number or Sections A-Q ******** -- --Domain Version Number: 4.0 -- --******* Email completed agreement to hostmaster@internic.net ******* -- -- NETWORK SOLUTIONS, INC. -- -- DOMAIN NAME REGISTRATION AGREEMENT -- -- --A. Introduction. This domain name registration agreement --("Registration Agreement") is submitted to NETWORK SOLUTIONS, INC. --("NSI") for the purpose of applying for and registering a domain name --on the Internet. If this Registration Agreement is accepted by NSI, --and a domain name is registered in NSI's domain name database and --assigned to the Registrant, Registrant ("Registrant") agrees to be --bound by the terms of this Registration Agreement and the terms of --NSI's Domain Name Dispute Policy ("Dispute Policy") which is --incorporated herein by reference and made a part of this Registration --Agreement. This Registration Agreement shall be accepted at the --offices of NSI. -- --B. Fees and Payments. -- --1) Registration or renewal (re-registration) date through March 31, 1998: --Registrant agrees to pay a registration fee of One Hundred United States --Dollars (US$100) as consideration for the registration of each new domain --name or Fifty United States Dollars (US$50) to renew (re-register) an --existing registration. --2) Registration or renewal date on and after April 1, 1998: Registrant --agrees to pay a registration fee of Seventy United States Dollars (US$70) --as consideration for the registration of each new domain name or the --applicable renewal (re-registration) fee (currently Thirty-Five United --States Dollars (US$35)) at the time of renewal (re-registration). --3) Period of Service: The non-refundable fee covers a period of two (2) --years for each new registration, and one (1) year for each renewal, --and includes any permitted modification(s) to the domain name record --during the covered period. --4) Payment: Payment is due to Network Solutions within thirty (30) --days from the date of the invoice. -- --C. Dispute Policy. Registrant agrees, as a condition to --submitting this Registration Agreement, and if the Registration --Agreement is accepted by NSI, that the Registrant shall be bound by --NSI's current Dispute Policy. The current version of the Dispute --Policy may be found at the InterNIC Registration Services web site: --"http://www.netsol.com/rs/dispute-policy.html". -- --D. Dispute Policy Changes or Modifications. Registrant agrees --that NSI, in its sole discretion, may change or modify the Dispute --Policy, incorporated by reference herein, at any time. Registrant --agrees that Registrant's maintaining the registration of a domain name --after changes or modifications to the Dispute Policy become effective --constitutes Registrant's continued acceptance of these changes or --modifications. Registrant agrees that if Registrant considers any such --changes or modifications to be unacceptable, Registrant may request --that the domain name be deleted from the domain name database. -- --E. Disputes. Registrant agrees that, if the registration of its --domain name is challenged by any third party, the Registrant will be --subject to the provisions specified in the Dispute Policy. -- --F. Agents. Registrant agrees that if this Registration Agreement --is completed by an agent for the Registrant, such as an ISP or --Administrative Contact/Agent, the Registrant is nonetheless bound as a --principal by all terms and conditions herein, including the Dispute --Policy. -- --G. Limitation of Liability. Registrant agrees that NSI shall have --no liability to the Registrant for any loss Registrant may incur in --connection with NSI's processing of this Registration Agreement, in --connection with NSI's processing of any authorized modification to the --domain name's record during the covered period, as a result of the --Registrant's ISP's failure to pay either the initial registration fee --or renewal fee, or as a result of the application of the provisions of --the Dispute Policy. Registrant agrees that in no event shall the --maximum liability of NSI under this Agreement for any matter exceed --Five Hundred United States Dollars (US$500). -- --H. Indemnity. Registrant agrees, in the event the Registration --Agreement is accepted by NSI and a subsequent dispute arises with any --third party, to indemnify and hold NSI harmless pursuant to the terms --and conditions contained in the Dispute Policy. -- --I. Breach. Registrant agrees that failure to abide by any --provision of this Registration Agreement or the Dispute Policy may be --considered by NSI to be a material breach and that NSI may provide a --written notice, describing the breach, to the Registrant. If, within --thirty (30) days of the date of mailing such notice, the Registrant --fails to provide evidence, which is reasonably satisfactory to NSI, --that it has not breached its obligations, then NSI may delete --Registrant's registration of the domain name. Any such breach by a --Registrant shall not be deemed to be excused simply because NSI did --not act earlier in response to that, or any other, breach by the --Registrant. -- --J. No Guaranty. Registrant agrees that, by registration of a --domain name, such registration does not confer immunity from objection --to either the registration or use of the domain name. -- --K. Warranty. Registrant warrants by submitting this Registration --Agreement that, to the best of Registrant's knowledge and belief, the --information submitted herein is true and correct, and that any future --changes to this information will be provided to NSI in a timely manner --according to the domain name modification procedures in place at that --time. Breach of this warranty will constitute a material breach. -- --L. Revocation. Registrant agrees that NSI may delete a --Registrant's domain name if this Registration Agreement, or subsequent --modification(s) thereto, contains false or misleading information, or --conceals or omits any information NSI would likely consider material --to its decision to approve this Registration Agreement. -- --M. Right of Refusal. NSI, in its sole discretion, reserves the --right to refuse to approve the Registration Agreement for any --Registrant. Registrant agrees that the submission of this Registration --Agreement does not obligate NSI to accept this Registration Agreement. --Registrant agrees that NSI shall not be liable for loss or damages --that may result from NSI's refusal to accept this Registration --Agreement. -- --N. Severability. Registrant agrees that the terms of this --Registration Agreement are severable. If any term or provision is --declared invalid, it shall not affect the remaining terms or --provisions which shall continue to be binding. -- --O. Entirety. Registrant agrees that this Registration Agreement --and the Dispute Policy is the complete and exclusive agreement between --Registrant and NSI regarding the registration of Registrant's domain --name. This Registration Agreement and the Dispute Policy supersede all --prior agreements and understandings, whether established by custom, --practice, policy, or precedent. -- --P. Governing Law. Registrant agrees that this Registration --Agreement shall be governed in all respects by and construed in --accordance with the laws of the Commonwealth of Virginia, United --States of America. By submitting this Registration Agreement, --Registrant consents to the exclusive jurisdiction and venue of the --United States District Court for the Eastern District of Virginia, --Alexandria Division. If there is no jurisdiction in the United States --District Court for the Eastern District of Virginia, Alexandria --Division, then jurisdiction shall be in the Circuit Court of Fairfax --County, Fairfax, Virginia. -- --Q. This is Domain Name Registration Agreement Version --Number 4.0. This Registration Agreement is only for registrations --under top-level domains: COM, ORG, NET, and EDU. By completing --and submitting this Registration Agreement for consideration and --acceptance by NSI, the Registrant agrees that he/she has read and --agrees to be bound by A through P above. -- -- --Authorization --0a. (N)ew (M)odify (D)elete....:###action### --0b. Auth Scheme................: --0c. Auth Info..................: -- --1. Comments...................:###purpose### -- --2. Complete Domain Name.......:###domain### -- --Organization Using Domain Name -- --3a. Organization Name..........:###company### --###LOOP### --3b. Street Address.............:###address### --###ENDLOOP### --3c. City.......................:###city### --3d. State......................:###state### --3e. Postal Code................:###zip### --3f. Country....................:###country### -- --Administrative Contact --4a. NIC Handle (if known)......: --4b. (I)ndividual (R)ole........:I --4c. Name (Last, First).........:###last###, ###first### --4d. Organization Name..........:###company### --###LOOP### --4e. Street Address.............:###address### --###ENDLOOP### --4f. City.......................:###city### --4g. State......................:###state### --4h. Postal Code................:###zip### --4i. Country....................:###country### --4j. Phone Number...............:###daytime### --4k. Fax Number.................:###fax### --4l. E-Mailbox..................:###email### -- --Technical Contact --5a. NIC Handle (if known)......:###tech_contact### --5b. (I)ndividual (R)ole........: --5c. Name (Last, First).........: --5d. Organization Name..........: --5e. Street Address.............: --5f. City.......................: --5g. State......................: --5h. Postal Code................: --5i. Country....................: --5j. Phone Number...............: --5k. Fax Number.................: --5l. E-Mailbox..................: -- --Billing Contact --6a. NIC Handle (if known)......: --6b. (I)ndividual (R)ole........: --6c. Name (Last, First).........: --6d. Organization Name..........: --6e. Street Address.............: --6f. City.......................: --6g. State......................: --6h. Postal Code................: --6i. Country....................: --6j. Phone Number...............: --6k. Fax Number.................: --6l. E-Mailbox..................: -- --Prime Name Server --7a. Primary Server Hostname....:###primary### --7b. Primary Server Netaddress..:###primary_ip### -- --Secondary Name Server(s) --###LOOP### --8a. Secondary Server Hostname..:###secondary### --8b. Secondary Server Netaddress:###secondary_ip### --###ENDLOOP### -- --END OF AGREEMENT -- diff --cc etc/example-direct-cardin index 1a4097221,1a4097221..000000000 deleted file mode 100755,100755 --- a/etc/example-direct-cardin +++ /dev/null @@@ -1,67 -1,67 +1,0 @@@ --#!/usr/local/bin/perl -- --### --# THIS IS FROM CYBERCASH (is there a newer version?) --### -- --$paymentserverhost = 'localhost'; --$paymentserverport = 8000; --$paymentserversecret = 'two-turntables'; --use CCLib qw(sendmserver); -- --# first lets fake up some data --# use time of day and pid to give me my pretend --# order number --# you obviously need to get real data from somewhere... -- --$oid = "test$$"; #fake order number. --$amount = 'usd 42.42'; --$ramount = 'usd 24.24'; --$pan = '4111111111111111'; --$name = 'John Q. Doe'; --$addr = '17 Richard Rd.'; --$city = 'Ivyland'; --$state = 'PA'; --$zip = '18974'; --$country = 'USA'; --$exp = '7/97'; -- -- --%result = &sendmserver('mauthcapture', -- 'Order-ID', $oid, -- 'Amount', $amount, -- 'Card-Number', $pan, -- 'Card-Name', $name, -- 'Card-Address', $addr, -- 'Card-City', $city, -- 'Card-State', $state, -- 'Card-Zip', $zip, -- 'Card-Country', $country, -- 'Card-Exp', $exp); -- --# --# just dump results to stdout. --# you should process them... --# to allow results to affect operation of your fulfillment... --# --foreach (keys(%result)) { -- print " $_ ==> $result{$_}\n"; --} -- --print "\n"; -- --exit; -- --$trans=$result{'MTransactionNumber'}; --$code=$result{'MRetrievalCode'}; -- --%result = &sendmserver('return', -- 'Order-ID', $oid, -- 'Return-Amount',$ramount, -- 'Amount',$amount, -- ); -- --foreach (keys(%result)) { -- print " $_ ==> $result{$_}\n"; --} -- diff --cc fs_passwd/fs_passwd index bcf09f1fe,bcf09f1fe..000000000 deleted file mode 100755,100755 --- a/fs_passwd/fs_passwd +++ /dev/null @@@ -1,129 -1,129 +1,0 @@@ --#!/usr/bin/perl -Tw --# --# fs_passwd --# --# portions of this script are copied from the `passwd' script in the original --# (perl 4) camel book, now archived at --# http://www.perl.com/CPAN/scripts/nutshell/ch6/passwd --# --# ivan@sisd.com 98-mar-8 --# --# password lengths 0,255 instead of 6,8 - we'll let the server process --# check the data ivan@sisd.com 98-jul-17 -- --use strict; --use Getopt::Std; --use Socket; --use IO::Handle; --use vars qw($opt_f $opt_s); -- --my($fs_passwdd_socket)="/usr/local/freeside/fs_passwdd_socket"; --my($freeside_uid)=scalar(getpwnam('freeside')); -- --$ENV{'PATH'} ='/usr/bin:/usr/ucb:/bin'; --$ENV{'SHELL'} = '/bin/sh'; --$ENV{'IFS'} = " \t\n"; --$ENV{'CDPATH'} = ''; --$ENV{'ENV'} = ''; --$ENV{'BASH_ENV'} = ''; -- --$SIG{__DIE__}= sub { system '/bin/stty', 'echo'; }; -- --die "passwd program isn't running setuid to freeside\n" if $> != $freeside_uid; -- --unshift @ARGV, "-f" if $0 =~ /chfn$/; --unshift @ARGV, "-s" if $0 =~ /chsh$/; -- --getopts('fs'); -- --my($me)=''; --if ( $_ = shift(@ARGV) ) { -- /^(\w{2,8})$/; -- $me = $1; --} --die "You can't change the password for $me." if $me && $<; --$me = (getpwuid($<))[0] unless $me; -- --my($name,$passwd,$uid,$gid,$quota,$comment,$gcos,$dir,$shell)= -- getpwnam $me; -- --my($old_password,$new_password,$new_gecos,$new_shell); -- --if ( $opt_f || $opt_s ) { -- system '/bin/stty', '-echo'; -- print "Password:"; -- $old_password=; -- system '/bin/stty', 'echo'; -- chop($old_password); -- #$old_password =~ /^(.{6,8})$/ or die "\nIllegal password.\n"; -- $old_password =~ /^(.{0,255})$/ or die "\nIllegal password.\n"; -- $old_password = $1; -- -- $new_password = ''; -- -- if ( $opt_f ) { -- print "\nChanging gecos for $me.\n"; -- print "Gecos [", $gcos, "]: "; -- $new_gecos=; -- chop($new_gecos); -- $new_gecos ||= $gcos; -- $new_gecos =~ /^(.{0,255})$/ or die "\nIllegal gecos.\n"; -- } else { -- $new_gecos = ''; -- } -- -- if ( $opt_s ) { -- print "\nChanging shell for $me.\n"; -- print "Shell [", $shell, "]: "; -- $new_shell=; -- chop($new_shell); -- $new_shell ||= $shell; -- $new_shell =~ /^(.{0,255})$/ or die "\nIllegal shell.\n"; -- } else { -- $new_shell = ''; -- } -- --} else { -- -- print "Changing password for $me.\n"; -- print "Old password:"; -- system '/bin/stty', '-echo'; -- $old_password=; -- chop $old_password; -- #$old_password =~ /^(.{6,8})$/ or die "\nIllegal password.\n"; -- $old_password =~ /^(.{0,255})$/ or die "\nIllegal password.\n"; -- $old_password = $1; -- print "\nEnter the new password (minimum of 6, maximum of 8 characters)\n"; -- print "Please use a combination of upper and lowercase letters and numbers.\n"; -- print "New password:"; -- $new_password=; -- chop($new_password); -- #$new_password =~ /^(.{6,8})$/ or die "\nIllegal password.\n"; -- $new_password =~ /^(.{0,255})$/ or die "\nIllegal password.\n"; -- $new_password = $1; -- print "\nRe-enter new password:"; -- my($check_new_password); -- $check_new_password=; -- chop($check_new_password); -- die "\nThey don't match; try again.\n" unless $check_new_password eq $new_password; -- -- $new_gecos=''; -- $new_shell=''; --} --print "\n"; -- --system '/bin/stty', 'echo'; -- --socket(SOCK, PF_UNIX, SOCK_STREAM, 0) or die "socket: $!"; --connect(SOCK, sockaddr_un($fs_passwdd_socket)) or die "connect: $!"; --print SOCK join("\n",$me,$old_password,$new_password,$new_gecos,$new_shell),"\n"; --SOCK->flush; --my($error); --$error = ; --chop $error; -- --if ($error) { -- print "\nUpdate error: $error\n"; --} else { -- print "\nUpdate sucessful.\n"; --} diff --cc fs_passwd/fs_passwd_server index cb0e693dd,99e7c4351..000000000 deleted file mode 100755,100755 --- a/fs_passwd/fs_passwd_server +++ /dev/null @@@ -1,77 -1,73 +1,0 @@@ --#!/usr/bin/perl -Tw --# --# fs_passwd_server --# --# portions of this script are copied from the `passwd' script in the original --# (perl 4) camel book, now archived at --# http://www.perl.com/CPAN/scripts/nutshell/ch6/passwd --# --# ivan@sisd.com 98-mar-9 --# --# crypt-aware, s/password/_password/; ivan@sisd.com 98-aug-23 -- --use strict; --use IO::Handle; --use FS::SSH qw(sshopen2); --use FS::UID qw(adminsuidsetup); --use FS::Record qw(qsearchs); --use FS::svc_acct; - - my $user = shift or die &usage; - adminsuidsetup $user; - - my($shellmachine)=shift or die &usage; -- --$SIG{CHLD} = sub { wait() }; - -&adminsuidsetup; -- --my($fs_passwdd)="/usr/local/sbin/fs_passwdd"; - -my($shellmachine)=shift; -die "Usage: fs_passwd_server shellmachine\n" unless $shellmachine; -- --while (1) { -- my($reader,$writer)=(new IO::Handle, new IO::Handle); -- $writer->autoflush(1); -- sshopen2($shellmachine,$reader,$writer,$fs_passwdd); -- while (1) { -- my($username,$old_password,$new_password,$new_gecos,$new_shell); -- defined($username=<$reader>) or last; -- defined($old_password=<$reader>) or last; -- defined($new_password=<$reader>) or last; -- defined($new_gecos=<$reader>) or last; -- defined($new_shell=<$reader>) or last; -- chop($username); -- chop($old_password); -- chop($new_password); -- chop($new_gecos); -- chop($new_shell); -- my($svc_acct); -- -- #need to try both $old_password and encrypted $old_password -- #maybe the crypt function in svc_acct.export needs to be a library? -- my $salt = substr($old_password,0,2); -- my $cold_password = crypt($old_password,$salt); -- $svc_acct=qsearchs('svc_acct',{'username'=>$username, -- '_password'=>$old_password, -- } ) -- || qsearchs('svc_acct',{'username'=>$username, -- '_password'=>$cold_password, -- } ); -- unless ( $svc_acct ) { print $writer "Incorrect password.\n"; next; } -- -- my(%hash)=$svc_acct->hash; - my($new_svc_acct) = new FS::svc_acct ( \%hash ); - my($new_svc_acct) = create FS::svc_acct ( \%hash ); -- $new_svc_acct->setfield('_password',$new_password) -- if $new_password && $new_password ne $old_password; -- $new_svc_acct->setfield('finger',$new_gecos) if $new_gecos; -- $new_svc_acct->setfield('shell',$new_shell) if $new_shell; -- my($error)=$new_svc_acct->replace($svc_acct); -- print $writer $error,"\n"; -- } -- close $writer; -- close $reader; -- sleep 60; -- warn "Connection to $shellmachine lost! Reconnecting...\n"; - } - - sub usage { - die "Usage:\n\n fs_passwd_server user shellmachine\n"; --} -- diff --cc fs_passwd/fs_passwdd index be7539984,582e13ccd..000000000 deleted file mode 100755,100755 --- a/fs_passwd/fs_passwdd +++ /dev/null @@@ -1,49 -1,49 +1,0 @@@ --#!/usr/bin/perl -Tw --# --# fs_passwdd --# --# This is run REMOTELY over ssh by fs_passwd_server. --# --# ivan@sisd.com 98-mar-9 -- --use strict; --use Socket; -- --my($fs_passwdd_socket)="/usr/local/freeside/fs_passwdd_socket"; -- - $ENV{'PATH'} ='/usr/local/bin:/usr/bin:/usr/ucb:/bin'; -$ENV{'PATH'} ='/usr/bin:/usr/ucb:/bin'; --$ENV{'SHELL'} = '/bin/sh'; --$ENV{'IFS'} = " \t\n"; --$ENV{'CDPATH'} = ''; --$ENV{'ENV'} = ''; --$ENV{'BASH_ENV'} = ''; -- --$|=1; -- --my $uaddr = sockaddr_un($fs_passwdd_socket); --my $proto = getprotobyname('tcp'); -- --socket(Server,PF_UNIX,SOCK_STREAM,0) or die "socket: $!"; --unlink($fs_passwdd_socket); --bind(Server, $uaddr) or die "bind: $!"; --listen(Server,SOMAXCONN) or die "listen: $!"; -- --my($paddr); --for ( ; $paddr = accept(Client,Server); close Client) { -- my($me,$old_password,$new_password,$new_gecos,$new_shell); -- -- $me=; -- $old_password=; -- $new_password=; -- $new_gecos=; -- $new_shell=; -- -- print $me,$old_password,$new_password,$new_gecos,$new_shell; -- my($error); -- -- $error=; -- -- print Client $error; -- close Client; --} -- diff --cc fs_radlog/fs_radlogd index 74c2af361,74c2af361..000000000 deleted file mode 100755,100755 --- a/fs_radlog/fs_radlogd +++ /dev/null @@@ -1,51 -1,51 +1,0 @@@ --#!/usr/bin/perl -Tw --# --# ivan@sisd.com 98-mar-23 -- --use strict; --use Date::Parse; #but hopefully not -- --$|=1; -- --my($file,$pos)=@_; --open(FILE,"<$file") or die "Can't open $file: $!"; --seek(FILE,$pos,0) or die "Can't seek: $!"; -- --my($datestr); --my(%param); -- --$SIG{'HUP'} = sub { print "EOF\n"; exit; }; -- --while (1) { -- -- while () { -- next if /^$/; -- if ( /^\S/ ) { -- chop($datestr=$_); -- undef %param; -- } else { -- warn "Unexpected line: $_"; -- } -- while () { -- if ( /^$/ ) { -- #if ( $param{'Acct-Status-Type'} eq 'Stop' ) { -- print join("\t", -- tell FILE, -- %param, -- ),"\n"; -- #} -- last; -- } elsif ( /^\s+([\w\-]+)\s\=\s\"?([\w\.\-]+)\"?\s*$/ ) { -- $param{$1}=$2; -- } else { -- warn "Unexpected line: $_"; -- } -- -- } -- -- } -- sleep 1; -- seek(FILE,0,1); --} -- -- diff --cc htdocs/browse/agent.cgi index b73d17b76,cf5f2281f..000000000 deleted file mode 100755,100755 --- a/htdocs/browse/agent.cgi +++ /dev/null @@@ -1,134 -1,72 +1,0 @@@ --#!/usr/bin/perl -Tw --# - # $Id: agent.cgi,v 1.13 1999-04-09 04:22:34 ivan Exp $ -# 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 - # - # $Log: agent.cgi,v $ - # Revision 1.13 1999-04-09 04:22:34 ivan - # also table() - # - # Revision 1.12 1999/04/09 03:52:55 ivan - # explicit & for table/itable/ntable - # - # Revision 1.11 1999/01/20 09:43:16 ivan - # comment out future UI code (but look at it, it's neat!) - # - # Revision 1.10 1999/01/19 05:13:24 ivan - # for mod_perl: no more top-level my() variables; use vars instead - # also the last s/create/new/; - # - # Revision 1.9 1999/01/18 09:41:14 ivan - # all $cgi->header calls now include ( '-expires' => 'now' ) for mod_perl - # (good idea anyway) - # - # Revision 1.8 1999/01/18 09:22:26 ivan - # changes to track email addresses for email invoicing - # - # Revision 1.7 1998/12/17 05:25:16 ivan - # fix visual and other bugs - # - # Revision 1.6 1998/11/23 05:29:46 ivan - # use CGI::Carp - # - # Revision 1.5 1998/11/23 05:27:31 ivan - # to eliminate warnings - # - # Revision 1.4 1998/11/20 08:50:36 ivan - # s/CGI::Base/CGI.pm, visual fixes - # - # Revision 1.3 1998/11/08 10:11:02 ivan - # CGI.pm - # - # Revision 1.2 1998/11/07 10:24:22 ivan - # don't use depriciated FS::Bill and FS::Invoice, other miscellania - # -- --use strict; - use vars qw( $ui $cgi $p $agent ); - use CGI; - use CGI::Carp qw(fatalsToBrowser); -use CGI::Base; --use FS::UID qw(cgisuidsetup swapuid); --use FS::Record qw(qsearch qsearchs); - use FS::CGI qw(header menubar table popurl); - use FS::agent; - use FS::agent_type; - - #Begin silliness - # - #use FS::UI::CGI; - #use FS::UI::agent; - # - #$ui = new FS::UI::agent; - #$ui->browse; - #exit; - #__END__ - #End silliness -use FS::CGI qw(header menubar); -- - $cgi = new CGI; -my($cgi) = new CGI::Base; -$cgi->get; -- --&cgisuidsetup($cgi); - - $p = popurl(2); -- - print $cgi->header( '-expires' => 'now' ), header('Agent Listing', menubar( - 'Main Menu' => $p, - 'Agent Types' => $p. 'browse/agent_type.cgi', - # 'Add new agent' => '../edit/agent.cgi' -SendHeaders(); # one guess. -print header('Agent Listing', menubar( - 'Main Menu' => '../', - 'Add new agent' => '../edit/agent.cgi' --)), <
- END - print &table(), < - 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 < - - - --
AgentAgent #AgentTypeFreq. (unimp.)Prog. (unimp.)
Agent #Agent - -- $hashref->{agentnum} - $hashref->{agent}$atype$hashref->{agent}$atype$hashref->{freq}$hashref->{prog}
Add new agentAdd new agent type
- - -- -- --END -- diff --cc htdocs/browse/agent_type.cgi index 9d8687299,5f05bd514..000000000 deleted file mode 100755,100755 --- a/htdocs/browse/agent_type.cgi +++ /dev/null @@@ -1,105 -1,81 +1,0 @@@ --#!/usr/bin/perl -Tw --# - # $Id: agent_type.cgi,v 1.8 1999-04-09 04:22:34 ivan Exp $ -# 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 - # - # $Log: agent_type.cgi,v $ - # Revision 1.8 1999-04-09 04:22:34 ivan - # also table() - # - # Revision 1.7 1999/04/09 03:52:55 ivan - # explicit & for table/itable/ntable - # - # Revision 1.6 1999/04/07 11:10:46 ivan - # harmless typo - # - # Revision 1.5 1999/01/19 05:13:25 ivan - # for mod_perl: no more top-level my() variables; use vars instead - # also the last s/create/new/; - # - # Revision 1.4 1999/01/18 09:41:15 ivan - # all $cgi->header calls now include ( '-expires' => 'now' ) for mod_perl - # (good idea anyway) - # - # Revision 1.3 1998/12/17 05:25:17 ivan - # fix visual and other bugs - # - # Revision 1.2 1998/11/21 07:39:52 ivan - # visual - # -- --use strict; - use vars qw( $cgi $p $agent_type ); - use CGI; - use CGI::Carp qw(fatalsToBrowser); -use CGI::Base; --use FS::UID qw(cgisuidsetup swapuid); --use FS::Record qw(qsearch qsearchs); - use FS::CGI qw(header menubar popurl table); - use FS::agent_type; - use FS::type_pkgs; - use FS::part_pkg; -use FS::CGI qw(header menubar); -- - $cgi = new CGI; -my($cgi) = new CGI::Base; -$cgi->get; -- --&cgisuidsetup($cgi); -- - $p = popurl(2); - print $cgi->header( '-expires' => 'now' ), header("Agent Type Listing", menubar( - 'Main Menu' => $p, - )), "Agent types define groups of packages that you can then assign to". - " particular agents.

", &table(), < '../', - 'Add new agent type' => "../edit/agent_type.cgi", -)), <Click on agent type number to edit. - -- - - - - - -- --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 < -
Agent TypePackagesType #TypePackages
- -- $hashref->{typenum} -- $hashref->{atype}$hashref->{atype}
!, - print qq!!, -- $part_pkg->getfield('pkg'),"
Add new agent type
- - -- -- --END -- diff --cc htdocs/browse/cust_main_county.cgi index 5f2b13dc0,d615198c9..000000000 deleted file mode 100755,100755 --- a/htdocs/browse/cust_main_county.cgi +++ /dev/null @@@ -1,104 -1,65 +1,0 @@@ --#!/usr/bin/perl -Tw --# - # $Id: cust_main_county.cgi,v 1.7 1999-04-09 04:22:34 ivan Exp $ -# 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 - # - # $Log: cust_main_county.cgi,v $ - # Revision 1.7 1999-04-09 04:22:34 ivan - # also table() - # - # Revision 1.6 1999/04/09 03:52:55 ivan - # explicit & for table/itable/ntable - # - # Revision 1.5 1999/01/19 05:13:26 ivan - # for mod_perl: no more top-level my() variables; use vars instead - # also the last s/create/new/; - # - # Revision 1.4 1999/01/18 09:41:16 ivan - # all $cgi->header calls now include ( '-expires' => 'now' ) for mod_perl - # (good idea anyway) - # - # Revision 1.3 1998/12/17 05:25:18 ivan - # fix visual and other bugs - # - # Revision 1.2 1998/11/18 09:01:34 ivan - # i18n! i18n! - # -- --use strict; - use vars qw( $cgi $p $cust_main_county ); - use CGI; - use CGI::Carp qw(fatalsToBrowser); -use CGI::Base; --use FS::UID qw(cgisuidsetup swapuid); --use FS::Record qw(qsearch qsearchs); - use FS::CGI qw(header menubar popurl table); - use FS::cust_main_county; -use FS::CGI qw(header menubar); -- - $cgi = new CGI; -my($cgi) = new CGI::Base; -$cgi->get; -- --&cgisuidsetup($cgi); - - $p = popurl(2); -- - print $cgi->header( '-expires' => 'now' ), header("Tax Rate Listing", menubar( - 'Main Menu' => $p, - 'Edit tax rates' => $p. "edit/cust_main_county.cgi", -SendHeaders(); # one guess. -print header("Tax Rate Listing", menubar( - 'Main Menu' => '../', - 'Edit tax rates' => "../edit/cust_main_county.cgi", --)),<expand country to specify a country's tax rates by state. -
Click on expand state to specify a state's tax rates by county. -

- END - print &table(), <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 ""; -- -- print <$hashref->{tax}% -- --END -- --} -- --print < -- -- -- --END -- diff --cc htdocs/browse/part_pkg.cgi index d4c359b28,e5ff31e9e..000000000 deleted file mode 100755,100755 --- a/htdocs/browse/part_pkg.cgi +++ /dev/null @@@ -1,110 -1,81 +1,0 @@@ --#!/usr/bin/perl -Tw --# - # $Id: part_pkg.cgi,v 1.8 1999-04-09 04:22:34 ivan Exp $ -# 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 - # - # $Log: part_pkg.cgi,v $ - # Revision 1.8 1999-04-09 04:22:34 ivan - # also table() - # - # Revision 1.7 1999/04/09 03:52:55 ivan - # explicit & for table/itable/ntable - # - # Revision 1.6 1999/01/19 05:13:27 ivan - # for mod_perl: no more top-level my() variables; use vars instead - # also the last s/create/new/; - # - # Revision 1.5 1999/01/18 09:41:17 ivan - # all $cgi->header calls now include ( '-expires' => 'now' ) for mod_perl - # (good idea anyway) - # - # Revision 1.4 1998/12/17 05:25:19 ivan - # fix visual and other bugs - # - # Revision 1.3 1998/11/21 07:23:45 ivan - # visual - # - # Revision 1.2 1998/11/21 07:00:32 ivan - # visual - # -- --use strict; - use vars qw( $cgi $p $part_pkg ); - use CGI; - use CGI::Carp qw(fatalsToBrowser); -use CGI::Base; --use FS::UID qw(cgisuidsetup swapuid); --use FS::Record qw(qsearch qsearchs); - use FS::CGI qw(header menubar popurl table); - use FS::part_pkg; - use FS::pkg_svc; - use FS::part_svc; -use FS::CGI qw(header menubar); -- - $cgi = new CGI; -my($cgi) = new CGI::Base; -$cgi->get; -- --&cgisuidsetup($cgi); -- - $p = popurl(2); -SendHeaders(); # one guess. -- - print $cgi->header( '-expires' => 'now' ), header("Package Part Listing",menubar( - 'Main Menu' => $p, - )), "One or more services are grouped together into a package and given", - " pricing information. Customers purchase packages, not services.

", - &table(), < '../', - 'Add new package' => "../edit/part_pkg.cgi", -)), <Click on package part number to edit. --
CountryStateCountyTax
$hashref->{country}$hashref->{state}", $hashref->{state} - ? $hashref->{state} - - print "", $hashref->{county} - ? $hashref->{county} -- : qq!(ALL) !. - qq!expand country! - qq!expand! -- , ""; - if ( $hashref->{county} ) { - print $hashref->{county}; - } else { - print "(ALL)"; - if ( $hashref->{state} ) { - print qq!!. - qq!expand state!; - } - } - print "
-- - - - -- -- -- -- -- -- -- --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); - my($n)=""; -- foreach $pkg_svc ( @pkg_svc ) { -- my($svcpart)=$pkg_svc->getfield('svcpart'); -- my($part_svc) = qsearchs('part_svc',{'svcpart'=> $svcpart }); - print $n,qq!\n"; - $n=""; - $pkg_svc->getfield('quantity'),"\n"; -- } -- -- print ""; --} -- --print < -
PackagePart #PackageCommentSetup FeeFreq.Recur. FeeServiceQuan.
- -- $hashref->{pkgpart} -- $hashref->{pkg}$hashref->{pkg}$hashref->{comment}$hashref->{setup}$hashref->{freq}$hashref->{recur}!, - print qq!!, -- $part_svc->getfield('svc'),"", - $pkg_svc->getfield('quantity'),"
Add new package
- - -- -- --END -- diff --cc htdocs/browse/part_referral.cgi index e4ca25a65,b16fa896d..000000000 deleted file mode 100755,100755 --- a/htdocs/browse/part_referral.cgi +++ /dev/null @@@ -1,88 -1,57 +1,0 @@@ --#!/usr/bin/perl -Tw --# - # $Id: part_referral.cgi,v 1.9 1999-04-09 04:22:34 ivan Exp $ -# 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 - # - # $Log: part_referral.cgi,v $ - # Revision 1.9 1999-04-09 04:22:34 ivan - # also table() - # - # Revision 1.8 1999/04/09 03:52:55 ivan - # explicit & for table/itable/ntable - # - # Revision 1.7 1999/01/19 05:13:28 ivan - # for mod_perl: no more top-level my() variables; use vars instead - # also the last s/create/new/; - # - # Revision 1.6 1999/01/18 09:41:18 ivan - # all $cgi->header calls now include ( '-expires' => 'now' ) for mod_perl - # (good idea anyway) - # - # Revision 1.5 1998/12/17 05:25:20 ivan - # fix visual and other bugs - # - # Revision 1.4 1998/12/17 04:32:55 ivan - # print $cgi->header - # - # Revision 1.3 1998/12/17 04:31:36 ivan - # use CGI::Carp - # - # Revision 1.2 1998/12/17 04:26:04 ivan - # use CGI; no relative URLs - # -- --use strict; - use vars qw( $cgi $p $part_referral ); - use CGI; - use CGI::Carp qw(fatalsToBrowser); -use CGI::Base; --use FS::UID qw(cgisuidsetup swapuid); --use FS::Record qw(qsearch); - use FS::CGI qw(header menubar popurl table); - use FS::part_referral; -use FS::CGI qw(header menubar); -- - $cgi = new CGI; -my($cgi) = new CGI::Base; -$cgi->get; -- --&cgisuidsetup($cgi); - - $p = popurl(2); -- - print $cgi->header( '-expires' => 'now' ), header("Referral Listing", menubar( - 'Main Menu' => $p, - # 'Add new referral' => "../edit/part_referral.cgi", - )), "Where a customer heard about your service. Tracked for informational purposes.

", &table(), < '../', - '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 < - - --
ReferralReferral #Referral
- -- $hashref->{refnum} - $hashref->{referral}$hashref->{referral}
Add new referral
-- -- -- --END -- diff --cc htdocs/browse/part_svc.cgi index 123cb7d2a,71a556421..000000000 deleted file mode 100755,100755 --- a/htdocs/browse/part_svc.cgi +++ /dev/null @@@ -1,118 -1,81 +1,0 @@@ --#!/usr/bin/perl -Tw --# - # $Id: part_svc.cgi,v 1.11 1999-04-09 04:22:34 ivan Exp $ -# 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 - # - # $Log: part_svc.cgi,v $ - # Revision 1.11 1999-04-09 04:22:34 ivan - # also table() - # - # Revision 1.10 1999/04/09 03:52:55 ivan - # explicit & for table/itable/ntable - # - # Revision 1.9 1999/01/19 05:13:29 ivan - # for mod_perl: no more top-level my() variables; use vars instead - # also the last s/create/new/; - # - # Revision 1.8 1999/01/18 09:41:19 ivan - # all $cgi->header calls now include ( '-expires' => 'now' ) for mod_perl - # (good idea anyway) - # - # Revision 1.7 1998/12/30 23:06:22 ivan - # typo - # - # Revision 1.6 1998/12/30 23:03:20 ivan - # bugfixes; fields isn't exported by derived classes - # - # Revision 1.5 1998/12/17 05:25:21 ivan - # fix visual and other bugs - # - # Revision 1.4 1998/11/21 02:26:22 ivan - # visual - # - # Revision 1.3 1998/11/20 23:10:57 ivan - # visual - # - # Revision 1.2 1998/11/20 08:50:37 ivan - # s/CGI::Base/CGI.pm, visual fixes - # -- --use strict; - use vars qw( $cgi $p $part_svc ); - use CGI; - use CGI::Carp qw(fatalsToBrowser); - use FS::UID qw(cgisuidsetup); - use FS::Record qw(qsearch fields); - use FS::part_svc; - use FS::CGI qw(header menubar popurl table); -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); -- - $cgi = new CGI; -my($cgi) = new CGI::Base; -$cgi->get; -- --&cgisuidsetup($cgi); - - $p = popurl(2); -- - print $cgi->header( '-expires' => 'now' ), header('Service Part Listing', menubar( - 'Main Menu' => $p, -SendHeaders(); # one guess. -print header('Service Part Listing', menubar( - 'Main Menu' => '../', - 'Add new service' => "../edit/part_svc.cgi", --)),<
- END - print &table(), <Click on service part number to edit. - -- - - - -- -- - - - -- --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) || 1; - my($rowspan)=scalar(@rows); -- print < - - - - -- --END - - my($n1)=''; -- my($row); -- foreach $row ( @rows ) { -- my($flag)=$part_svc->getfield($svcdb.'__'.$row.'_flag'); - print $n1,""; - $n1=""; - print ""; -- } --print ""; --} -- --print < - - --
ServicePart #ServiceTableFieldModifierActionValue
- $hashref->{svcpart} $hashref->{svc} - $hashref->{svcpart} - $hashref->{svc}$hashref->{svcdb}$row"; - print "$row"; -- if ( $flag eq "D" ) { print "Default"; } -- elsif ( $flag eq "F" ) { print "Fixed"; } -- else { print "(Unknown!)"; } - print "",$part_svc->getfield($svcdb."__".$row),"
",$part_svc->getfield($svcdb."__".$row),"
Add new service
- -- -- --END -- diff --cc htdocs/browse/svc_acct_pop.cgi index 8094a9fd1,a8a3a9224..000000000 deleted file mode 100755,100755 --- a/htdocs/browse/svc_acct_pop.cgi +++ /dev/null @@@ -1,97 -1,63 +1,0 @@@ --#!/usr/bin/perl -Tw --# - # $Id: svc_acct_pop.cgi,v 1.8 2000-01-28 22:56:13 ivan Exp $ -# 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 - # - # $Log: svc_acct_pop.cgi,v $ - # Revision 1.8 2000-01-28 22:56:13 ivan - # track full phone number - # - # Revision 1.7 1999/04/09 04:22:34 ivan - # also table() - # - # Revision 1.6 1999/04/09 03:52:55 ivan - # explicit & for table/itable/ntable - # - # Revision 1.5 1999/01/19 05:13:30 ivan - # for mod_perl: no more top-level my() variables; use vars instead - # also the last s/create/new/; - # - # Revision 1.4 1999/01/18 09:41:20 ivan - # all $cgi->header calls now include ( '-expires' => 'now' ) for mod_perl - # (good idea anyway) - # - # Revision 1.3 1998/12/17 05:25:22 ivan - # fix visual and other bugs - # - # Revision 1.2 1998/12/17 04:36:59 ivan - # use CGI;, use CGI::Carp, visual changes, relative URLs - # -- --use strict; - use vars qw( $cgi $p $svc_acct_pop ); - use CGI; - use CGI::Carp qw(fatalsToBrowser); -use CGI::Base; --use FS::UID qw(cgisuidsetup swapuid); --use FS::Record qw(qsearch qsearchs); - use FS::CGI qw(header menubar table popurl); - use FS::svc_acct_pop; -use FS::CGI qw(header menubar); -- - $cgi = new CGI; -my($cgi) = new CGI::Base; -$cgi->get; -- --&cgisuidsetup($cgi); - - $p = popurl(2); -- - print $cgi->header( '-expires' => 'now' ), header('POP Listing', menubar( - 'Main Menu' => $p, - )), "Points of Presence

", &table(), < '../', - 'Add new POP' => "../edit/svc_acct_pop.cgi", -)), <Click on pop number to edit. - -- - - -- -- -- -- - -- --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 < - - --
POP #CityStateArea codeExchangeLocal
- -- $hashref->{popnum} - $hashref->{city} - $hashref->{state} - $hashref->{ac} - $hashref->{exch} - $hashref->{loc}$hashref->{city}$hashref->{state}$hashref->{ac}$hashref->{exch}
Add new POP
-- -- -- --END -- diff --cc htdocs/docs/admin.html index 8adddbe92,8adddbe92..000000000 deleted file mode 100644,100644 --- a/htdocs/docs/admin.html +++ /dev/null @@@ -1,6 -1,6 +1,0 @@@ -- -- Administration -- -- --

Administration

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

Billing

- The freeside-bill script can be run daily to bill all customers. Usage: bill [ -c [ i ] ] [ -d date ] [ -b ] - 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 --cc htdocs/docs/config.html index cad10ce65,9b8002601..000000000 deleted file mode 100644,100644 --- a/htdocs/docs/config.html +++ /dev/null @@@ -1,62 -1,38 +1,0 @@@ -- -- Configuration files -- -- --

Configuration files

- Configuration file layout has changed in 1.2.x. -
    -
  • First, the file `/usr/local/etc/freeside/mapsecrets' is read. Each line - in this file contains a username and filename, separated by whitespace. Note - that these are not local usernames - they are passed from Apache (you _did_ - setup - user authetication, correct?). Filenames are located in - `/usr/local/etc/freeside/'. The specified filename is parsed exactly - the same as the pre-1.2.x `secrets' file: -
  • 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. See the DBI manpage and the manpage - for your DBD for the exact syntax. -
- All further configuration files and directories are located in - `/usr/local/etc/freeside/conf.datasource', for example, - `/usr/local/etc/freeside/conf.DBI:Pg:dbname=freeside' -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. -
  • deletecustomers - The existance of this file will enable customer deletions. Be very careful! Deleting a customer will remove all traces that this customer ever existed! It should probably only be used when auditing a legacy database. Normally, you cancel all of a customers' packages if they cancel service. --
  • domain - Your domain name. -
  • editreferrals - The existance of this file will allow you to change the referral of existing customers. --
  • erpcdmachines - Your ERPCD authenticaion machines, one per line. This enables export of `/usr/annex/acp_passwd' and `/usr/annex/acp_dialup'. -
  • hidecancelledpackages - The existance of this file will prevent cancelled packages from showing up in listings (though they will still be in the database) -
  • hidecancelledcustomers - The existance of this file will prevent customers with only cancelled packages from showing up in listings (though they will still be in the database) --
  • home - For new users, prefixed to usrename to create a directory name. Should have a leading but not a trailing slash. -
  • invoice_from - Return address on email invoices. --
  • 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'. -
  • passwordmin - Minimum password length (default 6); --
  • 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. -
  • showpasswords - The existance of this file will allow unencrypted user passwords to be displayed. --
  • smtpmachine - SMTP relay for Freeside's outgoing mail. -
  • usernamemin - Minimum username length (default 2); -
  • usernamemax - Maximum username length (default is the size of the SQL column, probably specified when fs-setup was run) --
-- -- diff --cc htdocs/docs/export.html index 86a2b4ccd,f760b97dd..000000000 deleted file mode 100644,100644 --- a/htdocs/docs/export.html +++ /dev/null @@@ -1,40 -1,39 +1,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 /usr/local/etc/freeside/export.datasrc directory. Using the appropriate configuration files, you can export these files to your remote machines unattended; see below. Some RADIUS servers (such as Radiator) will authenticate directly out of an SQL database. In these cases, - it is reccommended that you copy the svc_acct table to an external RADIUS machine rather than run the RADIUS server on your Freeside machine. -
  • 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.new 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. -
    • 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. -
    • 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 /usr/local/etc/freeside/export.datasrc directory. Using the appropriate configuration files, you can export these files to your remote machines unattemded; see below. -
  • 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 /usr/local/etc/freeside/export.datasrc/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. -
    • 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. -
  • 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. -
    • 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 --cc htdocs/docs/index.html index 21ec25755,20051ca4d..000000000 deleted file mode 100644,100644 --- a/htdocs/docs/index.html +++ /dev/null @@@ -1,27 -1,23 +1,0 @@@ -- -- Documentation -- -- --

Documentation

-- -- diff --cc htdocs/docs/install.html index 574ab91e4,c4784ebf6..000000000 deleted file mode 100644,100644 --- a/htdocs/docs/install.html +++ /dev/null @@@ -1,74 -1,56 +1,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) -
  • 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 -
    -
  • Build and install the Perl libraries: -
    - $ cd FS/
    - $ perl Makefile.PL
    - $ make
    - $ su
    - # make install
    -
  • 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. The web interface needs to run as the freeside user - there are several ways to do this. -
      -
    • Use Perl's setuid emulation: see the Security Bugs section of the perlsec manpage. -
    • 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
      -
    • Use Apache's suEXEC. -
      cd /usr/local/apache/htdocs/freeside
      - chown -R freeside .
      - chmod 755 browse/*.cgi edit/*.cgi edit/process/*.cgi misc/*.cgi misc/process/*.cgi search/*.cgi view/*.cgi
      -
    • Use mod_perl. You should run a separate iteration of Apache[-SSL] as the freeside user. (Warning: The redirect method of CGI.pm 2.36 [as distributed with Perl 5.004_04] is broken under mod_perl. Downlaod the current version from CPAN. Apache 1.3.6 is also highly recommended because of signal handling problems in earlier versions.) -
      cd /usr/local/apache/htdocs/freeside
      - chown -R root .
      - chmod 755 browse/*.cgi edit/*.cgi edit/process/*.cgi misc/*.cgi misc/process/*.cgi search/*.cgi view/*.cgi
      -
    -
  • Create the necessary configuration files. -
  • Create the `/usr/local/etc/freeside/counters.datasrc', and - `/usr/local/etc/freeside/export.datasrc' directories for each datasrc (owned by the freeside user). -
  • As the freeside user, run bin/fs-setup to create the database tables. -
  • 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 --cc htdocs/docs/legacy.html index 3ab21dab2,40e09cb3c..000000000 deleted file mode 100644,100644 --- a/htdocs/docs/legacy.html +++ /dev/null @@@ -1,34 -1,34 +1,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: -
  • 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: -
  • 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 --cc htdocs/docs/passwd.html index a8f8151e2,a8f8151e2..000000000 deleted file mode 100644,100644 --- a/htdocs/docs/passwd.html +++ /dev/null @@@ -1,16 -1,16 +1,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 --cc htdocs/docs/schema.html index 3eea6f69d,5a296ec83..000000000 deleted file mode 100644,100644 --- a/htdocs/docs/schema.html +++ /dev/null @@@ -1,227 -1,205 +1,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 -
    • titlenum - title --
    • first - name -
    • middle - name --
    • last - name --
    • ss - social security number --
    • company --
    • address1 --
    • address2 --
    • city --
    • county --
    • state --
    • zip --
    • country --
    • daytime - phone --
    • night - phone -
    • fax - 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_invoice - Invoice destinations for email invoices -
      -
    • destnum - primary key -
    • custnum - customer -
    • dest - Invoice destination: If numeric, a svcnum, if string, a literal email address, or `POST' to enable mailing (the default if no cust_main_invoice records exist) --
    --
  • cust_main_county - Tax rates --
      --
    • taxnum - primary key --
    • state --
    • county -
    • country --
    • 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 -
    • 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 -
    -
  • part_title - Personal titles -
      -
    • titlenum - primary key -
    • title - personal title (`Dr.' or `Mr.') --
    --
  • pkg_svc -- -
  • prepay_credit -
      -
    • prepaynum - primary key -
    • identifier - text or numeric string used to receive this credit -
    • amount - amount of credit --
    --
  • 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 -
    • loc - rest of number --
    --
  • svc_acct_sm - Domain mail aliases -- --
  • svc_domain - Domains -- --
  • type_pkgs -- --
-- diff --cc htdocs/docs/trouble.html index fce743928,2cf6d4e71..000000000 deleted file mode 100644,100644 --- a/htdocs/docs/trouble.html +++ /dev/null @@@ -1,26 -1,41 +1,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 as the freeside freeside user. See - the New Installation section of the documentation. -
  • If you receive `can not connect to server' errors using MySQL on a system that doesn't support native threading, you may need to specify the full hostname in your DBI datasource. See the MySQL documentation, DBI manpage and the DBD::mysql manpage for details. - 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 --cc htdocs/docs/upgrade.html index d2201f601,d2201f601..000000000 deleted file mode 100644,100644 --- a/htdocs/docs/upgrade.html +++ /dev/null @@@ -1,24 -1,24 +1,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 --cc htdocs/docs/upgrade2.html index 7acae48f7,4bf7ea45a..000000000 deleted file mode 100644,100644 --- a/htdocs/docs/upgrade2.html +++ /dev/null @@@ -1,11 -1,11 +1,0 @@@ -- - Upgrading to 1.1.4 - Upgrading to 1.1.3 -- -- -

    Upgrading to 1.1.4 from 1.1.x

    -

    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 --cc htdocs/edit/agent.cgi index 5b42095b3,5bd116528..000000000 deleted file mode 100755,100755 --- a/htdocs/edit/agent.cgi +++ /dev/null @@@ -1,108 -1,77 +1,0 @@@ --#!/usr/bin/perl -Tw --# - # $Id: agent.cgi,v 1.7 1999-04-07 11:27:50 ivan Exp $ -# 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 - # - # $Log: agent.cgi,v $ - # Revision 1.7 1999-04-07 11:27:50 ivan - # avoid perl's silly arguement not numeric error - # - # Revision 1.6 1999/01/25 12:09:50 ivan - # yet more mod_perl stuff - # - # Revision 1.5 1999/01/19 05:13:31 ivan - # for mod_perl: no more top-level my() variables; use vars instead - # also the last s/create/new/; - # - # Revision 1.4 1999/01/18 09:41:21 ivan - # all $cgi->header calls now include ( '-expires' => 'now' ) for mod_perl - # (good idea anyway) - # - # Revision 1.3 1998/12/17 06:16:57 ivan - # fix double // in relative URLs, s/CGI::Base/CGI/; - # - # Revision 1.2 1998/11/23 07:52:08 ivan - # *** empty log message *** - # -- --use strict; - use vars qw ( $cgi $agent $action $hashref $p $agent_type ); - use CGI; -use CGI::Base; --use CGI::Carp qw(fatalsToBrowser); --use FS::UID qw(cgisuidsetup); - use FS::CGI qw(header menubar popurl); - use FS::Record qw(qsearch qsearchs fields); -use FS::Record qw(qsearch qsearchs); --use FS::agent; - use FS::agent_type; -use FS::CGI qw(header menubar); -- - $cgi = new CGI; -my($cgi) = new CGI::Base; -$cgi->get; -- --&cgisuidsetup($cgi); -- - if ( $cgi->param('error') ) { - $agent = new FS::agent ( { - map { $_, scalar($cgi->param($_)) } fields('agent') - } ); - } elsif ( $cgi->keywords ) { - my($query) = $cgi->keywords; - $query =~ /^(\d+)$/; - $agent = qsearchs( 'agent', { 'agentnum' => $1 } ); -SendHeaders(); # one guess. - -my($agent,$action); -if ( $cgi->var('QUERY_STRING') =~ /^(\d+)$/ ) { #editing - $agent=qsearchs('agent',{'agentnum'=>$1}); - $action='Edit'; --} else { #adding - $agent = new FS::agent {}; - $agent=create FS::agent {}; - $action='Add'; --} - $action = $agent->agentnum ? 'Edit' : 'Add'; - $hashref = $agent->hashref; - - $p = popurl(2); - - print $cgi->header( '-expires' => 'now' ), header("$action Agent", menubar( - 'Main Menu' => $p, - 'View all agents' => $p. 'browse/agent.cgi', - )); -my($hashref)=$agent->hashref; -- - print qq!Error: !, $cgi->param('error'), - "" - if $cgi->param('error'); -print header("$action Agent", menubar( - 'Main Menu' => '../', - 'View all agents' => '../browse/agent.cgi', -)), '
      '; -- - print '', - qq!!, -print qq!!, -- "Agent #", $hashref->{agentnum} ? $hashref->{agentnum} : "(NEW)"; -- --print < --Agent --Agent type --Program (unimplemented) -- --END -- --print qq!
      !; -- --print < -- -- --END -- diff --cc htdocs/edit/agent_type.cgi index bdf64c58f,b9fff4530..000000000 deleted file mode 100755,100755 --- a/htdocs/edit/agent_type.cgi +++ /dev/null @@@ -1,124 -1,75 +1,0 @@@ --#!/usr/bin/perl -Tw - # - # $Id: agent_type.cgi,v 1.11 1999-04-07 11:19:21 ivan Exp $ --# --# 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 - # - # $Log: agent_type.cgi,v $ - # Revision 1.11 1999-04-07 11:19:21 ivan - # silly HTML typo - # - # Revision 1.10 1999/01/25 12:09:51 ivan - # yet more mod_perl stuff - # - # Revision 1.9 1999/01/19 05:13:32 ivan - # for mod_perl: no more top-level my() variables; use vars instead - # also the last s/create/new/; - # - # Revision 1.8 1999/01/18 09:41:22 ivan - # all $cgi->header calls now include ( '-expires' => 'now' ) for mod_perl - # (good idea anyway) - # - # Revision 1.7 1999/01/18 09:22:29 ivan - # changes to track email addresses for email invoicing - # - # Revision 1.6 1998/12/17 06:16:58 ivan - # fix double // in relative URLs, s/CGI::Base/CGI/; - # - # Revision 1.5 1998/11/21 07:58:27 ivan - # package names link to them - # - # Revision 1.4 1998/11/21 07:45:19 ivan - # visual, use FS::table_name when doing qsearch('table_name') - # - # Revision 1.3 1998/11/15 11:20:12 ivan - # s/CGI-Base/CGI.pm/ causes s/QUERY_STRING/keywords/; - # - # Revision 1.2 1998/11/13 09:56:46 ivan - # change configuration file layout to support multiple distinct databases (with - # own set of config files, export, etc.) - # -- --use strict; - use vars qw( $cgi $agent_type $action $hashref $p $part_pkg ); - use CGI; -use CGI::Base; --use CGI::Carp qw(fatalsToBrowser); --use FS::UID qw(cgisuidsetup); - use FS::Record qw(qsearch qsearchs fields); - use FS::agent_type; - use FS::CGI qw(header menubar popurl); -use FS::Record qw(qsearch qsearchs); --use FS::agent_type; - use FS::part_pkg; - use FS::type_pkgs; -use FS::CGI qw(header menubar); -- - $cgi = new CGI; -my($cgi) = new CGI::Base; -$cgi->get; -- --&cgisuidsetup($cgi); -- - if ( $cgi->param('error') ) { - $agent_type = new FS::agent_type ( { - map { $_, scalar($cgi->param($_)) } fields('agent') - } ); - } elsif ( $cgi->keywords ) { #editing - my( $query ) = $cgi->keywords; - $query =~ /^(\d+)$/; -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 = new FS::agent_type {}; - $agent_type=create FS::agent_type {}; - $action='Add'; --} - $action = $agent_type->typenum ? 'Edit' : 'Add'; - $hashref = $agent_type->hashref; - - $p = popurl(2); - print $cgi->header( '-expires' => 'now' ), header("$action Agent Type", menubar( - 'Main Menu' => "$p", - 'View all agent types' => "${p}browse/agent_type.cgi", - )); -my($hashref)=$agent_type->hashref; -- - print qq!Error: !, $cgi->param('error'), - "" - if $cgi->param('error'); -print header("$action Agent Type", menubar( - 'Main Menu' => '../', - 'View all agent types' => '../browse/agent_type.cgi', -)), ''; -- - print '', - qq!!, -print qq!!, -- "Agent Type #", $hashref->{typenum} ? $hashref->{typenum} : "(NEW)"; -- --print <
      Agent Type -

      Select which packages agents of this type may sell to customers
      -
      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"> !, - qq!', $part_pkg->getfield('pkg'), '', - qq!"VALUE="ON"> !,$part_pkg->getfield('pkg') -- ; --} -- --print qq!
      !; -- --print < -- -- --END -- diff --cc htdocs/edit/cust_credit.cgi index 35c4d48fe,75ef21208..000000000 deleted file mode 100755,100755 --- a/htdocs/edit/cust_credit.cgi +++ /dev/null @@@ -1,121 -1,97 +1,0 @@@ --#!/usr/bin/perl -Tw --# - # $Id: cust_credit.cgi,v 1.7 1999-02-28 00:03:33 ivan Exp $ -# 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 - # - # $Log: cust_credit.cgi,v $ - # Revision 1.7 1999-02-28 00:03:33 ivan - # removed misleading comments - # - # Revision 1.6 1999/01/25 12:09:52 ivan - # yet more mod_perl stuff - # - # Revision 1.5 1999/01/19 05:13:33 ivan - # for mod_perl: no more top-level my() variables; use vars instead - # also the last s/create/new/; - # - # Revision 1.4 1999/01/18 09:41:23 ivan - # all $cgi->header calls now include ( '-expires' => 'now' ) for mod_perl - # (good idea anyway) - # - # Revision 1.3 1998/12/23 02:26:06 ivan - # *** empty log message *** - # - # Revision 1.2 1998/12/17 06:16:59 ivan - # fix double // in relative URLs, s/CGI::Base/CGI/; - # -- --use strict; - use vars qw( $cgi $query $custnum $otaker $p1 $crednum $_date $amount $reason ); --use Date::Format; - use CGI; - use CGI::Carp qw(fatalsToBrowser); -use CGI::Base qw(:DEFAULT :CGI); #CGI module --use FS::UID qw(cgisuidsetup getotaker); - use FS::CGI qw(header popurl); - use FS::Record qw(fields); - #use FS::cust_credit; -- - $cgi = new CGI; -my($cgi) = new CGI::Base; -$cgi->get; --cgisuidsetup($cgi); - - if ( $cgi->param('error') ) { - #$cust_credit = new FS::cust_credit ( { - # map { $_, scalar($cgi->param($_)) } fields('cust_credit') - #} ); - $custnum = $cgi->param('custnum'); - $amount = $cgi->param('amount'); - #$refund = $cgi->param('refund'); - $reason = $cgi->param('reason'); - } else { - ($query) = $cgi->keywords; - $query =~ /^(\d+)$/; - $custnum = $1; - $amount = ''; - #$refund = 'yes'; - $reason = ''; - } - $_date = time; -- - $otaker = getotaker; -#untaint custnum -$QUERY_STRING =~ /^(\d+)$/; -my($custnum)=$1; -- - $p1 = popurl(1); -#untaint otaker -my($otaker)=getotaker; -- - print $cgi->header( '-expires' => 'now' ), header("Post Credit", ''); - print qq!Error: !, $cgi->param('error'), - "" - if $cgi->param('error'); -SendHeaders(); # one guess. --print < -
       -
       -  
       -    Post Credit
       -  
       -  
       -    
      -

      Post Credit

      -
      - -
      --END
      --
      - $crednum = "";
       -#crednum
       -my($crednum)="";
      --print qq!Credit #!, $crednum ? $crednum : " (NEW)", qq!!;
      --
       -#custnum
      --print qq!\nCustomer #$custnum!;
      --
       -#paybatch
      --print qq!!;
      --
      - print qq!\nDate: !, time2str("%D",$_date), qq!!;
       -#date
       -my($date)=time;
       -print qq!\nDate: !, time2str("%D",$date), qq!!;
      --
       -#amount
       -my($amount)='';
      --print qq!\nAmount \$!;
      - print qq!!;
      --
      - #print qq! Also post refund!;
       -#refund?
       -#print qq! Also post refund!;
      --
       -#otaker (hidden)
      --print qq!!;
      --
       -#reason
       -my($reason)='';
      --print qq!\nReason !;
      --
      --print <
      --
      --
      --END -- --print < -- -- --END -- diff --cc htdocs/edit/cust_main.cgi index 4eef9c74d,14556010c..000000000 deleted file mode 100755,100755 --- a/htdocs/edit/cust_main.cgi +++ /dev/null @@@ -1,435 -1,214 +1,0 @@@ --#!/usr/bin/perl -Tw --# - # $Id: cust_main.cgi,v 1.24 2000-01-30 06:54:50 ivan Exp $ -# 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 - # - # $Log: cust_main.cgi,v $ - # Revision 1.24 2000-01-30 06:54:50 ivan - # credit card expiration dates not sticky bug fixed? - # - # Revision 1.23 2000/01/27 00:53:14 ivan - # 5.004_04 workaround - # - # Revision 1.22 1999/12/17 02:33:23 ivan - # argh - # - # Revision 1.21 1999/08/23 07:40:38 ivan - # missing flag - # - # Revision 1.20 1999/08/23 07:08:11 ivan - # no CGI::Switch for now - # - # Revision 1.19 1999/08/21 02:14:25 ivan - # better error message for no agents - # - # Revision 1.18 1999/08/11 15:38:33 ivan - # fix for perl 5.004_04 - # - # Revision 1.17 1999/08/10 11:15:45 ivan - # corrected a misleading comment - # - # Revision 1.15 1999/04/14 13:14:54 ivan - # configuration option to edit referrals of existing customers - # - # Revision 1.14 1999/04/14 07:47:53 ivan - # i18n fixes - # - # Revision 1.13 1999/04/09 03:52:55 ivan - # explicit & for table/itable/ntable - # - # Revision 1.12 1999/04/06 11:16:16 ivan - # give a meaningful error message if you try to create a customer before you've - # created an agent - # - # Revision 1.11 1999/03/25 13:55:10 ivan - # one-screen new customer entry (including package and service) for simple - # packages with one svc_acct service - # - # Revision 1.10 1999/02/28 00:03:34 ivan - # removed misleading comments - # - # Revision 1.9 1999/02/23 08:09:20 ivan - # beginnings of one-screen new customer entry and some other miscellania - # - # Revision 1.8 1999/01/25 12:09:53 ivan - # yet more mod_perl stuff - # - # Revision 1.7 1999/01/19 05:13:34 ivan - # for mod_perl: no more top-level my() variables; use vars instead - # also the last s/create/new/; - # - # Revision 1.6 1999/01/18 09:41:24 ivan - # all $cgi->header calls now include ( '-expires' => 'now' ) for mod_perl - # (good idea anyway) - # - # Revision 1.5 1999/01/18 09:22:30 ivan - # changes to track email addresses for email invoicing - # - # Revision 1.4 1998/12/23 08:08:15 ivan - # fix typo - # - # Revision 1.3 1998/12/17 06:17:00 ivan - # fix double // in relative URLs, s/CGI::Base/CGI/; - # -- --use strict; - use vars qw( $cgi $custnum $action $cust_main $p1 @agents $agentnum - $last $first $ss $company $address1 $address2 $city $zip - $daytime $night $fax @invoicing_list $invoicing_list $payinfo - $payname %payby %paybychecked $refnum $otaker $r ); - use vars qw ( $conf $pkgpart $username $password $popnum $ulen $ulen2 ); - #use CGI::Switch; - use CGI; -use CGI::Base; --use CGI::Carp qw(fatalsToBrowser); --use FS::UID qw(cgisuidsetup getotaker); - #use FS::Record qw(qsearch qsearchs fields); - use FS::Record qw(qsearch qsearchs fields dbdef); - use FS::CGI qw(header popurl itable table); -use FS::Record qw(qsearch qsearchs); --use FS::cust_main; - use FS::agent; - use FS::part_referral; - use FS::cust_main_county; - - #for misplaced logic below - use FS::part_pkg; - - #for false laziness below - use FS::svc_acct_pop; -- - #for (other) false laziness below - use FS::agent; - use FS::type_pkgs; -my($cgi) = new CGI::Base; -$cgi->get; -- - $cgi = new CGI; --cgisuidsetup($cgi); -- - $conf = new FS::Conf; -SendHeaders(); # one guess. -- --#get record - - if ( $cgi->param('error') ) { - $cust_main = new FS::cust_main ( { - map { $_, scalar($cgi->param($_)) } fields('cust_main') - } ); - $custnum = $cust_main->custnum; - $pkgpart = $cgi->param('pkgpart_svcpart') || ''; - if ( $pkgpart =~ /^(\d+)_/ ) { - $pkgpart = $1; - } else { - $pkgpart = ''; - } - $username = $cgi->param('username'); - $password = $cgi->param('_password'); - $popnum = $cgi->param('popnum'); - } elsif ( $cgi->keywords ) { #editing - my( $query ) = $cgi->keywords; - $query =~ /^(\d+)$/; -my($custnum,$action,$cust_main); -if ( $cgi->var('QUERY_STRING') =~ /^(\d+)$/ ) { #editing -- $custnum=$1; - $cust_main = qsearchs('cust_main', { 'custnum' => $custnum } ); - $pkgpart = 0; - $username = ''; - $password = ''; - $popnum = 0; - $cust_main = qsearchs('cust_main',{'custnum'=>$custnum}); - $action='Edit'; --} else { -- $custnum=''; - $cust_main = new FS::cust_main ( {} ); - $cust_main = create FS::cust_main ( {} ); -- $cust_main->setfield('otaker',&getotaker); - $pkgpart = 0; - $username = ''; - $password = ''; - $popnum = 0; - $cust_main->setfield('country','US'); - $action='Add'; --} - $action = $custnum ? 'Edit' : 'Add'; - - # top - - $p1 = popurl(1); - print $cgi->header( '-expires' => 'now' ), header("Customer $action", ''); - print qq!Error: !, $cgi->param('error'), - "" - if $cgi->param('error'); - print qq!!, - qq!!, - qq!Customer # !, ( $custnum ? $custnum : " (NEW)" ), - - ; -- - # agent -print < - - Customer $action - - -
      -

      Customer $action

      -
      - -
       -END
      --
      - $r = qq!*!;
       -print qq!!,
       -      qq!Customer #!;
       -print $custnum ? $custnum : " (NEW)" , "";
      --
      - @agents = qsearch( 'agent', {} );
      - #die "No agents created!" unless @agents;
      - die "You have not created any agents.  You must create at least one agent before adding a customer.  Go to ". popurl(2). "browse/agent.cgi and create one or more agents." unless @agents;
      - $agentnum = $cust_main->agentnum || $agents[0]->agentnum; #default to first
      - if ( scalar(@agents) == 1 ) {
      -   print qq!!;
      - } else {
      -   print qq!

      ${r}Agent "; -#agentnum -my($agentnum)=$cust_main->agentnum || 1; #set to first agent by default -my(@agents) = qsearch('agent',{}); -print qq!\n\nAgent # "; -- --#referral - - $refnum = $cust_main->refnum || 0; - if ( $custnum && ! $conf->exists('editreferrals') ) { - print qq!!; - } else { -#unless ($custnum) { - my($refnum)=$cust_main->refnum || 0; #to avoid "arguement not numeric" error -- my(@referrals) = qsearch('part_referral',{}); - if ( scalar(@referrals) == 1 ) { - $refnum ||= $referrals[0]->refnum; - print qq!!; - } else { - print qq!

      ${r}Referral "; - print qq!\nReferral "; -#} -- - ($last,$first,$ss,$company,$address1,$address2,$city,$zip)=( -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, - $cust_main->zip, --); -- - print "

      Contact information", &itable("#c0c0c0"), <${r}Contact name
      (last, first), SS# - Company - ${r}Address -   - ${r}City${r}State/Country SS# -Company -Address - -City State (county) ${r}Zip!; -print ""; -- - ($daytime,$night,$fax)=( -my($zip,$country,$daytime,$night,$fax)=( - $cust_main->zip, - $cust_main->country, -- $cust_main->daytime, -- $cust_main->night, -- $cust_main->fax, --); -- --print <Day Phone - Night Phone - Fax - END - - print "$r required fields
      "; - - # billing info - Zip -Country: $country -- - sub expselect { - my $prefix = shift; - my( $m, $y ) = (0, 0); - if ( scalar(@_) ) { - my $date = shift; - if ( $date =~ /^(\d{4})-(\d{1,2})-\d{1,2}$/ ) { #PostgreSQL date format - ( $m, $y ) = ( $2, $1 ); - } elsif ( $date =~ /^(\d{1,2})-(\d{1,2}-)?(\d{4}$)/ ) { - ( $m, $y ) = ( $1, $3 ); - } else { - die "unrecognized expiration date format: $date"; - } - } -Phone (daytime) (night) (fax) -- - my $return = qq!!; - for ( 1999 .. 2037 ) { - $return .= " "Credit card ", - 'BILL' => "Billing ", - 'COMP' => "Complimentary", -); -for (qw(CARD BILL COMP)) { - print qq!payby eq "$_"); - print qq!>$payby{$_}!; --} - - print "
      Billing information", &itable("#c0c0c0"), - qq!tax eq "Y"; - print qq!>Tax Exempt!; - print qq!invoicing_list; - print qq! CHECKED! - if ! @invoicing_list || grep { $_ eq 'POST' } @invoicing_list; - print qq!>Postal mail invoice!; - $invoicing_list = join(', ', grep { $_ ne 'POST' } @invoicing_list ); - print qq!Email invoice !; -- - print "Billing type", - "", - &table("#c0c0c0"), ""; -- - ($payinfo, $payname)=( -my($payinfo,$payname,$otaker)=( -- $cust_main->payinfo, -- $cust_main->payname, - $cust_main->otaker, --); -- - %payby = ( - 'CARD' => qq!Credit card
      ${r}
      ${r}Exp !. expselect("CARD"). qq!
      ${r}Name on card
      !, - 'BILL' => qq!Billing
      P.O.
      ${r}Exp !. expselect("BILL", "12-2037"). qq!
      ${r}Attention
      !, - 'COMP' => qq!Complimentary
      ${r}Approved by
      ${r}Exp !. expselect("COMP"), - ); - %paybychecked = ( - 'CARD' => qq!Credit card
      ${r}
      ${r}Exp !. expselect("CARD", $cust_main->paydate). qq!
      ${r}Name on card
      !, - 'BILL' => qq!Billing
      P.O.
      ${r}Exp !. expselect("BILL", $cust_main->paydate). qq!
      ${r}Attention
      !, - 'COMP' => qq!Complimentary
      ${r}Approved by
      ${r}Exp !. expselect("COMP", $cust_main->paydate), - ); - for (qw(CARD BILL COMP)) { - print qq!payby eq "$_") { - print qq! CHECKED> $paybychecked{$_}!; - } else { - print qq!> $payby{$_}!; - } -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 "$r required fields for each billing type"; -print < -END -- - #false laziness, copied from FS::cust_pkg::order - my $pkgpart; - if ( scalar(@agents) == 1 ) { - # $pkgpart->{PKGPART} is true iff $custnum may purchase $pkgpart - my($agent)=qsearchs('agent',{'agentnum'=> $agentnum }); - $pkgpart = $agent->pkgpart_hashref; - } else { - #can't know (agent not chosen), so, allow all - my %typenum; - foreach my $agent ( @agents ) { - next if $typenum{$agent->typenum}++; - #fixed in 5.004_05 #$pkgpart->{$_}++ foreach keys %{ $agent->pkgpart_hashref } - foreach ( keys %{ $agent->pkgpart_hashref } ) { $pkgpart->{$_}++; } #5.004_04 workaround - } - } - #eslaf -print qq!Exp. date (MM/YY or MM/YYYY) Billing name \ntax eq "Y"; -print qq!> Tax Exempt!; -- - my @part_pkg = grep { $_->svcpart('svc_acct') && $pkgpart->{ $_->pkgpart } } - qsearch( 'part_pkg', {} ); -print <
      First package", &itable("#c0c0c0"), - qq! -
      -END -- - print qq!
      - - END -- - unless ( $cgi->param('clone') ) { - print <
      -- -- --END - } -- - $count = 0; - foreach $part_svc ( ( qsearch( 'part_svc', {} ) ) ) { - my $svcpart = $part_svc->svcpart; - my $pkg_svc = qsearchs( 'pkg_svc', { - 'pkgpart' => $cgi->param('clone') || $part_pkg->pkgpart, -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, - } ) || new FS::pkg_svc ( { - 'pkgpart' => $cgi->param('clone') || $part_pkg->pkgpart, - }) || create FS::pkg_svc({ - 'pkgpart' => $part_pkg->getfield('pkgpart'), -- 'svcpart' => $svcpart, -- 'quantity' => 0, -- }); - #? #next unless $pkg_svc; - next unless $pkg_svc; -- - unless ( defined ($cgi->param('clone')) && $cgi->param('clone') ) { - print '' if $count == 0 ; - print qq!"; - $count++; - if ($count == 2) - { - print ''; - $count = 0; - } - } else { - print qq!quantity || 0, qq!">\n!; - print qq!! if $count == 0 ; - print qq!!, - qq!"; - $count ++ ; - if ($count == 2) - { - print qq!! ; - $count = 0 ; -- } --} -print qq!! if ($count != 0) ; -- - unless ( $cgi->param('clone') ) { - print qq!! if ($count != 0) ; - print "
      Quan.ServiceQuan.Service
      quantity || 0, - qq!">!, $part_svc->getfield('svc'), "
      !, $part_svc->getfield('svc'), "
      "; - } -print ""; -- --print qq!
      !; -- --print < -- -- --END -- diff --cc htdocs/edit/part_referral.cgi index 24ac9dd82,f29802239..000000000 deleted file mode 100755,100755 --- a/htdocs/edit/part_referral.cgi +++ /dev/null @@@ -1,90 -1,66 +1,0 @@@ --#!/usr/bin/perl -Tw --# - # $Id: part_referral.cgi,v 1.6 1999-04-07 11:43:23 ivan Exp $ -# 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 - # - # $Log: part_referral.cgi,v $ - # Revision 1.6 1999-04-07 11:43:23 ivan - # pick up errors right away, leave input - # - # Revision 1.5 1999/02/07 09:59:20 ivan - # more mod_perl fixes, and bugfixes Peter Wemm sent via email - # - # Revision 1.4 1999/01/19 05:13:41 ivan - # for mod_perl: no more top-level my() variables; use vars instead - # also the last s/create/new/; - # - # Revision 1.3 1999/01/18 09:41:30 ivan - # all $cgi->header calls now include ( '-expires' => 'now' ) for mod_perl - # (good idea anyway) - # - # Revision 1.2 1998/12/17 06:17:06 ivan - # fix double // in relative URLs, s/CGI::Base/CGI/; - # -- --use strict; - use vars qw( $cgi $part_referral $action $hashref $p1 $query ); - use CGI; -use CGI::Base; --use CGI::Carp qw(fatalsToBrowser); --use FS::UID qw(cgisuidsetup); - use FS::Record qw(qsearch qsearchs fields); -use FS::Record qw(qsearch qsearchs); --use FS::part_referral; - use FS::CGI qw(header menubar popurl); -use FS::CGI qw(header menubar); -- - $cgi = new CGI; -my($cgi) = new CGI::Base; -$cgi->get; -- --&cgisuidsetup($cgi); -- - if ( $cgi->param('error') ) { - $part_referral = new FS::part_referral ( { - map { $_, scalar($cgi->param($_)) } fields('part_referral') - } ); - } elsif ( $cgi->keywords ) { - my($query) = $cgi->keywords; - $query =~ /^(\d+)$/; - $part_referral = qsearchs( 'part_referral', { 'refnum' => $1 } ); -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 = new FS::part_referral {}; - $part_referral=create FS::part_referral {}; - $action='Add'; --} - $action = $part_referral->refnum ? 'Edit' : 'Add'; - $hashref = $part_referral->hashref; - - $p1 = popurl(1); - print $cgi->header( '-expires' => 'now' ), header("$action Referral", menubar( - 'Main Menu' => popurl(2), - 'View all referrals' => popurl(2). "browse/part_referral.cgi", - )); -my($hashref)=$part_referral->hashref; -- - print qq!Error: !, $cgi->param('error'), - "" - if $cgi->param('error'); -print header("$action Referral", menubar( - 'Main Menu' => '../', - 'View all referrals' => "../browse/part_referral.cgi", -)), < -END -- - print qq!!; -#display -- --print qq!!, -- "Referral #", $hashref->{refnum} ? $hashref->{refnum} : "(NEW)"; -- --print < --Referral --
      --END -- --print qq!
      !; -- --print < -- -- --END -- diff --cc htdocs/edit/part_svc.cgi index e1f1e2ad5,491c013fe..000000000 deleted file mode 100755,100755 --- a/htdocs/edit/part_svc.cgi +++ /dev/null @@@ -1,196 -1,148 +1,0 @@@ --#!/usr/bin/perl -Tw --# - # $Id: part_svc.cgi,v 1.12 1999-04-09 04:22:34 ivan Exp $ -# 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 - # - # $Log: part_svc.cgi,v $ - # Revision 1.12 1999-04-09 04:22:34 ivan - # also table() - # - # Revision 1.11 1999/04/09 03:52:55 ivan - # explicit & for table/itable/ntable - # - # Revision 1.10 1999/04/08 13:01:50 ivan - # [ AND DOCUMENT! ] all svc_acct services should have a default - # or fixed shell - # - # Revision 1.9 1999/02/23 08:09:21 ivan - # beginnings of one-screen new customer entry and some other miscellania - # - # Revision 1.8 1999/02/07 09:59:21 ivan - # more mod_perl fixes, and bugfixes Peter Wemm sent via email - # - # Revision 1.7 1999/01/19 05:13:42 ivan - # for mod_perl: no more top-level my() variables; use vars instead - # also the last s/create/new/; - # - # Revision 1.6 1999/01/18 09:41:31 ivan - # all $cgi->header calls now include ( '-expires' => 'now' ) for mod_perl - # (good idea anyway) - # - # Revision 1.5 1998/12/30 23:03:21 ivan - # bugfixes; fields isn't exported by derived classes - # - # Revision 1.4 1998/12/17 06:17:07 ivan - # fix double // in relative URLs, s/CGI::Base/CGI/; - # - # Revision 1.3 1998/11/21 06:43:26 ivan - # visual - # -- --use strict; - use vars qw( $cgi $part_svc $action $query $hashref $p %defs $svcdb ); - use CGI; -use CGI::Base; --use CGI::Carp qw(fatalsToBrowser); --use FS::UID qw(cgisuidsetup); - use FS::Record qw(qsearchs fields); - use FS::part_svc; - use FS::CGI qw(header menubar popurl table); -use FS::Record qw(qsearchs); -use FS::part_svc qw(fields); -use FS::CGI qw(header menubar); -- - $cgi = new CGI; -my($cgi) = new CGI::Base; -$cgi->get; -- --&cgisuidsetup($cgi); -- - if ( $cgi->param('error') ) { - $part_svc = new FS::part_svc ( { - map { $_, scalar($cgi->param($_)) } fields('part_svc') - } ); - } elsif ( $cgi->keywords ) { - my ($query) = $cgi->keywords; - $query =~ /^(\d+)$/; -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 = new FS::part_svc {}; - $part_svc=create FS::part_svc {}; - $action='Add'; --} - $action = $part_svc->svcpart ? 'Edit' : 'Add'; - $hashref = $part_svc->hashref; -my($hashref)=$part_svc->hashref; -- - $p = popurl(2); - print $cgi->header( '-expires' => 'now' ), header("$action Service Definition", menubar( - 'Main Menu' => $p, - 'View all services' => "${p}browse/part_svc.cgi", - )); -print header("$action Service Definition", menubar( - 'Main Menu' => '../', - 'View all services' => '../browse/part_svc.cgi', -)), ''; -- - print qq!Error: !, $cgi->param('error'), - "" - if $cgi->param('error'); -- - print ''; -- --print qq!!, -- "Service Part #", $hashref->{svcpart} ? $hashref->{svcpart} : "(NEW)"; -- --print < --Service - -Table ', - map '{svcdb}). ">$_\n", qw( - svc_acct svc_domain svc_acct_sm - ); - print ""; - # svc_acct svc_domain svc_acct_sm svc_charge svc_wo - - print <Field - -- --END -- --#these might belong somewhere else for other user interfaces --#pry need to eventually create stuff that's shared amount UIs - %defs = ( -my(%defs)=( -- 'svc_acct' => { -- 'dir' => 'Home directory', -- 'uid' => 'UID (set to fixed and blank for dial-only)', -- 'slipip' => 'IP address', - 'popnum' => qq!POP number!, - 'popnum' => 'POP number', -- 'username' => 'Username', -- 'quota' => '(unimplemented)', -- '_password' => 'Password', -- 'gid' => 'GID (when blank, defaults to UID)', - 'shell' => 'Shell (all service definitions should have a default or fixed shell that is present in the shells configuration file)', - 'shell' => 'Shell', -- 'finger' => 'GECOS', -- }, -- 'svc_domain' => { -- 'domain' => 'Domain', -- }, -- 'svc_acct_sm' => { -- 'domuser' => 'domuser@virtualdomain.com', -- 'domuid' => 'UID where domuser@virtualdomain.com mail is forwarded', -- 'domsvc' => 'svcnum from svc_domain for virtualdomain.com', -- }, -- 'svc_charge' => { -- 'amount' => 'amount', -- }, -- 'svc_wo' => { -- 'worker' => 'Worker', -- '_date' => 'Date', -- }, --); -- - # svc_acct svc_domain svc_acct_sm svc_charge svc_wo -my($svcdb); --foreach $svcdb ( qw( - svc_acct svc_domain svc_acct_sm - svc_acct svc_domain svc_acct_sm svc_charge svc_wo --) ) { -- -- my(@rows)=map { /^${svcdb}__(.*)$/; $1 } -- grep ! /_flag$/, -- grep /^${svcdb}__/, -- fields('part_svc'); -- my($rowspan)=scalar(@rows); -- -- my($ptmp)=""; -- my($row); -- foreach $row (@rows) { - my $value = $part_svc->getfield($svcdb. '__'. $row); - my $flag = $part_svc->getfield($svcdb. '__'. $row. '_flag'); - print "$ptmp"; - my($value)=$part_svc->getfield($svcdb.'__'.$row); - my($flag)=$part_svc->getfield($svcdb.'__'.$row.'_flag'); - print "$ptmp"; -- print qq!"; - ' CHECKED'x($flag eq ''). ">
      Off"; -- print qq!\n"; - print qq!
      !, - ""; -- $ptmp=''; -- } --} --print "
      TableFieldModifier
      $svcdb
      $row"; - print "- $defs{$svcdb}{$row}" - if defined $defs{$svcdb}{$row}; - print "
      $row - $defs{$svcdb}{$row}OffDefault "; -- print qq!Fixed "; - print qq!!, - "
      "; -- - print qq!\n
      !; - qq!">!; -- --print < -- -- --END -- diff --cc htdocs/edit/process/agent.cgi index c1b397aac,5d1ce3232..000000000 deleted file mode 100755,100755 --- a/htdocs/edit/process/agent.cgi +++ /dev/null @@@ -1,69 -1,53 +1,0 @@@ --#!/usr/bin/perl -Tw --# - # $Id: agent.cgi,v 1.7 1999-01-25 12:09:57 ivan Exp $ -# 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 - # - # $Log: agent.cgi,v $ - # Revision 1.7 1999-01-25 12:09:57 ivan - # yet more mod_perl stuff - # - # Revision 1.6 1999/01/19 05:13:47 ivan - # for mod_perl: no more top-level my() variables; use vars instead - # also the last s/create/new/; - # - # Revision 1.5 1999/01/18 22:47:49 ivan - # s/create/new/g; and use fields('table_name') - # - # Revision 1.4 1998/12/30 23:03:26 ivan - # bugfixes; fields isn't exported by derived classes - # - # Revision 1.3 1998/12/17 08:40:16 ivan - # s/CGI::Request/CGI.pm/; etc - # - # Revision 1.2 1998/11/23 07:52:29 ivan - # *** empty log message *** - # -- --use strict; - use vars qw ( $cgi $agentnum $old $new $error ); - use CGI; -use CGI::Request; --use CGI::Carp qw(fatalsToBrowser); --use FS::UID qw(cgisuidsetup); - use FS::Record qw(qsearch qsearchs fields); - use FS::agent; - use FS::CGI qw(popurl); -use FS::Record qw(qsearch qsearchs); -use FS::agent qw(fields); -use FS::CGI qw(idiot); -- - $cgi = new CGI; -my($req)=new CGI::Request; # create form object -- - &cgisuidsetup($cgi); -&cgisuidsetup($req->cgi); -- - $agentnum = $cgi->param('agentnum'); -my($agentnum)=$req->param('agentnum'); -- - $old = qsearchs('agent',{'agentnum'=>$agentnum}) if $agentnum; -my($old)=qsearchs('agent',{'agentnum'=>$agentnum}) if $agentnum; -- - $new = new FS::agent ( { -#unmunge typenum -$req->param('typenum') =~ /^(\d+)(:.*)?$/; -$req->param('typenum',$1); - -my($new)=create FS::agent ( { -- map { - $_, scalar($cgi->param($_)); - $_, $req->param($_); -- } fields('agent') --} ); -- -my($error); --if ( $agentnum ) { -- $error=$new->replace($old); --} else { -- $error=$new->insert; -- $agentnum=$new->getfield('agentnum'); --} -- --if ( $error ) { - $cgi->param('error', $error); - print $cgi->redirect(popurl(2). "agent.cgi?". $cgi->query_string ); - &idiot($error); --} else { - print $cgi->redirect(popurl(3). "browse/agent.cgi"); - #$req->cgi->redirect("../../view/agent.cgi?$agentnum"); - #$req->cgi->redirect("../../edit/agent.cgi?$agentnum"); - $req->cgi->redirect("../../browse/agent.cgi"); --} -- diff --cc htdocs/edit/process/agent_type.cgi index 99c54ab3b,43f129fd5..000000000 deleted file mode 100755,100755 --- a/htdocs/edit/process/agent_type.cgi +++ /dev/null @@@ -1,96 -1,83 +1,0 @@@ --#!/usr/bin/perl -Tw --# - # $Id: agent_type.cgi,v 1.7 1999-01-25 12:09:58 ivan Exp $ -# 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 - # - # $Log: agent_type.cgi,v $ - # Revision 1.7 1999-01-25 12:09:58 ivan - # yet more mod_perl stuff - # - # Revision 1.6 1999/01/19 05:13:48 ivan - # for mod_perl: no more top-level my() variables; use vars instead - # also the last s/create/new/; - # - # Revision 1.5 1999/01/18 22:47:50 ivan - # s/create/new/g; and use fields('table_name') - # - # Revision 1.4 1998/12/30 23:03:27 ivan - # bugfixes; fields isn't exported by derived classes - # - # Revision 1.3 1998/12/17 08:40:17 ivan - # s/CGI::Request/CGI.pm/; etc - # - # Revision 1.2 1998/11/21 07:49:20 ivan - # s/CGI::Request/CGI.pm/ - # -- --use strict; - use vars qw ( $cgi $typenum $old $new $error $part_pkg ); - use CGI; -use CGI::Request; --use CGI::Carp qw(fatalsToBrowser); - use FS::CGI qw( popurl); --use FS::UID qw(cgisuidsetup); - use FS::Record qw(qsearch qsearchs fields); - use FS::agent_type; -use FS::Record qw(qsearch qsearchs); -use FS::agent_type qw(fields); --use FS::type_pkgs; - use FS::part_pkg; -use FS::CGI qw(idiot); -- - $cgi = new CGI; - &cgisuidsetup($cgi); -my($req)=new CGI::Request; -&cgisuidsetup($req->cgi); -- - $typenum = $cgi->param('typenum'); - $old = qsearchs('agent_type',{'typenum'=>$typenum}) if $typenum; -my($typenum)=$req->param('typenum'); -my($old)=qsearchs('agent_type',{'typenum'=>$typenum}) if $typenum; -- - $new = new FS::agent_type ( { -my($new)=create FS::agent_type ( { -- map { - $_, scalar($cgi->param($_)); - $_, $req->param($_); -- } fields('agent_type') --} ); -- -my($error); --if ( $typenum ) { -- $error=$new->replace($old); --} else { -- $error=$new->insert; -- $typenum=$new->getfield('typenum'); --} -- --if ( $error ) { - $cgi->param('error', $error); - print $cgi->redirect(popurl(2). "agent_type.cgi?". $cgi->query_string ); - 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 && ! $cgi->param("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->delete; - die $error if $error; - $error=$d_type_pkgs->del; #FS::Record not FS::type_pkgs, - #so ->del not ->delete. hmm. hmm. - if ( $error ) { - idiot($error); - exit; - } -- - } elsif ( $cgi->param("pkgpart$pkgpart") - } elsif ( $req->param("pkgpart$pkgpart") -- && ! $type_pkgs -- ) { -- #ok to clobber it now (but bad form nonetheless?) - $type_pkgs=new FS::type_pkgs ({ - $type_pkgs=create FS::type_pkgs ({ -- 'typenum' => $typenum, -- 'pkgpart' => $pkgpart, -- }); -- $error= $type_pkgs->insert; - die $error if $error; - if ( $error ) { - idiot($error); - exit; - } -- } -- --} -- - print $cgi->redirect(popurl(3). "browse/agent_type.cgi"); -#$req->cgi->redirect("../../view/agent_type.cgi?$typenum"); -#$req->cgi->redirect("../../edit/agent_type.cgi?$typenum"); -$req->cgi->redirect("../../browse/agent_type.cgi"); -- diff --cc htdocs/edit/process/cust_credit.cgi index ea9c5a3a2,e660b4c78..000000000 deleted file mode 100755,100755 --- a/htdocs/edit/process/cust_credit.cgi +++ /dev/null @@@ -1,76 -1,70 +1,0 @@@ --#!/usr/bin/perl -Tw --# - # $Id: cust_credit.cgi,v 1.7 1999-04-07 15:23:05 ivan Exp $ -# 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 - # - # $Log: cust_credit.cgi,v $ - # Revision 1.7 1999-04-07 15:23:05 ivan - # don't use anchor in redirect - # - # Revision 1.6 1999/02/28 00:03:41 ivan - # removed misleading comments - # - # Revision 1.5 1999/01/25 12:09:59 ivan - # yet more mod_perl stuff - # - # Revision 1.4 1999/01/19 05:13:49 ivan - # for mod_perl: no more top-level my() variables; use vars instead - # also the last s/create/new/; - # - # Revision 1.3 1999/01/18 22:47:51 ivan - # s/create/new/g; and use fields('table_name') - # - # Revision 1.2 1998/12/17 08:40:18 ivan - # s/CGI::Request/CGI.pm/; etc - # -- --use strict; - use vars qw( $cgi $custnum $new $error ); - use CGI; - use CGI::Carp qw(fatalsToBrowser); -use CGI::Request; --use FS::UID qw(cgisuidsetup getotaker); - use FS::CGI qw(popurl); - use FS::Record qw(fields); --use FS::cust_credit; -- - $cgi = new CGI; - cgisuidsetup($cgi); -my($req)=new CGI::Request; # create form object -cgisuidsetup($req->cgi); -- - $cgi->param('custnum') =~ /^(\d*)$/ or die "Illegal custnum!"; - $custnum = $1; -$req->param('custnum') =~ /^(\d*)$/ or die "Illegal custnum!"; -my($custnum)=$1; -- - $cgi->param('otaker',getotaker); -$req->param('otaker',getotaker); -- - $new = new FS::cust_credit ( { -my($new) = create FS::cust_credit ( { -- map { - $_, scalar($cgi->param($_)); - #} qw(custnum _date amount otaker reason) - } fields('cust_credit') - $_, $req->param($_); - } qw(custnum _date amount otaker reason) --} ); -- -my($error); --$error=$new->insert; -&idiot($error) if $error; -- - if ( $error ) { - $cgi->param('error', $error); - print $cgi->redirect(popurl(2). "cust_credit.cgi?". $cgi->query_string ); - } else { - print $cgi->redirect(popurl(3). "view/cust_main.cgi?$custnum"); - } -#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 --cc htdocs/edit/process/cust_main.cgi index 25dc0299b,7664dfcb8..000000000 deleted file mode 100755,100755 --- a/htdocs/edit/process/cust_main.cgi +++ /dev/null @@@ -1,192 -1,102 +1,0 @@@ --#!/usr/bin/perl -Tw --# - # $Id: cust_main.cgi,v 1.11 1999-08-10 12:54:06 ivan Exp $ -# 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 - # - # $Log: cust_main.cgi,v $ - # Revision 1.11 1999-08-10 12:54:06 ivan - # use FS::cust_pkg::pkgpart_href - # - # Revision 1.10 1999/04/14 07:47:53 ivan - # i18n fixes - # - # Revision 1.9 1999/04/07 15:22:19 ivan - # don't use anchor in redirect - # - # Revision 1.8 1999/03/25 13:55:10 ivan - # one-screen new customer entry (including package and service) for simple - # packages with one svc_acct service - # - # Revision 1.7 1999/02/28 00:03:42 ivan - # removed misleading comments - # - # Revision 1.6 1999/01/25 12:10:00 ivan - # yet more mod_perl stuff - # - # Revision 1.5 1999/01/19 05:13:50 ivan - # for mod_perl: no more top-level my() variables; use vars instead - # also the last s/create/new/; - # - # Revision 1.4 1999/01/18 09:22:32 ivan - # changes to track email addresses for email invoicing - # - # Revision 1.3 1998/12/17 08:40:19 ivan - # s/CGI::Request/CGI.pm/; etc - # - # Revision 1.2 1998/11/18 08:57:36 ivan - # i18n, s/CGI-modules/CGI.pm/, FS::CGI::idiot instead of inline, FS::CGI::popurl - # -- --use strict; - use vars qw( $cgi $payby @invoicing_list $new $custnum $error ); - use vars qw( $cust_pkg $cust_svc $svc_acct ); - use CGI; -use CGI::Request; --use CGI::Carp qw(fatalsToBrowser); - use FS::UID qw(cgisuidsetup getotaker); - use FS::CGI qw( popurl ); - use FS::Record qw( qsearch qsearchs fields ); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearchs); --use FS::cust_main; - use FS::type_pkgs; - use FS::agent; - - $cgi = new CGI; - &cgisuidsetup($cgi); - - #unmunge stuff -- - $cgi->param('tax','') unless defined($cgi->param('tax')); -my($req)=new CGI::Request; # create form object -- - $cgi->param('refnum', (split(/:/, ($cgi->param('refnum'))[0] ))[0] ); -&cgisuidsetup($req->cgi); -- - $cgi->param('state') =~ /^(\w*)( \(([\w ]+)\))? ?\/ ?(\w+)$/ - or die "Oops, illegal \"state\" param: ". $cgi->param('state'); - $cgi->param('state', $1); - $cgi->param('county', $3 || ''); - $cgi->param('country', $4); -#create new record object -- - if ( $payby = $cgi->param('payby') ) { - $cgi->param('payinfo', $cgi->param( $payby. '_payinfo' ) ); - $cgi->param('paydate', - $cgi->param( $payby. '_month' ). '-'. $cgi->param( $payby. '_year' ) ); - $cgi->param('payname', $cgi->param( $payby. '_payname' ) ); - } -#unmunge agentnum -$req->param('agentnum', - (split(/:/, ($req->param('agentnum'))[0] ))[0] -); -- - $cgi->param('otaker', &getotaker ); -#unmunge tax -$req->param('tax','') unless defined($req->param('tax')); -- - @invoicing_list = split( /\s*\,\s*/, $cgi->param('invoicing_list') ); - push @invoicing_list, 'POST' if $cgi->param('invoicing_list_POST'); -#unmunge refnum -$req->param('refnum', - (split(/:/, ($req->param('refnum'))[0] ))[0] -); -- - #create new record object -#unmunge state/county -$req->param('state') =~ /^(\w+)( \((\w+)\))?$/; -$req->param('state', $1); -$req->param('county', $3 || ''); -- - $new = new FS::cust_main ( { -my($new) = create FS::cust_main ( { -- map { - $_, scalar($cgi->param($_)) - # } qw(custnum agentnum last first ss company address1 address2 city county - # state zip daytime night fax payby payinfo paydate payname tax - # otaker refnum) - } fields('cust_main') - $_, $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) --} ); - - #perhaps the invocing_list magic should move to cust_main.pm? - $error = $new->check_invoicing_list( \@invoicing_list ); -- - #perhaps this stuff should go to cust_main.pm as well - $cust_pkg = ''; - $svc_acct = ''; --if ( $new->custnum eq '' ) { - - if ( $cgi->param('pkgpart_svcpart') ) { - my $x = $cgi->param('pkgpart_svcpart'); - $x =~ /^(\d+)_(\d+)$/; - my($pkgpart, $svcpart) = ($1, $2); - #false laziness: copied from FS::cust_pkg::order (which should become a - #FS::cust_main method) - my(%part_pkg); - # generate %part_pkg - # $part_pkg{$pkgpart} is true iff $custnum may purchase $pkgpart - my $agent = qsearchs('agent',{'agentnum'=> $new->agentnum }); - #my($type_pkgs); - #foreach $type_pkgs ( qsearch('type_pkgs',{'typenum'=> $agent->typenum }) ) { - # my($pkgpart)=$type_pkgs->pkgpart; - # $part_pkg{$pkgpart}++; - #} - # $pkgpart_href->{PKGPART} is true iff $custnum may purchase $pkgpart - my $pkgpart_href = $agent->pkgpart_hashref; - #eslaf - - # this should wind up in FS::cust_pkg! - $error ||= "Agent ". $new->agentnum. " (type ". $agent->typenum. ") can't". - "purchase pkgpart ". $pkgpart - #unless $part_pkg{ $pkgpart }; - unless $pkgpart_href->{ $pkgpart }; -- - $cust_pkg = new FS::cust_pkg ( { - #later 'custnum' => $custnum, - 'pkgpart' => $pkgpart, - } ); - $error ||= $cust_pkg->check; - my($error)=$new->insert; - &idiot($error) if $error; -- - #$cust_svc = new FS::cust_svc ( { 'svcpart' => $svcpart } ); -} else { #create old record object -- - #$error ||= $cust_svc->check; - my($old) = qsearchs( 'cust_main', { 'custnum', $new->custnum } ); - &idiot("Old record not found!") unless $old; - my($error)=$new->replace($old); - &idiot($error) if $error; -- - $svc_acct = new FS::svc_acct ( { - 'svcpart' => $svcpart, - 'username' => $cgi->param('username'), - '_password' => $cgi->param('_password'), - 'popnum' => $cgi->param('popnum'), - } ); -} -- - my $y = $svc_acct->setdefault; # arguably should be in new method - $error ||= $y unless ref($y); - #and just in case you were silly - $svc_acct->svcpart($svcpart); - $svc_acct->username($cgi->param('username')); - $svc_acct->_password($cgi->param('_password')); - $svc_acct->popnum($cgi->param('popnum')); -my($custnum)=$new->custnum; -$req->cgi->redirect("../../view/cust_main.cgi?$custnum#cust_main"); -- - $error ||= $svc_acct->check; -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 -- - } elsif ( $cgi->param('username') ) { #good thing to catch - $error = "Can't assign username without a package!"; - } - exit; -- - $error ||= $new->insert; - if ( $cust_pkg && ! $error ) { - $cust_pkg->custnum( $new->custnum ); - $error ||= $cust_pkg->insert; - warn "WARNING: $error on pre-checked cust_pkg record!" if $error; - $svc_acct->pkgnum( $cust_pkg->pkgnum ); - $error ||= $svc_acct->insert; - warn "WARNING: $error on pre-checked svc_acct record!" if $error; - } - } else { #create old record object - my $old = qsearchs( 'cust_main', { 'custnum' => $new->custnum } ); - $error ||= "Old record not found!" unless $old; - $error ||= $new->replace($old); --} -- - if ( $error ) { - $cgi->param('error', $error); - print $cgi->redirect(popurl(2). "cust_main.cgi?". $cgi->query_string ); - } else { - $new->invoicing_list( \@invoicing_list ); - $custnum = $new->custnum; - print $cgi->redirect(popurl(3). "view/cust_main.cgi?$custnum"); - } diff --cc htdocs/edit/process/cust_main_county-expand.cgi index 7e618c7b8,a821560c6..000000000 deleted file mode 100755,100755 --- a/htdocs/edit/process/cust_main_county-expand.cgi +++ /dev/null @@@ -1,97 -1,71 +1,0 @@@ --#!/usr/bin/perl -Tw --# - # $Id: cust_main_county-expand.cgi,v 1.6 1999-01-25 12:19:07 ivan Exp $ -# 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 - # - # $Log: cust_main_county-expand.cgi,v $ - # Revision 1.6 1999-01-25 12:19:07 ivan - # yet more mod_perl stuff - # - # Revision 1.5 1999/01/19 05:13:51 ivan - # for mod_perl: no more top-level my() variables; use vars instead - # also the last s/create/new/; - # - # Revision 1.4 1999/01/18 22:47:52 ivan - # s/create/new/g; and use fields('table_name') - # - # Revision 1.3 1998/12/17 08:40:20 ivan - # s/CGI::Request/CGI.pm/; etc - # - # Revision 1.2 1998/11/18 09:01:40 ivan - # i18n! i18n! - # -#ivan@sisd.com 98-sep-2 -- --use strict; - use vars qw ( $cgi $taxnum $cust_main_county @expansion $expansion ); - use CGI; -use CGI::Request; --use CGI::Carp qw(fatalsToBrowser); --use FS::UID qw(cgisuidsetup datasrc); --use FS::Record qw(qsearch qsearchs); - use FS::CGI qw(popurl); --use FS::cust_main_county; - use FS::cust_main; -use FS::CGI qw(eidiot); -- - $cgi = new CGI; - &cgisuidsetup($cgi); -my($req)=new CGI::Request; # create form object -- - $cgi->param('taxnum') =~ /^(\d+)$/ or die "Illegal taxnum!"; - $taxnum = $1; - $cust_main_county = qsearchs('cust_main_county',{'taxnum'=>$taxnum}) -&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!"); -- - if ( $cgi->param('delim') eq 'n' ) { - @expansion=split(/\n/,$cgi->param('expansion')); - } elsif ( $cgi->param('delim') eq 's' ) { - @expansion=split(/\s+/,$cgi->param('expansion')); -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!"; --} -- - @expansion=map { - unless ( /^\s*([\w\- ]+)\s*$/ ) { - $cgi->param('error', "Illegal item in expansion"); - print $cgi->redirect(popurl(2). "cust_main_county-expand.cgi?". $cgi->query_string ); - exit; - } -@counties=map { - /^\s*([\w\- ]+)\s*$/ or eidiot("Illegal county"); -- $1; - } @expansion; -} @counties; -- - foreach ( @expansion) { -my($county); -foreach ( @counties) { -- my(%hash)=$cust_main_county->hash; - my($new)=new FS::cust_main_county \%hash; - my($new)=create FS::cust_main_county \%hash; -- $new->setfield('taxnum',''); - if ( ! $cust_main_county->state ) { - $new->setfield('state',$_); - } else { - $new->setfield('county',$_); - } - $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'), - 'country' => $cust_main_county->getfield('country'), --} ) ) { -- my($error)=($cust_main_county->delete); -- die $error if $error; --} -- - print $cgi->redirect(popurl(3). "edit/cust_main_county.cgi"); -$req->cgi->redirect("../../edit/cust_main_county.cgi"); -- diff --cc htdocs/edit/process/cust_main_county.cgi index 0fc1708c5,58eaa63ce..000000000 deleted file mode 100755,100755 --- a/htdocs/edit/process/cust_main_county.cgi +++ /dev/null @@@ -1,60 -1,38 +1,0 @@@ --#!/usr/bin/perl -Tw --# - # $Id: cust_main_county.cgi,v 1.6 1999-01-25 12:19:08 ivan Exp $ -# 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 - # - # $Log: cust_main_county.cgi,v $ - # Revision 1.6 1999-01-25 12:19:08 ivan - # yet more mod_perl stuff - # - # Revision 1.5 1999/01/19 05:13:52 ivan - # for mod_perl: no more top-level my() variables; use vars instead - # also the last s/create/new/; - # - # Revision 1.4 1999/01/18 22:47:53 ivan - # s/create/new/g; and use fields('table_name') - # - # Revision 1.3 1998/12/17 08:40:21 ivan - # s/CGI::Request/CGI.pm/; etc - # - # Revision 1.2 1998/11/18 09:01:41 ivan - # i18n! i18n! - # -- --use strict; - use vars qw( $cgi ); - use CGI; -use CGI::Request; --use CGI::Carp qw(fatalsToBrowser); --use FS::UID qw(cgisuidsetup); - use FS::CGI qw(popurl); --use FS::Record qw(qsearch qsearchs); --use FS::cust_main_county; -use FS::CGI qw(eidiot); -- - $cgi = new CGI; - &cgisuidsetup($cgi); -my($req)=new CGI::Request; # create form object -- - foreach ( $cgi->param ) { -&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 $cgi->param("tax$taxnum"); - next unless $old->getfield('tax') ne $req->param("tax$taxnum"); -- my(%hash)=$old->hash; - $hash{tax}=$cgi->param("tax$taxnum"); - my($new)=new FS::cust_main_county \%hash; - $hash{tax}=$req->param("tax$taxnum"); - my($new)=create FS::cust_main_county \%hash; -- my($error)=$new->replace($old); - if ( $error ) { - $cgi->param('error', $error); - print $cgi->redirect(popurl(2). "cust_main_county.cgi?". $cgi->query_string ); - exit; - } - eidiot($error) if $error; --} -- - print $cgi->redirect(popurl(3). "browse/cust_main_county.cgi"); -$req->cgi->redirect("../../browse/cust_main_county.cgi"); -- diff --cc htdocs/edit/process/cust_pay.cgi index ca5029c3c,9ec97532b..000000000 deleted file mode 100755,100755 --- a/htdocs/edit/process/cust_pay.cgi +++ /dev/null @@@ -1,67 -1,57 +1,0 @@@ --#!/usr/bin/perl -Tw --# - # $Id: cust_pay.cgi,v 1.7 1999-02-28 00:03:43 ivan Exp $ -# 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 - # - # $Log: cust_pay.cgi,v $ - # Revision 1.7 1999-02-28 00:03:43 ivan - # removed misleading comments - # - # Revision 1.6 1999/01/25 12:19:09 ivan - # yet more mod_perl stuff - # - # Revision 1.5 1999/01/19 05:13:53 ivan - # for mod_perl: no more top-level my() variables; use vars instead - # also the last s/create/new/; - # - # Revision 1.4 1999/01/18 22:47:54 ivan - # s/create/new/g; and use fields('table_name') - # - # Revision 1.3 1998/12/30 23:03:28 ivan - # bugfixes; fields isn't exported by derived classes - # - # Revision 1.2 1998/12/17 08:40:22 ivan - # s/CGI::Request/CGI.pm/; etc - # -- --use strict; - use vars qw( $cgi $invnum $new $error ); - use CGI; - use CGI::Carp qw(fatalsToBrowser); -use CGI::Request; --use FS::UID qw(cgisuidsetup); - use FS::CGI qw(popurl); - use FS::Record qw(fields); - use FS::cust_pay; -use FS::cust_pay qw(fields); -- - $cgi = new CGI; - &cgisuidsetup($cgi); -my($req)=new CGI::Request; -&cgisuidsetup($req->cgi); -- - $cgi->param('invnum') =~ /^(\d*)$/ or die "Illegal svcnum!"; - $invnum = $1; -$req->param('invnum') =~ /^(\d*)$/ or die "Illegal svcnum!"; -my($invnum)=$1; -- - $new = new FS::cust_pay ( { -my($new) = create FS::cust_pay ( { -- map { - $_, scalar($cgi->param($_)); - #} qw(invnum paid _date payby payinfo paybatch) - } fields('cust_pay') - $_, $req->param($_); - } qw(invnum paid _date payby payinfo paybatch) --} ); -- -my($error); --$error=$new->insert; -- - if ($error) { - $cgi->param('error', $error); - print $cgi->redirect(popurl(2). 'cust_pay.cgi?'. $cgi->query_string ); - exit; - } else { - print $cgi->redirect(popurl(3). "view/cust_bill.cgi?$invnum"); -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 --cc htdocs/edit/process/cust_pkg.cgi index 9d82b3c24,6f5bc875a..000000000 deleted file mode 100755,100755 --- a/htdocs/edit/process/cust_pkg.cgi +++ /dev/null @@@ -1,80 -1,73 +1,0 @@@ --#!/usr/bin/perl -Tw --# - # $Id: cust_pkg.cgi,v 1.7 1999-04-07 15:24:06 ivan Exp $ -# 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 - # - # $Log: cust_pkg.cgi,v $ - # Revision 1.7 1999-04-07 15:24:06 ivan - # don't use anchor in redirect - # - # Revision 1.6 1999/02/28 00:03:44 ivan - # removed misleading comments - # - # Revision 1.5 1999/02/07 09:59:26 ivan - # more mod_perl fixes, and bugfixes Peter Wemm sent via email - # - # Revision 1.3 1999/01/19 05:13:54 ivan - # for mod_perl: no more top-level my() variables; use vars instead - # also the last s/create/new/; - # - # Revision 1.2 1998/12/17 08:40:23 ivan - # s/CGI::Request/CGI.pm/; etc - # -- --use strict; - use vars qw( $cgi $custnum @remove_pkgnums @pkgparts $pkgpart $error ); - use CGI; -use CGI::Request; --use CGI::Carp qw(fatalsToBrowser); --use FS::UID qw(cgisuidsetup); - use FS::CGI qw(popurl); --use FS::cust_pkg; -- - $cgi = new CGI; # create form object - &cgisuidsetup($cgi); - $error = ''; -my($req)=new CGI::Request; # create form object - -&cgisuidsetup($req->cgi); -- --#untaint custnum - $cgi->param('custnum') =~ /^(\d+)$/; - $custnum = $1; -$req->param('new_custnum') =~ /^(\d+)$/; -my($custnum)=$1; -- - @remove_pkgnums = map { -my(@remove_pkgnums) = map { -- /^(\d+)$/ or die "Illegal remove_pkg value!"; -- $1; - } $cgi->param('remove_pkg'); -} $req->param('remove_pkg'); -- - foreach $pkgpart ( map /^pkg(\d+)$/ ? $1 : (), $cgi->param ) { - if ( $cgi->param("pkg$pkgpart") =~ /^(\d+)$/ ) { - my $num_pkgs = $1; - while ( $num_pkgs-- ) { - push @pkgparts,$pkgpart; - } - } else { - $error = "Illegal quantity"; - last; -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; -- } --} -- - $error ||= FS::cust_pkg::order($custnum,\@pkgparts,\@remove_pkgnums); -my($error) = FS::cust_pkg::order($custnum,\@pkgparts,\@remove_pkgnums); -- --if ($error) { - $cgi->param('error', $error); - print $cgi->redirect(popurl(2). "cust_pkg.cgi?". $cgi->query_string ); - 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 { - print $cgi->redirect(popurl(3). "view/cust_main.cgi?$custnum"); - $req->cgi->redirect("../../view/cust_main.cgi?$custnum#cust_pkg"); --} -- diff --cc htdocs/edit/process/part_pkg.cgi index adf4672bd,7d787819a..000000000 deleted file mode 100755,100755 --- a/htdocs/edit/process/part_pkg.cgi +++ /dev/null @@@ -1,131 -1,79 +1,0 @@@ --#!/usr/bin/perl -Tw - # - # $Id: part_pkg.cgi,v 1.8 1999-02-07 09:59:27 ivan Exp $ --# --# 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 - # - # $Log: part_pkg.cgi,v $ - # Revision 1.8 1999-02-07 09:59:27 ivan - # more mod_perl fixes, and bugfixes Peter Wemm sent via email - # - # Revision 1.7 1999/01/19 05:13:55 ivan - # for mod_perl: no more top-level my() variables; use vars instead - # also the last s/create/new/; - # - # Revision 1.6 1999/01/18 22:47:56 ivan - # s/create/new/g; and use fields('table_name') - # - # Revision 1.5 1998/12/30 23:03:29 ivan - # bugfixes; fields isn't exported by derived classes - # - # Revision 1.4 1998/12/17 08:40:24 ivan - # s/CGI::Request/CGI.pm/; etc - # - # Revision 1.3 1998/11/21 07:17:58 ivan - # bugfix to work for regular aswell as custom pricing - # - # Revision 1.2 1998/11/15 13:16:15 ivan - # first pass as per-user custom pricing - # -- --use strict; - use vars qw( $cgi $pkgpart $old $new $part_svc $error ); - use CGI; -use CGI::Request; --use CGI::Carp qw(fatalsToBrowser); --use FS::UID qw(cgisuidsetup); - use FS::CGI qw(popurl); - use FS::Record qw(qsearch qsearchs fields); - use FS::part_pkg; -use FS::Record qw(qsearch qsearchs); -use FS::part_pkg qw(fields); --use FS::pkg_svc; - use FS::cust_pkg; -use FS::CGI qw(eidiot); -- - $cgi = new CGI; - &cgisuidsetup($cgi); -my($req)=new CGI::Request; # create form object -- - $pkgpart = $cgi->param('pkgpart'); -&cgisuidsetup($req->cgi); -- - $old = qsearchs('part_pkg',{'pkgpart'=>$pkgpart}) if $pkgpart; -my($pkgpart)=$req->param('pkgpart'); -- - $new = new FS::part_pkg ( { -my($old)=qsearchs('part_pkg',{'pkgpart'=>$pkgpart}) if $pkgpart; - -my($new)=create FS::part_pkg ( { -- map { - $_, scalar($cgi->param($_)); - $_, $req->param($_); -- } fields('part_pkg') --} ); - - #most of the stuff below should move to part_pkg.pm - - foreach $part_svc ( qsearch('part_svc', {} ) ) { - my $quantity = $cgi->param('pkg_svc'. $part_svc->svcpart) || 0; - unless ( $quantity =~ /^(\d+)$/ ) { - $cgi->param('error', "Illegal quantity" ); - print $cgi->redirect(popurl(2). "part_pkg.cgi?". $cgi->query_string ); - exit; - } - } - - local $SIG{HUP} = 'IGNORE'; - local $SIG{INT} = 'IGNORE'; - local $SIG{QUIT} = 'IGNORE'; - local $SIG{TERM} = 'IGNORE'; - local $SIG{TSTP} = 'IGNORE'; - local $SIG{PIPE} = 'IGNORE'; -- --if ( $pkgpart ) { - $error = $new->replace($old); - my($error)=$new->replace($old); - eidiot($error) if $error; --} else { - $error = $new->insert; - $pkgpart=$new->pkgpart; - } - if ( $error ) { - $cgi->param('error', $error ); - print $cgi->redirect(popurl(2). "part_pkg.cgi?". $cgi->query_string ); - exit; - my($error)=$new->insert; - eidiot($error) if $error; - $pkgpart=$new->getfield('pkgpart'); --} -- -my($part_svc); --foreach $part_svc (qsearch('part_svc',{})) { - my $quantity = $cgi->param('pkg_svc'. $part_svc->svcpart) || 0; - my $old_pkg_svc = qsearchs('pkg_svc', { - 'pkgpart' => $pkgpart, - 'svcpart' => $part_svc->svcpart, - } ); - my $old_quantity = $old_pkg_svc ? $old_pkg_svc->quantity : 0; -# 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 = new FS::pkg_svc( { - my($new_pkg_svc)=create FS::pkg_svc({ -- 'pkgpart' => $pkgpart, - 'svcpart' => $part_svc->svcpart, - 'svcpart' => $part_svc->getfield('svcpart'), - #'quantity' => $req->param('pkg_svc'. $part_svc->getfield('svcpart')), -- 'quantity' => $quantity, - } ); - if ( $old_pkg_svc ) { - my $myerror = $new_pkg_svc->replace($old_pkg_svc); - die $myerror if $myerror; - }); - if ($old_pkg_svc) { - my($error)=$new_pkg_svc->replace($old_pkg_svc); - eidiot($error) if $error; -- } else { - my $myerror = $new_pkg_svc->insert; - die $myerror if $myerror; - my($error)=$new_pkg_svc->insert; - eidiot($error) if $error; -- } - } - - unless ( $cgi->param('pkgnum') && $cgi->param('pkgnum') =~ /^(\d+)$/ ) { - print $cgi->redirect(popurl(3). "browse/part_pkg.cgi"); - } else { - my($old_cust_pkg) = qsearchs( 'cust_pkg', { 'pkgnum' => $1 } ); - my %hash = $old_cust_pkg->hash; - $hash{'pkgpart'} = $pkgpart; - my($new_cust_pkg) = new FS::cust_pkg \%hash; - my $myerror = $new_cust_pkg->replace($old_cust_pkg); - die "Error modifying cust_pkg record: $myerror\n" if $myerror; - print $cgi->redirect(popurl(3). "view/cust_main.cgi?". $new_cust_pkg->custnum); --} -- -#$req->cgi->redirect("../../view/part_pkg.cgi?$pkgpart"); -#$req->cgi->redirect("../../edit/part_pkg.cgi?$pkgpart"); -$req->cgi->redirect("../../browse/part_pkg.cgi"); -- diff --cc htdocs/edit/process/part_referral.cgi index cde27ede1,08a4c01d0..000000000 deleted file mode 100755,100755 --- a/htdocs/edit/process/part_referral.cgi +++ /dev/null @@@ -1,65 -1,45 +1,0 @@@ --#!/usr/bin/perl -Tw --# - # $Id: part_referral.cgi,v 1.6 1999-02-07 09:59:28 ivan Exp $ -# 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 - # - # $Log: part_referral.cgi,v $ - # Revision 1.6 1999-02-07 09:59:28 ivan - # more mod_perl fixes, and bugfixes Peter Wemm sent via email - # - # Revision 1.5 1999/01/19 05:13:56 ivan - # for mod_perl: no more top-level my() variables; use vars instead - # also the last s/create/new/; - # - # Revision 1.4 1999/01/18 22:47:57 ivan - # s/create/new/g; and use fields('table_name') - # - # Revision 1.3 1998/12/30 23:03:30 ivan - # bugfixes; fields isn't exported by derived classes - # - # Revision 1.2 1998/12/17 08:40:25 ivan - # s/CGI::Request/CGI.pm/; etc - # -- --use strict; - use vars qw( $cgi $refnum $new $error ); - use CGI; -use CGI::Request; --use CGI::Carp qw(fatalsToBrowser); --use FS::UID qw(cgisuidsetup); - use FS::Record qw(qsearchs fields); - use FS::part_referral; - use FS::CGI qw(popurl); -use FS::Record qw(qsearchs); -use FS::part_referral qw(fields); -use FS::CGI qw(eidiot); -use FS::CGI qw(eidiot); -- - $cgi = new CGI; - &cgisuidsetup($cgi); -my($req)=new CGI::Request; # create form object -- - $refnum = $cgi->param('refnum'); -&cgisuidsetup($req->cgi); -- - $new = new FS::part_referral ( { -my($refnum)=$req->param('refnum'); - -my($new)=create FS::part_referral ( { -- map { - $_, scalar($cgi->param($_)); - $_, $req->param($_); -- } fields('part_referral') --} ); -- --if ( $refnum ) { - my $old = qsearchs( 'part_referral', { 'refnum' =>$ refnum } ); - die "(Old) Record not found!" unless $old; - $error = $new->replace($old); - my($old)=qsearchs('part_referral',{'refnum'=>$refnum}); - eidiot("(Old) Record not found!") unless $old; - my($error)=$new->replace($old); - eidiot($error) if $error; --} else { - $error = $new->insert; - my($error)=$new->insert; - eidiot($error) if $error; --} - $refnum=$new->refnum; -- - if ( $error ) { - $cgi->param('error', $error); - print $cgi->redirect(popurl(2). "part_referral.cgi?". $cgi->query_string ); - } else { - print $cgi->redirect(popurl(3). "browse/part_referral.cgi"); - } -$refnum=$new->getfield('refnum'); -$req->cgi->redirect("../../browse/part_referral.cgi"); -- diff --cc htdocs/edit/process/part_svc.cgi index 0b3e2cd1c,0f0fbc6e8..000000000 deleted file mode 100755,100755 --- a/htdocs/edit/process/part_svc.cgi +++ /dev/null @@@ -1,69 -1,47 +1,0 @@@ --#!/usr/bin/perl -Tw --# - # $Id: part_svc.cgi,v 1.7 1999-02-07 09:59:29 ivan Exp $ -# 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 - # - # $Log: part_svc.cgi,v $ - # Revision 1.7 1999-02-07 09:59:29 ivan - # more mod_perl fixes, and bugfixes Peter Wemm sent via email - # - # Revision 1.6 1999/01/19 05:13:57 ivan - # for mod_perl: no more top-level my() variables; use vars instead - # also the last s/create/new/; - # - # Revision 1.5 1999/01/18 22:47:58 ivan - # s/create/new/g; and use fields('table_name') - # - # Revision 1.4 1998/12/30 23:03:31 ivan - # bugfixes; fields isn't exported by derived classes - # - # Revision 1.3 1998/12/17 08:40:26 ivan - # s/CGI::Request/CGI.pm/; etc - # - # Revision 1.2 1998/11/21 06:43:08 ivan - # s/CGI::Request/CGI.pm/ - # -- --use strict; - use vars qw ( $cgi $svcpart $old $new $error ); - use CGI; -use CGI::Request; --use CGI::Carp qw(fatalsToBrowser); --use FS::UID qw(cgisuidsetup); - use FS::Record qw(qsearchs fields); - use FS::part_svc; - use FS::CGI qw(popurl); -use FS::Record qw(qsearchs); -use FS::part_svc qw(fields); -use FS::CGI qw(eidiot); -- - $cgi = new CGI; - &cgisuidsetup($cgi); -my($req)=new CGI::Request; # create form object -- - $svcpart = $cgi->param('svcpart'); -&cgisuidsetup($req->cgi); -- - $old = qsearchs('part_svc',{'svcpart'=>$svcpart}) if $svcpart; -my($svcpart)=$req->param('svcpart'); -- - $new = new FS::part_svc ( { -my($old)=qsearchs('part_svc',{'svcpart'=>$svcpart}) if $svcpart; - -my($new)=create FS::part_svc ( { -- map { - $_, scalar($cgi->param($_)); - $_, $req->param($_); --# } qw(svcpart svc svcdb) -- } fields('part_svc') --} ); -- --if ( $svcpart ) { - $error = $new->replace($old); - my($error)=$new->replace($old); - eidiot($error) if $error; --} else { - $error = $new->insert; - my($error)=$new->insert; - eidiot($error) if $error; -- $svcpart=$new->getfield('svcpart'); --} -- - if ( $error ) { - $cgi->param('error', $error); - print $cgi->redirect(popurl(2). "part_svc.cgi?". $cgi->query_string ); - } else { - print $cgi->redirect(popurl(3)."browse/part_svc.cgi"); - } -#$req->cgi->redirect("../../view/part_svc.cgi?$svcpart"); -#$req->cgi->redirect("../../edit/part_svc.cgi?$svcpart"); -$req->cgi->redirect("../../browse/part_svc.cgi"); -- diff --cc htdocs/edit/process/svc_acct.cgi index 84f93abe8,8d77ba703..000000000 deleted file mode 100755,100755 --- a/htdocs/edit/process/svc_acct.cgi +++ /dev/null @@@ -1,96 -1,87 +1,0 @@@ --#!/usr/bin/perl -Tw --# - # $Id: svc_acct.cgi,v 1.7 1999-08-27 00:26:33 ivan Exp $ -# 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 - # - # $Log: svc_acct.cgi,v $ - # Revision 1.7 1999-08-27 00:26:33 ivan - # better error messages - # - # Revision 1.6 1999/02/28 00:03:45 ivan - # removed misleading comments - # - # Revision 1.5 1999/02/07 09:59:30 ivan - # more mod_perl fixes, and bugfixes Peter Wemm sent via email - # - # Revision 1.4 1999/01/19 05:13:58 ivan - # for mod_perl: no more top-level my() variables; use vars instead - # also the last s/create/new/; - # - # Revision 1.3 1999/01/18 22:47:59 ivan - # s/create/new/g; and use fields('table_name') - # - # Revision 1.2 1998/12/17 08:40:27 ivan - # s/CGI::Request/CGI.pm/; etc - # -- --use strict; - use vars qw( $cgi $svcnum $old $new $error ); - use CGI; -use CGI::Request; --use CGI::Carp qw(fatalsToBrowser); --use FS::UID qw(cgisuidsetup); - use FS::CGI qw(popurl); - use FS::Record qw(qsearchs fields); -use FS::Record qw(qsearchs); --use FS::svc_acct; -- - $cgi = new CGI; - &cgisuidsetup($cgi); -my($req) = new CGI::Request; # create form object -&cgisuidsetup($req->cgi); -- - $cgi->param('svcnum') =~ /^(\d*)$/ or die "Illegal svcnum!"; - $svcnum = $1; -$req->param('svcnum') =~ /^(\d*)$/ or die "Illegal svcnum!"; -my($svcnum)=$1; -- - if ( $svcnum ) { - $old = qsearchs('svc_acct', { 'svcnum' => $svcnum } ) - or die "fatal: can't find account (svcnum $svcnum)!"; - } else { - $old = ''; - } -my($old)=qsearchs('svc_acct',{'svcnum'=>$svcnum}) if $svcnum; -- --#unmunge popnum - $cgi->param('popnum', (split(/:/, $cgi->param('popnum') ))[0] ); -$req->param('popnum', (split(/:/, $req->param('popnum') ))[0] ); -- --#unmunge passwd - if ( $cgi->param('_password') eq '*HIDDEN*' ) { - die "fatal: no previous account to recall hidden password from!" unless $old; - $cgi->param('_password',$old->getfield('_password')); -if ( $req->param('_password') eq '*HIDDEN*' ) { - $req->param('_password',$old->getfield('_password')); --} -- - $new = new FS::svc_acct ( { -my($new) = create FS::svc_acct ( { -- map { - $_, scalar($cgi->param($_)); - #} qw(svcnum pkgnum svcpart username _password popnum uid gid finger dir - # shell quota slipip) - } ( fields('svc_acct'), qw( pkgnum svcpart ) ) - $_, $req->param($_); - } qw(svcnum pkgnum svcpart username _password popnum uid gid finger dir - shell quota slipip) --} ); -- --if ( $svcnum ) { - $error = $new->replace($old); - my($error) = $new->replace($old); - &idiot($error) if $error; --} else { - $error = $new->insert; - $svcnum = $new->svcnum; - my($error) = $new->insert; - &idiot($error) if $error; - $svcnum = $new->getfield('svcnum'); --} -- - if ( $error ) { - $cgi->param('error', $error); - print $cgi->redirect(popurl(2). "svc_acct.cgi?". $cgi->query_string ); - } else { - print $cgi->redirect(popurl(3). "view/svc_acct.cgi?" . $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 --cc htdocs/edit/process/svc_acct_pop.cgi index 763bca4a8,18d7940b4..000000000 deleted file mode 100755,100755 --- a/htdocs/edit/process/svc_acct_pop.cgi +++ /dev/null @@@ -1,66 -1,43 +1,0 @@@ --#!/usr/bin/perl -Tw --# - # $Id: svc_acct_pop.cgi,v 1.6 1999-02-07 09:59:31 ivan Exp $ -# 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 - # - # $Log: svc_acct_pop.cgi,v $ - # Revision 1.6 1999-02-07 09:59:31 ivan - # more mod_perl fixes, and bugfixes Peter Wemm sent via email - # - # Revision 1.5 1999/01/19 05:13:59 ivan - # for mod_perl: no more top-level my() variables; use vars instead - # also the last s/create/new/; - # - # Revision 1.4 1999/01/18 22:48:00 ivan - # s/create/new/g; and use fields('table_name') - # - # Revision 1.3 1998/12/30 23:03:32 ivan - # bugfixes; fields isn't exported by derived classes - # - # Revision 1.2 1998/12/17 08:40:28 ivan - # s/CGI::Request/CGI.pm/; etc - # -- --use strict; - use vars qw( $cgi $popnum $old $new $error ); - use CGI; -use CGI::Request; --use CGI::Carp qw(fatalsToBrowser); --use FS::UID qw(cgisuidsetup); - use FS::Record qw(qsearch qsearchs fields); - use FS::svc_acct_pop; - use FS::CGI qw(popurl); -use FS::Record qw(qsearch qsearchs); -use FS::svc_acct_pop qw(fields); -use FS::CGI qw(eidiot); -- - $cgi = new CGI; # create form object -my($req)=new CGI::Request; # create form object -- - &cgisuidsetup($cgi); -&cgisuidsetup($req->cgi); -- - $popnum = $cgi->param('popnum'); -my($popnum)=$req->param('popnum'); -- - $old = qsearchs('svc_acct_pop',{'popnum'=>$popnum}) if $popnum; -my($old)=qsearchs('svc_acct_pop',{'popnum'=>$popnum}) if $popnum; -- - $new = new FS::svc_acct_pop ( { -my($new)=create FS::svc_acct_pop ( { -- map { - $_, scalar($cgi->param($_)); - $_, $req->param($_); -- } fields('svc_acct_pop') --} ); -- --if ( $popnum ) { - $error = $new->replace($old); - my($error)=$new->replace($old); - eidiot($error) if $error; --} else { - $error = $new->insert; - my($error)=$new->insert; - eidiot($error) if $error; -- $popnum=$new->getfield('popnum'); - } - - if ( $error ) { - $cgi->param('error', $error); - print $cgi->redirect(popurl(2). "svc_acct_pop.cgi?". $cgi->query_string ); - } else { - print $cgi->redirect(popurl(3). "browse/svc_acct_pop.cgi"); --} -$req->cgi->redirect("../../browse/svc_acct_pop.cgi"); -- diff --cc htdocs/edit/process/svc_acct_sm.cgi index 9c39bb8e5,9ad546bf4..000000000 deleted file mode 100755,100755 --- a/htdocs/edit/process/svc_acct_sm.cgi +++ /dev/null @@@ -1,83 -1,80 +1,0 @@@ --#!/usr/bin/perl -Tw --# - # $Id: svc_acct_sm.cgi,v 1.6 1999-02-28 00:03:46 ivan Exp $ -# 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 - # - # $Log: svc_acct_sm.cgi,v $ - # Revision 1.6 1999-02-28 00:03:46 ivan - # removed misleading comments - # - # Revision 1.5 1999/02/07 09:59:32 ivan - # more mod_perl fixes, and bugfixes Peter Wemm sent via email - # - # Revision 1.4 1999/01/19 05:14:00 ivan - # for mod_perl: no more top-level my() variables; use vars instead - # also the last s/create/new/; - # - # Revision 1.3 1999/01/18 22:48:01 ivan - # s/create/new/g; and use fields('table_name') - # - # Revision 1.2 1998/12/17 08:40:29 ivan - # s/CGI::Request/CGI.pm/; etc - # -- --use strict; - use vars qw( $cgi $svcnum $old $new $error ); - use CGI; -use CGI::Request; --use CGI::Carp qw(fatalsToBrowser); --use FS::UID qw(cgisuidsetup); - use FS::Record qw(qsearchs fields); -use FS::Record qw(qsearchs); --use FS::svc_acct_sm; - use FS::CGI qw(popurl); -- - $cgi = new CGI; - cgisuidsetup($cgi); -my($req)=new CGI::Request; # create form object -cgisuidsetup($req->cgi); -- - $cgi->param('svcnum') =~ /^(\d*)$/ or die "Illegal svcnum!"; - $svcnum =$1; -$req->param('svcnum') =~ /^(\d*)$/ or die "Illegal svcnum!"; -my($svcnum)=$1; -- - $old = qsearchs('svc_acct_sm',{'svcnum'=>$svcnum}) if $svcnum; -my($old)=qsearchs('svc_acct_sm',{'svcnum'=>$svcnum}) if $svcnum; -- --#unmunge domsvc and domuid - #$cgi->param('domsvc',(split(/:/, $cgi->param('domsvc') ))[0] ); - #$cgi->param('domuid',(split(/:/, $cgi->param('domuid') ))[0] ); -$req->param('domsvc',(split(/:/, $req->param('domsvc') ))[0] ); -$req->param('domuid',(split(/:/, $req->param('domuid') ))[0] ); -- - $new = new FS::svc_acct_sm ( { -my($new) = create FS::svc_acct_sm ( { -- map { - ($_, scalar($cgi->param($_))); - #} qw(svcnum pkgnum svcpart domuser domuid domsvc) - } ( fields('svc_acct_sm'), qw( pkgnum svcpart ) ) - ($_, 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'); --} -- - if ($error) { - $cgi->param('error', $error); - print $cgi->redirect(popurl(2). "svc_acct_sm.cgi?". $cgi->query_string ); -unless ($error) { - $req->cgi->redirect("../../view/svc_acct_sm.cgi?$svcnum"); --} else { - print $cgi->redirect(popurl(3). "view/svc_acct_sm.cgi?$svcnum"); - 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 --cc htdocs/edit/process/svc_domain.cgi index e12aa1b55,0782772dd..000000000 deleted file mode 100755,100755 --- a/htdocs/edit/process/svc_domain.cgi +++ /dev/null @@@ -1,80 -1,78 +1,0 @@@ --#!/usr/bin/perl -Tw --# - # $Id: svc_domain.cgi,v 1.6 1999-02-28 00:03:47 ivan Exp $ -# 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 - # - # $Log: svc_domain.cgi,v $ - # Revision 1.6 1999-02-28 00:03:47 ivan - # removed misleading comments - # - # Revision 1.5 1999/02/07 09:59:33 ivan - # more mod_perl fixes, and bugfixes Peter Wemm sent via email - # - # Revision 1.4 1999/01/19 05:14:01 ivan - # for mod_perl: no more top-level my() variables; use vars instead - # also the last s/create/new/; - # - # Revision 1.3 1999/01/18 22:48:02 ivan - # s/create/new/g; and use fields('table_name') - # - # Revision 1.2 1998/12/17 08:40:30 ivan - # s/CGI::Request/CGI.pm/; etc - # -- --use strict; - use vars qw( $cgi $svcnum $new $error ); - use CGI; -use CGI::Request; --use CGI::Carp qw(fatalsToBrowser); --use FS::UID qw(cgisuidsetup); - use FS::Record qw(qsearchs fields); -use FS::Record qw(qsearchs); --use FS::svc_domain; - use FS::CGI qw(popurl); -- --#remove this to actually test the domains! --$FS::svc_domain::whois_hack = 1; -- - $cgi = new CGI; - &cgisuidsetup($cgi); -my($req) = new CGI::Request; -&cgisuidsetup($req->cgi); -- - $cgi->param('svcnum') =~ /^(\d*)$/ or die "Illegal svcnum!"; - $svcnum = $1; -$req->param('svcnum') =~ /^(\d*)$/ or die "Illegal svcnum!"; -my($svcnum)=$1; -- - $new = new FS::svc_domain ( { -my($new) = create FS::svc_domain ( { -- map { - $_, scalar($cgi->param($_)); - #} qw(svcnum pkgnum svcpart domain action purpose) - } ( fields('svc_domain'), qw( pkgnum svcpart action purpose ) ) - $_, $req->param($_); - } qw(svcnum pkgnum svcpart domain action purpose) --} ); -- - if ($cgi->param('legal') ne "Yes") { -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 ($cgi->param('svcnum')) { -} elsif ($req->param('svcnum')) { -- $error="Can't modify a domain!"; --} else { -- $error=$new->insert; -- $svcnum=$new->svcnum; --} -- - if ($error) { - $cgi->param('error', $error); - print $cgi->redirect(popurl(2). "svc_domain.cgi?". $cgi->query_string ); -unless ($error) { - $req->cgi->redirect("../../view/svc_domain.cgi?$svcnum"); --} else { - print $cgi->redirect(popurl(3). "view/svc_domain.cgi?$svcnum"); - 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 --cc htdocs/edit/svc_acct.cgi index 963bc1edf,61d0fdc28..000000000 deleted file mode 100755,100755 --- a/htdocs/edit/svc_acct.cgi +++ /dev/null @@@ -1,228 -1,191 +1,0 @@@ --#!/usr/bin/perl -Tw --# - # $Id: svc_acct.cgi,v 1.10 1999-04-14 11:27:06 ivan Exp $ -# 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 - # - # $Log: svc_acct.cgi,v $ - # Revision 1.10 1999-04-14 11:27:06 ivan - # showpasswords config option to show passwords - # - # Revision 1.9 1999/02/28 00:03:37 ivan - # removed misleading comments - # - # Revision 1.8 1999/02/23 08:09:22 ivan - # beginnings of one-screen new customer entry and some other miscellania - # - # Revision 1.7 1999/02/07 09:59:22 ivan - # more mod_perl fixes, and bugfixes Peter Wemm sent via email - # - # Revision 1.6 1999/01/19 05:13:43 ivan - # for mod_perl: no more top-level my() variables; use vars instead - # also the last s/create/new/; - # - # Revision 1.5 1999/01/18 09:41:32 ivan - # all $cgi->header calls now include ( '-expires' => 'now' ) for mod_perl - # (good idea anyway) - # - # Revision 1.4 1998/12/30 23:03:22 ivan - # bugfixes; fields isn't exported by derived classes - # - # Revision 1.3 1998/12/17 06:17:08 ivan - # fix double // in relative URLs, s/CGI::Base/CGI/; - # -- --use strict; - use vars qw( $conf $cgi @shells $action $svcnum $svc_acct $pkgnum $svcpart - $part_svc $svc $otaker $username $password $ulen $ulen2 $p1 - $popnum $uid $gid $finger $dir $shell $quota $slipip ); - use CGI; - use CGI::Carp qw(fatalsToBrowser); -use CGI::Base qw(:DEFAULT :CGI); --use FS::UID qw(cgisuidsetup getotaker); - use FS::CGI qw(header popurl); - use FS::Record qw(qsearch qsearchs fields); - use FS::svc_acct; - use FS::Conf; -use FS::Record qw(qsearch qsearchs); -use FS::svc_acct qw(fields); -- - $cgi = new CGI; -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); -- - $conf = new FS::Conf; - @shells = $conf->config('shells'); -my($action,$svcnum,$svc_acct,$pkgnum,$svcpart,$part_svc); -- - if ( $cgi->param('error') ) { - $svc_acct = new FS::svc_acct ( { - map { $_, scalar($cgi->param($_)) } fields('svc_acct') - } ); - $svcnum = $svc_acct->svcnum; - $pkgnum = $cgi->param('pkgnum'); - $svcpart = $cgi->param('svcpart'); - $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart}); - die "No part_svc entry!" unless $part_svc; - } else { - my($query) = $cgi->keywords; - if ( $query =~ /^(\d+)$/ ) { #editing - $svcnum=$1; - $svc_acct=qsearchs('svc_acct',{'svcnum'=>$svcnum}) - or die "Unknown (svc_acct) svcnum!"; -if ( $QUERY_STRING =~ /^(\d+)$/ ) { #editing -- - my($cust_svc)=qsearchs('cust_svc',{'svcnum'=>$svcnum}) - or die "Unknown (cust_svc) svcnum!"; - $svcnum=$1; - $svc_acct=qsearchs('svc_acct',{'svcnum'=>$svcnum}) - or die "Unknown (svc_acct) svcnum!"; -- - $pkgnum=$cust_svc->pkgnum; - $svcpart=$cust_svc->svcpart; - my($cust_svc)=qsearchs('cust_svc',{'svcnum'=>$svcnum}) - or die "Unknown (cust_svc) svcnum!"; -- - $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart}); - die "No part_svc entry!" unless $part_svc; - $pkgnum=$cust_svc->pkgnum; - $svcpart=$cust_svc->svcpart; -- - } else { #adding - $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart}); - die "No part_svc entry!" unless $part_svc; -- - $svc_acct = new FS::svc_acct({}); - $action="Edit"; -- - foreach $_ (split(/-/,$query)) { - $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; -} else { #adding -- - $svcnum=''; - $svc_acct=create FS::svc_acct({}); -- - #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') - ) ; - } - 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; -- - #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) ); - } - } - $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') - ) ; -- } - } - $action = $svcnum ? 'Edit' : 'Add'; -- - $svc = $part_svc->getfield('svc'); - #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) ); - } - } -- - $otaker = getotaker; - $action="Add"; -- - $username = $svc_acct->username; - if ( $svc_acct->_password ) { - if ( $conf->exists('showpasswords') ) { - $password = $svc_acct->_password; - } else { - $password = "*HIDDEN*"; - } - } else { - $password = ''; --} -- - $ulen = $svc_acct->dbdef_table->column('username')->length; - $ulen2 = $ulen+2; -my($svc)=$part_svc->getfield('svc'); -- - $p1 = popurl(1); - print $cgi->header( '-expires' => 'now' ), header("$action $svc account"); -my($otaker)=getotaker; -- - print qq!Error: !, $cgi->param('error'), - "" - if $cgi->param('error'); -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 - $popnum = $svc_acct->popnum || 0; -my($popnum)=$svc_acct->popnum || 0; --if ( $part_svc->svc_acct__popnum_flag eq "F" ) { -- print qq!!; --} else { -- print qq!
      POP: "; --} -- - ($uid,$gid,$finger,$dir)=( -my($uid,$gid,$finger,$dir)=( -- $svc_acct->uid, -- $svc_acct->gid, -- $svc_acct->finger, -- $svc_acct->dir, --); -- --print < -- --
      GECOS: -- --END -- - $shell = $svc_acct->shell; -my($shell)=$svc_acct->shell; --if ( $part_svc->svc_acct__shell_flag eq "F" ) { -- print qq!!; --} else { -- print qq!
      Shell: "; --} -- - ($quota,$slipip)=( -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 qq!

      !; -- --print < -- -- --END -- -- diff --cc htdocs/edit/svc_acct_pop.cgi index 1797b2b8e,46d803f07..000000000 deleted file mode 100755,100755 --- a/htdocs/edit/svc_acct_pop.cgi +++ /dev/null @@@ -1,102 -1,67 +1,0 @@@ --#!/usr/bin/perl -Tw --# - # $Id: svc_acct_pop.cgi,v 1.9 2000-01-28 23:02:48 ivan Exp $ -# 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 - # - # $Log: svc_acct_pop.cgi,v $ - # Revision 1.9 2000-01-28 23:02:48 ivan - # track full phone number - # - # Revision 1.8 1999/02/23 08:09:23 ivan - # beginnings of one-screen new customer entry and some other miscellania - # - # Revision 1.7 1999/02/07 09:59:23 ivan - # more mod_perl fixes, and bugfixes Peter Wemm sent via email - # - # Revision 1.6 1999/01/19 05:13:44 ivan - # for mod_perl: no more top-level my() variables; use vars instead - # also the last s/create/new/; - # - # Revision 1.5 1999/01/18 09:41:33 ivan - # all $cgi->header calls now include ( '-expires' => 'now' ) for mod_perl - # (good idea anyway) - # - # Revision 1.4 1998/12/23 02:57:45 ivan - # $cgi->keywords instead of $cgi->query_string - # - # Revision 1.3 1998/12/17 06:17:10 ivan - # fix double // in relative URLs, s/CGI::Base/CGI/; - # - # Revision 1.2 1998/11/13 09:56:47 ivan - # change configuration file layout to support multiple distinct databases (with - # own set of config files, export, etc.) - # -- --use strict; - use vars qw( $cgi $svc_acct_pop $action $query $hashref $p1 ); - use CGI; -use CGI::Base; --use CGI::Carp qw(fatalsToBrowser); --use FS::UID qw(cgisuidsetup); - use FS::Record qw(qsearch qsearchs fields); - use FS::CGI qw(header menubar popurl); -use FS::Record qw(qsearch qsearchs); --use FS::svc_acct_pop; - $cgi = new CGI; -use FS::CGI qw(header menubar); - -my($cgi) = new CGI::Base; -$cgi->get; - --&cgisuidsetup($cgi); -- - if ( $cgi->param('error') ) { - $svc_acct_pop = new FS::svc_acct_pop ( { - map { $_, scalar($cgi->param($_)) } fields('svc_acct_pop') - } ); - } elsif ( $cgi->keywords ) { #editing - my($query)=$cgi->keywords; - $query =~ /^(\d+)$/; -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 = new FS::svc_acct_pop {}; - $svc_acct_pop=create FS::svc_acct_pop {}; - $action='Add'; --} - $action = $svc_acct_pop->popnum ? 'Edit' : 'Add'; - $hashref = $svc_acct_pop->hashref; - - $p1 = popurl(1); - print $cgi->header( '-expires' => 'now' ), header("$action POP", menubar( - 'Main Menu' => popurl(2), - 'View all POPs' => popurl(2). "browse/svc_acct_pop.cgi", - )); - - print qq!Error: !, $cgi->param('error'), - "" - if $cgi->param('error'); -my($hashref)=$svc_acct_pop->hashref; -- - print qq!!; -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 -State --Area Code --Exchange - Local -- --END -- --print qq!
      !; -- --print < -- -- --END -- diff --cc htdocs/edit/svc_acct_sm.cgi index cb7cbfae0,45a8eb8fc..000000000 deleted file mode 100755,100755 --- a/htdocs/edit/svc_acct_sm.cgi +++ /dev/null @@@ -1,247 -1,219 +1,0 @@@ --#!/usr/bin/perl -Tw --# - # $Id: svc_acct_sm.cgi,v 1.9 1999-02-28 00:03:38 ivan Exp $ -# 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 - # - # $Log: svc_acct_sm.cgi,v $ - # Revision 1.9 1999-02-28 00:03:38 ivan - # removed misleading comments - # - # Revision 1.8 1999/02/07 09:59:24 ivan - # more mod_perl fixes, and bugfixes Peter Wemm sent via email - # - # Revision 1.7 1999/01/19 05:13:45 ivan - # for mod_perl: no more top-level my() variables; use vars instead - # also the last s/create/new/; - # - # Revision 1.6 1999/01/18 09:41:34 ivan - # all $cgi->header calls now include ( '-expires' => 'now' ) for mod_perl - # (good idea anyway) - # - # Revision 1.5 1998/12/30 23:03:24 ivan - # bugfixes; fields isn't exported by derived classes - # - # Revision 1.4 1998/12/23 02:58:45 ivan - # $cgi->keywords instead of $cgi->query_string - # - # Revision 1.3 1998/12/17 06:17:11 ivan - # fix double // in relative URLs, s/CGI::Base/CGI/; - # - # Revision 1.2 1998/12/16 05:19:15 ivan - # use FS::Conf - # -- --use strict; - use vars qw( $conf $cgi $mydomain $action $svcnum $svc_acct_sm $pkgnum $svcpart - $part_svc $query %username %domain $p1 $domuser $domsvc $domuid ); - use CGI; - use CGI::Carp qw(fatalsToBrowser); -use CGI::Base qw(:DEFAULT :CGI); --use FS::UID qw(cgisuidsetup); - use FS::CGI qw(header popurl); - use FS::Record qw(qsearch qsearchs fields); - use FS::svc_acct_sm; - use FS::Conf; -use FS::Record qw(qsearch qsearchs); -use FS::svc_acct_sm qw(fields); -- - $cgi = new CGI; -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); -- - $conf = new FS::Conf; - $mydomain = $conf->config('domain'); -SendHeaders(); # one guess. -- - if ( $cgi->param('error') ) { - $svc_acct_sm = new FS::svc_acct_sm ( { - map { $_, scalar($cgi->param($_)) } fields('svc_acct_sm') - } ); - $svcnum = $svc_acct_sm->svcnum; - $pkgnum = $cgi->param('pkgnum'); - $svcpart = $cgi->param('svcpart'); - $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart}); - die "No part_svc entry!" unless $part_svc; - } else { - my($query) = $cgi->keywords; - if ( $query =~ /^(\d+)$/ ) { #editing - $svcnum=$1; - $svc_acct_sm=qsearchs('svc_acct_sm',{'svcnum'=>$svcnum}) - or die "Unknown (svc_acct_sm) svcnum!"; -my($action,$svcnum,$svc_acct_sm,$pkgnum,$svcpart,$part_svc); -if ( $QUERY_STRING =~ /^(\d+)$/ ) { #editing -- - my($cust_svc)=qsearchs('cust_svc',{'svcnum'=>$svcnum}) - or die "Unknown (cust_svc) svcnum!"; - $svcnum=$1; - $svc_acct_sm=qsearchs('svc_acct_sm',{'svcnum'=>$svcnum}) - or die "Unknown (svc_acct_sm) svcnum!"; -- - $pkgnum=$cust_svc->pkgnum; - $svcpart=$cust_svc->svcpart; - 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; - $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart}); - die "No part_svc entry!" unless $part_svc; -- - } else { #adding - $action="Edit"; -- - $svc_acct_sm = new FS::svc_acct_sm({}); -} else { #adding -- - foreach $_ (split(/-/,$query)) { #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; - $svc_acct_sm=create FS::svc_acct_sm({}); -- - $svcnum=''; - 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; -- - #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) ); - } - } - $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'; - --} - $action = $svc_acct_sm->svcnum ? 'Edit' : '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"; --} - - $p1 = popurl(1); - print $cgi->header( '-expires' => 'now' ), header("Mail Alias $action", ''); - - print qq!Error: !, $cgi->param('error'), - "" - if $cgi->param('error'); -- - print qq!!; -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!!;
      --
      - ($domuser,$domsvc,$domuid)=(
       -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 --cc htdocs/edit/svc_domain.cgi index 6b5eff560,0717a2c09..000000000 deleted file mode 100755,100755 --- a/htdocs/edit/svc_domain.cgi +++ /dev/null @@@ -1,164 -1,120 +1,0 @@@ --#!/usr/bin/perl -Tw --# - # $Id: svc_domain.cgi,v 1.9 1999-02-28 00:03:39 ivan Exp $ -# 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 - # - # $Log: svc_domain.cgi,v $ - # Revision 1.9 1999-02-28 00:03:39 ivan - # removed misleading comments - # - # Revision 1.8 1999/02/07 09:59:25 ivan - # more mod_perl fixes, and bugfixes Peter Wemm sent via email - # - # Revision 1.7 1999/01/19 05:13:46 ivan - # for mod_perl: no more top-level my() variables; use vars instead - # also the last s/create/new/; - # - # Revision 1.6 1999/01/18 09:41:35 ivan - # all $cgi->header calls now include ( '-expires' => 'now' ) for mod_perl - # (good idea anyway) - # - # Revision 1.5 1998/12/30 23:03:25 ivan - # bugfixes; fields isn't exported by derived classes - # - # Revision 1.4 1998/12/23 03:00:16 ivan - # $cgi->keywords instead of $cgi->query_string - # - # Revision 1.3 1998/12/17 06:17:12 ivan - # fix double // in relative URLs, s/CGI::Base/CGI/; - # - # Revision 1.2 1998/11/13 09:56:48 ivan - # change configuration file layout to support multiple distinct databases (with - # own set of config files, export, etc.) - # -- --use strict; - use vars qw( $cgi $action $svcnum $svc_domain $pkgnum $svcpart $part_svc - $svc $otaker $domain $p1 $kludge_action $purpose ); - use CGI; - use CGI::Carp qw(fatalsToBrowser); -use CGI::Base qw(:DEFAULT :CGI); --use FS::UID qw(cgisuidsetup getotaker); - use FS::CGI qw(header popurl); - use FS::Record qw(qsearch qsearchs fields); - use FS::svc_domain; -use FS::Record qw(qsearch qsearchs); -use FS::svc_domain qw(fields); -- - $cgi = new CGI; -my($cgi) = new CGI::Base; -$cgi->get; --&cgisuidsetup($cgi); -- - if ( $cgi->param('error') ) { - $svc_domain = new FS::svc_domain ( { - map { $_, scalar($cgi->param($_)) } fields('svc_domain') - } ); - $svcnum = $svc_domain->svcnum; - $pkgnum = $cgi->param('pkgnum'); - $svcpart = $cgi->param('svcpart'); - $kludge_action = $cgi->param('action'); - $purpose = $cgi->param('purpose'); - $part_svc = qsearchs('part_svc', { 'svcpart' => $svcpart } ); - die "No part_svc entry!" unless $part_svc; - } else { - $kludge_action = ''; - $purpose = ''; - my($query) = $cgi->keywords; - if ( $query =~ /^(\d+)$/ ) { #editing - $svcnum=$1; - $svc_domain=qsearchs('svc_domain',{'svcnum'=>$svcnum}) - or die "Unknown (svc_domain) svcnum!"; -my($action,$svcnum,$svc_domain,$pkgnum,$svcpart,$part_svc); -- - my($cust_svc)=qsearchs('cust_svc',{'svcnum'=>$svcnum}) - or die "Unknown (cust_svc) svcnum!"; -if ( $QUERY_STRING =~ /^(\d+)$/ ) { #editing -- - $pkgnum=$cust_svc->pkgnum; - $svcpart=$cust_svc->svcpart; - $svcnum=$1; - $svc_domain=qsearchs('svc_domain',{'svcnum'=>$svcnum}) - or die "Unknown (svc_domain) svcnum!"; -- - $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart}); - die "No part_svc entry!" unless $part_svc; - my($cust_svc)=qsearchs('cust_svc',{'svcnum'=>$svcnum}) - or die "Unknown (cust_svc) svcnum!"; -- - } else { #adding - $pkgnum=$cust_svc->pkgnum; - $svcpart=$cust_svc->svcpart; -- - $svc_domain = new FS::svc_domain({}); - $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)) { - $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; - 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=''; - $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) ); - } - #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 = $svcnum ? 'Edit' : 'Add'; -- - $svc = $part_svc->getfield('svc'); - $action="Add"; -- - $otaker = getotaker; -} -- - $domain = $svc_domain->domain; -my($svc)=$part_svc->getfield('svc'); -- - $p1 = popurl(1); - print $cgi->header( '-expires' => 'now' ), header("$action $svc", ''); -my($otaker)=getotaker; -- - print qq!Error: !, $cgi->param('error'), - "" - if $cgi->param('error'); -my($domain)=( - $svc_domain->domain, -); -- -SendHeaders(); --print < - - - $action $svc - - -
      -

      $action $svc

      -

      - -- -- -- - END - - print qq!New!; - print qq!
      Transfer!; - New -
      Transfer -- - print <Customer agrees to be bound by NSI's -- --Domain Name Registration Agreement -- --

      Domain -
      Purpose/Description: -
      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 --cc htdocs/images/mid-logo.gif index 4ceb3add5,4ceb3add5..000000000 deleted file mode 100644,100644 Binary files differ diff --cc htdocs/images/small-logo.gif index a8e9c5763,a8e9c5763..000000000 deleted file mode 100644,100644 Binary files differ diff --cc htdocs/index.html index 052aed3ed,de0667e59..000000000 deleted file mode 100755,100755 --- a/htdocs/index.html +++ /dev/null @@@ -1,94 -1,96 +1,0 @@@ -- -- -- -- Freeside Main Menu -- -- -- -- -- --
      --

      -- Silicon Interactive Software Design --

      --
      freeside main menu
      --
      -- - Freeside home page - Information -- --
      -- Documentation -- --

      --
      - - - -- -- diff --cc htdocs/misc/bill.cgi index 52323ba59,d41f6d1c9..000000000 deleted file mode 100755,100755 --- a/htdocs/misc/bill.cgi +++ /dev/null @@@ -1,58 -1,66 +1,0 @@@ --#!/usr/bin/perl -Tw - # - # $Id: bill.cgi,v 1.5 1999-08-12 04:32:21 ivan Exp $ --# --# 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 - # - # $Log: bill.cgi,v $ - # Revision 1.5 1999-08-12 04:32:21 ivan - # hidecancelledcustomers - # - # Revision 1.4 1999/01/19 05:14:02 ivan - # for mod_perl: no more top-level my() variables; use vars instead - # also the last s/create/new/; - # - # Revision 1.3 1998/12/23 03:01:13 ivan - # $cgi->keywords instead of $cgi->query_string - # - # Revision 1.2 1998/12/17 09:12:41 ivan - # s/CGI::(Request|Base)/CGI.pm/; - # -- --use strict; - use vars qw( $cgi $query $custnum $cust_main $error ); - use CGI; -use CGI::Base qw(:DEFAULT :CGI); --use CGI::Carp qw(fatalsToBrowser); --use FS::UID qw(cgisuidsetup); - use FS::CGI qw(popurl eidiot); --use FS::Record qw(qsearchs); - use FS::cust_main; -use FS::Bill; -- - $cgi = new CGI; -my($cgi) = new CGI::Base; -$cgi->get; --&cgisuidsetup($cgi); -- --#untaint custnum - ($query) = $cgi->keywords; - $query =~ /^(\d*)$/; - $custnum = $1; - $cust_main = qsearchs('cust_main',{'custnum'=>$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 -- ); - &eidiot($error) if $error; -&idiot($error) if $error; -- --$error = $cust_main->collect( --# 'invoice-time'=>$time, --# 'batch_card'=> 'yes', -- 'batch_card'=> 'no', -- 'report_badcard'=> 'yes', -- ); - &eidiot($error) if $error; -&idiot($error) if $error; -- - print $cgi->redirect(popurl(2). "view/cust_main.cgi?$custnum"); -$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 --cc htdocs/misc/cancel-unaudited.cgi index 78b7d3175,929274f38..000000000 deleted file mode 100755,100755 --- a/htdocs/misc/cancel-unaudited.cgi +++ /dev/null @@@ -1,78 -1,85 +1,0 @@@ --#!/usr/bin/perl -Tw --# - # $Id: cancel-unaudited.cgi,v 1.6 1999-02-28 00:03:48 ivan Exp $ -# 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 - # - # $Log: cancel-unaudited.cgi,v $ - # Revision 1.6 1999-02-28 00:03:48 ivan - # removed misleading comments - # - # Revision 1.5 1999/02/07 09:59:34 ivan - # more mod_perl fixes, and bugfixes Peter Wemm sent via email - # - # Revision 1.4 1999/01/19 05:14:03 ivan - # for mod_perl: no more top-level my() variables; use vars instead - # also the last s/create/new/; - # - # Revision 1.3 1998/12/23 03:02:05 ivan - # $cgi->keywords instead of $cgi->query_string - # - # Revision 1.2 1998/12/17 09:12:42 ivan - # s/CGI::(Request|Base)/CGI.pm/; - # -- --use strict; - use vars qw( $cgi $query $svcnum $svc_acct $cust_svc $error ); - use CGI; -use CGI::Base qw(:DEFAULT :CGI); # CGI module --use CGI::Carp qw(fatalsToBrowser); --use FS::UID qw(cgisuidsetup); - use FS::CGI qw(popurl eidiot); --use FS::Record qw(qsearchs); --use FS::cust_svc; --use FS::svc_acct; -- - $cgi = new CGI; -my($cgi) = new CGI::Base; -$cgi->get; --&cgisuidsetup($cgi); -- --#untaint svcnum - ($query) = $cgi->keywords; - $query =~ /^(\d+)$/; - $svcnum = $1; -$QUERY_STRING =~ /^(\d+)$/; -my($svcnum)=$1; -- - $svc_acct = qsearchs('svc_acct',{'svcnum'=>$svcnum}); - die "Unknown svcnum!" unless $svc_acct; -my($svc_acct) = qsearchs('svc_acct',{'svcnum'=>$svcnum}); -&idiot("Unknown svcnum!") unless $svc_acct; -- - $cust_svc = qsearchs('cust_svc',{'svcnum'=>$svcnum}); - &eidiot(qq!This account has already been audited. Cancel the - getfield('pkgnum') . -- qq!pkgnum"> 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; - &eidiot($error) if $error; -&idiot($error) if $error; --$error = $svc_acct->delete; - &eidiot($error) if $error; -&idiot($error) if $error; -- -bless($cust_svc,"FS::cust_svc"); --$error = $cust_svc->delete; - &eidiot($error) if $error; -&idiot($error) if $error; -- - print $cgi->redirect(popurl(2)); -$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 --cc htdocs/misc/cancel_pkg.cgi index 7bbcf6e7f,6702a0351..000000000 deleted file mode 100755,100755 --- a/htdocs/misc/cancel_pkg.cgi +++ /dev/null @@@ -1,71 -1,54 +1,0 @@@ --#!/usr/bin/perl -Tw --# - # $Id: cancel_pkg.cgi,v 1.6 1999-04-08 10:35:02 ivan Exp $ -# 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 - # - # $Log: cancel_pkg.cgi,v $ - # Revision 1.6 1999-04-08 10:35:02 ivan - # import necessary subroutines from FS::CGI - # - # Revision 1.5 1999/02/28 00:03:49 ivan - # removed misleading comments - # - # Revision 1.4 1999/01/19 05:14:04 ivan - # for mod_perl: no more top-level my() variables; use vars instead - # also the last s/create/new/; - # - # Revision 1.3 1998/12/23 03:02:54 ivan - # $cgi->keywords instead of $cgi->query_string - # - # Revision 1.2 1998/12/17 09:12:43 ivan - # s/CGI::(Request|Base)/CGI.pm/; - # -- --use strict; - use vars qw ( $cgi $query $pkgnum $cust_pkg $error ); - use CGI; -use CGI::Base qw(:DEFAULT :CGI); # CGI module --use CGI::Carp qw(fatalsToBrowser); --use FS::UID qw(cgisuidsetup); - use FS::CGI qw(eidiot popurl); --use FS::Record qw(qsearchs); - use FS::CGI qw(popurl eidiot); --use FS::cust_pkg; -use FS::CGI qw(idiot); -- - $cgi = new CGI; -my($cgi) = new CGI::Base; -$cgi->get; --&cgisuidsetup($cgi); -- --#untaint pkgnum - ($query) = $cgi->keywords; - $query =~ /^(\d+)$/ || die "Illegal pkgnum"; - $pkgnum = $1; -$QUERY_STRING =~ /^(\d+)$/ || die "Illegal pkgnum"; -my($pkgnum)=$1; -- - $cust_pkg = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum}); -my($cust_pkg) = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum}); -- - $error = $cust_pkg->cancel; - eidiot($error) if $error; -bless($cust_pkg,'FS::cust_pkg'); -my($error)=$cust_pkg->cancel; -idiot($error) if $error; -- - print $cgi->redirect(popurl(2). "view/cust_main.cgi?".$cust_pkg->getfield('custnum')); -$cgi->redirect("../view/cust_main.cgi?".$cust_pkg->getfield('custnum')); -- diff --cc htdocs/misc/expire_pkg.cgi index cf1f23153,163516627..000000000 deleted file mode 100755,100755 --- a/htdocs/misc/expire_pkg.cgi +++ /dev/null @@@ -1,61 -1,71 +1,0 @@@ --#!/usr/bin/perl -Tw --# - # $Id: expire_pkg.cgi,v 1.4 1999-02-28 00:03:50 ivan Exp $ -# 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 - # - # $Log: expire_pkg.cgi,v $ - # Revision 1.4 1999-02-28 00:03:50 ivan - # removed misleading comments - # - # Revision 1.3 1999/01/19 05:14:05 ivan - # for mod_perl: no more top-level my() variables; use vars instead - # also the last s/create/new/; - # - # Revision 1.2 1998/12/17 09:12:44 ivan - # s/CGI::(Request|Base)/CGI.pm/; - # -- --use strict; - use vars qw ( $cgi $date $pkgnum $cust_pkg %hash $new $error ); --use Date::Parse; - use CGI; -use CGI::Request; --use CGI::Carp qw(fatalsToBrowser); --use FS::UID qw(cgisuidsetup); - use FS::CGI qw(popurl eidiot); --use FS::Record qw(qsearchs); --use FS::cust_pkg; -- - $cgi = new CGI; - &cgisuidsetup($cgi); -my($req) = new CGI::Request; -&cgisuidsetup($req->cgi); -- --#untaint date & pkgnum -- - if ( $cgi->param('date') ) { - str2time($cgi->param('date')) =~ /^(\d+)$/ or die "Illegal date"; -my($date); -if ( $req->param('date') ) { - str2time($req->param('date')) =~ /^(\d+)$/ or die "Illegal date"; -- $date=$1; --} else { -- $date=''; --} -- - $cgi->param('pkgnum') =~ /^(\d+)$/ or die "Illegal pkgnum"; - $pkgnum = $1; -$req->param('pkgnum') =~ /^(\d+)$/ or die "Illegal pkgnum"; -my($pkgnum)=$1; -- - $cust_pkg = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum}); - %hash = $cust_pkg->hash; -my($cust_pkg) = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum}); -my(%hash)=$cust_pkg->hash; --$hash{expire}=$date; - $new = new FS::cust_pkg ( \%hash ); - $error = $new->replace($cust_pkg); - &eidiot($error) if $error; -my($new)=create FS::cust_pkg ( \%hash ); -my($error) = $new->replace($cust_pkg); -&idiot($error) if $error; -- - print $cgi->redirect(popurl(2). "view/cust_main.cgi?".$cust_pkg->getfield('custnum')); -$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 --cc htdocs/misc/link.cgi index eb1780711,d1db000ec..000000000 deleted file mode 100755,100755 --- a/htdocs/misc/link.cgi +++ /dev/null @@@ -1,85 -1,72 +1,0 @@@ --#!/usr/bin/perl -Tw --# - # $Id: link.cgi,v 1.7 1999-04-08 11:31:40 ivan Exp $ -# 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 - # - # $Log: link.cgi,v $ - # Revision 1.7 1999-04-08 11:31:40 ivan - # *** empty log message *** - # - # Revision 1.6 1999/02/28 00:03:51 ivan - # removed misleading comments - # - # Revision 1.5 1999/01/19 05:14:06 ivan - # for mod_perl: no more top-level my() variables; use vars instead - # also the last s/create/new/; - # - # Revision 1.4 1999/01/18 09:41:36 ivan - # all $cgi->header calls now include ( '-expires' => 'now' ) for mod_perl - # (good idea anyway) - # - # Revision 1.3 1998/12/23 03:03:39 ivan - # $cgi->keywords instead of $cgi->query_string - # - # Revision 1.2 1998/12/17 09:12:45 ivan - # s/CGI::(Request|Base)/CGI.pm/; - # -- --use strict; - use vars qw ( %link_field $cgi $pkgnum $svcpart $query $part_svc $svc $svcdb - $link_field ); - use CGI; - use CGI::Carp qw(fatalsToBrowser); -use CGI::Base qw(:DEFAULT :CGI); --use FS::UID qw(cgisuidsetup); - use FS::CGI qw(popurl header); --use FS::Record qw(qsearchs); -- - %link_field = ( -my(%link_field)=( -- 'svc_acct' => 'username', -- 'svc_domain' => 'domain', -- 'svc_acct_sm' => '', -- 'svc_charge' => '', -- 'svc_wo' => '', --); -- - $cgi = new CGI; -my($cgi) = new CGI::Base; -$cgi->get; --cgisuidsetup($cgi); -- - ($query) = $cgi->keywords; - foreach $_ (split(/-/,$query)) { #get & untaint pkgnum & svcpart -my($pkgnum,$svcpart); -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}); - $svc = $part_svc->getfield('svc'); - $svcdb = $part_svc->getfield('svcdb'); - $link_field = $link_field{$svcdb}; -my($part_svc) = qsearchs('part_svc',{'svcpart'=>$svcpart}); -my($svc) = $part_svc->getfield('svc'); -my($svcdb) = $part_svc->getfield('svcdb'); -my($link_field) = $link_field{$svcdb}; -- - print $cgi->header( '-expires' => 'now' ), header("Link to existing $svc"), - qq!
      !; -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 --cc htdocs/misc/print-invoice.cgi index 213f15406,084dcc1c4..000000000 deleted file mode 100755,100755 --- a/htdocs/misc/print-invoice.cgi +++ /dev/null @@@ -1,51 -1,57 +1,0 @@@ --#!/usr/bin/perl -Tw - # - # $Id: print-invoice.cgi,v 1.4 1999-01-19 05:14:07 ivan Exp $ --# --# 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 - # - # $Log: print-invoice.cgi,v $ - # Revision 1.4 1999-01-19 05:14:07 ivan - # for mod_perl: no more top-level my() variables; use vars instead - # also the last s/create/new/; - # - # Revision 1.3 1998/12/23 03:04:24 ivan - # $cgi->keywords instead of $cgi->query_string - # - # Revision 1.2 1998/12/17 09:12:47 ivan - # s/CGI::(Request|Base)/CGI.pm/; - # -- --use strict; - use vars qw($conf $cgi $lpr $query $invnum $cust_bill $custnum ); - use CGI; -use CGI::Base qw(:DEFAULT :CGI); --use CGI::Carp qw(fatalsToBrowser); --use FS::UID qw(cgisuidsetup); - use FS::CGI qw(popurl); --use FS::Record qw(qsearchs); - use FS::cust_bill; -use FS::Invoice; -- - $cgi = new CGI; - &cgisuidsetup($cgi); -my($lpr) = "|lpr -h"; -- - $conf = new FS::Conf; - $lpr = $conf->config('lpr'); -my($cgi) = new CGI::Base; -$cgi->get; -&cgisuidsetup($cgi); -- --#untaint invnum - ($query) = $cgi->keywords; - $query =~ /^(\d*)$/; - $invnum = $1; - $cust_bill = qsearchs('cust_bill',{'invnum'=>$invnum}); -$QUERY_STRING =~ /^(\d*)$/; -my($invnum)=$1; -my($cust_bill)=qsearchs('cust_bill',{'invnum'=>$invnum}); --die "Can't find invoice!\n" unless $cust_bill; -- - open(LPR,"|$lpr") or die "Can't open $lpr: $!"; - 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"; -- - $custnum = $cust_bill->getfield('custnum'); -my($custnum)=$cust_bill->getfield('custnum'); -- - print $cgi->redirect(popurl(2). "view/cust_main.cgi?$custnum#history"); -$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 --cc htdocs/misc/process/link.cgi index eec43cf47,23fb05386..000000000 deleted file mode 100755,100755 --- a/htdocs/misc/process/link.cgi +++ /dev/null @@@ -1,73 -1,73 +1,0 @@@ --#!/usr/bin/perl -Tw --# - # $Id: link.cgi,v 1.5 1999-04-15 14:09:17 ivan Exp $ -# 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 - # - # $Log: link.cgi,v $ - # Revision 1.5 1999-04-15 14:09:17 ivan - # get rid of top-level my() variables - # - # Revision 1.4 1999/02/07 09:59:35 ivan - # more mod_perl fixes, and bugfixes Peter Wemm sent via email - # - # Revision 1.3 1999/01/19 05:14:10 ivan - # for mod_perl: no more top-level my() variables; use vars instead - # also the last s/create/new/; - # - # Revision 1.2 1998/12/17 09:15:00 ivan - # s/CGI::Request/CGI.pm/; - # -- --use strict; - use vars qw ( $cgi $old $new $error $pkgnum $svcpart $svcnum ); - use CGI; -use CGI::Request; --use CGI::Carp qw(fatalsToBrowser); - use FS::CGI qw(popurl idiot); -use FS::CGI qw(idiot); --use FS::UID qw(cgisuidsetup); --use FS::cust_svc; --use FS::Record qw(qsearchs); -- - $cgi = new CGI; - cgisuidsetup($cgi); -my($req)=new CGI::Request; # create form object -cgisuidsetup($req->cgi); -- - $cgi->param('pkgnum') =~ /^(\d+)$/; - $pkgnum = $1; - $cgi->param('svcpart') =~ /^(\d+)$/; - $svcpart = $1; - $cgi->param('svcnum') =~ /^(\d*)$/; - $svcnum = $1; -#$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'); - $cgi->param('link_field') =~ /^(\w+)$/; my($link_field)=$1; - my($svc_acct)=qsearchs($svcdb,{$link_field => $cgi->param('link_value') }); - eidiot("$link_field not found!") unless $svc_acct; - $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; --} -- - $old = qsearchs('cust_svc',{'svcnum'=>$svcnum}); -my($old)=qsearchs('cust_svc',{'svcnum'=>$svcnum}); --die "svcnum not found!" unless $old; - $new = new FS::cust_svc ({ -my($new)=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. - print $cgi->redirect(popurl(3). "view/cust_pkg.cgi?$pkgnum"); - $req->cgi->redirect("../../view/cust_pkg.cgi?$pkgnum"); --} else { - idiot($error); - 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 --cc htdocs/misc/susp_pkg.cgi index abe4f70b0,7b23caeb2..000000000 deleted file mode 100755,100755 --- a/htdocs/misc/susp_pkg.cgi +++ /dev/null @@@ -1,64 -1,68 +1,0 @@@ --#!/usr/bin/perl -Tw --# - # $Id: susp_pkg.cgi,v 1.6 1999-04-08 10:35:02 ivan Exp $ -# 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 - # - # $Log: susp_pkg.cgi,v $ - # Revision 1.6 1999-04-08 10:35:02 ivan - # import necessary subroutines from FS::CGI - # - # Revision 1.5 1999/02/28 00:03:52 ivan - # removed misleading comments - # - # Revision 1.4 1999/01/19 05:14:08 ivan - # for mod_perl: no more top-level my() variables; use vars instead - # also the last s/create/new/; - # - # Revision 1.3 1998/12/23 03:04:56 ivan - # $cgi->keywords instead of $cgi->query_string - # - # Revision 1.2 1998/12/17 09:12:48 ivan - # s/CGI::(Request|Base)/CGI.pm/; - # -- --use strict; - use vars qw( $cgi $query $pkgnum $cust_pkg $error ); - use CGI; -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::CGI qw(popurl eidiot); --use FS::cust_pkg; -- - $cgi = new CGI; -my($cgi) = new CGI::Base; -$cgi->get; --&cgisuidsetup($cgi); -- --#untaint pkgnum - ($query) = $cgi->keywords; - $query =~ /^(\d+)$/ || die "Illegal pkgnum"; - $pkgnum = $1; -$QUERY_STRING =~ /^(\d+)$/ || die "Illegal pkgnum"; -my($pkgnum)=$1; -- - $cust_pkg = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum}); -my($cust_pkg) = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum}); -- - $error = $cust_pkg->suspend; - &eidiot($error) if $error; -bless($cust_pkg,'FS::cust_pkg'); -my($error)=$cust_pkg->suspend; -&idiot($error) if $error; -- - print $cgi->redirect(popurl(2). "view/cust_main.cgi?".$cust_pkg->getfield('custnum')); -$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 --cc htdocs/misc/unsusp_pkg.cgi index 9e60064c3,2f340c6fa..000000000 deleted file mode 100755,100755 --- a/htdocs/misc/unsusp_pkg.cgi +++ /dev/null @@@ -1,61 -1,68 +1,0 @@@ --#!/usr/bin/perl -Tw --# - # $Id: unsusp_pkg.cgi,v 1.5 1999-02-28 00:03:53 ivan Exp $ -# 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 - # - # $Log: unsusp_pkg.cgi,v $ - # Revision 1.5 1999-02-28 00:03:53 ivan - # removed misleading comments - # - # Revision 1.4 1999/01/19 05:14:09 ivan - # for mod_perl: no more top-level my() variables; use vars instead - # also the last s/create/new/; - # - # Revision 1.3 1998/12/23 03:05:25 ivan - # $cgi->keywords instead of $cgi->query_string - # - # Revision 1.2 1998/12/17 09:12:49 ivan - # s/CGI::(Request|Base)/CGI.pm/; - # -- --use strict; - use vars qw( $cgi $query $pkgnum $cust_pkg $error ); - use CGI; -use CGI::Base qw(:DEFAULT :CGI); # CGI module --use CGI::Carp qw(fatalsToBrowser); --use FS::UID qw(cgisuidsetup); - use FS::CGI qw(popurl eidiot); --use FS::Record qw(qsearchs); --use FS::cust_pkg; -- - $cgi = new CGI; -my($cgi) = new CGI::Base; -$cgi->get; --&cgisuidsetup($cgi); -- --#untaint pkgnum - ($query) = $cgi->keywords; - $query =~ /^(\d+)$/ || die "Illegal pkgnum"; - $pkgnum = $1; -$QUERY_STRING =~ /^(\d+)$/ || die "Illegal pkgnum"; -my($pkgnum)=$1; -- - $cust_pkg = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum}); -my($cust_pkg) = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum}); -- - $error = $cust_pkg->unsuspend; - &eidiot($error) if $error; -bless($cust_pkg,'FS::cust_pkg'); -my($error)=$cust_pkg->unsuspend; -&idiot($error) if $error; -- - print $cgi->redirect(popurl(2). "view/cust_main.cgi?".$cust_pkg->getfield('custnum')); -$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 --cc htdocs/search/cust_bill.cgi index c849341e3,5be84b79e..000000000 deleted file mode 100755,100755 --- a/htdocs/search/cust_bill.cgi +++ /dev/null @@@ -1,44 -1,46 +1,0 @@@ --#!/usr/bin/perl -Tw --# - # $Id: cust_bill.cgi,v 1.4 1999-02-28 00:03:54 ivan Exp $ -# 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 - # - # $Log: cust_bill.cgi,v $ - # Revision 1.4 1999-02-28 00:03:54 ivan - # removed misleading comments - # - # Revision 1.3 1999/01/19 05:14:11 ivan - # for mod_perl: no more top-level my() variables; use vars instead - # also the last s/create/new/; - # - # Revision 1.2 1998/12/17 09:41:07 ivan - # s/CGI::(Base|Request)/CGI.pm/; - # -- --use strict; - use vars qw ( $cgi $invnum ); - use CGI; - use CGI::Carp qw(fatalsToBrowser); -use CGI::Request; --use FS::UID qw(cgisuidsetup); - use FS::CGI qw(popurl idiot); --use FS::Record qw(qsearchs); -- - $cgi = new CGI; - cgisuidsetup($cgi); -my($req)=new CGI::Request; -cgisuidsetup($req->cgi); -- - $cgi->param('invnum') =~ /^\s*(FS-)?(\d+)\s*$/; - $invnum = $2; -$req->param('invnum') =~ /^\s*(FS-)?(\d+)\s*$/; -my($invnum)=$2; -- --if ( qsearchs('cust_bill',{'invnum'=>$invnum}) ) { - print $cgi->redirect(popurl(2). "view/cust_bill.cgi?$invnum"); #redirect - $req->cgi->redirect("../view/cust_bill.cgi?$invnum"); #redirect --} else { #error - idiot("Invoice not found."); - CGI::Base::SendHeaders(); # one guess - print < - - Invoice Search Error - - -
      -

      Invoice Search Error

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

      Invoice Search

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

      -- --

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

      Customer Search

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

      -- --

      -
      -- -- -- diff --cc htdocs/search/cust_main.cgi index ef076f97e,70ce991f7..000000000 deleted file mode 100755,100755 --- a/htdocs/search/cust_main.cgi +++ /dev/null @@@ -1,298 -1,235 +1,0 @@@ --#!/usr/bin/perl -Tw --# - # $Id: cust_main.cgi,v 1.14 1999-08-12 04:45:21 ivan Exp $ -# 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 - # - # $Log: cust_main.cgi,v $ - # Revision 1.14 1999-08-12 04:45:21 ivan - # typo - missed a paren - # - # Revision 1.13 1999/08/12 04:32:21 ivan - # hidecancelledcustomers - # - # Revision 1.12 1999/07/17 10:38:52 ivan - # scott nelson noticed this mod_perl-triggered bug and - # gave me a great bugreport at the last rhythmethod - # - # Revision 1.11 1999/04/09 04:22:34 ivan - # also table() - # - # Revision 1.10 1999/04/09 03:52:55 ivan - # explicit & for table/itable/ntable - # - # Revision 1.9 1999/02/28 00:03:55 ivan - # removed misleading comments - # - # Revision 1.8 1999/02/07 09:59:36 ivan - # more mod_perl fixes, and bugfixes Peter Wemm sent via email - # - # Revision 1.7 1999/01/25 12:19:11 ivan - # yet more mod_perl stuff - # - # Revision 1.6 1999/01/19 05:14:12 ivan - # for mod_perl: no more top-level my() variables; use vars instead - # also the last s/create/new/; - # - # Revision 1.5 1999/01/18 09:41:37 ivan - # all $cgi->header calls now include ( '-expires' => 'now' ) for mod_perl - # (good idea anyway) - # - # Revision 1.4 1998/12/30 00:57:50 ivan - # bug - # - # Revision 1.3 1998/12/17 09:41:08 ivan - # s/CGI::(Base|Request)/CGI.pm/; - # - # Revision 1.2 1998/11/12 08:10:22 ivan - # CGI.pm instead of CGI-modules - # relative URLs using popurl - # got rid of lots of little tables - # s/agrep/String::Approx/; - # bubble up packages and services and link (slow) - # -- --use strict; - #use vars qw( $conf %ncancelled_pkgs %all_pkgs $cgi @cust_main $sortby ); - use vars qw( $conf %all_pkgs $cgi @cust_main $sortby ); - use CGI; -use CGI::Request; --use CGI::Carp qw(fatalsToBrowser); --use IO::Handle; - use String::Approx qw(amatch); -use IPC::Open2; --use FS::UID qw(cgisuidsetup); --use FS::Record qw(qsearch qsearchs); - use FS::CGI qw(header menubar eidiot popurl table); - use FS::cust_main; -use FS::CGI qw(header idiot); -- - $cgi = new CGI; - cgisuidsetup($cgi); -my($fuzziness)=2; #fuzziness for fuzzy searches, see man agrep - #0-4: 0=no fuzz, 4=very fuzzy (too much fuzz!) -- - $conf = new FS::Conf; -my($req)=new CGI::Request; -&cgisuidsetup($req->cgi); -- - if ( $cgi->keywords ) { - my($query)=$cgi->keywords; - 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 { - @cust_main=(); - &cardsearch if ( $cgi->param('card_on') && $cgi->param('card') ); - &lastsearch if ( $cgi->param('last_on') && $cgi->param('last_text') ); - &companysearch if ( $cgi->param('company_on') && $cgi->param('company_text') ); - } -my(@cust_main); -my($sortby); -- - @cust_main = grep { $_->ncancelled_pkgs || ! $_->all_pkgs } @cust_main - if $conf->exists('hidecancelledcustomers'); - if ( $conf->exists('hidecancelledpackages' ) ) { - %all_pkgs = map { $_->custnum => [ $_->ncancelled_pkgs ] } @cust_main; -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 { - %all_pkgs = map { $_->custnum => [ $_->all_pkgs ] } @cust_main; - &cardsearch if ($req->param('card_on') ); - &lastsearch if ($req->param('last_on') ); - &companysearch if ($req->param('company_on') ); --} -- --if ( scalar(@cust_main) == 1 ) { - print $cgi->redirect(popurl(2). "view/cust_main.cgi?". $cust_main[0]->custnum); - $req->cgi->redirect("../view/cust_main.cgi?". $cust_main[0]->custnum); -- exit; --} elsif ( scalar(@cust_main) == 0 ) { - eidiot "No matching customers found!\n"; - idiot "No matching customers found!\n"; - exit; --} else { -- -- my($total)=scalar(@cust_main); - print $cgi->header( '-expires' => 'now' ), header("Customer Search Results",menubar( - 'Main Menu', popurl(2) - )), "$total matching customers found
      ", &table(), < -- - - Cust. # -- Contact name -- Company - Packages - Services -- --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, -- ); - - my(@lol_cust_svc); - my($rowspan)=0;#scalar( @{$all_pkgs{$custnum}} ); - foreach ( @{$all_pkgs{$custnum}} ) { - my(@cust_svc) = qsearch( 'cust_svc', { 'pkgnum' => $_->pkgnum } ); - push @lol_cust_svc, \@cust_svc; - $rowspan += scalar(@cust_svc) || 1; - } - - #my($rowspan) = scalar(@{$all_pkgs{$custnum}}); - my($view) = popurl(2). "view/cust_main.cgi?$custnum"; -- print < - $custnum - $last, $first - $company - $custnum - $last, $first - $company - --END - - my($n1)=''; - foreach ( @{$all_pkgs{$custnum}} ) { - my($pkgnum) = ($_->pkgnum); - my($pkg) = $_->part_pkg->pkg; - my $comment = $_->part_pkg->comment; - my($pkgview) = popurl(2). "/view/cust_pkg.cgi?$pkgnum"; - #my(@cust_svc) = shift @lol_cust_svc; - my(@cust_svc) = qsearch( 'cust_svc', { 'pkgnum' => $_->pkgnum } ); - my($rowspan) = scalar(@cust_svc) || 1; - - print $n1, qq!$pkg - $comment!; - my($n2)=''; - foreach my $cust_svc ( @cust_svc ) { - my($label, $value, $svcdb) = $cust_svc->label; - my($svcnum) = $cust_svc->svcnum; - my($sview) = popurl(2). "/view"; - print $n2,qq!$label!, - qq!$value!; - $n2=""; - } - #print qq!\n!; - $n1=""; - if ($lcount-- == 0) { # lots of little tables instead of one big one - $lcount=$lines; - print < - - - - - -END -- } - print "<\TR>"; -- } -- -- print < - -- -- --END -- --} -- --# -- --sub last_sort { -- $a->getfield('last') cmp $b->getfield('last'); --} -- --sub company_sort { - return -1 if $a->company && ! $b->company; - return 1 if ! $a->company && $b->company; -- $a->getfield('company') cmp $b->getfield('company'); --} -- --sub custnum_sort { -- $a->getfield('custnum') <=> $b->getfield('custnum'); --} -- --sub cardsearch { -- - my($card)=$cgi->param('card'); - my($card)=$req->param('card'); -- $card =~ s/\D//g; - $card =~ /^(\d{13,16})$/ or eidiot "Illegal card number\n"; - $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 ( $cgi->param('last_type') ) { - foreach ( $req->param('last_type') ) { -- $last_type{$_}++; -- } -- - $cgi->param('last_text') =~ /^([\w \,\.\-\']*)$/ - or eidiot "Illegal last name"; - $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'}) { - foreach ( amatch($last, [ qw(i) ], @all_last) ) { - $last{$_}++; - } - 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 ( $cgi->param('company_type') ) { - foreach ( $req->param('company_type') ) { -- $company_type{$_}++ -- }; -- - $cgi->param('company_text') =~ /^([\w \,\.\-\']*)$/ - or eidiot "Illegal company"; - $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'}) { - foreach ( amatch($company, [ qw(i) ], @all_company ) ) { - 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 --cc htdocs/search/cust_main.html index 3184698b4,656943f9c..000000000 deleted file mode 100755,100755 --- a/htdocs/search/cust_main.html +++ /dev/null @@@ -1,36 -1,36 +1,0 @@@ -- -- -- Customer Search -- - - - Customer Search - -
      - -
      -

      Customer Search

      -
      -
      --
      - Search for last name: - Search for last name: -- - using search method: --
      -- -- - - -- -- --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, -- ); - my $p = popurl(2); -- print < - - - - - - - - -- --END - - if ($lcount-- == 0) { # lots of little tables instead of one big one - $lcount=$lines; - print < -
      Cust. #Contact nameCompany -
      Package #Customer #Contact nameNameCompany
      $pkgnum$custnum$name$company$pkgnum$custnum$name$company
      - - - - - - -END - } -- } -- -- print < - -- -- --END -- exit; -- --} -- --sub pkgnum_sort { -- $a->getfield('pkgnum') <=> $b->getfield('pkgnum'); --} -- diff --cc htdocs/search/svc_acct.cgi index 850865789,250a741db..000000000 deleted file mode 100755,100755 --- a/htdocs/search/svc_acct.cgi +++ /dev/null @@@ -1,207 -1,186 +1,0 @@@ --#!/usr/bin/perl -Tw --# - # $Id: svc_acct.cgi,v 1.11 1999-04-14 11:25:33 ivan Exp $ -# 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 - # - # $Log: svc_acct.cgi,v $ - # Revision 1.11 1999-04-14 11:25:33 ivan - # *** empty log message *** - # - # Revision 1.10 1999/04/14 11:20:21 ivan - # visual fix - # - # Revision 1.9 1999/04/10 01:53:18 ivan - # oops, search usernames limited to 8 chars - # - # Revision 1.8 1999/04/09 23:43:29 ivan - # just in case - # - # Revision 1.7 1999/02/07 09:59:38 ivan - # more mod_perl fixes, and bugfixes Peter Wemm sent via email - # - # Revision 1.6 1999/01/19 05:14:14 ivan - # for mod_perl: no more top-level my() variables; use vars instead - # also the last s/create/new/; - # - # Revision 1.5 1999/01/18 09:41:39 ivan - # all $cgi->header calls now include ( '-expires' => 'now' ) for mod_perl - # (good idea anyway) - # - # Revision 1.4 1999/01/18 09:22:34 ivan - # changes to track email addresses for email invoicing - # - # Revision 1.3 1998/12/23 03:06:28 ivan - # $cgi->keywords instead of $cgi->query_string - # - # Revision 1.2 1998/12/17 09:41:10 ivan - # s/CGI::(Base|Request)/CGI.pm/; - # -- --use strict; - use vars qw( $cgi @svc_acct $sortby $query ); - use CGI; -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 eidiot popurl table); - use FS::svc_acct; - use FS::cust_main; -use FS::CGI qw(header idiot); -- - $cgi = new CGI; - &cgisuidsetup($cgi); -my($req)=new CGI::Request; # create form object -&cgisuidsetup($req->cgi); -- - ($query)=$cgi->keywords; - $query ||= ''; #to avoid use of unitialized value errors -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 { - $sortby=\*uid_sort; -- &usernamesearch; --} -- --if ( scalar(@svc_acct) == 1 ) { -- my($svcnum)=$svc_acct[0]->svcnum; - print $cgi->redirect(popurl(2). "view/svc_acct.cgi?$svcnum"); #redirect - $req->cgi->redirect("../view/svc_acct.cgi?$svcnum"); #redirect -- exit; --} elsif ( scalar(@svc_acct) == 0 ) { #error - eidiot("Account not found"); - idiot("Account not found"); - exit; --} else { -- my($total)=scalar(@svc_acct); - print $cgi->header( '-expires' => 'now' ), - header("Account Search Results",''), - "$total matching accounts found", - &table(), < -- - - - - - - - - - - - - - - -- --END -- - my($lines)=16; - my($lcount)=$lines; -- my(%saw,$svc_acct); - my $p = popurl(2); -- 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" - ? "$custnum" -- : "(unlinked)" -- ; - my($pname) = $custnum ? "$last, $first" : ''; - my $pcompany = $custnum ? "$company" : ''; - 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 nameCompanyService #UsernameUIDServiceCustomer #Contact nameCompany
      $svcnum$username$uid$svcnum$username$uid$svc -- $pcustnum -- $pname - $pcompany - $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 { -- - $cgi->param('username') =~ /^([\w\d\-]+)$/; #untaint username_text - $req->param('username') =~ /^([\w\d\-]{2,8})$/; #untaint username_text -- my($username)=$1; -- -- @svc_acct=qsearch('svc_acct',{'username'=>$username}); -- --} -- -- diff --cc htdocs/search/svc_acct.html index 91291be99,91291be99..000000000 deleted file mode 100755,100755 --- a/htdocs/search/svc_acct.html +++ /dev/null @@@ -1,21 -1,21 +1,0 @@@ -- -- -- Account Search -- -- --
      --

      Account Search

      --
      --
      --
      -- Search for username: -- -- --

      -- -- -- --


      -- -- -- diff --cc htdocs/search/svc_acct_sm.cgi index ddf2a1f23,3b1a4cf4e..000000000 deleted file mode 100755,100755 --- a/htdocs/search/svc_acct_sm.cgi +++ /dev/null @@@ -1,140 -1,128 +1,0 @@@ --#!/usr/bin/perl -Tw --# - # $Id: svc_acct_sm.cgi,v 1.10 1999-07-20 06:03:36 ivan Exp $ -# 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 - # - # $Log: svc_acct_sm.cgi,v $ - # Revision 1.10 1999-07-20 06:03:36 ivan - # s/CGI::Request/CGI/; (how'd i miss that before?) - # - # Revision 1.9 1999/04/09 04:22:34 ivan - # also table() - # - # Revision 1.8 1999/04/09 03:52:55 ivan - # explicit & for table/itable/ntable - # - # Revision 1.7 1999/02/28 00:03:56 ivan - # removed misleading comments - # - # Revision 1.6 1999/02/09 09:22:58 ivan - # visual and bugfixes - # - # Revision 1.5 1999/01/19 05:14:16 ivan - # for mod_perl: no more top-level my() variables; use vars instead - # also the last s/create/new/; - # - # Revision 1.4 1999/01/18 09:41:40 ivan - # all $cgi->header calls now include ( '-expires' => 'now' ) for mod_perl - # (good idea anyway) - # - # Revision 1.3 1998/12/17 09:41:11 ivan - # s/CGI::(Base|Request)/CGI.pm/; - # -- --use strict; - use vars qw( $conf $cgi $mydomain $domuser $svc_domain $domsvc @svc_acct_sm ); - use CGI; -use CGI::Request; --use CGI::Carp qw(fatalsToBrowser); --use FS::UID qw(cgisuidsetup); - use FS::CGI qw(popurl idiot header table); --use FS::Record qw(qsearch qsearchs); - use FS::Conf; - use FS::svc_domain; - use FS::svc_acct_sm; - use FS::svc_acct; -- - $cgi = new CGI; - &cgisuidsetup($cgi); -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; -- - $conf = new FS::Conf; - $mydomain = $conf->config('domain'); -my($req)=new CGI::Request; # create form object -&cgisuidsetup($req->cgi); -- - $cgi->param('domuser') =~ /^([a-z0-9_\-]{0,32})$/; - $domuser = $1; -$req->param('domuser') =~ /^([a-z0-9_\-]{0,32})$/; -my($domuser)=$1; -- - $cgi->param('domain') =~ /^([\w\-\.]+)$/ or die "Illegal domain"; - $svc_domain = qsearchs('svc_domain',{'domain'=>$1}) -$req->param('domain') =~ /^([\w\-\.]+)$/ or die "Illegal domain"; -my($svc_domain)=qsearchs('svc_domain',{'domain'=>$1}) -- or die "Unknown domain"; - $domsvc = $svc_domain->svcnum; -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; - print $cgi->redirect(popurl(2). "view/svc_acct_sm.cgi?$svcnum"); - $req->cgi->redirect("../view/svc_acct_sm.cgi?$svcnum"); #redirect --} elsif ( scalar(@svc_acct_sm) > 1 ) { - print $cgi->header( '-expires' => 'now' ), - header('Mail Alias Search Results'), - &table(), < - - 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; -- - my $svc_domain = qsearchs( 'svc_domain', { 'svcnum' => $domsvc } ); - if ( $svc_domain ) { - my $domain = $svc_domain->domain; - print <\n !, - ; - } else { - my $warning = "couldn't find svc_domain.svcnum $svcnum ( svc_acct_sm.svcnum $svcnum"; - warn $warning; - print ""; - } - print '', ( ($domuser eq '*') ? "(anything)" : $domuser ); -- - my $svc_acct = qsearchs( 'svc_acct', { 'uid' => $domuid } ); - if ( $svc_acct ) { - my $username = $svc_acct->username; - my $svc_acct_svcnum =$svc_acct->svcnum; - print qq!! - ; - } else { - my $warning = "couldn't find svc_acct.uid $domuid (svc_acct_sm.svcnum $svcnum)!"; - warn $warning; - print ""; - } - print < \n -\n \n -END -- -- } -- - print '
      Mail to
      (click to view mail alias)
      Forwards to
      (click to view account)
      Mail to
      (click here to view mail alias)
      Forwards to
      (click here to view account)
      -END -- - print qq!
      !, - #print '', ( ($domuser eq '*') ? "(anything)" : $domuser ); - ( ($domuser eq '*') ? "(anything)" : $domuser ), - qq!\@$domain
      WARNING: $warning$username\@$mydomain!, - qq!
      WARNING: $warning
      $username\@$mydomain
      '; - print < - - - -END -- --} else { #error - idiot("Mail Alias not found"); - CGI::Base::SendHeaders(); # one guess - print < - - Mail Alias Search Error - - -
      -

      Mail Alias Search Error

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

      Mail Alias Search

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

      -- --

      -- --
      -- -- -- -- diff --cc htdocs/search/svc_domain.cgi index bf85e4a73,d5277037b..000000000 deleted file mode 100755,100755 --- a/htdocs/search/svc_domain.cgi +++ /dev/null @@@ -1,206 -1,139 +1,0 @@@ --#!/usr/bin/perl -Tw --# - # $Id: svc_domain.cgi,v 1.10 1999-07-17 10:38:52 ivan Exp $ -# 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 - # - # $Log: svc_domain.cgi,v $ - # Revision 1.10 1999-07-17 10:38:52 ivan - # scott nelson noticed this mod_perl-triggered bug and - # gave me a great bugreport at the last rhythmethod - # - # Revision 1.9 1999/04/15 13:39:16 ivan - # $cgi->header( '-expires' => 'now' ) - # - # Revision 1.8 1999/02/28 00:03:57 ivan - # removed misleading comments - # - # Revision 1.7 1999/02/23 08:09:24 ivan - # beginnings of one-screen new customer entry and some other miscellania - # - # Revision 1.6 1999/02/09 09:22:59 ivan - # visual and bugfixes - # - # Revision 1.5 1999/02/07 09:59:39 ivan - # more mod_perl fixes, and bugfixes Peter Wemm sent via email - # - # Revision 1.4 1999/01/19 05:14:17 ivan - # for mod_perl: no more top-level my() variables; use vars instead - # also the last s/create/new/; - # - # Revision 1.3 1998/12/23 03:06:50 ivan - # $cgi->keywords instead of $cgi->query_string - # - # Revision 1.2 1998/12/17 09:41:12 ivan - # s/CGI::(Base|Request)/CGI.pm/; - # -- --use strict; - use vars qw ( $cgi @svc_domain $sortby $query $conf $mydomain ); - use CGI; -use CGI::Request; --use CGI::Carp qw(fatalsToBrowser); --use FS::UID qw(cgisuidsetup); --use FS::Record qw(qsearch qsearchs); - use FS::CGI qw(header eidiot popurl); - use FS::svc_domain; - use FS::cust_svc; - use FS::svc_acct_sm; - use FS::svc_acct; -use FS::CGI qw(header idiot); -- - $cgi = new CGI; - &cgisuidsetup($cgi); -my($req)=new CGI::Request; -&cgisuidsetup($req->cgi); -- - $conf = new FS::Conf; - $mydomain = $conf->config('domain'); -my(@svc_domain); -my($sortby); -- - ($query)=$cgi->keywords; -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 { - $cgi->param('domain') =~ /^([\w\-\.]+)$/; - $req->param('domain') =~ /^([\w\-\.]+)$/; -- my($domain)=$1; - #push @svc_domain, qsearchs('svc_domain',{'domain'=>$domain}); - @svc_domain = qsearchs('svc_domain',{'domain'=>$domain}); - push @svc_domain, qsearchs('svc_domain',{'domain'=>$domain}); --} -- --if ( scalar(@svc_domain) == 1 ) { - print $cgi->redirect(popurl(2). "view/svc_domain.cgi?". $svc_domain[0]->svcnum); - $req->cgi->redirect("../view/svc_domain.cgi?". $svc_domain[0]->svcnum); -- exit; --} elsif ( scalar(@svc_domain) == 0 ) { - eidiot "No matching domains found!\n"; - idiot "No matching domains found!\n"; - exit; --} else { - CGI::Base::SendHeaders(); # one guess -- -- my($total)=scalar(@svc_domain); - print $cgi->header( '-expires' => 'now' ), - header("Domain Search Results",''), < -- -- Service # -- Domain - Mail to
      (click to view mail alias) - Forwards to
      (click to view account) - -- --END -- - my($lines)=16; - my($lcount)=$lines; -- my(%saw,$svc_domain); - my $p = popurl(2); -- 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=''; - #} - - my @svc_acct_sm=qsearch('svc_acct_sm',{'domsvc' => $svcnum}); - my $rowspan = scalar(@svc_acct_sm) || 1; - - my($malias); - if ( qsearch('svc_acct_sm',{'domsvc'=>$svcnum}) ) { - $malias=( - qq|
      |. - qq||. - qq||. - qq||. - qq|
      | - ); - } else { - $malias=''; - } -- print < - $svcnum - $domain - $svcnum - $domain - $malias - --END - - my $n1 = ''; - # false laziness: this was stolen from search/svc_acct_sm.cgi. but the - # web interface in general needs to be rewritten in a mucho cleaner way - 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 } ); - #if ( $svc_domain ) { - # my $domain = $svc_domain->domain; - - print qq!$n1!, - #print '', ( ($domuser eq '*') ? "(anything)" : $domuser ); - ( ($domuser eq '*') ? "(anything)" : $domuser ), - qq!\@$domain !, - ; - #} else { - # my $warning = "couldn't find svc_domain.svcnum $svcnum ( svc_acct_sm.svcnum $svcnum"; - # warn $warning; - # print "$n1WARNING: $warning"; - #} - - my $svc_acct = qsearchs( 'svc_acct', { 'uid' => $domuid } ); - if ( $svc_acct ) { - my $username = $svc_acct->username; - my $svc_acct_svcnum =$svc_acct->svcnum; - print qq!$username\@$mydomain!, - qq!! - ; - } else { - my $warning = "couldn't find svc_acct.uid $domuid (svc_acct_sm.svcnum $svcnum)!"; - warn $warning; - print "WARNING: $warning"; - } - $n1 = ""; - if ($lcount-- == 0) { # lots of little tables instead of one big one - $lcount=$lines; - print < - - - - - - -END -- } - #end of false laziness - print ""; - -- } -- -- print < - -- -- --END -- --} -- --sub svcnum_sort { -- $a->getfield('svcnum') <=> $b->getfield('svcnum'); --} -- --sub domain_sort { -- $a->getfield('domain') cmp $b->getfield('doimain'); --} -- -- diff --cc htdocs/search/svc_domain.html index 533743ba2,533743ba2..000000000 deleted file mode 100755,100755 --- a/htdocs/search/svc_domain.html +++ /dev/null @@@ -1,22 -1,22 +1,0 @@@ -- -- -- Domain Search -- -- --
      --

      Domain Search

      --
      --
      --
      -- Search for domain: -- -- --

      -- -- -- --


      -- -- -- -- diff --cc htdocs/view/cust_bill.cgi index 93a6f7a29,96101d004..000000000 deleted file mode 100755,100755 --- a/htdocs/view/cust_bill.cgi +++ /dev/null @@@ -1,93 -1,79 +1,0 @@@ --#!/usr/bin/perl -Tw --# - # $Id: cust_bill.cgi,v 1.8 1999-02-28 00:03:58 ivan Exp $ -# 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 - # - # $Log: cust_bill.cgi,v $ - # Revision 1.8 1999-02-28 00:03:58 ivan - # removed misleading comments - # - # Revision 1.7 1999/01/25 12:26:03 ivan - # yet more mod_perl stuff - # - # Revision 1.6 1999/01/19 05:14:18 ivan - # for mod_perl: no more top-level my() variables; use vars instead - # also the last s/create/new/; - # - # Revision 1.5 1999/01/18 09:41:42 ivan - # all $cgi->header calls now include ( '-expires' => 'now' ) for mod_perl - # (good idea anyway) - # - # Revision 1.4 1998/12/30 23:03:33 ivan - # bugfixes; fields isn't exported by derived classes - # - # Revision 1.3 1998/12/23 03:07:49 ivan - # $cgi->keywords instead of $cgi->query_string - # - # Revision 1.2 1998/12/17 09:57:20 ivan - # s/CGI::(Base|Request)/CGI.pm/; - # -- --use strict; - use vars qw ( $cgi $query $invnum $cust_bill $custnum $printed $p ); --use IO::File; - use CGI; -use CGI::Base qw(:DEFAULT :CGI); # CGI module --use CGI::Carp qw(fatalsToBrowser); --use FS::UID qw(cgisuidsetup); - use FS::CGI qw(header popurl menubar); --use FS::Record qw(qsearchs); - use FS::cust_bill; -use FS::Invoice; -- - $cgi = new CGI; -my($cgi) = new CGI::Base; -$cgi->get; --&cgisuidsetup($cgi); -- --#untaint invnum - ($query) = $cgi->keywords; - $query =~ /^(\d+)$/; - $invnum = $1; -$QUERY_STRING =~ /^(\d+)$/; -my($invnum)=$1; -- - $cust_bill = qsearchs('cust_bill',{'invnum'=>$invnum}); -my($cust_bill) = qsearchs('cust_bill',{'invnum'=>$invnum}); --die "Invoice #$invnum not found!" unless $cust_bill; - $custnum = $cust_bill->getfield('custnum'); -my($custnum) = $cust_bill->getfield('custnum'); -- - $printed = $cust_bill->printed; -my($printed) = $cust_bill->printed; -- - $p = popurl(2); - print $cgi->header( '-expires' => 'now' ), header('Invoice View', menubar( - "Main Menu" => $p, - "View this customer (#$custnum)" => "${p}view/cust_main.cgi?$custnum", - )), <Enter payments (check/cash) against this invoice -
      Reprint this invoice -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 --cc htdocs/view/cust_main.cgi
      index 055256570,ca5fcd94f..000000000
      deleted file mode 100755,100755
      --- a/htdocs/view/cust_main.cgi
      +++ /dev/null
      @@@ -1,429 -1,336 +1,0 @@@
      --#!/usr/bin/perl -Tw
      --#
      - # $Id: cust_main.cgi,v 1.18 1999-08-12 04:16:01 ivan Exp $
       -# 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
      - #
      - # $Log: cust_main.cgi,v $
      - # Revision 1.18  1999-08-12 04:16:01  ivan
      - # hidecancelledpackages config option
      - #
      - # Revision 1.17  1999/04/15 16:44:36  ivan
      - # delete customers
      - #
      - # Revision 1.16  1999/04/09 04:22:34  ivan
      - # also table()
      - #
      - # Revision 1.15  1999/04/09 03:52:55  ivan
      - # explicit & for table/itable/ntable
      - #
      - # Revision 1.14  1999/04/08 04:04:37  ivan
      - # eliminate double // in links
      - #
      - # Revision 1.13  1999/02/28 00:04:00  ivan
      - # removed misleading comments
      - #
      - # Revision 1.12  1999/02/07 09:59:40  ivan
      - # more mod_perl fixes, and bugfixes Peter Wemm sent via email
      - #
      - # Revision 1.11  1999/01/25 12:26:04  ivan
      - # yet more mod_perl stuff
      - #
      - # Revision 1.10  1999/01/19 05:14:19  ivan
      - # for mod_perl: no more top-level my() variables; use vars instead
      - # also the last s/create/new/;
      - #
      - # Revision 1.9  1999/01/18 09:41:43  ivan
      - # all $cgi->header calls now include ( '-expires' => 'now' ) for mod_perl
      - # (good idea anyway)
      - #
      - # Revision 1.8  1999/01/18 09:22:35  ivan
      - # changes to track email addresses for email invoicing
      - #
      - # Revision 1.7  1998/12/30 23:03:34  ivan
      - # bugfixes; fields isn't exported by derived classes
      - #
      - # Revision 1.6  1998/12/23 02:42:33  ivan
      - # remove double '/' in link urls
      - #
      - # Revision 1.5  1998/12/23 02:36:28  ivan
      - # use FS::cust_refund; to eliminate warning
      - #
      - # Revision 1.4  1998/12/17 09:57:21  ivan
      - # s/CGI::(Base|Request)/CGI.pm/;
      - #
      - # Revision 1.3  1998/11/15 13:14:20  ivan
      - # first pass as per-customer custom pricing
      - #
      - # Revision 1.2  1998/11/13 11:28:08  ivan
      - # s/CGI-modules/CGI.pm/;, relative URL's with popurl
      - #
      --
      --use strict;
      - use vars qw ( $cgi $query $custnum $cust_main $hashref $agent $referral 
      -               @packages $package @history @bills $bill @credits $credit
      -               $balance $item @agents @referrals @invoicing_list $n1 $conf ); 
      - use CGI;
       -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 popurl table itable ntable);
      - use FS::cust_credit;
      - use FS::cust_pay;
      - use FS::cust_bill;
      - use FS::part_pkg;
      - use FS::cust_pkg;
      - use FS::part_referral;
      - use FS::agent;
      - use FS::cust_main;
      - use FS::cust_refund;
       -use FS::CGI qw(header menubar);
      --
      - $cgi = new CGI;
       -my($cgi) = new CGI::Base;
       -$cgi->get;
      --&cgisuidsetup($cgi);
      - 
      - $conf = new FS::Conf;
      --
      - print $cgi->header( '-expires' => 'now' ), header("Customer View", menubar(
      -   'Main Menu' => popurl(2)
      - ));
       -SendHeaders(); # one guess.
       -print header("Customer View", menubar(
       -  'Main Menu' => '../',
       -)),<
       -END
      --
      - die "No customer specified (bad URL)!" unless $cgi->keywords;
      - ($query) = $cgi->keywords; # needs parens with my, ->keywords returns array
      - $query =~ /^(\d+)$/;
      - $custnum = $1;
      - $cust_main = qsearchs('cust_main',{'custnum'=>$custnum});
       -#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;
      - $hashref = $cust_main->hashref;
       -my($hashref)=$cust_main->hashref;
      --
      - print &itable(), '
      ', - ; -#bill now linke -print qq!
      !, - qq!Bill this customer now
      !; -- - @agents = qsearch( 'agent', {} ); - unless ( scalar(@agents) == 1 ) { - $agent = qsearchs('agent',{ - 'agentnum' => $cust_main->agentnum - } ); - print ''; - } - @referrals = qsearch( 'part_referral', {} ); - unless ( scalar(@referrals) == 1 ) { - my $referral = qsearchs('part_referral', { - 'refnum' => $cust_main->refnum - } ); - print ''; - } - print ''; -#formatting -print qq!
      Customer Information!, - qq!!, - qq!
      Edit this information
      !; -- - print '
      Service #Domain
      '; -#custnum -print "
      Customer #$custnum
      ", - qq!
      Customer Information | !, - qq!Comments | !, - qq!Packages | !, - qq!Payment History
      !; -- - print qq!Edit this customer!; - print qq! | Delete this customer! - if $conf->exists('deletecustomers'); - print &ntable("#c0c0c0"), "
      ", &ntable("#c0c0c0",2), - '
      Customer number', - $custnum, '
      Agent', - $agent->agentnum, ": ", $agent->agent, '
      Referral', - $referral->refnum, ": ", $referral->referral, '
      Order taker', - $cust_main->otaker, '
      '; -#agentnum -my($agent)=qsearchs('agent',{ - 'agentnum' => $cust_main->getfield('agentnum') -} ); -die "Agent not found!" unless $agent; -print "
      Agent #" , $agent->getfield('agentnum') , ": " , - $agent->getfield('agent') , ""; -- - print ''; -#refnum -my($referral)=qsearchs('part_referral',{'refnum' => $cust_main->refnum}); -die "Referral not found!" unless $referral; -print "
      Referral #", $referral->refnum, ": ", - $referral->referral, "<\B>"; -- - print "Contact information", &ntable("#c0c0c0"), "", - &ntable("#c0c0c0",2), - 'Contact name
      (last, first)', - '', - $cust_main->last, ', ', $cust_main->first, - 'SS#', - $cust_main->ss || ' ', '', - 'Company', - $cust_main->company, - '', - 'Address', - $cust_main->address1, - '', - ; - print ' ', - $cust_main->address2, '' - if $cust_main->address2; - print 'City', - $cust_main->city, - 'State', - $cust_main->state, - 'Zip', - $cust_main->zip, '', - 'Country', - $cust_main->country, - '', - ; - print 'Day Phone', - $cust_main->daytime || ' ', '', - 'Night Phone', - $cust_main->night || ' ', '', - 'Fax', - $cust_main->fax || ' ', '', - '', "" - ; -#last, first -print "

      ", $hashref->{'last'}, ", ", $hashref->{first}, ""; -- - print ''; -#ss -print " (SS# ", $hashref->{ss}, ")" if $hashref->{ss}; -- - @invoicing_list = $cust_main->invoicing_list; - print "Billing information (", - qq!!, "Bill now)", - &ntable("#c0c0c0"), "", &ntable("#c0c0c0",2), - 'Tax exempt', - $cust_main->tax ? 'yes' : 'no', - '', - 'Postal invoices', - ( grep { $_ eq 'POST' } @invoicing_list ) ? 'yes' : 'no', - '', - 'Email invoices', - join(', ', grep { $_ ne 'POST' } @invoicing_list ) || 'no', - '', - 'Billing type', - ; -#company -print "
      ", $hashref->{company}, "" if $hashref->{company}; -- - if ( $cust_main->payby eq 'CARD' ) { - print 'Credit card', - 'Card number', - $cust_main->payinfo, '', - 'Expiration', - $cust_main->paydate, '', - 'Name on card', - $cust_main->payname, '' - ; - } elsif ( $cust_main->payby eq 'BILL' ) { - print 'Billing'; - print 'P.O. ', - $cust_main->payinfo, '', - if $cust_main->payinfo; - print 'Expiration', - $cust_main->paydate, '', - 'Attention', - $cust_main->payname, '', - ; - } elsif ( $cust_main->payby eq 'COMP' ) { - print 'Complimentary', - 'Authorized by', - $cust_main->payinfo, '', - 'Expiration', - $cust_main->paydate, '', - ; -#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}, "!"; --} -- - print ""; -#tax -print "
      (Tax exempt)" if $hashref->{tax}; -- - print qq!

      Packages !, - # qq!
      Click on package number to view/edit package.!, - qq!( Order and cancel packages )!, - ; -#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!!, &table(), "\n", - qq!Package!, - qq!DatesServices\n!, -print qq!
      \n!, - qq!\n!, -- qq!!, -- qq!!, -- qq!\n!; -- --#get package info - if ( $conf->exists('hidecancelledpackages') ) { - @packages = $cust_main->ncancelled_pkgs; - } else { - @packages = $cust_main->all_pkgs; - } - - $n1 = ''; -my(@packages)=qsearch('cust_pkg',{'custnum'=>$custnum}); -my($package); --foreach $package (@packages) { - my $pkgnum = $package->pkgnum; - my $pkg = $package->part_pkg->pkg; - my $comment = $package->part_pkg->comment; - my $pkgview = popurl(2). "view/cust_pkg.cgi?$pkgnum"; - my @cust_svc = qsearch( 'cust_svc', { 'pkgnum' => $pkgnum } ); - my $rowspan = scalar(@cust_svc) || 1; - - my $button_cgi = new CGI; - $button_cgi->param('clone', $package->part_pkg->pkgpart); - $button_cgi->param('pkgnum', $package->pkgnum); - my $button_url = popurl(2). "edit/part_pkg.cgi?". $button_cgi->query_string; - - #print $n1, qq!!, - print $n1, qq!!, - qq!!, - ; - for ( qw( setup bill susp expire cancel ) ) { - print "', - ; - } - - my $n2 = ''; - foreach my $cust_svc ( @cust_svc ) { - my($label, $value, $svcdb) = $cust_svc->label; - my($svcnum) = $cust_svc->svcnum; - my($sview) = popurl(2). "view"; - print $n2,qq!!, - qq!!; - $n2=""; - } - $n1=""; - } - print ""; - 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
      $pkgnum$pkgnum!, - #qq!$pkg - $comment!, - qq!$pkg - $comment!, - qq! ( Edit | Customize pricing )", ( $package->getfield($_) - ? time2str("%D", $package->getfield($_) ) - : ' ' - ), '$label$value
      !, - $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} ) : "" , - "
      "; -print "
      "; -- --#formatting - print qq!

      Payment History!, - qq!!, - qq! ( Click on invoice to view invoice/enter payment. | !, - qq!!, - qq!Post credit / refund )!; -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. -- - @history = (); #needed for mod_perl :) -my(@history); -- - @bills = qsearch('cust_bill',{'custnum'=>$custnum}); -my(@bills)=qsearch('cust_bill',{'custnum'=>$custnum}); -my($bill); --foreach $bill (@bills) { -- my($bref)=$bill->hashref; -- push @history, - $bref->{_date} . qq!\t{invnum} . qq!">Invoice #! . $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"; -- } --} -- - @credits = qsearch('cust_credit',{'custnum'=>$custnum}); -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 &table(), < -- -- -- -- -- -- -- -- -- --END -- --#display payment history -- - $balance = 0; -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), -- "
      "; -print ""; -- --#end -- --#formatting --print < -- --END -- --#subroutiens --sub keyfield_numerically { (split(/\t/,$a))[0] <=> (split(/\t/,$b))[0] ; } -- diff --cc htdocs/view/cust_pkg.cgi index 0054ee0fa,04e38326a..000000000 deleted file mode 100755,100755 --- a/htdocs/view/cust_pkg.cgi +++ /dev/null @@@ -1,206 -1,181 +1,0 @@@ --#!/usr/bin/perl -Tw --# - # $Id: cust_pkg.cgi,v 1.11 1999-04-09 04:22:34 ivan Exp $ -# 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 - # - # $Log: cust_pkg.cgi,v $ - # Revision 1.11 1999-04-09 04:22:34 ivan - # also table() - # - # Revision 1.10 1999/04/09 03:52:55 ivan - # explicit & for table/itable/ntable - # - # Revision 1.9 1999/04/08 12:00:19 ivan - # aesthetic update - # - # Revision 1.8 1999/02/28 00:04:01 ivan - # removed misleading comments - # - # Revision 1.7 1999/01/19 05:14:20 ivan - # for mod_perl: no more top-level my() variables; use vars instead - # also the last s/create/new/; - # - # Revision 1.6 1999/01/18 09:41:44 ivan - # all $cgi->header calls now include ( '-expires' => 'now' ) for mod_perl - # (good idea anyway) - # - # Revision 1.5 1998/12/23 03:11:40 ivan - # *** empty log message *** - # - # Revision 1.3 1998/12/17 09:57:22 ivan - # s/CGI::(Base|Request)/CGI.pm/; - # - # Revision 1.2 1998/11/13 09:56:49 ivan - # change configuration file layout to support multiple distinct databases (with - # own set of config files, export, etc.) - # -- --use strict; - use vars qw ( $cgi %uiview %uiadd $part_svc $query $pkgnum $cust_pkg $part_pkg - $custnum $susp $cancel $expire $pkg $comment $setup $bill - $otaker ); --use Date::Format; - use CGI; - use CGI::Carp qw(fatalsToBrowser); -use CGI::Base qw(:DEFAULT :CGI); # CGI module --use FS::UID qw(cgisuidsetup); - use FS::CGI qw(popurl header menubar ntable table); --use FS::Record qw(qsearch qsearchs); - use FS::part_svc; - use FS::cust_pkg; - use FS::part_pkg; - use FS::pkg_svc; - use FS::cust_svc; -- - $cgi = new CGI; - cgisuidsetup($cgi); -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} = popurl(2). "view/". $part_svc->svcdb . ".cgi"; - $uiadd{$part_svc->svcpart}= popurl(2). "edit/". $part_svc->svcdb . ".cgi"; - $uiview{$part_svc->svcpart}="../view/". $part_svc->svcdb . ".cgi"; - $uiadd{$part_svc->svcpart}="../edit/". $part_svc->svcdb . ".cgi"; --} -- - ($query) = $cgi->keywords; - $query =~ /^(\d+)$/; - $pkgnum = $1; -SendHeaders(); # one guess. -print < - - Package View - - -
      -

      Package View

      -
      - -END - -#untaint pkgnum -$QUERY_STRING =~ /^(\d+)$/; -my($pkgnum)=$1; -- --#get package record - $cust_pkg = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum}); -my($cust_pkg)=qsearchs('cust_pkg',{'pkgnum'=>$pkgnum}); --die "No package!" unless $cust_pkg; - $part_pkg = qsearchs('part_pkg',{'pkgpart'=>$cust_pkg->getfield('pkgpart')}); -my($part_pkg)=qsearchs('part_pkg',{'pkgpart'=>$cust_pkg->getfield('pkgpart')}); -- - $custnum = $cust_pkg->getfield('custnum'); - print $cgi->header( '-expires' => 'now' ), header('Package View', menubar( - "View this customer (#$custnum)" => popurl(2). "view/cust_main.cgi?$custnum", - 'Main Menu' => popurl(2) - )); -#nav bar -my($custnum)=$cust_pkg->getfield('custnum'); -print qq!
      View this customer!, - qq! (#$custnum) | Main menu

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

      \n!; -- - print "Package information"; - print ' (unsuspend)' if ( $susp && ! $cancel ); - print ' (suspend)' unless ( $susp || $cancel ); - print ' (cancel)' unless $cancel; -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"; -- - print &ntable("#c0c0c0"), '', &ntable("#c0c0c0",2), - 'Package number', - $pkgnum, '', - 'Package', - $pkg, '', - 'Comment', - $comment, '', - 'Setup date', - ( $setup ? time2str("%D",$setup) : "(Not setup)" ), '', - 'Next bill date', - ( $bill ? time2str("%D",$bill) : " " ), '', - ; - print 'Suspension date', - time2str("%D",$susp), '' if $susp; - print 'Expiration date', - time2str("%D",$expire), '' if $expire; - print 'Cancellation date', - time2str("%D",$cancel), '' if $cancel; - print 'Order taker', - $otaker, '', - '' - ; -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) : "" ,""; -- - # print < - # - #Expire (date): - # - #END -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', &table(); - 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; - my %pkg_svc = (); - 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; - 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; - my($label, $value, $svcdb) = $cust_svc->label; -- print < - --END -- } else { -- print < -- -- --END -- } -- -- } -- warn "WARNING: Leftover services pkgnum $pkgnum!" if @cust_svc;; -- } -- - print "
      Service(View) $svc: $value
      (View) $svc
      -- (Add) $svc -- or -- (Link to existing) $svc --
      ", - "Choose (View) to view or edit an existing service
      ", - "Choose (Add) to setup a new service
      ", - "Choose (Link to existing) to link to a legacy (pre-Freeside) service", - "
      " - ; - print "
      "; - --} -- --#formatting --print < -- --END -- diff --cc htdocs/view/svc_acct.cgi index e203c7ec0,7096c2fb1..000000000 deleted file mode 100755,100755 --- a/htdocs/view/svc_acct.cgi +++ /dev/null @@@ -1,171 -1,172 +1,0 @@@ --#!/usr/bin/perl -Tw --# - # $Id: svc_acct.cgi,v 1.10 1999-04-14 11:27:06 ivan Exp $ -# 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 - # - # $Log: svc_acct.cgi,v $ - # Revision 1.10 1999-04-14 11:27:06 ivan - # showpasswords config option to show passwords - # - # Revision 1.9 1999/04/08 12:00:19 ivan - # aesthetic update - # - # Revision 1.8 1999/02/28 00:04:02 ivan - # removed misleading comments - # - # Revision 1.7 1999/01/19 05:14:21 ivan - # for mod_perl: no more top-level my() variables; use vars instead - # also the last s/create/new/; - # - # Revision 1.6 1999/01/18 09:41:45 ivan - # all $cgi->header calls now include ( '-expires' => 'now' ) for mod_perl - # (good idea anyway) - # - # Revision 1.5 1999/01/18 09:22:36 ivan - # changes to track email addresses for email invoicing - # - # Revision 1.4 1998/12/23 03:09:19 ivan - # $cgi->keywords instead of $cgi->query_string - # - # Revision 1.3 1998/12/17 09:57:23 ivan - # s/CGI::(Base|Request)/CGI.pm/; - # - # Revision 1.2 1998/12/16 05:24:29 ivan - # use FS::Conf; - # -- --use strict; - use vars qw( $conf $cgi $mydomain $query $svcnum $svc_acct $cust_svc $pkgnum - $cust_pkg $custnum $part_svc $p $svc_acct_pop $password ); - use CGI; - use CGI::Carp qw( fatalsToBrowser ); - use FS::UID qw( cgisuidsetup ); - use FS::CGI qw( header popurl menubar); - use FS::Record qw( qsearchs fields ); - use FS::Conf; - use FS::svc_acct; - use FS::cust_svc; - use FS::cust_pkg; - use FS::part_svc; - use FS::svc_acct_pop; -use CGI::Base qw(:DEFAULT :CGI); -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearchs fields); -- - $cgi = new CGI; - &cgisuidsetup($cgi); -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 $_ !~ /^(#|$)/, ; -- - $conf = new FS::Conf; - $mydomain = $conf->config('domain'); -my($cgi) = new CGI::Base; -$cgi->get; -&cgisuidsetup($cgi); -- - ($query) = $cgi->keywords; - $query =~ /^(\d+)$/; - $svcnum = $1; - $svc_acct = qsearchs('svc_acct',{'svcnum'=>$svcnum}); -#untaint svcnum -$QUERY_STRING =~ /^(\d+)$/; -my($svcnum)=$1; -my($svc_acct)=qsearchs('svc_acct',{'svcnum'=>$svcnum}); --die "Unkonwn svcnum" unless $svc_acct; -- - $cust_svc = qsearchs('cust_svc',{'svcnum'=>$svcnum}); - $pkgnum = $cust_svc->getfield('pkgnum'); -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'); - } else { - $cust_pkg = ''; - $custnum = ''; --} -- - $part_svc = qsearchs('part_svc',{'svcpart'=> $cust_svc->svcpart } ); -my($part_svc)=qsearchs('part_svc',{'svcpart'=> $cust_svc->svcpart } ); --die "Unkonwn svcpart" unless $part_svc; -- - $p = popurl(2); - print $cgi->header( '-expires' => 'now' ), header('Account View', menubar( - ( ( $pkgnum || $custnum ) - ? ( "View this package (#$pkgnum)" => "${p}view/cust_pkg.cgi?$pkgnum", - "View this customer (#$custnum)" => "${p}view/cust_main.cgi?$custnum", - ) - : ( "Cancel this (unaudited) account" => - "${p}misc/cancel-unaudited.cgi?$svcnum" ) - ), - "Main menu" => $p, - )); -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
      !; -- - print qq!Edit this information!, - "
      Service #$svcnum", - "
      Service: ", $part_svc->svc, "", - "

      Username: ", $svc_acct->username, "" - ; -#formatting -print qq!
      General
      !; -- - print "
      Password: "; - $password = $svc_acct->_password; - if ( $password =~ /^\*\w+\* (.*)$/ ) { - $password = $1; - print "(login disabled) "; - } - if ( $conf->exists('showpasswords') ) { - print "$password"; -#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 "(hidden)"; - print "
      Password: (hidden)
      "; --} - $password = ''; -- - $svc_acct_pop = qsearchs('svc_acct_pop',{'popnum'=>$svc_acct->popnum}); - print "
      POP: ", $svc_acct_pop->city, ", ", $svc_acct_pop->state, -# 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 "

      Uid: ", $svc_acct->uid, "", - "
      Gid: ", $svc_acct->gid, "", - "
      Finger name: ", $svc_acct->finger, "", - "
      Home directory: ", $svc_acct->dir, "", - "
      Shell: ", $svc_acct->shell, "", - "
      Quota: ", $svc_acct->quota, " (unimplemented)" - ; - 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)"; - print "No shell account.
      "; --} -- -# SLIP/PPP -print qq!
      !; --if ($svc_acct->slipip) { - print "

      IP address: ", ( $svc_acct->slipip eq "0.0.0.0" || $svc_acct->slipip eq '0e0' ) ? "(Dynamic)" : $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 "No SLIP/PPP account" --} -- - print ""; -print "
      "; - - #formatting - print < - -END -- diff --cc htdocs/view/svc_acct_sm.cgi index 51fbc0351,42623eefd..000000000 deleted file mode 100755,100755 --- a/htdocs/view/svc_acct_sm.cgi +++ /dev/null @@@ -1,123 -1,114 +1,0 @@@ --#!/usr/bin/perl -Tw --# - # $Id: svc_acct_sm.cgi,v 1.10 1999-04-08 12:00:19 ivan Exp $ -# 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 - # - # $Log: svc_acct_sm.cgi,v $ - # Revision 1.10 1999-04-08 12:00:19 ivan - # aesthetic update - # - # Revision 1.9 1999/02/28 00:04:03 ivan - # removed misleading comments - # - # Revision 1.8 1999/02/09 09:23:00 ivan - # visual and bugfixes - # - # Revision 1.7 1999/02/07 09:59:42 ivan - # more mod_perl fixes, and bugfixes Peter Wemm sent via email - # - # Revision 1.6 1999/01/19 05:14:22 ivan - # for mod_perl: no more top-level my() variables; use vars instead - # also the last s/create/new/; - # - # Revision 1.5 1999/01/18 09:41:46 ivan - # all $cgi->header calls now include ( '-expires' => 'now' ) for mod_perl - # (good idea anyway) - # - # Revision 1.4 1998/12/23 03:09:52 ivan - # $cgi->keywords instead of $cgi->query_string - # - # Revision 1.3 1998/12/17 09:57:24 ivan - # s/CGI::(Base|Request)/CGI.pm/; - # - # Revision 1.2 1998/12/16 05:24:30 ivan - # use FS::Conf; - # -- --use strict; - use vars qw($conf $cgi $mydomain $query $svcnum $svc_acct_sm $cust_svc - $pkgnum $cust_pkg $custnum $part_svc $p $domsvc $domuid $domuser - $svc $svc_domain $domain $svc_acct $username ); - use CGI; -use CGI::Base qw(:DEFAULT :CGI); --use FS::UID qw(cgisuidsetup); - use FS::CGI qw(header popurl menubar ); --use FS::Record qw(qsearchs); - use FS::Conf; - use FS::svc_acct_sm; - use FS::cust_svc; - use FS::cust_pkg; - use FS::part_svc; - use FS::svc_domain; - use FS::svc_acct; -- - $cgi = new CGI; - cgisuidsetup($cgi); -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; -- - $conf = new FS::Conf; - $mydomain = $conf->config('domain'); -my($cgi) = new CGI::Base; -$cgi->get; -cgisuidsetup($cgi); -- - ($query) = $cgi->keywords; - $query =~ /^(\d+)$/; - $svcnum = $1; - $svc_acct_sm = qsearchs('svc_acct_sm',{'svcnum'=>$svcnum}); -#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; -- - $cust_svc = qsearchs('cust_svc',{'svcnum'=>$svcnum}); - $pkgnum = $cust_svc->getfield('pkgnum'); -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'); - } else { - $cust_pkg = ''; - $custnum = ''; --} -- - $part_svc = qsearchs('part_svc',{'svcpart'=> $cust_svc->svcpart } ); -my($part_svc)=qsearchs('part_svc',{'svcpart'=> $cust_svc->svcpart } ); --die "Unkonwn svcpart" unless $part_svc; -- - $p = popurl(2); - print $cgi->header( '-expires' => 'now' ), header('Mail Alias View', menubar( - ( ( $pkgnum || $custnum ) - ? ( "View this package (#$pkgnum)" => "${p}view/cust_pkg.cgi?$pkgnum", - "View this customer (#$custnum)" => "${p}view/cust_main.cgi?$custnum", - ) - : ( "Cancel this (unaudited) account" => - "${p}misc/cancel-unaudited.cgi?$svcnum" ) - ), - "Main menu" => $p, - )); -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 -} -- - ($domsvc,$domuid,$domuser) = ( -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, --); - $svc = $part_svc->svc; - $svc_domain = qsearchs('svc_domain',{'svcnum'=>$domsvc}); - $domain = $svc_domain->domain; - $svc_acct = qsearchs('svc_acct',{'uid'=>$domuid}); - $username = $svc_acct->username; -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; -- - print qq!Edit this information!, - "
      Service #$svcnum", - "
      Service: $svc", - qq!
      Mail to !, ( ($domuser eq '*') ? "(anything)" : $domuser ) , qq!\@$domain forwards to $username\@$mydomain mailbox.!, - '' - ; -#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 --cc htdocs/view/svc_domain.cgi index fef5ad4f3,78ff6ac0b..000000000 deleted file mode 100755,100755 --- a/htdocs/view/svc_domain.cgi +++ /dev/null @@@ -1,99 -1,76 +1,0 @@@ --#!/usr/bin/perl -Tw --# - # $Id: svc_domain.cgi,v 1.10 1999-08-27 22:18:44 ivan Exp $ -# 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 - # - # $Log: svc_domain.cgi,v $ - # Revision 1.10 1999-08-27 22:18:44 ivan - # point to patrick instead of internic! - # - # Revision 1.9 1999/04/08 12:00:19 ivan - # aesthetic update - # - # Revision 1.8 1999/02/28 00:04:04 ivan - # removed misleading comments - # - # Revision 1.7 1999/02/23 08:09:25 ivan - # beginnings of one-screen new customer entry and some other miscellania - # - # Revision 1.6 1999/01/19 05:14:23 ivan - # for mod_perl: no more top-level my() variables; use vars instead - # also the last s/create/new/; - # - # Revision 1.5 1999/01/18 09:41:47 ivan - # all $cgi->header calls now include ( '-expires' => 'now' ) for mod_perl - # (good idea anyway) - # - # Revision 1.4 1998/12/23 03:10:19 ivan - # $cgi->keywords instead of $cgi->query_string - # - # Revision 1.3 1998/12/17 09:57:25 ivan - # s/CGI::(Base|Request)/CGI.pm/; - # - # Revision 1.2 1998/11/13 09:56:50 ivan - # change configuration file layout to support multiple distinct databases (with - # own set of config files, export, etc.) - # -- --use strict; - use vars qw( $cgi $query $svcnum $svc_domain $domain $cust_svc $pkgnum - $cust_pkg $custnum $part_svc $p ); - use CGI; -use CGI::Base qw(:DEFAULT :CGI); --use FS::UID qw(cgisuidsetup); - use FS::CGI qw(header menubar popurl menubar); --use FS::Record qw(qsearchs); - use FS::svc_domain; - use FS::cust_svc; - use FS::cust_pkg; - use FS::part_svc; -- - $cgi = new CGI; -my($cgi) = new CGI::Base; -$cgi->get; --cgisuidsetup($cgi); -- - ($query) = $cgi->keywords; - $query =~ /^(\d+)$/; - $svcnum = $1; - $svc_domain = qsearchs('svc_domain',{'svcnum'=>$svcnum}); -#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; -- - $cust_svc = qsearchs('cust_svc',{'svcnum'=>$svcnum}); - $pkgnum = $cust_svc->getfield('pkgnum'); -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'); - } else { - $cust_pkg = ''; - $custnum = ''; --} -- - $part_svc = qsearchs('part_svc',{'svcpart'=> $cust_svc->svcpart } ); -my($part_svc)=qsearchs('part_svc',{'svcpart'=> $cust_svc->svcpart } ); --die "Unkonwn svcpart" unless $part_svc; -- - $domain = $svc_domain->domain; -SendHeaders(); # one guess. -print < - - Domain View - - -

      Domain View

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

      - Service #$svcnum -
      -END -- - $p = popurl(2); - print $cgi->header( '-expires' => 'now' ), header('Domain View', menubar( - ( ( $pkgnum || $custnum ) - ? ( "View this package (#$pkgnum)" => "${p}view/cust_pkg.cgi?$pkgnum", - "View this customer (#$custnum)" => "${p}view/cust_main.cgi?$custnum", - ) - : ( "Cancel this (unaudited) account" => - "${p}misc/cancel-unaudited.cgi?$svcnum" ) - ), - "Main menu" => $p, - )), - "Service #$svcnum", - "
      Service: ", $part_svc->svc, "", - "
      Domain name: $domain.", - qq!

      View whois information.!, - '', - ; -print "
      "; -print "Service: ", $part_svc->svc, ""; -print "
      "; - -print qq!Domain name $domain.!; -print qq!

      View whois information.!; - -print "


      "; - - #formatting - print < - -END -