diff options
Diffstat (limited to 'htdocs')
85 files changed, 55 insertions, 6424 deletions
diff --git a/htdocs/browse/agent.cgi b/htdocs/browse/agent.cgi deleted file mode 100755 index cf5f228..0000000 --- a/htdocs/browse/agent.cgi +++ /dev/null @@ -1,72 +0,0 @@ -#!/usr/bin/perl -Tw -# -# agent.cgi: browse agent -# -# ivan@sisd.com 97-dec-12 -# -# changes to allow pages to load from a relative location in the web tree. -# bmccane@maxbaud.net 98-mar-25 -# -# changed 'type' to 'atype' because type is reserved word in Pg6.3 -# bmccane@maxbaud.net 98-apr-3 -# -# agent type was linking to wrong cgi ivan@sisd.com 98-jul-18 -# -# lose background, FS::CGI ivan@sisd.com 98-sep-2 - -use strict; -use CGI::Base; -use FS::UID qw(cgisuidsetup swapuid); -use FS::Record qw(qsearch qsearchs); -use FS::CGI qw(header menubar); - -my($cgi) = new CGI::Base; -$cgi->get; - -&cgisuidsetup($cgi); - -SendHeaders(); # one guess. -print header('Agent Listing', menubar( - 'Main Menu' => '../', - 'Add new agent' => '../edit/agent.cgi' -)), <<END; - <BR> - Click on agent number to edit. - <TABLE BORDER> - <TR> - <TH><FONT SIZE=-1>Agent #</FONT></TH> - <TH>Agent</TH> - <TH>Type</TH> - <TH><FONT SIZE=-1>Freq. (unimp.)</FONT></TH> - <TH><FONT SIZE=-1>Prog. (unimp.)</FONT></TH> - </TR> -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; - <TR> - <TD><A HREF="../edit/agent.cgi?$hashref->{agentnum}"> - $hashref->{agentnum}</A></TD> - <TD>$hashref->{agent}</TD> - <TD><A HREF="../edit/agent_type.cgi?$typenum">$atype</A></TD> - <TD>$hashref->{freq}</TD> - <TD>$hashref->{prog}</TD> - </TR> -END - -} - -print <<END; - </TABLE> - </CENTER> - </BODY> -</HTML> -END - diff --git a/htdocs/browse/agent_type.cgi b/htdocs/browse/agent_type.cgi deleted file mode 100755 index 5f05bd5..0000000 --- a/htdocs/browse/agent_type.cgi +++ /dev/null @@ -1,81 +0,0 @@ -#!/usr/bin/perl -Tw -# -# agent_type.cgi: browse agent_type -# -# ivan@sisd.com 97-dec-10 -# -# Changes to allow page to work at a relative position in server -# Changes to make "Packages" display 2-wide in table (old way was too vertical) -# bmccane@maxbaud.net 98-apr-3 -# -# lose background, FS::CGI ivan@sisd.com 98-sep-2 - -use strict; -use CGI::Base; -use FS::UID qw(cgisuidsetup swapuid); -use FS::Record qw(qsearch qsearchs); -use FS::CGI qw(header menubar); - -my($cgi) = new CGI::Base; -$cgi->get; - -&cgisuidsetup($cgi); - -SendHeaders(); # one guess. - -print header("Agent Type Listing", menubar( - 'Main Menu' => '../', - 'Add new agent type' => "../edit/agent_type.cgi", -)), <<END; - <BR>Click on agent type number to edit. - <TABLE BORDER> - <TR> - <TH><FONT SIZE=-1>Type #</FONT></TH> - <TH>Type</TH> - <TH colspan="2">Packages</TH> - </TR> -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; - <TR> - <TD ROWSPAN=$rowspan><A HREF="../edit/agent_type.cgi?$hashref->{typenum}"> - $hashref->{typenum} - </A></TD> - <TD ROWSPAN=$rowspan>$hashref->{atype}</TD> -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!<TR>! if ($tdcount == 0) ; - $tdcount = 0 if ($tdcount == -1) ; - print qq!<TD><A HREF="../edit/part_pkg.cgi?$pkgpart">!, - $part_pkg->getfield('pkg'),"</A></TD>"; - $tdcount ++ ; - if ($tdcount == 2) - { - print qq!</TR>\n! ; - $tdcount = 0 ; - } - } - - print "</TR>"; -} - -print <<END; - </TR></TABLE> - </CENTER> - </BODY> -</HTML> -END - diff --git a/htdocs/browse/cust_main_county.cgi b/htdocs/browse/cust_main_county.cgi deleted file mode 100755 index d615198..0000000 --- a/htdocs/browse/cust_main_county.cgi +++ /dev/null @@ -1,65 +0,0 @@ -#!/usr/bin/perl -Tw -# -# cust_main_county.cgi: browse cust_main_county -# -# ivan@sisd.com 97-dec-13 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 -# -# lose background, FS::CGI ivan@sisd.com 98-sep-2 - -use strict; -use CGI::Base; -use FS::UID qw(cgisuidsetup swapuid); -use FS::Record qw(qsearch qsearchs); -use FS::CGI qw(header menubar); - -my($cgi) = new CGI::Base; -$cgi->get; - -&cgisuidsetup($cgi); - -SendHeaders(); # one guess. -print header("Tax Rate Listing", menubar( - 'Main Menu' => '../', - 'Edit tax rates' => "../edit/cust_main_county.cgi", -)),<<END; - <BR>Click on <u>expand</u> to specify tax rates by county. - <P><TABLE BORDER> - <TR> - <TH><FONT SIZE=-1>State</FONT></TH> - <TH>County</TH> - <TH><FONT SIZE=-1>Tax</FONT></TH> - </TR> -END - -my($cust_main_county); -foreach $cust_main_county ( qsearch('cust_main_county',{}) ) { - my($hashref)=$cust_main_county->hashref; - print <<END; - <TR> - <TD>$hashref->{state}</TD> -END - - print "<TD>", $hashref->{county} - ? $hashref->{county} - : qq!(ALL) <FONT SIZE=-1>!. - qq!<A HREF="../edit/cust_main_county-expand.cgi?!. $hashref->{taxnum}. - qq!">expand</A></FONT>! - , "</TD>"; - - print <<END; - <TD>$hashref->{tax}%</TD> - </TR> -END - -} - -print <<END; - </TABLE> - </CENTER> - </BODY> -</HTML> -END - diff --git a/htdocs/browse/part_pkg.cgi b/htdocs/browse/part_pkg.cgi deleted file mode 100755 index e5ff31e..0000000 --- a/htdocs/browse/part_pkg.cgi +++ /dev/null @@ -1,81 +0,0 @@ -#!/usr/bin/perl -Tw -# -# part_svc.cgi: browse part_pkg -# -# ivan@sisd.com 97-dec-5,9 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 -# -# lose background, FS::CGI ivan@sisd.com 98-sep-2 - -use strict; -use CGI::Base; -use FS::UID qw(cgisuidsetup swapuid); -use FS::Record qw(qsearch qsearchs); -use FS::CGI qw(header menubar); - -my($cgi) = new CGI::Base; -$cgi->get; - -&cgisuidsetup($cgi); - -SendHeaders(); # one guess. - -print header("Package Part Listing",menubar( - 'Main Menu' => '../', - 'Add new package' => "../edit/part_pkg.cgi", -)), <<END; - <BR>Click on package part number to edit. - <TABLE BORDER> - <TR> - <TH><FONT SIZE=-1>Part #</FONT></TH> - <TH>Package</TH> - <TH>Comment</TH> - <TH><FONT SIZE=-1>Setup Fee</FONT></TH> - <TH><FONT SIZE=-1>Freq.</FONT></TH> - <TH><FONT SIZE=-1>Recur. Fee</FONT></TH> - <TH>Service</TH> - <TH><FONT SIZE=-1>Quan.</FONT></TH> - </TR> -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; - <TR> - <TD ROWSPAN=$rowspan><A HREF="../edit/part_pkg.cgi?$hashref->{pkgpart}"> - $hashref->{pkgpart} - </A></TD> - <TD ROWSPAN=$rowspan>$hashref->{pkg}</TD> - <TD ROWSPAN=$rowspan>$hashref->{comment}</TD> - <TD ROWSPAN=$rowspan>$hashref->{setup}</TD> - <TD ROWSPAN=$rowspan>$hashref->{freq}</TD> - <TD ROWSPAN=$rowspan>$hashref->{recur}</TD> -END - - my($pkg_svc); - foreach $pkg_svc ( @pkg_svc ) { - my($svcpart)=$pkg_svc->getfield('svcpart'); - my($part_svc) = qsearchs('part_svc',{'svcpart'=> $svcpart }); - print qq!<TD><A HREF="../edit/part_svc.cgi?$svcpart">!, - $part_svc->getfield('svc'),"</A></TD><TD>", - $pkg_svc->getfield('quantity'),"</TD></TR><TR>\n"; - } - - print "</TR>"; -} - -print <<END; - </TR></TABLE> - </CENTER> - </BODY> -</HTML> -END - diff --git a/htdocs/browse/part_referral.cgi b/htdocs/browse/part_referral.cgi deleted file mode 100755 index b16fa89..0000000 --- a/htdocs/browse/part_referral.cgi +++ /dev/null @@ -1,57 +0,0 @@ -#!/usr/bin/perl -Tw -# -# part_referral.cgi: Browse part_referral -# -# ivan@sisd.com 98-feb-23 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 -# -# lose background, FS::CGI ivan@sisd.com 98-sep-2 - -use strict; -use CGI::Base; -use FS::UID qw(cgisuidsetup swapuid); -use FS::Record qw(qsearch); -use FS::CGI qw(header menubar); - -my($cgi) = new CGI::Base; -$cgi->get; - -&cgisuidsetup($cgi); - -SendHeaders(); # one guess. -print header("Referral Listing", menubar( - 'Main Menu' => '../', - 'Add new referral' => "../edit/part_referral.cgi", -)), <<END; - <BR>Click on referral number to edit. - <TABLE BORDER> - <TR> - <TH><FONT SIZE=-1>Referral #</FONT></TH> - <TH>Referral</TH> - </TR> -END - -my($part_referral); -foreach $part_referral ( sort { - $a->getfield('refnum') <=> $b->getfield('refnum') -} qsearch('part_referral',{}) ) { - my($hashref)=$part_referral->hashref; - print <<END; - <TR> - <TD><A HREF="../edit/part_referral.cgi?$hashref->{refnum}"> - $hashref->{refnum}</A></TD> - <TD>$hashref->{referral}</TD> - </TR> -END - -} - -print <<END; - </TABLE> - </CENTER> - </BODY> -</HTML> -END - diff --git a/htdocs/browse/part_svc.cgi b/htdocs/browse/part_svc.cgi deleted file mode 100755 index 71a5564..0000000 --- a/htdocs/browse/part_svc.cgi +++ /dev/null @@ -1,81 +0,0 @@ -#!/usr/bin/perl -Tw -# -# part_svc.cgi: browse part_svc -# -# ivan@sisd.com 97-nov-14, 97-dec-9 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 -# -# lose background, FS::CGI ivan@sisd.com 98-sep-2 - -use strict; -use CGI::Base; -use FS::UID qw(cgisuidsetup swapuid); -use FS::Record qw(qsearch); -use FS::part_svc qw(fields); -use FS::CGI qw(header menubar); - -my($cgi) = new CGI::Base; -$cgi->get; - -&cgisuidsetup($cgi); - -SendHeaders(); # one guess. -print header('Service Part Listing', menubar( - 'Main Menu' => '../', - 'Add new service' => "../edit/part_svc.cgi", -)),<<END; - <BR>Click on service part number to edit. - <TABLE BORDER> - <TR> - <TH>Part #</TH> - <TH>Service</TH> - <TH>Table</TH> - <TH>Field</TH> - <TH>Action</TH> - <TH>Value</TH> - </TR> -END - -my($part_svc); -foreach $part_svc ( sort { - $a->getfield('svcpart') <=> $b->getfield('svcpart') -} qsearch('part_svc',{}) ) { - my($hashref)=$part_svc->hashref; - my($svcdb)=$hashref->{svcdb}; - my(@rows)= - grep $hashref->{${svcdb}.'__'.$_.'_flag'}, - map { /^${svcdb}__(.*)$/; $1 } - grep ! /_flag$/, - grep /^${svcdb}__/, - fields('part_svc') - ; - my($rowspan)=scalar(@rows); - print <<END; - <TR> - <TD ROWSPAN=$rowspan><A HREF="../edit/part_svc.cgi?$hashref->{svcpart}"> - $hashref->{svcpart} - </A></TD> - <TD ROWSPAN=$rowspan>$hashref->{svc}</TD> - <TD ROWSPAN=$rowspan>$hashref->{svcdb}</TD> -END - my($row); - foreach $row ( @rows ) { - my($flag)=$part_svc->getfield($svcdb.'__'.$row.'_flag'); - print "<TD>$row</TD><TD>"; - if ( $flag eq "D" ) { print "Default"; } - elsif ( $flag eq "F" ) { print "Fixed"; } - else { print "(Unknown!)"; } - print "</TD><TD>",$part_svc->getfield($svcdb."__".$row),"</TD></TR><TR>"; - } -print "</TR>"; -} - -print <<END; - </TABLE> - </CENTER> - </BODY> -</HTML> -END - diff --git a/htdocs/browse/svc_acct_pop.cgi b/htdocs/browse/svc_acct_pop.cgi deleted file mode 100755 index a8a3a92..0000000 --- a/htdocs/browse/svc_acct_pop.cgi +++ /dev/null @@ -1,63 +0,0 @@ -#!/usr/bin/perl -Tw -# -# svc_acct_pop.cgi: browse pops -# -# ivan@sisd.com 98-mar-8 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 -# -# lose background, FS::CGI ivan@sisd.com 98-sep-2 - -use strict; -use CGI::Base; -use FS::UID qw(cgisuidsetup swapuid); -use FS::Record qw(qsearch qsearchs); -use FS::CGI qw(header menubar); - -my($cgi) = new CGI::Base; -$cgi->get; - -&cgisuidsetup($cgi); - -SendHeaders(); # one guess. -print header('POP Listing', menubar( - 'Main Menu' => '../', - 'Add new POP' => "../edit/svc_acct_pop.cgi", -)), <<END; - <BR>Click on pop number to edit. - <TABLE BORDER> - <TR> - <TH><FONT SIZE=-1>POP #</FONT></TH> - <TH>City</TH> - <TH>State</TH> - <TH>Area code</TH> - <TH>Exchange</TH> - </TR> -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; - <TR> - <TD><A HREF="../edit/svc_acct_pop.cgi?$hashref->{popnum}"> - $hashref->{popnum}</A></TD> - <TD>$hashref->{city}</TD> - <TD>$hashref->{state}</TD> - <TD>$hashref->{ac}</TD> - <TD>$hashref->{exch}</TD> - </TR> -END - -} - -print <<END; - </TABLE> - </CENTER> - </BODY> -</HTML> -END - diff --git a/htdocs/docs/CGI-modules-2.76-patch.txt b/htdocs/docs/CGI-modules-2.76-patch.txt index 55b50bb..9729623 100755 --- a/htdocs/docs/CGI-modules-2.76-patch.txt +++ b/htdocs/docs/CGI-modules-2.76-patch.txt @@ -1,23 +1,39 @@ -ivan@rootwood:~/src/CGI-modules-2.76/CGI$ diff -c Base.pm Base.pm.orig -*** Base.pm Sat Jul 18 00:33:21 1998 ---- Base.pm.orig Sat Jul 18 00:06:12 1998 +# This is a patch for Base.pm.old to update it to Base.pm. +# It was generated by makepatch 1.93 (2.0BETA) on Tue Nov 3 21:44:39 1998. +# +# To apply this patch, chdir to source directory Base.pm.old and enter +# +# patch -p1 -N < <this-file> + +exit +# End of preamble. + +# Patch input follows. +__DATA__ +Index: Base.pm +Prereq: 2.76 +####### => +*** Base.pm.old Wed Oct 14 00:24:12 1998 +--- Base.pm Tue Nov 3 21:38:49 1998 *************** *** 938,945 **** my $orig_uri = $self->get_uri; $self->log("Redirecting $CGI::Base::REQUEST_METHOD $orig_uri to $to_uri") - if $Debug; -! my $msg = ($perm) ? StatusHdr(301,"Moved Permanently") -! : StatusHdr(302,"Moved Temporarily"); + if $Debug; +! my $msg = ($perm) ? ServerHdr(301,"Moved Permanently") +! : ServerHdr(302,"Moved Temporarily"); my $hdrs = SendHeaders($msg, LocationHdr($to_uri)); $self->log($hdrs); } --- 938,945 ---- my $orig_uri = $self->get_uri; $self->log("Redirecting $CGI::Base::REQUEST_METHOD $orig_uri to $to_uri") - if $Debug; -! my $msg = ($perm) ? ServerHdr(301,"Moved Permanently") -! : ServerHdr(302,"Moved Temporarily"); + if $Debug; +! my $msg = ($perm) ? StatusHdr(301,"Moved Permanently") +! : StatusHdr(302,"Moved Temporarily"); my $hdrs = SendHeaders($msg, LocationHdr($to_uri)); $self->log($hdrs); } + +End of Patch. diff --git a/htdocs/docs/admin.html b/htdocs/docs/admin.html deleted file mode 100644 index 8adddbe..0000000 --- a/htdocs/docs/admin.html +++ /dev/null @@ -1,6 +0,0 @@ -<head> - <title>Administration</title> -</head> -<body> - <h1>Administration</h1> -</body> diff --git a/htdocs/docs/billing.html b/htdocs/docs/billing.html deleted file mode 100644 index 02bfbd7..0000000 --- a/htdocs/docs/billing.html +++ /dev/null @@ -1,40 +0,0 @@ -<head> - <title>Billing</title> -</head> -<body> - <h1>Billing</h1> - The bin/bill script can be run daily to bill all customers. Usage: bill [ -c [ i ] ] [ -d <i>date</i> ] [ -b ] - <ul> - <li>-c: Turn on collecting (you probably want this). - <li>-i: Real-time billing (as opposed to bacth billing). Only relevant for credit cards. Not available without modifying site_perl/Bill.pm - <li>-d: Pretend it is <i>date</i> (parsed by Date::Parse) - <li>-b: N/A - </ul> - Printing should be configured on your freeside machine to print invoices. - <br><br>Batch credit card processing - <ul> - <li>After this script is run, a credit card batch will be in the <a href="schema.html#cust_pay_batch">cust_pay_batch</a> table. Export this table to your credit card batching. - <li>When your batch completes, erase the cust_pay_batch records in that batch and add any necessary paymants to the <a href="schema.html#cust_pay">cust_pay</a> table. Example code to add payments is: - <pre>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 -</pre> -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. - </ul> -</body> diff --git a/htdocs/docs/config.html b/htdocs/docs/config.html deleted file mode 100644 index 9b80026..0000000 --- a/htdocs/docs/config.html +++ /dev/null @@ -1,38 +0,0 @@ -<head> - <title>Configuration files</title> -</head> -<body> - <h1>Configuration files</h1> -Configuration files and directories are located in `/var/spool/freeside/conf'. -<ul> - <li>address - Your company name and address, four lines. - <li>bsdshellmachines - Your BSD flavored shell (and mail) machines, one per line. This enables export of `/etc/passwd' and `/etc/master.passwd'. - <li>cybercash2 - <a href="http://www.cybercash.com/cybercash/services/cashreg214.html">CyberCash v2</a> support, four lines: paymentserverhost, paymentserverport, paymentserversecret, and transaction type (`mauthonly' or `mauthcapture'). CCLib.pm is required. - <li>cybercash3.2 - <a href="http://www.cybercash.com/cybercash/services/technology.html">CyberCash v3.2</a> 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. - <li>domain - Your domain name. - <li>erpcdmachines - Your ERPCD authenticaion machines, one per line. This enables export of `/usr/annex/acp_passwd' and `/usr/annex/acp_dialup'. - <li>home - For new users, prefixed to usrename to create a directory name. Should have a leading but not a trailing slash. - <li>lpr - Print command for paper invoices, for example `lpr -h'. - <li>nismachines - Your NIS master (not slave master) machines, one per line. This enables export of `/etc/global/passwd' and `/etc/global/shadow'. - <li>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'. - <li>radiusmachines - Your RADIUS authentication machines, one per line. This enables export of `/etc/raddb/users'. - <li>registries - Directory which contains domain registry information. Each registry is a directory. - <ul> - <li>registries/internic - Currently the only supported registry - <ul> - <li>registries/internic/from - Email address from which InterNIC domain registrations are sent. - <li>regestries/internic/nameservers - The nameservers for InterNIC domain registrations, one per line. Each line contains an IP address and hostname, separated by whitespace. - <li>registries/internic/tech_contact - Technical contact NIC handle for domain registrations. - <li>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'. - <li>registries/internic/to - Email address to which InterNIC domain registrations are sent. - </ul> - </ul> - <li>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. - <li>sendmailmachines - Your sendmail machines, one per line. This enables export of `/etc/virtusertable' and `/etc/sendmail.cw'. - <li>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. - <li>shellmachines - Your Linux and System V flavored shell (and mail) machines, one per line. This enables export of `/etc/passwd' and `/etc/shadow' files. - <li>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. - <li>smtpmachine - SMTP relay for Freeside's outgoing mail. -</ul> -</body> - diff --git a/htdocs/docs/export.html b/htdocs/docs/export.html deleted file mode 100644 index f760b97..0000000 --- a/htdocs/docs/export.html +++ /dev/null @@ -1,39 +0,0 @@ -<head> - <title>File exporting</title> -</head> -<body> - <h1>File exporting</h1> - <ul> - <li>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 <a href="config.html">configuration files</a>, you can export these files to your remote machines unattended; see below. - <ul> - <li>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. - <li>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. - <li>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. - <li>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. - <li>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. - </ul> - <li>site_perl/svc_acct.pm - If a shellmachine is defined, users can be created, modified and deleted remotely; see below. - <ul> - <li>The command `useradd -d <i>homedir</i> -s <i>shell</i> -u <i>uid</i> <i>username</i>' is executed when a user is added. - <li>The command `userdel <i>username</i>' is executed with a user is deleted. - <li>If a user's home directory changes, the command `[ -d <i>old_homedir</i> && ( chmod u+t <i>old_homedir</i>; umask 022; mkdir <i>new_homedir</i>; cd <i>old_homedir</i>; find . -depth -print | cpio -pdm <i>new_homedir</i>; chmod u-t <i>new_homedir</i>; chown -R <i>uid</i>.<i>gid</i> <i>new_homedir</i>; rm -rf <i>old_homedir</i> )' is executed. - </ul> - <li>bin/svc_acct_sm.export will create <a href="http://www.qmail.org">Qmail</a> `rcpthosts', `recipientmap' and `virtualdomains' files and <a href="http://www.sendmail.org">Sendmail</a> `virtusertable' and `sendmail.cw' files in the `/var/spool/freeside/export' directory. Using the appropriate <a href="config.html">configuration files</a>, you can export these files to your remote machines unattemded; see below. - <ul> - <li>qmailmachines - recipientmap, virtualdomains and rcpthosts are copied to the `/var/qmail/control' directory on the remote machine. Note: If you <a href="legacy.html#svc_acct_sm">imported</a> 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. - <li>shellmachine - The command `[ -e <i>homedir</i>/.qmail-default ] || { touch <i>homedir</i>/.qmail-default; chown <i>uid</i>.<i>gid</i> <i>homedir</i>/.qmail-default; }' will be run on this machine for users in the virtualdomains file. - <li>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. - </ul> - <li>site_perl/svc_acct_sm.pm - If the qmailmachines configuration file exists and a shellmachine is defined, user `.qmail-' files can be updated. - <ul> - <li>The command `[ -e <i>homedir</i>/.qmail-<i>domain</i>-default ] || { touch <i>homedir</i>/.qmail-<i>domain</i>-default; chown <i>uid</i>.<i>gid</i> <i>homedir</i>/.qmail-<i>domain</i>-default; }' is run. - </ul> - </ul> - <br><a name=ssh>Unattended remote login</a> - 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. <b>Do not use this feature unless you understand what you are doing!</b> - <ul> - <li>As the freeside user (on your freeside machine), generate an authentication key using <a href="http://www.tac.nyc.ny.us/cgi-bin/man-cgi?ssh-keygen+1">ssh-keygen</a>. Since this is for unattended operation, you need to use a blank passphrase. - <li>Append the newly-created identity.pub file to root's authorized_keys on the remote machine(s). - </ul> - -</body> - diff --git a/htdocs/docs/index.html b/htdocs/docs/index.html deleted file mode 100644 index 20051ca..0000000 --- a/htdocs/docs/index.html +++ /dev/null @@ -1,23 +0,0 @@ -<head> - <title>Documentation</title> -</head> -<body> - <h1>Documentation</h1> -<ul> - <li><a href="install.html">New Installation</a> - <li><a href="upgrade.html">Upgrading from 1.0.x to 1.1.x</a> - <li><a href="upgrade2.html">Upgrading from 1.1.x to 1.1.3</a> - <li><a href="config.html">Configuration files</a> -<!-- - <li><a href="admin.html">Administration</a> -!--> - <li><a href="../index.html#admin">Administration</a> - <li><a href="legacy.html">Importing legacy data</a> - <li><a href="export.html">File exporting and remote setup</a> - <li><a href="passwd.html">fs_passwd</a> - <li><a href="billing.html">Billing</a> - <li><a href="trouble.html">Troubleshooting</a> - <li><a href="schema.html">Schema reference</a> - <li><a href="man/">Perl API</a> -</ul> -</body> diff --git a/htdocs/docs/install.html b/htdocs/docs/install.html deleted file mode 100644 index c4784eb..0000000 --- a/htdocs/docs/install.html +++ /dev/null @@ -1,56 +0,0 @@ -<head> - <title>Installation</title> -</head> -<body> -<h1>Installation</h1> -Before installing, you need: -<ul> - <li>A web server, such as <a href="http://www.apache-ssl.org">Apache-SSL</a> or <a href="http://www.apache.org">Apache</a> - <li><a href="ftp://ftp.cs.hut.fi/pub/ssh/">SSH</a> - <li>agrep from the <a href="http://glimpse.cs.arizona.edu">Glimpse</a> distribution, if you want fuzzy searching capability - <li><a href="http://www.perl.com/CPANl/doc/relinfo/INSTALL.html">Perl</a> (at least 5.004_04) - <li>A database engine supported by Perl's <a href="http://www.hermetica.com/technologia/DBI/">DBI</a>, such as <a href="http://www.tcx.se/">MySQL</a> or <a href="http://www.postgresql.org/">PostgreSQL</a> - <li>Perl modules - <ul> - <li><a href="http://www.perl.com/CPAN/modules/by-module/MIME/">MIME-Base64</a> - <li><a href="http://www.perl.com/CPAN/modules/by-module/Data">Data-Dumper</a> - <li><a href="http://www.perl.com/CPAN/modules/by-module/MD5">MD5</a> - <li><a href="http://www.perl.com/CPAN/modules/by-module/Net">libnet</a> - <li><a href="http://www.perl.com/CPAN/modules/by-module/LWP/">libwww-perl</a> - <li><a href="http://www.perl.com/CPAN/modules/by-module/CGI/">CGI-modules</a> (<b>NOT</b> CGI.pm) with this <a href="CGI-modules-2.76-patch.txt">patch</a> applied - <li><a href="http://www.perl.com/CPAN/modules/by-module/Business/">Business-CreditCard</a> - <li><a href="http://www.perl.com/CPAN/modules/by-module/Data/">Data-ShowTable</a> - <li><a href="http://www.perl.com/CPAN/modules/by-module/Mail/">MailTools</a> - <li><a href="http://www.perl.com/CPAN/modules/by-module/Time/">TimeDate</a> - <li><a href="http://www.perl.com/CPAN/modules/by-module/Date/">DateManip</a> - <li><a href="http://www.perl.com/CPAN/modules/by-module/File/">File-CounterFile</a> - <li><a href="http://www.perl.com/CPAN/modules/by-module/FreezeThaw/">FreezeThaw</a> - <li><a href="http://www.perl.com/CPAN/modules/by-module/DBI/">DBI - <li><a href="http://www.perl.com/CPAN/modules/by-module/DBD/">DBD for your database engine</a> - </ul> -</ul> -Install the Freeside distribution: -<ul> - <li>Add the user `freeside' to your system. - <li>Add the freeside database to your database engine. (with <a href="http://www.mysql.com/Manual_chapter/manual_Syntax.html#Create database">MySQL</a>) (with <a href="http://www.postgresql.org/docs/admin/manage-ag.htm#AEN854">PostgreSQL</a>) - <li>Allow the freeside user full access to the freeside database. (with <a href="http://www.mysql.com/Manual_chapter/manual_Privilege_system.html#Privilege system">MySQL</a>) (with <a href="http://www.postgresql.org/docs/admin/newuser.htm">PostgreSQL</a>) - <li>Unpack the tarball: <pre>gunzip -c fs-x.y.z.tar.gz | tar xvf -</pre> - <li>Copy or link fs-x.y.z/site_perl to FS in your site_perl directory. (try `<code>perl -V</code>' if unsure) <pre>mkdir /usr/local/lib/site_perl/FS -cp fs-x.y.z/site_perl/* /usr/local/lib/site_perl/FS</pre> or <pre>ln -s /full/path/to/fs-x.y.z/site_perl /usr/local/lib/site_perl/FS</pre> - <li>Copy or link fs-x.y.z/htdocs to your web server's document space. <pre>mkdir /usr/local/apache/htdocs/freeside -cp -r fs-x.y.z/htdocs/* /usr/local/apache/htdocs/freeside</pre> or <pre>ln -s /full/path/to/fs-x.y.z/htdocs /usr/local/apache/htdocs/freeside</pre> - <li>Restrict access to this web interface. (with <a href="http://www.apache.org/docs/misc/FAQ.html#user-authentication">Apache</a>) - <li>Enable CGI execution for files with the `.cgi' extension. (with <a href="http://www.apache.org/docs/mod/mod_mime.html#addhandler">Apache</a>) - <li>Set ownership and permissions for the web interface. Your system should support secure setuid scripts or Perl's emulation, see <a href="http://www.perl.com/CPAN-local/doc/manual/html/pod/perlsec.html#Security_Bugs">perlsec: Security Bugs</a> for information and workarounds. -<pre>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</pre> -<li>Create the base Freeside directory `/var/spool/freeside', and the subdirectories `conf', `counters', and `export'. <pre>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</pre> - <li>Create the necessary <a href="config.html">configuration files</a>. - <li>Run bin/fs-setup to create the database tables. -</ul> -</body> diff --git a/htdocs/docs/legacy.html b/htdocs/docs/legacy.html deleted file mode 100644 index 40e09cb..0000000 --- a/htdocs/docs/legacy.html +++ /dev/null @@ -1,34 +0,0 @@ -<head> - <title>Importing legacy data</title> -</head> -<body> - <h1>Importing legacy data</h1> -<ul> - <li><a name="svc_acct">bin/svc_acct.import</a> - Import `passwd', ( `shadow' or `master.passwd' ) and RADIUS `users'. Before running bin/svc_acct.import, you need <a href="http://rootwood.sisd.com/freeside/browse/part_svc.cgi">services</a> (with table svc_acct) as follows: - <ul> - <li>Most accounts probably have entries in passwd and users (with Port-Limit nonexistant or 1) - <li>Some accounts have entries in passwd and users, but with Port-Limit 2 (or more) - <li>Some accounts might have entries in users only (Port-Limit 1) - <li>Some accounts might have entries in users only (Port-Limit >= 2) - <li>POP mail accounts have entries in passwd only, and have a particular shell. - <li>Everything else in passwd is a shell account. - </ul> - <li><a name="svc_acct_sm">bin/svc_acct_sm.import</a> - Import qmail ( `virtualdomains' and `rcpthosts' ), or sendmail ( `virtusertable' and `sendmail.cw' ) files. Before running bin/svc_acct_sm.import, you need <a href="http://rootwood.sisd.com/freeside/browse/part_svc.cgi">services</a> as follows: - <ul> - <li>Domain (table svc_acct) - <li>Mail alias (table svc_acct_sm) - </ul> - <li><a name="cust_main">Importing customer data</a> - <ul> - <li>Manually - <ul> - <li>Add a <a href="../edit/cust_main.cgi">new customer</a> - <li>Add one or more packages for this customer - <li>Enter a package by clicking on the package number - <li>Pick the `Link to existing' option - </ul> - <li>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. - </ul> -</ul> -</body> - diff --git a/htdocs/docs/man/Conf.txt b/htdocs/docs/man/Conf.txt index c46c9ee..5e7be7f 100644 --- a/htdocs/docs/man/Conf.txt +++ b/htdocs/docs/man/Conf.txt @@ -45,3 +45,5 @@ SEE ALSO HISTORY Ivan Kohler <ivan@sisd.com> 98-sep-6 + sub exists forgot to fetch $dir ivan@sisd.com 98-sep-27 + diff --git a/htdocs/docs/man/Invoice.txt b/htdocs/docs/man/Invoice.txt index 17953d5..426359f 100644 --- a/htdocs/docs/man/Invoice.txt +++ b/htdocs/docs/man/Invoice.txt @@ -21,3 +21,7 @@ HISTORY =< 0 return address comes from /var/spool/freeside/conf/address ivan@sisd.com 98-jul-2 + pod ivan@sisd.com 98-sep-20something + + s/ISA/@ISA/ in use vars ivan@sisd.com 98-sep-27 + diff --git a/htdocs/docs/man/Record.txt b/htdocs/docs/man/Record.txt index 0accb65..7570132 100644 --- a/htdocs/docs/man/Record.txt +++ b/htdocs/docs/man/Record.txt @@ -330,3 +330,5 @@ HISTORY added pod documentation ivan@sisd.com 98-sep-6 + ut_phonen got ''; at the end ivan@sisd.com 98-sep-27 + diff --git a/htdocs/docs/man/dbdef_column.txt b/htdocs/docs/man/dbdef_column.txt index 93e2395..6747a32 100644 --- a/htdocs/docs/man/dbdef_column.txt +++ b/htdocs/docs/man/dbdef_column.txt @@ -46,16 +46,17 @@ METHODS line [ $datasrc ] Returns an SQL column definition. - If passed a DBI $datasrc specifying the DBD::mysql manpage, - will use MySQL-specific syntax. Non-standard syntax for - other engines (if applicable) may also be supported in the - future. + If passed a DBI $datasrc specifying the DBD::mysql manpage + or the DBD::Pg manpage, will use engine-specific syntax. BUGS SEE ALSO the FS::dbdef_table manpage, the FS::dbdef manpage, the DBI manpage +VERSION + $Id: dbdef_column.txt,v 1.5 1999-04-08 13:39:32 ivan Exp $ + HISTORY class for dealing with column definitions @@ -67,3 +68,12 @@ HISTORY mySQL-specific hack for null (what should be default?) ivan@sisd.com 98-jun-2 + $Log: dbdef_column.txt,v $ + Revision 1.5 1999-04-08 13:39:32 ivan + convert from pod for 1.2.0 release + Revision 1.3 1998/10/13 13:04:17 ivan + fixed doc to indicate Pg specific syntax too + + Revision 1.2 1998/10/12 23:40:28 ivan added Pg-specific + behaviour in sub line + diff --git a/htdocs/docs/man/dbdef_table.txt b/htdocs/docs/man/dbdef_table.txt index 25e010d..4fcb093 100644 --- a/htdocs/docs/man/dbdef_table.txt +++ b/htdocs/docs/man/dbdef_table.txt @@ -75,6 +75,9 @@ SEE ALSO FS::dbdef_index manpage, the FS::dbdef_unique manpage, the DBI manpage +VERSION + $Id: dbdef_table.txt,v 1.2 1998-10-14 06:52:48 ivan Exp $ + HISTORY class for dealing with table definitions @@ -92,3 +95,8 @@ HISTORY pod ivan@sisd.com 98-sep-24 + $Log: dbdef_table.txt,v $ + Revision 1.2 1998-10-14 06:52:48 ivan + 1,1,4 release, fix postgresql quirks. + + diff --git a/htdocs/docs/passwd.html b/htdocs/docs/passwd.html deleted file mode 100644 index a8f8151..0000000 --- a/htdocs/docs/passwd.html +++ /dev/null @@ -1,16 +0,0 @@ -<head> - <title>fs_passwd</title> -</head> -<body> - <h1>fs_passwd</h1> -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. <b>Do not use this feature unless you understand what you are doing!</b> -<br><br>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. -<ul> - <li>Create a freeside account on the shell machine(s). - <li>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). - <li>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. - <li>Copy fs_passwd/fs_passwdd to /usr/local/sbin on the shell machine(s). (chown freeside, chmod 500) - <li>Create /usr/local/freeside on the shell machine(s). (chown freeside, chmod 700) - <li>Run an iteration of "fs_passwd/fs_passwd_server shell.machine" as the freeside user for each shell machine (this is a daemon process). -</ul> -</body> diff --git a/htdocs/docs/schema.html b/htdocs/docs/schema.html deleted file mode 100644 index 5a296ec..0000000 --- a/htdocs/docs/schema.html +++ /dev/null @@ -1,205 +0,0 @@ -<head> - <title>Schema reference</title> -</head> -<body> - <h1>Schema reference</h1> - <ul> - <li><a name="agent">agent</a> - Agents are resellers of your service. Agents may be limited to a subset of your full offerings (via their agent type). - <ul> - <li>agentnum - primary key - <li>agent - name of this agent - <li>typenum - <a href="#agent_type">agent type</a> - <li>prog - (unimplemented) - <li>freq - (unimplemented) - </ul> - <li><a name="agent_type">agent_type</a> - Agent types define groups of packages that you can then assign to particular agents. - <ul> - <li>typenum - primary key - <li>atype - name of this agent type - </ul> - <li><a name="cust_bill">cust_bill</a> - Invoices - <ul> - <li>invnum - primary key - <li>custnum - <a href="#cust_main">customer</a> - <li>_date - <li>charged - amount of this invoice - <li>owed - amount still outstanding on this invoice - <li>printed - how many times this invoice has been printed automatically - </ul> - <li><a name="cust_bill_pkg">cust_bill_pkg</a> - Invoice line items - <ul> - <li>invnum - (multiple) key - <li>pkgnum - <a href="#cust_pkg">package</a> - <li>setup - setup fee - <li>recur - recurring fee - <li>sdate - starting date - <li>edate - ending date - </ul> - <li><a name="cust_credit">cust_credit</a> - Credits - <ul> - <li>crednum - primary key - <li>custnum - <a href="#cust_main">customer</a> - <li>amount - amount credited - <li>credited - amount still outstanding (not yet refunded) on this credit - <li>_date - <li>otaker - order taker - <li>reason - </ul> - <li><a name="cust_main">cust_main</a> - Customers - <ul> - <li>custnum - primary key - <li>agentnum - <a href="#agent">agent</a> - <li>refnum - <a href="#part_referral">referral</a> - <li>first - name - <li>last - name - <li>ss - social security number - <li>company - <li>address1 - <li>address2 - <li>city - <li>county - <li>state - <li>zip - <li>country - <li>daytime - phone - <li>night - phone - <li>payby - CARD, BILL, or COMP - <li>payinfo - card number, P.O.#, or comp issuer - <li>paydate - expiration date - <li>payname - billing name (name on card) - <li>tax - tax exempt, Y or null - <li>otaker - order taker - </ul> - <li><a name="cust_main_county">cust_main_county</a> - Tax rates - <ul> - <li>taxnum - primary key - <li>state - <li>county - <li>tax - % rate - </ul> - <li><a name="cust_pay">cust_pay</a> - Payments - <ul> - <li>paynum - primary key - <li>invnum - <a href="#cust_bill">invoice</a> - <li>paid - amount - <li>_date - <li>payby - CARD, BILL, or COMP - <li>payinfo - card number, P.O.#, or comp issuer - <li>paybatch - text field for tracking card processor batches - </ul> - <li><a name="cust_pay_batch">cust_pay_batch</a> - Pending batch - <ul> - <li>trancode - 77 for charges - <li>cardnum - <li>exp - card expiration - <li>amount - <li>invnum - <a href="#cust_bill">invoice</a> - <li>custnum - <a href="#cust_main">customer</a> - <li>payname - name on card - <li>first - name - <li>last - name - <li>address1 - <li>address2 - <li>city - <li>state - <li>zip - <li>country - </ul> - <li><a name="cust_pkg">cust_pkg</a> - Customer billing items - <ul> - <li>pkgnum - primary key - <li>custnum - <a href="#cust_main">customer</a> - <li>pkgpart - <a href="#part_pkg">Package definition</a> - <li>setup - date - <li>bill - next bill date - <li>susp - (past) suspension date - <li>expire - (future) cancellation date - <li>cancel - (past) cancellation date - <li>otaker - order taker - </ul> - <li><a name="cust_refund">cust_refund</a> - Refunds - <ul> - <li>refundnum - primary key - <li>crednum - <a href="#cust_credit">credit</a> - <li>refund - amount - <li>_date - <li>payby - CARD, BILL or COMP - <li>payinfo - card number, P.O.#, or comp issuer - <li>otaker - order taker - </ul> - <li><a name="cust_svc">cust_svc</a> - Customer services - <ul> - <li>svcnum - primary key - <li>pkgnum - <a href="#cust_pkg">package</a> - <li>svcpart - <a href="#part_svc">Service definition</a> - </ul> - <li><a name="part_pkg">part_pkg</a> - Package definitions - <ul> - <li>pkgpart - primary key - <li>pkg - package name - <li>comment - non-customer visable package comment - <li>setup - setup fee - <li>freq - recurring frequency (months) - <li>recur - recurring fee - </ul> - <li><a name="part_referral">part_referral</a> - Referral listing - <ul> - <li>refnum</li> - primary key - <li>referral</li> - referral - </ul> - <li><a name="part_svc">part_svc</a> - Service definitions - <ul> - <li>svcpart - primary key - <li>svc - name of this service - <li>svcdb - table used for this service: svc_acct, svc_acct_sm, svc_domain, svc_charge or svc_wo - <li><i>table</i>__<i>field</i> - Default or fixed value for <i>field</i> in <i>table</i> - <li><i>table</i>__<i>field</i>_flag - null, D or F - </ul> - <li><a name="pkg_svc">pkg_svc</a> - <ul> - <li>pkgpart - <a href="#part_pkg">Package definition</a> - <li>svcpart - <a href="#part_svc">Service definition</a> - <li>quantity - quantity of this service that this package includes - </ul> - <li><a name="svc_acct">svc_acct</a> - Accounts - <ul> - <li>svcnum - <a href="#cust_svc">primary key</a> - <li>username - <li>_password - <li>popnum - <a href="#svc_acct_pop">Point of Presence</a> - <li>uid - <li>gid - <li>finger - GECOS - <li>dir - <li>shell - <li>quota - (unimplementd) - <li>slipip - IP address - <li>radius_<i>Radius_Attribute</i> - Radius-Attribute - </ul> - <li><a name="svc_acct_pop">svc_acct_pop</a> - Points of Presence - <ul> - <li>popnum - primary key - <li>city - <li>state - <li>ac - area code - <li>exch - exchange - </ul> - <li><a name="svc_acct_sm">svc_acct_sm</a> - Domain mail aliases - <ul> - <li>svcnum - <a href="#cust_svc">primary key</a> - <li>domsvc - <a href="#svc_domain">Domain</a> (by svcnum) - <li>domuid - <a href="#svc_acct">Account</a> (by uid) - <li>domuser - domuser @ <a href="#svc_domain">Domain</a> forwards to <a href="#svc_acct">Account</a> - </ul> - <li><a name="svc_domain">svc_domain</a> - Domains - <ul> - <li>svcnum - <a href="#cust_svc">primary key</a> - <li>domain - </ul> - <li><a name="type_pkgs">type_pkgs</a> - <ul> - <li>typenum - <a href="#agent_type">agent type</a> - <li>pkgpart - <a href="#part_pkg">Package definition</a> - </ul> - </ul> -</body> diff --git a/htdocs/docs/trouble.html b/htdocs/docs/trouble.html deleted file mode 100644 index 2cf6d4e..0000000 --- a/htdocs/docs/trouble.html +++ /dev/null @@ -1,41 +0,0 @@ -<head> - <title>Troubleshooting</title> -</head> -<body> - <h1>Troubleshooting</h1> - <ul> - <li>When troubleshooting the web interface, helpful information is often in your web server's error log. - <li>Internet Explorer will not work with Freeside's HTML interface. -<a HREF="http://www.netscape.com">Netscape</a>, -<a HREF="http://lynx.browser.org">Lynx</a>, and -<a HREF="http://www.cs.indiana.edu/elisp/w3/docs.html">Emacs/W3</a>, -among others, should work fine. - <li>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. - <li>If you get tons of errors in your web server's error log like this: -<pre> -Ambiguous use of value => resolved to "value" => -at /usr/lib/perl5/site_perl/File/CounterFile.pm line 132. -</pre> - This clutters up your log files but is otherwise harmless. Upgrade to the latest File::CounterFile. - <li>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: -<pre> -access to <i>/your/path</i>/edit/process/<i>some_table</i>.cgi failed for -<i>machine.domain.tld</i>, reason: malformed header from script. -Bad header=HTTP/1.0 302 Moved Temporarily -</pre> - Then you forgot to apply this <a href="CGI-modules-2.76-patch.txt">patch</a> as mentioned in the <a href="install.html">New Installation</a> section of the documentation. - <li>If you get errors like this: -<pre> -UID.pm: Can't open /var/spool/freeside/conf/secrets: Permission denied -at <i>/your/path</i>/site_perl/FS/UID.pm line 26. -BEGIN failed--compilation aborted at -<i>/your/path</i>/edit/process/part_svc.cgi line 15. -</pre> - 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 <a href="install.html">New Installation</a> section of the documentation, set ownership and permissions for the web interface. Your system should support secure setuid scripts or Perl's emulation, see <a href="http://www.perl.com/CPAN-local/doc/manual/html/pod/perlsec.html#Security_Bugs">perlsec: Security Bugs</a> for information and workarounds. -<pre>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</pre> - </ul> -</body> diff --git a/htdocs/docs/upgrade.html b/htdocs/docs/upgrade.html deleted file mode 100644 index d2201f6..0000000 --- a/htdocs/docs/upgrade.html +++ /dev/null @@ -1,24 +0,0 @@ -<head> - <title>Upgrading to 1.1.x</title> -</head> -<body> -<h1>Upgrading to 1.1.x</h1> -<ul> - <li>Back up your data and current Freeside installation. - <li>Unpack a copy of the 1.0.0 distribution in a separate location. - <li>Diff your current installation against the 1.0.0 distribution. - <li>Apply all the diffs you found above, if applicable. - <li>Apply (at least) the following changes to your database: -<pre> -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; -</pre> - <li>Optionally change the field lengths and types to match a 1.1.x install; see `bin/fs-setup'. - <li>Create the necessary <a href="config.html">configuration files</a>, - <li>Copy or symlink htdocs and site_perl to the new 1.1.x copies. - <li>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. -</body> diff --git a/htdocs/docs/upgrade2.html b/htdocs/docs/upgrade2.html deleted file mode 100644 index 4bf7ea4..0000000 --- a/htdocs/docs/upgrade2.html +++ /dev/null @@ -1,11 +0,0 @@ -<head> - <title>Upgrading to 1.1.3</title> -</head> -<body> -<h1>Upgrading to 1.1.3 from 1.1.x</h1> -<ul> - <li>If migrating from 1.0.0, see these <a href="upgrade.html">instructions</a> first. - <li>Back up your data and current Freeside installation. - <li>If applicable, create the new <a href="config.html">configuration files</a>: lpr, cybercash2, cybercash3.2 - <li>Copy or symlink htdocs and site_perl to the new copies. -</body> diff --git a/htdocs/edit/agent.cgi b/htdocs/edit/agent.cgi deleted file mode 100755 index 5bd1165..0000000 --- a/htdocs/edit/agent.cgi +++ /dev/null @@ -1,77 +0,0 @@ -#!/usr/bin/perl -Tw -# -# agent.cgi: Add/Edit agent (output form) -# -# ivan@sisd.com 97-dec-12 -# -# Changes to allow page to work at a relative position in server -# Changed 'type' to 'atype' because Pg6.3 reserves the type word -# bmccane@maxbaud.net 98-apr-3 -# -# use FS::CGI, added inline documentation ivan@sisd.com 98-jul-12 - -use strict; -use CGI::Base; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearch qsearchs); -use FS::agent; -use FS::CGI qw(header menubar); - -my($cgi) = new CGI::Base; -$cgi->get; - -&cgisuidsetup($cgi); - -SendHeaders(); # one guess. - -my($agent,$action); -if ( $cgi->var('QUERY_STRING') =~ /^(\d+)$/ ) { #editing - $agent=qsearchs('agent',{'agentnum'=>$1}); - $action='Edit'; -} else { #adding - $agent=create FS::agent {}; - $action='Add'; -} -my($hashref)=$agent->hashref; - -print header("$action Agent", menubar( - 'Main Menu' => '../', - 'View all agents' => '../browse/agent.cgi', -)), '<FORM ACTION="process/agent.cgi" METHOD=POST>'; - -print qq!<INPUT TYPE="hidden" NAME="agentnum" VALUE="$hashref->{agentnum}">!, - "Agent #", $hashref->{agentnum} ? $hashref->{agentnum} : "(NEW)"; - -print <<END; -<PRE> -Agent <INPUT TYPE="text" NAME="agent" SIZE=32 VALUE="$hashref->{agent}"> -Agent type <SELECT NAME="typenum" SIZE=1> -END - -my($agent_type); -foreach $agent_type (qsearch('agent_type',{})) { - print "<OPTION"; - print " SELECTED" - if $hashref->{typenum} == $agent_type->getfield('typenum'); - print ">", $agent_type->getfield('typenum'), ": ", - $agent_type->getfield('atype'),"\n"; -} - -print <<END; -</SELECT> -Frequency (unimplemented) <INPUT TYPE="text" NAME="freq" VALUE="$hashref->{freq}"> -Program (unimplemented) <INPUT TYPE="text" NAME="prog" VALUE="$hashref->{prog}"> -</PRE> -END - -print qq!<BR><INPUT TYPE="submit" VALUE="!, - $hashref->{agentnum} ? "Apply changes" : "Add agent", - qq!">!; - -print <<END; - </FORM> - </BODY> -</HTML> -END - diff --git a/htdocs/edit/agent_type.cgi b/htdocs/edit/agent_type.cgi deleted file mode 100755 index b9fff45..0000000 --- a/htdocs/edit/agent_type.cgi +++ /dev/null @@ -1,75 +0,0 @@ -#!/usr/bin/perl -Tw -# -# agent_type.cgi: Add/Edit agent type (output form) -# -# ivan@sisd.com 97-dec-10 -# -# Changes to allow page to work at a relative position in server -# Changed 'type' to 'atype' because Pg6.3 reserves the type word -# bmccane@maxbaud.net 98-apr-3 -# -# use FS::CGI, added inline documentation ivan@sisd.com 98-jul-12 - -use strict; -use CGI::Base; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearch qsearchs); -use FS::agent_type; -use FS::CGI qw(header menubar); - -my($cgi) = new CGI::Base; -$cgi->get; - -&cgisuidsetup($cgi); - -SendHeaders(); # one guess. - -my($agent_type,$action); -if ( $cgi->var('QUERY_STRING') =~ /^(\d+)$/ ) { #editing - $agent_type=qsearchs('agent_type',{'typenum'=>$1}); - $action='Edit'; -} else { #adding - $agent_type=create FS::agent_type {}; - $action='Add'; -} -my($hashref)=$agent_type->hashref; - -print header("$action Agent Type", menubar( - 'Main Menu' => '../', - 'View all agent types' => '../browse/agent_type.cgi', -)), '<FORM ACTION="process/agent_type.cgi" METHOD=POST>'; - -print qq!<INPUT TYPE="hidden" NAME="typenum" VALUE="$hashref->{typenum}">!, - "Agent Type #", $hashref->{typenum} ? $hashref->{typenum} : "(NEW)"; - -print <<END; -<BR>Type <INPUT TYPE="text" NAME="atype" SIZE=32 VALUE="$hashref->{atype}"> -<P>Select which packages agents of this type may sell to customers</P> -END - -my($part_pkg); -foreach $part_pkg ( qsearch('part_pkg',{}) ) { - print qq!<BR><INPUT TYPE="checkbox" NAME="pkgpart!, - $part_pkg->getfield('pkgpart'), qq!" !, - # ( 'CHECKED 'x scalar( - qsearchs('type_pkgs',{ - 'typenum' => $agent_type->getfield('typenum'), - 'pkgpart' => $part_pkg->getfield('pkgpart'), - }) - ? 'CHECKED ' - : '', - qq!"VALUE="ON"> !,$part_pkg->getfield('pkg') - ; -} - -print qq!<BR><INPUT TYPE="submit" VALUE="!, - $hashref->{typenum} ? "Apply changes" : "Add agent type", - qq!">!; - -print <<END; - </FORM> - </BODY> -</HTML> -END - diff --git a/htdocs/edit/cust_credit.cgi b/htdocs/edit/cust_credit.cgi deleted file mode 100755 index 75ef212..0000000 --- a/htdocs/edit/cust_credit.cgi +++ /dev/null @@ -1,97 +0,0 @@ -#!/usr/bin/perl -Tw -# -# cust_credit.cgi: Add a credit (output form) -# -# Usage: cust_credit.cgi custnum [ -paybatch ] -# http://server.name/path/cust_credit?custnum [ -paybatch ] -# -# Note: Should be run setuid root as user nobody. -# -# some hooks in here for modifications as well as additions, but needs (lots) more work. -# also see process/cust_credit.cgi, the script that processes the form. -# -# ivan@voicenet.com 96-dec-05 -# -# paybatch field, differentiates between credits & credits+refunds by commandline -# ivan@voicenet.com 96-dec-08 -# -# added (but commented out) sprintf("%.2f" in amount field. Hmm. -# ivan@voicenet.com 97-jan-3 -# -# paybatch stuff thrown out - has checkbox now instead. -# (well, sort of. still passed around for backward compatability and possible editing hook) -# ivan@voicenet.com 97-apr-21 -# -# rewrite ivan@sisd.com 98-mar-16 - -use strict; -use Date::Format; -use CGI::Base qw(:DEFAULT :CGI); #CGI module -use FS::UID qw(cgisuidsetup getotaker); - -my($cgi) = new CGI::Base; -$cgi->get; -cgisuidsetup($cgi); - -#untaint custnum -$QUERY_STRING =~ /^(\d+)$/; -my($custnum)=$1; - -#untaint otaker -my($otaker)=getotaker; - -SendHeaders(); # one guess. -print <<END; -<HTML> - <HEAD> - <TITLE>Post Credit</TITLE> - </HEAD> - <BODY> - <CENTER> - <H1>Post Credit</H1> - </CENTER> - <FORM ACTION="process/cust_credit.cgi" METHOD=POST> - <HR><PRE> -END - -#crednum -my($crednum)=""; -print qq!Credit #<B>!, $crednum ? $crednum : " <I>(NEW)</I>", qq!</B><INPUT TYPE="hidden" NAME="crednum" VALUE="$crednum">!; - -#custnum -print qq!\nCustomer #<B>$custnum</B><INPUT TYPE="hidden" NAME="custnum" VALUE="$custnum">!; - -#paybatch -print qq!<INPUT TYPE="hidden" NAME="paybatch" VALUE="">!; - -#date -my($date)=time; -print qq!\nDate: <B>!, time2str("%D",$date), qq!</B><INPUT TYPE="hidden" NAME="_date" VALUE="$date">!; - -#amount -my($amount)=''; -print qq!\nAmount \$<INPUT TYPE="text" NAME="amount" VALUE="$amount" SIZE=8 MAXLENGTH=8>!; - -#refund? -#print qq! <INPUT TYPE="checkbox" NAME="refund" VALUE="yes">Also post refund!; - -#otaker (hidden) -print qq!<INPUT TYPE="hidden" NAME="otaker" VALUE="$otaker">!; - -#reason -my($reason)=''; -print qq!\nReason <INPUT TYPE="text" NAME="reason" VALUE="$reason" SIZE=72>!; - -print <<END; -</PRE> -<BR> -<CENTER><INPUT TYPE="submit" VALUE="Post"></CENTER> -END - -print <<END; - - </FORM> - </BODY> -</HTML> -END - diff --git a/htdocs/edit/cust_main.cgi b/htdocs/edit/cust_main.cgi deleted file mode 100755 index 1455601..0000000 --- a/htdocs/edit/cust_main.cgi +++ /dev/null @@ -1,214 +0,0 @@ -#!/usr/bin/perl -Tw -# -# cust_main.cgi: Edit a customer (output form) -# -# Usage: cust_main.cgi custnum -# http://server.name/path/cust_main.cgi?custnum -# -# Note: Should be run setuid freeside as user nobody. -# -# ivan@voicenet.com 96-nov-29 -> 96-dec-04 -# -# Blank custnum for new customer. -# ivan@voicenet.com 96-dec-16 -# -# referral defaults to blank, to force people to pick something -# ivan@voicenet.com 97-jun-4 -# -# rewrote for new API -# ivan@voicenet.com 97-jul-28 -# -# new customer is null, not '#' -# otaker gotten from &getotaker instead of $ENV{REMOTE_USER} -# ivan@sisd.com 97-nov-12 -# -# cgisuidsetup($cgi); -# no need for old_ fields. -# now state+county is a select field (took out PA hack) -# used autoloaded $cust_main->field methods -# ivan@sisd.com 97-dec-17 -# -# fixed quoting problems ivan@sisd.com 98-feb-23 -# -# paydate sql update ivan@sisd.com 98-mar-5 -# -# Changes to allow page to work at a relative position in server -# Changed 'day' to 'daytime' because Pg6.3 reserves the day word -# Added test for paydate in mm-dd-yyyy format for Pg6.3 default format -# bmccane@maxbaud.net 98-apr-3 -# -# fixed one missed day->daytime ivan@sisd.com 98-jul-13 - -use strict; -use CGI::Base; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup getotaker); -use FS::Record qw(qsearch qsearchs); -use FS::cust_main; - -my($cgi) = new CGI::Base; -$cgi->get; - -cgisuidsetup($cgi); - -SendHeaders(); # one guess. - -#get record -my($custnum,$action,$cust_main); -if ( $cgi->var('QUERY_STRING') =~ /^(\d+)$/ ) { #editing - $custnum=$1; - $cust_main = qsearchs('cust_main',{'custnum'=>$custnum}); - $action='Edit'; -} else { - $custnum=''; - $cust_main = create FS::cust_main ( {} ); - $cust_main->setfield('otaker',&getotaker); - $cust_main->setfield('country','US'); - $action='Add'; -} - -print <<END; -<HTML> - <HEAD> - <TITLE>Customer $action</TITLE> - </HEAD> - <BODY> - <CENTER> - <H1>Customer $action</H1> - </CENTER> - <FORM ACTION="process/cust_main.cgi" METHOD=POST> - <PRE> -END - -print qq!<INPUT TYPE="hidden" NAME="custnum" VALUE="$custnum">!, - qq!Customer #<FONT SIZE="+1"><B>!; -print $custnum ? $custnum : " (NEW)" , "</B></FONT>"; - -#agentnum -my($agentnum)=$cust_main->agentnum || 1; #set to first agent by default -my(@agents) = qsearch('agent',{}); -print qq!\n\nAgent # <SELECT NAME="agentnum" SIZE="1">!; -my($agent); -foreach $agent (sort { - $a->agent cmp $b->agent; -} @agents) { - print "<OPTION" . " SELECTED"x($agent->agentnum==$agentnum), - ">", $agent->agentnum,": ", $agent->agent, "\n"; -} -print "</SELECT>"; - -#referral -#unless ($custnum) { - my($refnum)=$cust_main->refnum || 0; #to avoid "arguement not numeric" error - my(@referrals) = qsearch('part_referral',{}); - print qq!\nReferral <SELECT NAME="refnum" SIZE="1">!; - print "<OPTION> \n"; - my($referral); - foreach $referral (sort { - $a->refnum <=> $b->refnum; - } @referrals) { - print "<OPTION" . " SELECTED"x($referral->refnum==$refnum), - ">", $referral->refnum, ": ", $referral->referral,"\n"; - } - print "</SELECT>"; -#} - -my($last,$first,$ss,$company,$address1,$address2,$city)=( - $cust_main->last, - $cust_main->first, - $cust_main->ss, - $cust_main->company, - $cust_main->address1, - $cust_main->address2, - $cust_main->city, -); - -print <<END; - - -Name (last)<INPUT TYPE="text" NAME="last" VALUE="$last"> (first)<INPUT TYPE="text" NAME="first" VALUE="$first"> SS# <INPUT TYPE="text" NAME="ss" VALUE="$ss" SIZE=11 MAXLENGTH=11> -Company <INPUT TYPE="text" NAME="company" VALUE="$company"> -Address <INPUT TYPE="text" NAME="address1" VALUE="$address1" SIZE=40 MAXLENGTH=40> - <INPUT TYPE="text" NAME="address2" VALUE="$address2" SIZE=40 MAXLENGTH=40> -City <INPUT TYPE="text" NAME="city" VALUE="$city"> State (county) <SELECT NAME="state" SIZE="1"> -END - -foreach ( qsearch('cust_main_county',{}) ) { - print "<OPTION"; - print " SELECTED" if ( $cust_main->state eq $_->state - && $cust_main->county eq $_->county ); - print ">",$_->state; - print " (",$_->county,")" if $_->county; -} -print "</SELECT>"; - -my($zip,$country,$daytime,$night,$fax)=( - $cust_main->zip, - $cust_main->country, - $cust_main->daytime, - $cust_main->night, - $cust_main->fax, -); - -print <<END; - Zip <INPUT TYPE="text" NAME="zip" VALUE="$zip" SIZE=10 MAXLENGTH=10> -Country: <FONT SIZE="+1"><B>$country</B></FONT><INPUT TYPE="hidden" NAME="country" VALUE="$country"> - -Phone (daytime)<INPUT TYPE="text" NAME="daytime" VALUE="$daytime" SIZE=18 MAXLENGTH=20> (night)<INPUT TYPE="text" NAME="night" VALUE="$night" SIZE=18 MAXLENGTH=20> (fax)<INPUT TYPE="text" NAME="fax" VALUE="$fax" SIZE=12 MAXLENGTH=12> - -END - -my(%payby)=( - 'CARD' => "Credit card ", - 'BILL' => "Billing ", - 'COMP' => "Complimentary", -); -for (qw(CARD BILL COMP)) { - print qq!<INPUT TYPE="radio" NAME="payby" VALUE="$_"!; - print qq! CHECKED! if ($cust_main->payby eq "$_"); - print qq!>$payby{$_}!; -} - - -my($payinfo,$payname,$otaker)=( - $cust_main->payinfo, - $cust_main->payname, - $cust_main->otaker, -); - -my($paydate); -if ( $cust_main->paydate =~ /^(\d{4})-(\d{2})-\d{2}$/ ) { - $paydate="$2/$1" -} elsif ( $cust_main->paydate =~ /^(\d{2})-\d{2}-(\d{4}$)/ ) { - $paydate="$1/$2" -} -else { - $paydate=''; -} - -print <<END; - - Card number , P.O. # or Authorization <INPUT TYPE="text" NAME="payinfo" VALUE="$payinfo" SIZE=19 MAXLENGTH=19> -END - -print qq!Exp. date (MM/YY or MM/YYYY)<INPUT TYPE="text" NAME="paydate" VALUE="$paydate" SIZE=8 MAXLENGTH=7> Billing name <INPUT TYPE="text" NAME="payname" VALUE="$payname">\n<INPUT TYPE="checkbox" NAME="tax" VALUE="Y"!; -print qq! CHECKED! if $cust_main->tax eq "Y"; -print qq!> Tax Exempt!; - -print <<END; - - -Order taken by: <FONT SIZE="+1"><B>$otaker</B></FONT><INPUT TYPE="hidden" NAME="otaker" VALUE="$otaker"> -</PRE> -END - -print qq!<CENTER><INPUT TYPE="submit" VALUE="!, - $custnum ? "Apply Changes" : "Add Customer", qq!"></CENTER>!; - -print <<END; - - </FORM> - </BODY> -</HTML> -END - diff --git a/htdocs/edit/cust_main_county-expand.cgi b/htdocs/edit/cust_main_county-expand.cgi deleted file mode 100755 index 59ff704..0000000 --- a/htdocs/edit/cust_main_county-expand.cgi +++ /dev/null @@ -1,49 +0,0 @@ -#!/usr/bin/perl -Tw -# -# cust_main_county-expand.cgi: Expand a state into counties (output form) -# -# ivan@sisd.com 97-dec-16 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 -# -# lose background, FS::CGI ivan@sisd.com 98-sep-2 - -use strict; -use CGI::Base; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearch qsearchs); -use FS::CGI qw(header menubar); - -my($cgi) = new CGI::Base; -$cgi->get; - -&cgisuidsetup($cgi); - -SendHeaders(); # one guess. - -$cgi->var('QUERY_STRING') =~ /^(\d+)$/ - or die "Illegal taxnum!"; -my($taxnum)=$1; - -my($cust_main_county)=qsearchs('cust_main_county',{'taxnum'=>$taxnum}); -die "Can't expand entry!" if $cust_main_county->getfield('county'); - -print header("Tax Rate (expand state)", menubar( - 'Main Menu' => '../', -)), <<END; - <FORM ACTION="process/cust_main_county-expand.cgi" METHOD=POST> - <INPUT TYPE="hidden" NAME="taxnum" VALUE="$taxnum"> - Separate counties by - <INPUT TYPE="radio" NAME="delim" VALUE="n" CHECKED>line - (rumor has it broken on some browsers) or - <INPUT TYPE="radio" NAME="delim" VALUE="s">whitespace. - <BR><INPUT TYPE="submit" VALUE="Submit"> - <BR><TEXTAREA NAME="counties" ROWS=100></TEXTAREA> - </FORM> - </CENTER> - </BODY> -</HTML> -END - diff --git a/htdocs/edit/cust_main_county.cgi b/htdocs/edit/cust_main_county.cgi deleted file mode 100755 index 904d583..0000000 --- a/htdocs/edit/cust_main_county.cgi +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/perl -Tw -# -# cust_main_county.cgi: Edit tax rates (output form) -# -# ivan@sisd.com 97-dec-13-16 -# -# Changes to allow page to work at a relative position in server -# Changed tax field to accept 6 chars (MO uses 6.1%) -# bmccane@maxbaud.net 98-apr-3 -# -# lose background, FS::CGI ivan@sisd.com 98-sep-2 - -use strict; -use CGI::Base; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearch qsearchs); -use FS::CGI qw(header menubar); - -my($cgi) = new CGI::Base; -$cgi->get; - -&cgisuidsetup($cgi); - -SendHeaders(); # one guess. - -print header("Edit tax rates", menubar( - 'Main Menu' => '../', -)),<<END; - <FORM ACTION="process/cust_main_county.cgi" METHOD=POST> - <TABLE BORDER> - <TR> - <TH><FONT SIZE=-1>State</FONT></TH> - <TH>County</TH> - <TH><FONT SIZE=-1>Tax</FONT></TH> - </TR> -END - -my($cust_main_county); -foreach $cust_main_county ( qsearch('cust_main_county',{}) ) { - my($hashref)=$cust_main_county->hashref; - print <<END; - <TR> - <TD>$hashref->{state}</TD> -END - - print "<TD>", $hashref->{county} - ? $hashref->{county} - : '(ALL)' - , "</TD>"; - - print qq!<TD><INPUT TYPE="text" NAME="tax!, $hashref->{taxnum}, - qq!" VALUE="!, $hashref->{tax}, qq!" SIZE=6 MAXLENGTH=6>%</TD></TR>!; -END - -} - -print <<END; - </TABLE> - <INPUT TYPE="submit" VALUE="Apply changes"> - </FORM> - </CENTER> - </BODY> -</HTML> -END - diff --git a/htdocs/edit/cust_pay.cgi b/htdocs/edit/cust_pay.cgi deleted file mode 100755 index a6cb204..0000000 --- a/htdocs/edit/cust_pay.cgi +++ /dev/null @@ -1,76 +0,0 @@ -#!/usr/bin/perl -Tw -# -# cust_pay.cgi: Add a payment (output form) -# -# Usage: cust_pay.cgi invnum -# http://server.name/path/cust_pay.cgi?invnum -# -# Note: Should be run setuid as user nobody. -# -# some hooks for modifications as well as additions, but needs work. -# -# ivan@voicenet.com 96-dec-11 -# -# rewrite ivan@sisd.com 98-mar-16 - -use strict; -use Date::Format; -use CGI::Base qw(:DEFAULT :CGI); -use FS::UID qw(cgisuidsetup); - -my($cgi) = new CGI::Base; -$cgi->get; -cgisuidsetup($cgi); - -#untaint invnum -$QUERY_STRING =~ /^(\d+)$/; -my($invnum)=$1; - -SendHeaders(); # one guess. -print <<END; -<HTML> - <HEAD> - <TITLE>Enter payment</TITLE> - </HEAD> - <BODY> - <CENTER> - <H1>Enter payment</H1> - </CENTER> - <FORM ACTION="process/cust_pay.cgi" METHOD=POST> - <HR><PRE> -END - -#invnum -print qq!Invoice #<B>$invnum</B><INPUT TYPE="hidden" NAME="invnum" VALUE="$invnum">!; - -#date -my($date)=time; -print qq!<BR>Date: <B>!, time2str("%D",$date), qq!</B><INPUT TYPE="hidden" NAME="_date" VALUE="$date">!; - -#paid -print qq!<BR>Amount \$<INPUT TYPE="text" NAME="paid" VALUE="" SIZE=8 MAXLENGTH=8>!; - -#payby -my($payby)="BILL"; -print qq!<BR>Payby: <B>$payby</B><INPUT TYPE="hidden" NAME="payby" VALUE="$payby">!; - -#payinfo (check # now as payby="BILL" hardcoded.. what to do later?) -my($payinfo)=""; -print qq!<BR>Check #<INPUT TYPE="text" NAME="payinfo" VALUE="$payinfo">!; - -#paybatch -print qq!<INPUT TYPE="hidden" NAME="paybatch" VALUE="">!; - -print <<END; -</PRE> -<BR> -<CENTER><INPUT TYPE="submit" VALUE="Post"></CENTER> -END - -print <<END; - - </FORM> - </BODY> -</HTML> -END - diff --git a/htdocs/edit/cust_pkg.cgi b/htdocs/edit/cust_pkg.cgi deleted file mode 100755 index d7f143d..0000000 --- a/htdocs/edit/cust_pkg.cgi +++ /dev/null @@ -1,137 +0,0 @@ -#!/usr/bin/perl -Tw -# -# cust_pkg.cgi: Add/edit packages (output form) -# -# this is for changing packages around, not editing things within the package -# -# Usage: cust_pkg.cgi custnum -# http://server.name/path/cust_pkg.cgi?custnum -# -# Note: Should be run setuid freeside as user nobody -# -# started with /sales/add/cust_pkg.cgi, which added packages -# ivan@voicenet.com 97-jan-5, 97-mar-21 -# -# Rewrote for new API -# ivan@voicenet.com 97-jul-7 -# -# FS::Search is no more, &cgisuidsetup needs $cgi, ivan@sisd.com 98-mar-7 -# -# Changes to allow page to work at a relative position in server -# Changed to display packages 2-wide in a table -# bmccane@maxbaud.net 98-apr-3 -# -# fixed a pretty cool bug from above which caused a visual glitch ivan@sisd.com -# 98-jun-1 - -use strict; -use CGI::Base qw(:DEFAULT :CGI); # CGI module -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup getotaker); -use FS::Record qw(qsearch qsearchs); - -my($cgi) = new CGI::Base; -$cgi->get; -&cgisuidsetup($cgi); - -my(%pkg,%comment); -foreach (qsearch('part_pkg', {})) { - $pkg{ $_ -> getfield('pkgpart') } = $_->getfield('pkg'); - $comment{ $_ -> getfield('pkgpart') } = $_->getfield('comment'); -} - -#untaint custnum -$QUERY_STRING =~ /^(\d+)$/; -my($custnum)=$1; - -my($otaker)=&getotaker; - -SendHeaders(); -print <<END; -<HTML> - <HEAD> - <TITLE>Add/Edit Packages</TITLE> - </HEAD> - <BODY> - <CENTER> - <H1>Add/Edit Packages</H1> - </CENTER> - <FORM ACTION="process/cust_pkg.cgi" METHOD=POST> - <HR> -END - -#custnum -print qq!<INPUT TYPE="hidden" NAME="new_custnum" VALUE="$custnum">!; - -#current packages (except cancelled packages) -my(@cust_pkg) = grep ! $_->getfield('cancel'), - qsearch('cust_pkg',{'custnum'=>$custnum}); - -if (@cust_pkg) { - print <<END; -<CENTER><FONT SIZE="+2">Current packages</FONT></CENTER> -These are packages the customer currently has. Select those packages you -wish to remove (if any).<BR><BR> -END - - my ($count) = 0 ; - print qq!<CENTER><TABLE>! ; - foreach (@cust_pkg) { - print qq!<TR>! if ($count ==0) ; - my($pkgnum,$pkgpart)=( $_->getfield('pkgnum'), $_->getfield('pkgpart') ); - print qq!<TD><INPUT TYPE="checkbox" NAME="remove_pkg" VALUE="$pkgnum">!, - #qq!$pkgnum: $pkg{$pkgpart} - $comment{$pkgpart}</TD>\n!, - #now you've got to admit this bug was pretty cool - qq!$pkgnum: $pkg{$pkgpart} - $comment{$pkgpart}</TD>\n!; - $count ++ ; - if ($count == 2) - { - $count = 0 ; - print qq!</TR>\n! ; - } - } - print qq!</TABLE></CENTER>! ; - - print "<HR>"; -} - -print <<END; -<CENTER><FONT SIZE="+2">New packages</FONT></CENTER> -These are packages the customer can purchase. Specify the quantity to add -of each package.<BR><BR> -END - -my($cust_main)=qsearchs('cust_main',{'custnum'=>$custnum}); -my($agent)=qsearchs('agent',{'agentnum'=> $cust_main->agentnum }); - -my($type_pkgs); -my ($count) = 0 ; -print qq!<CENTER><TABLE>! ; -foreach $type_pkgs ( qsearch('type_pkgs',{'typenum'=> $agent->typenum }) ) { - my($pkgpart)=$type_pkgs->pkgpart; - print qq!<TR>! if ($count == 0) ; - print <<END; - <TD> - <INPUT TYPE="text" NAME="pkg$pkgpart" VALUE="0" SIZE="2" MAXLENGTH="2"> - $pkgpart: $pkg{$pkgpart} - $comment{$pkgpart}</TD>\n -END - $count ++ ; - if ($count == 2) - { - print qq!</TR>\n! ; - $count = 0 ; - } -} -print qq!</TABLE></CENTER>! ; - -#otaker -print qq!<INPUT TYPE="hidden" NAME="new_otaker" VALUE="$otaker">\n!; - -#submit -print qq!<P><CENTER><INPUT TYPE="submit" VALUE="Order"></CENTER>\n!; - -print <<END; - </FORM> - </BODY> -</HTML> -END diff --git a/htdocs/edit/part_pkg.cgi b/htdocs/edit/part_pkg.cgi deleted file mode 100755 index 9fe739b..0000000 --- a/htdocs/edit/part_pkg.cgi +++ /dev/null @@ -1,102 +0,0 @@ -#!/usr/bin/perl -Tw -# -# part_pkg.cgi: Add/Edit package (output form) -# -# ivan@sisd.com 97-dec-10 -# -# Changes to allow page to work at a relative position in server -# Changed to display services 2-wide in table -# bmccane@maxbaud.net 98-apr-3 -# -# use FS::CGI, added inline documentation ivan@sisd.com 98-jul-12 - -use strict; -use CGI::Base; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearch qsearchs); -use FS::part_pkg; -use FS::pkg_svc; -use FS::CGI qw(header menubar); - -my($cgi) = new CGI::Base; -$cgi->get; - -&cgisuidsetup($cgi); - -SendHeaders(); # one guess. - -my($part_pkg,$action); -if ( $cgi->var('QUERY_STRING') =~ /^(\d+)$/ ) { #editing - $part_pkg=qsearchs('part_pkg',{'pkgpart'=>$1}); - $action='Edit'; -} else { #adding - $part_pkg=create FS::part_pkg {}; - $action='Add'; -} -my($hashref)=$part_pkg->hashref; - -print header("$action Package Definition", menubar( - 'Main Menu' => '../', - 'View all packages' => '../browse/part_pkg.cgi', -)), '<FORM ACTION="process/part_pkg.cgi" METHOD=POST>'; - -print qq!<INPUT TYPE="hidden" NAME="pkgpart" VALUE="$hashref->{pkgpart}">!, - "Package Part #", $hashref->{pkgpart} ? $hashref->{pkgpart} : "(NEW)"; - -print <<END; -<PRE> -Package (customer-visable) <INPUT TYPE="text" NAME="pkg" SIZE=32 VALUE="$hashref->{pkg}"> -Comment (customer-hidden) <INPUT TYPE="text" NAME="comment" SIZE=32 VALUE="$hashref->{comment}"> -Setup fee for this package <INPUT TYPE="text" NAME="setup" VALUE="$hashref->{setup}"> -Recurring fee for this package <INPUT TYPE="text" NAME="recur" VALUE="$hashref->{recur}"> -Frequency (months) of recurring fee <INPUT TYPE="text" NAME="freq" VALUE="$hashref->{freq}"> - -</PRE> - -Enter the quantity of each service this package includes.<BR><BR> -<TABLE BORDER><TR><TH><FONT SIZE=-1>Quan.</FONT></TH><TH>Service</TH> - <TH><FONT SIZE=-1>Quan.</FONT></TH><TH>Service</TH></TR> -END - -my($part_svc); -my($count) = 0 ; -foreach $part_svc ( qsearch('part_svc',{}) ) { - - my($svcpart)=$part_svc->getfield('svcpart'); - my($pkg_svc)=qsearchs('pkg_svc',{ - 'pkgpart' => $part_pkg->getfield('pkgpart'), - 'svcpart' => $svcpart, - }) || create FS::pkg_svc({ - 'pkgpart' => $part_pkg->getfield('pkgpart'), - 'svcpart' => $svcpart, - 'quantity' => 0, - }); - next unless $pkg_svc; - - print qq!<TR>! if $count == 0 ; - print qq!<TD><INPUT TYPE="text" NAME="pkg_svc$svcpart" SIZE=3 VALUE="!, - $pkg_svc->getfield('quantity') || 0,qq!"></TD>!, - qq!<TD><A HREF="part_svc.cgi?!,$part_svc->getfield('svcpart'), - qq!">!, $part_svc->getfield('svc'), "</A></TD>"; - $count ++ ; - if ($count == 2) - { - print qq!</TR>! ; - $count = 0 ; - } -} -print qq!</TR>! if ($count != 0) ; - -print "</TABLE>"; - -print qq!<BR><INPUT TYPE="submit" VALUE="!, - $hashref->{pkgpart} ? "Apply changes" : "Add package", - qq!">!; - -print <<END; - </FORM> - </BODY> -</HTML> -END - diff --git a/htdocs/edit/part_referral.cgi b/htdocs/edit/part_referral.cgi deleted file mode 100755 index f298022..0000000 --- a/htdocs/edit/part_referral.cgi +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/perl -Tw -# -# agent.cgi: Add/Edit referral (output form) -# -# ivan@sisd.com 98-feb-23 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 -# -# confisuing typo on submit button ivan@sisd.com 98-jun-14 -# -# lose background, FS::CGI ivan@sisd.com 98-sep-2 - -use strict; -use CGI::Base; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearch qsearchs); -use FS::part_referral; -use FS::CGI qw(header menubar); - -my($cgi) = new CGI::Base; -$cgi->get; - -&cgisuidsetup($cgi); - -SendHeaders(); # one guess. - -my($part_referral,$action); -if ( $cgi->var('QUERY_STRING') =~ /^(\d+)$/ ) { #editing - $part_referral=qsearchs('part_referral',{'refnum'=>$1}); - $action='Edit'; -} else { #adding - $part_referral=create FS::part_referral {}; - $action='Add'; -} -my($hashref)=$part_referral->hashref; - -print header("$action Referral", menubar( - 'Main Menu' => '../', - 'View all referrals' => "../browse/part_referral.cgi", -)), <<END; - <FORM ACTION="process/part_referral.cgi" METHOD=POST> -END - -#display - -print qq!<INPUT TYPE="hidden" NAME="refnum" VALUE="$hashref->{refnum}">!, - "Referral #", $hashref->{refnum} ? $hashref->{refnum} : "(NEW)"; - -print <<END; -<PRE> -Referral <INPUT TYPE="text" NAME="referral" SIZE=32 VALUE="$hashref->{referral}"> -</PRE> -END - -print qq!<BR><INPUT TYPE="submit" VALUE="!, - $hashref->{refnum} ? "Apply changes" : "Add referral", - qq!">!; - -print <<END; - </FORM> - </BODY> -</HTML> -END - diff --git a/htdocs/edit/part_svc.cgi b/htdocs/edit/part_svc.cgi deleted file mode 100755 index 491c013..0000000 --- a/htdocs/edit/part_svc.cgi +++ /dev/null @@ -1,148 +0,0 @@ -#!/usr/bin/perl -Tw -# -# part_svc.cgi: Add/Edit service (output form) -# -# ivan@sisd.com 97-nov-14 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 -# -# use FS::CGI, added inline documentation ivan@sisd.com 98-jul-12 - -use strict; -use CGI::Base; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearchs); -use FS::part_svc qw(fields); -use FS::CGI qw(header menubar); - -my($cgi) = new CGI::Base; -$cgi->get; - -&cgisuidsetup($cgi); - -SendHeaders(); # one guess. - -my($part_svc,$action); -if ( $cgi->var('QUERY_STRING') =~ /^(\d+)$/ ) { #editing - $part_svc=qsearchs('part_svc',{'svcpart'=>$1}); - $action='Edit'; -} else { #adding - $part_svc=create FS::part_svc {}; - $action='Add'; -} -my($hashref)=$part_svc->hashref; - -print header("$action Service Definition", menubar( - 'Main Menu' => '../', - 'View all services' => '../browse/part_svc.cgi', -)), '<FORM ACTION="process/part_svc.cgi" METHOD=POST>'; - - - -print qq!<INPUT TYPE="hidden" NAME="svcpart" VALUE="$hashref->{svcpart}">!, - "Service Part #", $hashref->{svcpart} ? $hashref->{svcpart} : "(NEW)"; - -print <<END; -<PRE> -Service <INPUT TYPE="text" NAME="svc" VALUE="$hashref->{svc}"> -Table <SELECT NAME="svcdb" SIZE=1> -END - -print map '<OPTION'. ' SELECTED'x($_ eq $hashref->{svcdb}). ">$_\n", qw( - svc_acct svc_domain svc_acct_sm svc_charge svc_wo -); - -print <<END; -</SELECT></PRE> -Services are items you offer to your customers. -<UL><LI>svc_acct - Shell accounts, POP mailboxes, SLIP/PPP and ISDN accounts - <LI>svc_domain - Virtual domains - <LI>svc_acct_sm - Virtual domain mail aliasing - <LI>svc_charge - One-time charges (Partially unimplemented) - <LI>svc_wo - Work orders (Partially unimplemented) -</UL> -For the columns in the table selected above, you can set default or fixed -values. For example, a SLIP/PPP account may have a default (or perhaps fixed) -<B>slipip</B> of <B>0.0.0.0</B>, while a POP mailbox will probably have a fixed -blank <B>slipip</B> as well as a fixed shell something like <B>/bin/true</B> or -<B>/usr/bin/passwd</B>. -<BR><BR> -<TABLE BORDER CELLPADDING=4><TR><TH>Table</TH><TH>Field</TH> -<TH COLSPAN=2>Modifier</TH></TR> -END - -#these might belong somewhere else for other user interfaces -#pry need to eventually create stuff that's shared amount UIs -my(%defs)=( - 'svc_acct' => { - 'dir' => 'Home directory', - 'uid' => 'UID (set to fixed and blank for dial-only)', - 'slipip' => 'IP address', - 'popnum' => '<A HREF="../browse/svc_acct_pop.cgi/">POP number</A>', - 'username' => 'Username', - 'quota' => '(unimplemented)', - '_password' => 'Password', - 'gid' => 'GID (when blank, defaults to UID)', - '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', - }, -); - -my($svcdb); -foreach $svcdb ( qw( - 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)="<TD ROWSPAN=$rowspan>$svcdb</TD>"; - my($row); - foreach $row (@rows) { - my($value)=$part_svc->getfield($svcdb.'__'.$row); - my($flag)=$part_svc->getfield($svcdb.'__'.$row.'_flag'); - print "<TR>$ptmp<TD>$row - <FONT SIZE=-1>$defs{$svcdb}{$row}</FONT></TD>"; - print qq!<TD><INPUT TYPE="radio" NAME="${svcdb}__${row}_flag" VALUE=""!. - ' CHECKED'x($flag eq ''). "><BR>Off</TD>"; - print qq!<TD><INPUT TYPE="radio" NAME="${svcdb}__${row}_flag" VALUE="D"!. - ' CHECKED'x($flag eq 'D'). ">Default "; - print qq!<INPUT TYPE="radio" NAME="${svcdb}__${row}_flag" VALUE="F"!. - ' CHECKED'x($flag eq 'F'). ">Fixed "; - print qq!<BR><INPUT TYPE="text" NAME="${svcdb}__${row}" VALUE="$value">!, - "</TD></TR>"; - $ptmp=''; - } -} -print "</TABLE>"; - -print qq!\n<CENTER><BR><INPUT TYPE="submit" VALUE="!, - $hashref->{svcpart} ? "Apply changes" : "Add service", - qq!"></CENTER>!; - -print <<END; - - </FORM> - </BODY> -</HTML> -END - diff --git a/htdocs/edit/process/agent.cgi b/htdocs/edit/process/agent.cgi deleted file mode 100755 index 5d1ce32..0000000 --- a/htdocs/edit/process/agent.cgi +++ /dev/null @@ -1,53 +0,0 @@ -#!/usr/bin/perl -Tw -# -# process/agent.cgi: Edit agent (process form) -# -# ivan@sisd.com 97-dec-12 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 -# -# lose background, FS::CGI ivan@sisd.com 98-sep-2 - -use strict; -use CGI::Request; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearch qsearchs); -use FS::agent qw(fields); -use FS::CGI qw(idiot); - -my($req)=new CGI::Request; # create form object - -&cgisuidsetup($req->cgi); - -my($agentnum)=$req->param('agentnum'); - -my($old)=qsearchs('agent',{'agentnum'=>$agentnum}) if $agentnum; - -#unmunge typenum -$req->param('typenum') =~ /^(\d+)(:.*)?$/; -$req->param('typenum',$1); - -my($new)=create FS::agent ( { - map { - $_, $req->param($_); - } fields('agent') -} ); - -my($error); -if ( $agentnum ) { - $error=$new->replace($old); -} else { - $error=$new->insert; - $agentnum=$new->getfield('agentnum'); -} - -if ( $error ) { - &idiot($error); -} else { - #$req->cgi->redirect("../../view/agent.cgi?$agentnum"); - #$req->cgi->redirect("../../edit/agent.cgi?$agentnum"); - $req->cgi->redirect("../../browse/agent.cgi"); -} - diff --git a/htdocs/edit/process/agent_type.cgi b/htdocs/edit/process/agent_type.cgi deleted file mode 100755 index 43f129f..0000000 --- a/htdocs/edit/process/agent_type.cgi +++ /dev/null @@ -1,83 +0,0 @@ -#!/usr/bin/perl -Tw -# -# process/agent_type.cgi: Edit agent type (process form) -# -# ivan@sisd.com 97-dec-11 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 -# -# lose background, FS::CGI ivan@sisd.com 98-sep-2 - -use strict; -use CGI::Request; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearch qsearchs); -use FS::agent_type qw(fields); -use FS::type_pkgs; -use FS::CGI qw(idiot); - -my($req)=new CGI::Request; -&cgisuidsetup($req->cgi); - -my($typenum)=$req->param('typenum'); -my($old)=qsearchs('agent_type',{'typenum'=>$typenum}) if $typenum; - -my($new)=create FS::agent_type ( { - map { - $_, $req->param($_); - } fields('agent_type') -} ); - -my($error); -if ( $typenum ) { - $error=$new->replace($old); -} else { - $error=$new->insert; - $typenum=$new->getfield('typenum'); -} - -if ( $error ) { - idiot($error); - exit; -} - -my($part_pkg); -foreach $part_pkg (qsearch('part_pkg',{})) { - my($pkgpart)=$part_pkg->getfield('pkgpart'); - - my($type_pkgs)=qsearchs('type_pkgs',{ - 'typenum' => $typenum, - 'pkgpart' => $pkgpart, - }); - if ( $type_pkgs && ! $req->param("pkgpart$pkgpart") ) { - my($d_type_pkgs)=$type_pkgs; #need to save $type_pkgs for below. - $error=$d_type_pkgs->del; #FS::Record not FS::type_pkgs, - #so ->del not ->delete. hmm. hmm. - if ( $error ) { - idiot($error); - exit; - } - - } elsif ( $req->param("pkgpart$pkgpart") - && ! $type_pkgs - ) { - #ok to clobber it now (but bad form nonetheless?) - $type_pkgs=create FS::type_pkgs ({ - 'typenum' => $typenum, - 'pkgpart' => $pkgpart, - }); - $error= $type_pkgs->insert; - if ( $error ) { - idiot($error); - exit; - } - } - -} - -#$req->cgi->redirect("../../view/agent_type.cgi?$typenum"); -#$req->cgi->redirect("../../edit/agent_type.cgi?$typenum"); -$req->cgi->redirect("../../browse/agent_type.cgi"); - diff --git a/htdocs/edit/process/cust_credit.cgi b/htdocs/edit/process/cust_credit.cgi deleted file mode 100755 index e660b4c..0000000 --- a/htdocs/edit/process/cust_credit.cgi +++ /dev/null @@ -1,70 +0,0 @@ -#!/usr/bin/perl -Tw -# -# process/cust_credit.cgi: Add a credit (process form) -# -# Usage: post form to: -# http://server.name/path/cust_credit.cgi -# -# Note: Should be run setuid root as user nobody. -# -# ivan@voicenet.com 96-dec-05 -> 96-dec-08 -# -# post a refund if $new_paybatch -# ivan@voicenet.com 96-dec-08 -# -# refunds are no longer applied against a specific payment (paybatch) -# paybatch field removed -# ivan@voicenet.com 97-apr-22 -# -# rewrite ivan@sisd.com 98-mar-16 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 - -use strict; -use CGI::Request; -use FS::UID qw(cgisuidsetup getotaker); -use FS::cust_credit; - -my($req)=new CGI::Request; # create form object -cgisuidsetup($req->cgi); - -$req->param('custnum') =~ /^(\d*)$/ or die "Illegal custnum!"; -my($custnum)=$1; - -$req->param('otaker',getotaker); - -my($new) = create FS::cust_credit ( { - map { - $_, $req->param($_); - } qw(custnum _date amount otaker reason) -} ); - -my($error); -$error=$new->insert; -&idiot($error) if $error; - -#no errors, no refund, so view our credit. -$req->cgi->redirect("../../view/cust_main.cgi?$custnum#history"); - -sub idiot { - my($error)=@_; - CGI::Base::SendHeaders(); # one guess - print <<END; -<HTML> - <HEAD> - <TITLE>Error posting credit/refund</TITLE> - </HEAD> - <BODY> - <CENTER> - <H4>Error posting credit/refund</H4> - </CENTER> - Your update did not occur because of the following error: - <P><B>$error</B> - <P>Hit the <I>Back</I> button in your web browser, correct this mistake, and press the <I>Post</I> button again. - </BODY> -</HTML> -END - -} - diff --git a/htdocs/edit/process/cust_main.cgi b/htdocs/edit/process/cust_main.cgi deleted file mode 100755 index 7664dfc..0000000 --- a/htdocs/edit/process/cust_main.cgi +++ /dev/null @@ -1,102 +0,0 @@ -#!/usr/bin/perl -Tw -# -# process/cust_main.cgi: Edit a customer (process form) -# -# Usage: post form to: -# http://server.name/path/cust_main.cgi -# -# Note: Should be run setuid root as user nobody. -# -# ivan@voicenet.com 96-dec-04 -# -# added referral check -# ivan@voicenet.com 97-jun-4 -# -# rewrote for new API -# ivan@voicenet.com 97-jul-28 -# -# same as above (again) and clean up some stuff ivan@sisd.com 98-feb-23 -# -# Changes to allow page to work at a relative position in server -# Changed 'day' to 'daytime' because Pg6.3 reserves the day word -# bmccane@maxbaud.net 98-apr-3 - -use strict; -use CGI::Request; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearchs); -use FS::cust_main; - -my($req)=new CGI::Request; # create form object - -&cgisuidsetup($req->cgi); - -#create new record object - -#unmunge agentnum -$req->param('agentnum', - (split(/:/, ($req->param('agentnum'))[0] ))[0] -); - -#unmunge tax -$req->param('tax','') unless defined($req->param('tax')); - -#unmunge refnum -$req->param('refnum', - (split(/:/, ($req->param('refnum'))[0] ))[0] -); - -#unmunge state/county -$req->param('state') =~ /^(\w+)( \((\w+)\))?$/; -$req->param('state', $1); -$req->param('county', $3 || ''); - -my($new) = create FS::cust_main ( { - map { - $_, $req->param("$_") || '' - } qw(custnum agentnum last first ss company address1 address2 city county - state zip country daytime night fax payby payinfo paydate payname tax - otaker refnum) -} ); - -if ( $new->custnum eq '' ) { - - my($error)=$new->insert; - &idiot($error) if $error; - -} else { #create old record object - - my($old) = qsearchs( 'cust_main', { 'custnum', $new->custnum } ); - &idiot("Old record not found!") unless $old; - my($error)=$new->replace($old); - &idiot($error) if $error; - -} - -my($custnum)=$new->custnum; -$req->cgi->redirect("../../view/cust_main.cgi?$custnum#cust_main"); - -sub idiot { - my($error)=@_; - CGI::Base::SendHeaders(); # one guess - print <<END; -<HTML> - <HEAD> - <TITLE>Error updating customer information</TITLE> - </HEAD> - <BODY> - <CENTER> - <H4>Error updating customer information</H4> - </CENTER> - Your update did not occur because of the following error: - <P><B>$error</B> - <P>Hit the <I>Back</I> button in your web browser, correct this mistake, and submit the form again. - </BODY> -</HTML> -END - - exit; - -} - diff --git a/htdocs/edit/process/cust_main_county-expand.cgi b/htdocs/edit/process/cust_main_county-expand.cgi deleted file mode 100755 index a821560..0000000 --- a/htdocs/edit/process/cust_main_county-expand.cgi +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/perl -Tw -# -# process/cust_main_county-expand.cgi: Expand counties (process form) -# -# ivan@sisd.com 97-dec-16 -# -# Changes to allow page to work at a relative position in server -# Added import of datasrc from UID.pm for Pg6.3 -# Default tax to 0.0 if using Pg6.3 -# bmccane@maxbaud.net 98-apr-3 -# -# lose background, FS::CGI -# undo default tax to 0.0 if using Pg6.3: comes from pre-expanded record -# for that state -#ivan@sisd.com 98-sep-2 - -use strict; -use CGI::Request; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup datasrc); -use FS::Record qw(qsearch qsearchs); -use FS::cust_main_county; -use FS::CGI qw(eidiot); - -my($req)=new CGI::Request; # create form object - -&cgisuidsetup($req->cgi); - -$req->param('taxnum') =~ /^(\d+)$/ or die "Illegal taxnum!"; -my($taxnum)=$1; -my($cust_main_county)=qsearchs('cust_main_county',{'taxnum'=>$taxnum}) - or die ("Unknown taxnum!"); - -my(@counties); -if ( $req->param('delim') eq 'n' ) { - @counties=split(/\n/,$req->param('counties')); -} elsif ( $req->param('delim') eq 's' ) { - @counties=split(/\s+/,$req->param('counties')); -} else { - die "Illegal delim!"; -} - -@counties=map { - /^\s*([\w\- ]+)\s*$/ or eidiot("Illegal county"); - $1; -} @counties; - -my($county); -foreach ( @counties) { - my(%hash)=$cust_main_county->hash; - my($new)=create FS::cust_main_county \%hash; - $new->setfield('taxnum',''); - $new->setfield('county',$_); - #if (datasrc =~ m/Pg/) - #{ - # $new->setfield('tax',0.0); - #} - my($error)=$new->insert; - die $error if $error; -} - -unless ( qsearch('cust_main',{ - 'state' => $cust_main_county->getfield('state'), - 'county' => $cust_main_county->getfield('county'), -} ) ) { - my($error)=($cust_main_county->delete); - die $error if $error; -} - -$req->cgi->redirect("../../edit/cust_main_county.cgi"); - diff --git a/htdocs/edit/process/cust_main_county.cgi b/htdocs/edit/process/cust_main_county.cgi deleted file mode 100755 index 58eaa63..0000000 --- a/htdocs/edit/process/cust_main_county.cgi +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/perl -Tw -# -# process/agent.cgi: Edit cust_main_county (process form) -# -# ivan@sisd.com 97-dec-16 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 -# -# lose background, FS::CGI ivan@sisd.com 98-sep-2 - -use strict; -use CGI::Request; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearch qsearchs); -use FS::cust_main_county; -use FS::CGI qw(eidiot); - -my($req)=new CGI::Request; # create form object - -&cgisuidsetup($req->cgi); - -foreach ( $req->params ) { - /^tax(\d+)$/ or die "Illegal form $_!"; - my($taxnum)=$1; - my($old)=qsearchs('cust_main_county',{'taxnum'=>$taxnum}) - or die "Couldn't find taxnum $taxnum!"; - next unless $old->getfield('tax') ne $req->param("tax$taxnum"); - my(%hash)=$old->hash; - $hash{tax}=$req->param("tax$taxnum"); - my($new)=create FS::cust_main_county \%hash; - my($error)=$new->replace($old); - eidiot($error) if $error; -} - -$req->cgi->redirect("../../browse/cust_main_county.cgi"); - diff --git a/htdocs/edit/process/cust_pay.cgi b/htdocs/edit/process/cust_pay.cgi deleted file mode 100755 index 9ec9753..0000000 --- a/htdocs/edit/process/cust_pay.cgi +++ /dev/null @@ -1,57 +0,0 @@ -#!/usr/bin/perl -Tw -# -# process/cust_pay.cgi: Add a payment (process form) -# -# Usage: post form to: -# http://server.name/path/cust_pay.cgi -# -# Note: Should be run setuid root as user nobody. -# -# ivan@voicenet.com 96-dec-11 -# -# rewrite ivan@sisd.com 98-mar-16 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 - -use strict; -use CGI::Request; -use FS::UID qw(cgisuidsetup); -use FS::cust_pay qw(fields); - -my($req)=new CGI::Request; -&cgisuidsetup($req->cgi); - -$req->param('invnum') =~ /^(\d*)$/ or die "Illegal svcnum!"; -my($invnum)=$1; - -my($new) = create FS::cust_pay ( { - map { - $_, $req->param($_); - } qw(invnum paid _date payby payinfo paybatch) -} ); - -my($error); -$error=$new->insert; - -if ($error) { #error! - CGI::Base::SendHeaders(); # one guess - print <<END; -<HTML> - <HEAD> - <TITLE>Error posting payment</TITLE> - </HEAD> - <BODY> - <CENTER> - <H4>Error posting payment</H4> - </CENTER> - Your update did not occur because of the following error: - <P><B>$error</B> - <P>Hit the <I>Back</I> button in your web browser, correct this mistake, and press the <I>Post</I> button again. - </BODY> -</HTML> -END -} else { #no errors! - $req->cgi->redirect("../../view/cust_bill.cgi?$invnum"); -} - diff --git a/htdocs/edit/process/cust_pkg.cgi b/htdocs/edit/process/cust_pkg.cgi deleted file mode 100755 index 6f5bc87..0000000 --- a/htdocs/edit/process/cust_pkg.cgi +++ /dev/null @@ -1,73 +0,0 @@ -#!/usr/bin/perl -Tw -# -# process/cust_pkg.cgi: Add/edit packages (process form) -# -# this is for changing packages around, not for editing things within the -# package -# -# Usage: post form to: -# http://server.name/path/cust_pkg.cgi -# -# Note: Should be run setuid root as user nobody. -# -# ivan@voicenet.com 97-mar-21 - 97-mar-24 -# -# rewrote for new API -# ivan@voicenet.com 97-jul-7 - 15 -# -# &cgisuidsetup($cgi) ivan@sisd.com 98-mar-7 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 - -use strict; -use CGI::Request; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::cust_pkg; - -my($req)=new CGI::Request; # create form object - -&cgisuidsetup($req->cgi); - -#untaint custnum -$req->param('new_custnum') =~ /^(\d+)$/; -my($custnum)=$1; - -my(@remove_pkgnums) = map { - /^(\d+)$/ or die "Illegal remove_pkg value!"; - $1; -} $req->param('remove_pkg'); - -my(@pkgparts); -my($pkgpart); -foreach $pkgpart ( map /^pkg(\d+)$/ ? $1 : (), $req->params ) { - my($num_pkgs)=$req->param("pkg$pkgpart"); - while ( $num_pkgs-- ) { - push @pkgparts,$pkgpart; - } -} - -my($error) = FS::cust_pkg::order($custnum,\@pkgparts,\@remove_pkgnums); - -if ($error) { - CGI::Base::SendHeaders(); - print <<END; -<HTML> - <HEAD> - <TITLE>Error updating packages</TITLE> - </HEAD> - <BODY> - <CENTER> - <H4>Error updating packages</H4> - </CENTER> - Your update did not occur because of the following error: - <P><B>$error</B> - <P>Hit the <I>Back</I> button in your web browser, correct this mistake, and submit the form again. - </BODY> -</HTML> -END -} else { - $req->cgi->redirect("../../view/cust_main.cgi?$custnum#cust_pkg"); -} - diff --git a/htdocs/edit/process/part_pkg.cgi b/htdocs/edit/process/part_pkg.cgi deleted file mode 100755 index 7d78781..0000000 --- a/htdocs/edit/process/part_pkg.cgi +++ /dev/null @@ -1,79 +0,0 @@ -#!/usr/bin/perl -Tw -# -# process/part_pkg.cgi: Edit package definitions (process form) -# -# ivan@sisd.com 97-dec-10 -# -# don't update non-changing records in part_svc (causing harmless but annoying -# "Records identical" errors). ivan@sisd.com 98-feb-19 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 -# -# Added `|| 0 ' when getting quantity off web page ivan@sisd.com 98-jun-4 -# -# lose background, FS::CGI ivan@sisd.com 98-sep-2 - -use strict; -use CGI::Request; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearch qsearchs); -use FS::part_pkg qw(fields); -use FS::pkg_svc; -use FS::CGI qw(eidiot); - -my($req)=new CGI::Request; # create form object - -&cgisuidsetup($req->cgi); - -my($pkgpart)=$req->param('pkgpart'); - -my($old)=qsearchs('part_pkg',{'pkgpart'=>$pkgpart}) if $pkgpart; - -my($new)=create FS::part_pkg ( { - map { - $_, $req->param($_); - } fields('part_pkg') -} ); - -if ( $pkgpart ) { - my($error)=$new->replace($old); - eidiot($error) if $error; -} else { - my($error)=$new->insert; - eidiot($error) if $error; - $pkgpart=$new->getfield('pkgpart'); -} - -my($part_svc); -foreach $part_svc (qsearch('part_svc',{})) { -# don't update non-changing records in part_svc (causing harmless but annoying -# "Records identical" errors). ivan@sisd.com 98-jan-19 - #my($quantity)=$req->param('pkg_svc'. $part_svc->getfield('svcpart')), - my($quantity)=$req->param('pkg_svc'. $part_svc->svcpart) || 0, - my($old_pkg_svc)=qsearchs('pkg_svc',{ - 'pkgpart' => $pkgpart, - 'svcpart' => $part_svc->getfield('svcpart'), - }); - my($old_quantity)=$old_pkg_svc ? $old_pkg_svc->quantity : 0; - next unless $old_quantity != $quantity; #!here - my($new_pkg_svc)=create FS::pkg_svc({ - 'pkgpart' => $pkgpart, - 'svcpart' => $part_svc->getfield('svcpart'), - #'quantity' => $req->param('pkg_svc'. $part_svc->getfield('svcpart')), - 'quantity' => $quantity, - }); - if ($old_pkg_svc) { - my($error)=$new_pkg_svc->replace($old_pkg_svc); - eidiot($error) if $error; - } else { - my($error)=$new_pkg_svc->insert; - eidiot($error) if $error; - } -} - -#$req->cgi->redirect("../../view/part_pkg.cgi?$pkgpart"); -#$req->cgi->redirect("../../edit/part_pkg.cgi?$pkgpart"); -$req->cgi->redirect("../../browse/part_pkg.cgi"); - diff --git a/htdocs/edit/process/part_referral.cgi b/htdocs/edit/process/part_referral.cgi deleted file mode 100755 index 08a4c01..0000000 --- a/htdocs/edit/process/part_referral.cgi +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/perl -Tw -# -# process/part_referral.cgi: Edit referrals (process form) -# -# ivan@sisd.com 98-feb-23 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 -# -# lose background, FS::CGI ivan@sisd.com 98-sep-2 - -use strict; -use CGI::Request; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearchs); -use FS::part_referral qw(fields); -use FS::CGI qw(eidiot); -use FS::CGI qw(eidiot); - -my($req)=new CGI::Request; # create form object - -&cgisuidsetup($req->cgi); - -my($refnum)=$req->param('refnum'); - -my($new)=create FS::part_referral ( { - map { - $_, $req->param($_); - } fields('part_referral') -} ); - -if ( $refnum ) { - my($old)=qsearchs('part_referral',{'refnum'=>$refnum}); - eidiot("(Old) Record not found!") unless $old; - my($error)=$new->replace($old); - eidiot($error) if $error; -} else { - my($error)=$new->insert; - eidiot($error) if $error; -} - -$refnum=$new->getfield('refnum'); -$req->cgi->redirect("../../browse/part_referral.cgi"); - diff --git a/htdocs/edit/process/part_svc.cgi b/htdocs/edit/process/part_svc.cgi deleted file mode 100755 index 0f0fbc6..0000000 --- a/htdocs/edit/process/part_svc.cgi +++ /dev/null @@ -1,47 +0,0 @@ -#!/usr/bin/perl -Tw -# -# process/part_svc.cgi: Edit service definitions (process form) -# -# ivan@sisd.com 97-nov-14 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 -# -# lose background, FS::CGI ivan@sisd.com 98-sep-2 - -use strict; -use CGI::Request; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearchs); -use FS::part_svc qw(fields); -use FS::CGI qw(eidiot); - -my($req)=new CGI::Request; # create form object - -&cgisuidsetup($req->cgi); - -my($svcpart)=$req->param('svcpart'); - -my($old)=qsearchs('part_svc',{'svcpart'=>$svcpart}) if $svcpart; - -my($new)=create FS::part_svc ( { - map { - $_, $req->param($_); -# } qw(svcpart svc svcdb) - } fields('part_svc') -} ); - -if ( $svcpart ) { - my($error)=$new->replace($old); - eidiot($error) if $error; -} else { - my($error)=$new->insert; - eidiot($error) if $error; - $svcpart=$new->getfield('svcpart'); -} - -#$req->cgi->redirect("../../view/part_svc.cgi?$svcpart"); -#$req->cgi->redirect("../../edit/part_svc.cgi?$svcpart"); -$req->cgi->redirect("../../browse/part_svc.cgi"); - diff --git a/htdocs/edit/process/svc_acct.cgi b/htdocs/edit/process/svc_acct.cgi deleted file mode 100755 index 8d77ba7..0000000 --- a/htdocs/edit/process/svc_acct.cgi +++ /dev/null @@ -1,87 +0,0 @@ -#!/usr/bin/perl -Tw -# -# process/svc_acct.cgi: Add/edit a customer (process form) -# -# Usage: post form to: -# http://server.name/path/svc_acct.cgi -# -# Note: Should br run setuid root as user nobody. -# -# ivan@voicenet.com 96-dec-18 -# -# Changed /u to /u2 -# ivan@voicenet.com 97-may-6 -# -# rewrote for new API -# ivan@voicenet.com 97-jul-17 - 21 -# -# no FS::Search, FS::svc_acct creates FS::cust_svc record, used for adding -# and editing ivan@sisd.com 98-mar-8 -# -# Changes to allow page to work at a relative position in server -# Changed 'password' to '_password' because Pg6.3 reserves the password word -# bmccane@maxbaud.net 98-apr-3 - -use strict; -use CGI::Request; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearchs); -use FS::svc_acct; - -my($req) = new CGI::Request; # create form object -&cgisuidsetup($req->cgi); - -$req->param('svcnum') =~ /^(\d*)$/ or die "Illegal svcnum!"; -my($svcnum)=$1; - -my($old)=qsearchs('svc_acct',{'svcnum'=>$svcnum}) if $svcnum; - -#unmunge popnum -$req->param('popnum', (split(/:/, $req->param('popnum') ))[0] ); - -#unmunge passwd -if ( $req->param('_password') eq '*HIDDEN*' ) { - $req->param('_password',$old->getfield('_password')); -} - -my($new) = create FS::svc_acct ( { - map { - $_, $req->param($_); - } qw(svcnum pkgnum svcpart username _password popnum uid gid finger dir - shell quota slipip) -} ); - -if ( $svcnum ) { - my($error) = $new->replace($old); - &idiot($error) if $error; -} else { - my($error) = $new->insert; - &idiot($error) if $error; - $svcnum = $new->getfield('svcnum'); -} - -#no errors, view account -$req->cgi->redirect("../../view/svc_acct.cgi?" . $svcnum ); - -sub idiot { - my($error)=@_; - CGI::Base::SendHeaders(); # one guess - print <<END; -<HTML> - <HEAD> - <TITLE>Error adding/updating account</TITLE> - </HEAD> - <BODY> - <CENTER> - <H4>Error adding/updating account</H4> - </CENTER> - Your update did not occur because of the following error: - <P><B>$error</B> - <P>Hit the <I>Back</I> button in your web browser, correct this mistake, and submit the form again. - </BODY> -</HTML> -END - exit; -} - diff --git a/htdocs/edit/process/svc_acct_pop.cgi b/htdocs/edit/process/svc_acct_pop.cgi deleted file mode 100755 index 18d7940..0000000 --- a/htdocs/edit/process/svc_acct_pop.cgi +++ /dev/null @@ -1,43 +0,0 @@ -#!/usr/bin/perl -Tw -# -# process/svc_acct_pop.cgi: Edit POP (process form) -# -# ivan@sisd.com 98-mar-8 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 -# -# lose background, FS::CGI ivan@sisd.com 98-sep-2 - -use strict; -use CGI::Request; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearch qsearchs); -use FS::svc_acct_pop qw(fields); -use FS::CGI qw(eidiot); - -my($req)=new CGI::Request; # create form object - -&cgisuidsetup($req->cgi); - -my($popnum)=$req->param('popnum'); - -my($old)=qsearchs('svc_acct_pop',{'popnum'=>$popnum}) if $popnum; - -my($new)=create FS::svc_acct_pop ( { - map { - $_, $req->param($_); - } fields('svc_acct_pop') -} ); - -if ( $popnum ) { - my($error)=$new->replace($old); - eidiot($error) if $error; -} else { - my($error)=$new->insert; - eidiot($error) if $error; - $popnum=$new->getfield('popnum'); -} -$req->cgi->redirect("../../browse/svc_acct_pop.cgi"); - diff --git a/htdocs/edit/process/svc_acct_sm.cgi b/htdocs/edit/process/svc_acct_sm.cgi deleted file mode 100755 index 9ad546b..0000000 --- a/htdocs/edit/process/svc_acct_sm.cgi +++ /dev/null @@ -1,80 +0,0 @@ -#!/usr/bin/perl -Tw -# -# process/svc_acct_sm.cgi: Add/edit a mail alias (process form) -# -# Usage: post form to: -# http://server.name/path/svc_acct_sm.cgi -# -# Note: Should br run setuid root as user nobody. -# -# lots of crufty stuff from svc_acct still in here, and modifications are (unelegantly) disabled. -# -# ivan@voicenet.com 97-jan-6 -# -# enabled modifications -# -# ivan@voicenet.com 97-may-7 -# -# fixed removal of cust_svc record on modifications! -# ivan@voicenet.com 97-jun-5 -# -# rewrite ivan@sisd.com 98-mar-15 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 - -use strict; -use CGI::Request; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearchs); -use FS::svc_acct_sm; - -my($req)=new CGI::Request; # create form object -cgisuidsetup($req->cgi); - -$req->param('svcnum') =~ /^(\d*)$/ or die "Illegal svcnum!"; -my($svcnum)=$1; - -my($old)=qsearchs('svc_acct_sm',{'svcnum'=>$svcnum}) if $svcnum; - -#unmunge domsvc and domuid -$req->param('domsvc',(split(/:/, $req->param('domsvc') ))[0] ); -$req->param('domuid',(split(/:/, $req->param('domuid') ))[0] ); - -my($new) = create FS::svc_acct_sm ( { - map { - ($_, scalar($req->param($_))); - } qw(svcnum pkgnum svcpart domuser domuid domsvc) -} ); - -my($error); -if ( $svcnum ) { - $error = $new->replace($old); -} else { - $error = $new->insert; - $svcnum = $new->getfield('svcnum'); -} - -unless ($error) { - $req->cgi->redirect("../../view/svc_acct_sm.cgi?$svcnum"); -} else { - CGI::Base::SendHeaders(); # one guess - print <<END; -<HTML> - <HEAD> - <TITLE>Error adding/editing mail alias</TITLE> - </HEAD> - <BODY> - <CENTER> - <H4>Error adding/editing mail alias</H4> - </CENTER> - Your update did not occur because of the following error: - <P><B>$error</B> - <P>Hit the <I>Back</I> button in your web browser, correct this mistake, and submit the form again. - </BODY> -</HTML> -END - -} - diff --git a/htdocs/edit/process/svc_domain.cgi b/htdocs/edit/process/svc_domain.cgi deleted file mode 100755 index 0782772..0000000 --- a/htdocs/edit/process/svc_domain.cgi +++ /dev/null @@ -1,78 +0,0 @@ -#!/usr/bin/perl -Tw -# -# process/svc_domain.cgi: Add a domain (process form) -# -# Usage: post form to: -# http://server.name/path/svc_domain.cgi -# -# Note: Should br run setuid root as user nobody. -# -# lots of yucky stuff in this one... bleachlkjhui! -# -# ivan@voicenet.com 97-jan-6 -# -# kludged for new domain template 3.5 -# ivan@voicenet.com 97-jul-24 -# -# moved internic bits to svc_domain.pm ivan@sisd.com 98-mar-14 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 - -use strict; -use CGI::Request; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearchs); -use FS::svc_domain; - -#remove this to actually test the domains! -$FS::svc_domain::whois_hack = 1; - -my($req) = new CGI::Request; -&cgisuidsetup($req->cgi); - -$req->param('svcnum') =~ /^(\d*)$/ or die "Illegal svcnum!"; -my($svcnum)=$1; - -my($new) = create FS::svc_domain ( { - map { - $_, $req->param($_); - } qw(svcnum pkgnum svcpart domain action purpose) -} ); - -my($error); -if ($req->param('legal') ne "Yes") { - $error = "Customer did not agree to be bound by NSI's ". - qq!<A HREF="http://rs.internic.net/help/agreement.txt">!. - "Domain Name Resgistration Agreement</A>"; -} elsif ($req->param('svcnum')) { - $error="Can't modify a domain!"; -} else { - $error=$new->insert; - $svcnum=$new->svcnum; -} - -unless ($error) { - $req->cgi->redirect("../../view/svc_domain.cgi?$svcnum"); -} else { - CGI::Base::SendHeaders(); # one guess - print <<END; -<HTML> - <HEAD> - <TITLE>Error adding domain</TITLE> - </HEAD> - <BODY> - <CENTER> - <H4>Error adding domain</H4> - </CENTER> - Your update did not occur because of the following error: - <P><B>$error</B> - <P>Hit the <I>Back</I> button in your web browser, correct this mistake, and submit the form again. - </BODY> -</HTML> -END - -} - - diff --git a/htdocs/edit/svc_acct.cgi b/htdocs/edit/svc_acct.cgi deleted file mode 100755 index 61d0fdc..0000000 --- a/htdocs/edit/svc_acct.cgi +++ /dev/null @@ -1,191 +0,0 @@ -#!/usr/bin/perl -Tw -# -# svc_acct.cgi: Add/edit account (output form) -# -# Usage: svc_acct.cgi {svcnum} | pkgnum{pkgnum}-svcpart{svcpart} -# http://server.name/path/svc_acct.cgi? {svcnum} | pkgnum{pkgnum}-svcpart{svcpart} -# -# Note: Should be run setuid freeside as user nobody -# -# ivan@voicenet.com 96-dec-18 -# -# rewrite ivan@sisd.com 98-mar-8 -# -# Changes to allow page to work at a relative position in server -# Changed 'password' to '_password' because Pg6.3 reserves the password word -# bmccane@maxbaud.net 98-apr-3 -# -# use conf/shells and dbdef username length ivan@sisd.com 98-jul-13 - -use strict; -use CGI::Base qw(:DEFAULT :CGI); -use FS::UID qw(cgisuidsetup getotaker); -use FS::Record qw(qsearch qsearchs); -use FS::svc_acct qw(fields); - -my($shells)="/var/spool/freeside/conf/shells"; -open(SHELLS,$shells) or die "Can't open $shells: $!"; -my(@shells)=map { - /^([\/\w]*)$/ or die "Illegal shell in conf/shells!"; - $1; -} grep $_ !~ /^#/, <SHELLS>; - -my($cgi) = new CGI::Base; -$cgi->get; -&cgisuidsetup($cgi); - -my($action,$svcnum,$svc_acct,$pkgnum,$svcpart,$part_svc); - -if ( $QUERY_STRING =~ /^(\d+)$/ ) { #editing - - $svcnum=$1; - $svc_acct=qsearchs('svc_acct',{'svcnum'=>$svcnum}) - or die "Unknown (svc_acct) svcnum!"; - - my($cust_svc)=qsearchs('cust_svc',{'svcnum'=>$svcnum}) - or die "Unknown (cust_svc) svcnum!"; - - $pkgnum=$cust_svc->pkgnum; - $svcpart=$cust_svc->svcpart; - - $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart}); - die "No part_svc entry!" unless $part_svc; - - $action="Edit"; - -} else { #adding - - $svc_acct=create FS::svc_acct({}); - - foreach $_ (split(/-/,$QUERY_STRING)) { - $pkgnum=$1 if /^pkgnum(\d+)$/; - $svcpart=$1 if /^svcpart(\d+)$/; - } - $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart}); - die "No part_svc entry!" unless $part_svc; - - $svcnum=''; - - #set gecos - my($cust_pkg)=qsearchs('cust_pkg',{'pkgnum'=>$pkgnum}); - if ($cust_pkg) { - my($cust_main)=qsearchs('cust_main',{'custnum'=> $cust_pkg->custnum } ); - $svc_acct->setfield('finger', - $cust_main->getfield('first') . " " . $cust_main->getfield('last') - ) ; - } - - #set fixed and default fields from part_svc - my($field); - foreach $field ( fields('svc_acct') ) { - if ( $part_svc->getfield('svc_acct__'. $field. '_flag') ne '' ) { - $svc_acct->setfield($field,$part_svc->getfield('svc_acct__'. $field) ); - } - } - - $action="Add"; - -} - -my($svc)=$part_svc->getfield('svc'); - -my($otaker)=getotaker; - -my($username,$password)=( - $svc_acct->username, - $svc_acct->_password ? "*HIDDEN*" : '', -); - -my($ulen)=$svc_acct->dbdef_table->column('username')->length; -my($ulen2)=$ulen+2; - -SendHeaders(); -print <<END; -<HTML> - <HEAD> - <TITLE>$action $svc account</TITLE> - </HEAD> - <BODY> - <CENTER> - <H1>$action $svc account</H1> - </CENTER><HR> - <FORM ACTION="process/svc_acct.cgi" METHOD=POST> - <INPUT TYPE="hidden" NAME="svcnum" VALUE="$svcnum"> - <INPUT TYPE="hidden" NAME="pkgnum" VALUE="$pkgnum"> - <INPUT TYPE="hidden" NAME="svcpart" VALUE="$svcpart"> -Username: -<INPUT TYPE="text" NAME="username" VALUE="$username" SIZE=$ulen2 MAXLENGTH=$ulen> -<BR>Password: -<INPUT TYPE="text" NAME="_password" VALUE="$password" SIZE=10 MAXLENGTH=8> -(blank to generate) -END - -#pop -my($popnum)=$svc_acct->popnum || 0; -if ( $part_svc->svc_acct__popnum_flag eq "F" ) { - print qq!<INPUT TYPE="hidden" NAME="popnum" VALUE="$popnum">!; -} else { - print qq!<BR>POP: <SELECT NAME="popnum" SIZE=1><OPTION>\n!; - my($svc_acct_pop); - foreach $svc_acct_pop ( qsearch ('svc_acct_pop',{} ) ) { - print "<OPTION", $svc_acct_pop->popnum == $popnum ? ' SELECTED' : '', ">", - $svc_acct_pop->popnum, ": ", - $svc_acct_pop->city, ", ", - $svc_acct_pop->state, - "(", $svc_acct_pop->ac, ")/", - $svc_acct_pop->exch, "\n" - ; - } - print "</SELECT>"; -} - -my($uid,$gid,$finger,$dir)=( - $svc_acct->uid, - $svc_acct->gid, - $svc_acct->finger, - $svc_acct->dir, -); - -print <<END; -<INPUT TYPE="hidden" NAME="uid" VALUE="$uid"> -<INPUT TYPE="hidden" NAME="gid" VALUE="$gid"> -<BR>GECOS: <INPUT TYPE="text" NAME="finger" VALUE="$finger"> -<INPUT TYPE="hidden" NAME="dir" VALUE="$dir"> -END - -my($shell)=$svc_acct->shell; -if ( $part_svc->svc_acct__shell_flag eq "F" ) { - print qq!<INPUT TYPE="hidden" NAME="shell" VALUE="$shell">!; -} else { - print qq!<BR>Shell: <SELECT NAME="shell" SIZE=1>!; - my($etc_shell); - foreach $etc_shell (@shells) { - print "<OPTION", $etc_shell eq $shell ? ' SELECTED' : '', ">", - $etc_shell, "\n"; - } - print "</SELECT>"; -} - -my($quota,$slipip)=( - $svc_acct->quota, - $svc_acct->slipip, -); - -print qq!<INPUT TYPE="hidden" NAME="quota" VALUE="$quota">!; - -if ( $part_svc->svc_acct__slipip_flag eq "F" ) { - print qq!<INPUT TYPE="hidden" NAME="slipip" VALUE="$slipip">!; -} else { - print qq!<BR>IP: <INPUT TYPE="text" NAME="slipip" VALUE="$slipip">!; -} - -#submit -print qq!<P><CENTER><INPUT TYPE="submit" VALUE="Submit"></CENTER>!; - -print <<END; - </FORM> - </BODY> -</HTML> -END - - diff --git a/htdocs/edit/svc_acct_pop.cgi b/htdocs/edit/svc_acct_pop.cgi deleted file mode 100755 index 46d803f..0000000 --- a/htdocs/edit/svc_acct_pop.cgi +++ /dev/null @@ -1,67 +0,0 @@ -#!/usr/bin/perl -Tw -# -# svc_acct_pop.cgi: Add/Edit pop (output form) -# -# ivan@sisd.com 98-mar-8 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 -# -# lose background, FS::CGI ivan@sisd.com 98-sep-2 - -use strict; -use CGI::Base; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearch qsearchs); -use FS::svc_acct_pop; -use FS::CGI qw(header menubar); - -my($cgi) = new CGI::Base; -$cgi->get; - -&cgisuidsetup($cgi); - -SendHeaders(); # one guess. - -my($svc_acct_pop,$action); -if ( $cgi->var('QUERY_STRING') =~ /^(\d+)$/ ) { #editing - $svc_acct_pop=qsearchs('svc_acct_pop',{'popnum'=>$1}); - $action='Edit'; -} else { #adding - $svc_acct_pop=create FS::svc_acct_pop {}; - $action='Add'; -} -my($hashref)=$svc_acct_pop->hashref; - -print header("$action POP", menubar( - 'Main Menu' => '../', - 'View all POPs' => "../browse/svc_acct_pop.cgi", -)), <<END; - <FORM ACTION="process/svc_acct_pop.cgi" METHOD=POST> -END - -#display - -print qq!<INPUT TYPE="hidden" NAME="popnum" VALUE="$hashref->{popnum}">!, - "POP #", $hashref->{popnum} ? $hashref->{popnum} : "(NEW)"; - -print <<END; -<PRE> -City <INPUT TYPE="text" NAME="city" SIZE=32 VALUE="$hashref->{city}"> -State <INPUT TYPE="text" NAME="state" SIZE=3 MAXLENGTH=2 VALUE="$hashref->{state}"> -Area Code <INPUT TYPE="text" NAME="ac" SIZE=4 MAXLENGTH=3 VALUE="$hashref->{ac}"> -Exchange <INPUT TYPE="text" NAME="exch" SIZE=4 MAXLENGTH=3 VALUE="$hashref->{exch}"> -</PRE> -END - -print qq!<BR><INPUT TYPE="submit" VALUE="!, - $hashref->{popnum} ? "Apply changes" : "Add POP", - qq!">!; - -print <<END; - </FORM> - </BODY> -</HTML> -END - diff --git a/htdocs/edit/svc_acct_sm.cgi b/htdocs/edit/svc_acct_sm.cgi deleted file mode 100755 index 45a8eb8..0000000 --- a/htdocs/edit/svc_acct_sm.cgi +++ /dev/null @@ -1,219 +0,0 @@ -#!/usr/bin/perl -Tw -# -# svc_acct_sm.cgi: Add/edit a mail alias (output form) -# -# Usage: svc_acct_sm.cgi {svcnum} | pkgnum{pkgnum}-svcpart{svcpart} -# http://server.name/path/svc_acct_sm.cgi? {svcnum} | pkgnum{pkgnum}-svcpart{svcpart} -# -# use {svcnum} for edit, pkgnum{pkgnum}-svcpart{svcpart} for add -# -# Note: Should be run setuid freeside as user nobody. -# -# should error out in a more CGI-friendly way, and should have more error checking (sigh). -# -# ivan@voicenet.com 97-jan-5 -# -# added debugging code; fixed CPU-sucking problem with trying to edit an (unaudited) mail alias (no pkgnum) -# -# ivan@voicenet.com 97-may-7 -# -# fixed uid selection -# ivan@voicenet.com 97-jun-4 -# -# uid selection across _CUSTOMER_, not just _PACKAGE_ -# -# ( i need to be rewritten with fast searches) -# -# ivan@voicenet.com 97-oct-3 -# -# added fast searches in some of the places where it is sorely needed... -# I see DBI::mysql in your future... -# ivan@voicenet.com 97-oct-23 -# -# rewrite ivan@sisd.com 98-mar-15 -# -# /var/spool/freeside/conf/domain ivan@sisd.com 98-jul-26 - -use strict; -use CGI::Base qw(:DEFAULT :CGI); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearch qsearchs); -use FS::svc_acct_sm qw(fields); - -my($conf_domain)="/var/spool/freeside/conf/domain"; -open(DOMAIN,$conf_domain) or die "Can't open $conf_domain: $!"; -my($mydomain)=map { - /^(.*)$/ or die "Illegal line in $conf_domain!"; #yes, we trust the file - $1 -} grep $_ !~ /^(#|$)/, <DOMAIN>; -close DOMAIN; - -my($cgi) = new CGI::Base; -$cgi->get; -&cgisuidsetup($cgi); - -SendHeaders(); # one guess. - -my($action,$svcnum,$svc_acct_sm,$pkgnum,$svcpart,$part_svc); -if ( $QUERY_STRING =~ /^(\d+)$/ ) { #editing - - $svcnum=$1; - $svc_acct_sm=qsearchs('svc_acct_sm',{'svcnum'=>$svcnum}) - or die "Unknown (svc_acct_sm) svcnum!"; - - my($cust_svc)=qsearchs('cust_svc',{'svcnum'=>$svcnum}) - or die "Unknown (cust_svc) svcnum!"; - - $pkgnum=$cust_svc->pkgnum; - $svcpart=$cust_svc->svcpart; - - $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart}); - die "No part_svc entry!" unless $part_svc; - - $action="Edit"; - -} else { #adding - - $svc_acct_sm=create FS::svc_acct_sm({}); - - foreach $_ (split(/-/,$QUERY_STRING)) { #get & untaint pkgnum & svcpart - $pkgnum=$1 if /^pkgnum(\d+)$/; - $svcpart=$1 if /^svcpart(\d+)$/; - } - $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart}); - die "No part_svc entry!" unless $part_svc; - - $svcnum=''; - - #set fixed and default fields from part_svc - my($field); - foreach $field ( fields('svc_acct_sm') ) { - if ( $part_svc->getfield('svc_acct_sm__'. $field. '_flag') ne '' ) { - $svc_acct_sm->setfield($field,$part_svc->getfield('svc_acct_sm__'. $field) ); - } - } - - $action='Add'; - -} - -my(%username,%domain); -if ($pkgnum) { - - #find all possible uids (and usernames) - - my($u_part_svc,@u_acct_svcparts); - foreach $u_part_svc ( qsearch('part_svc',{'svcdb'=>'svc_acct'}) ) { - push @u_acct_svcparts,$u_part_svc->getfield('svcpart'); - } - - my($cust_pkg)=qsearchs('cust_pkg',{'pkgnum'=>$pkgnum}); - my($custnum)=$cust_pkg->getfield('custnum'); - my($i_cust_pkg); - foreach $i_cust_pkg ( qsearch('cust_pkg',{'custnum'=>$custnum}) ) { - my($cust_pkgnum)=$i_cust_pkg->getfield('pkgnum'); - my($acct_svcpart); - foreach $acct_svcpart (@u_acct_svcparts) { #now find the corresponding - #record(s) in cust_svc ( for this - #pkgnum ! ) - my($i_cust_svc); - foreach $i_cust_svc ( qsearch('cust_svc',{'pkgnum'=>$cust_pkgnum,'svcpart'=>$acct_svcpart}) ) { - my($svc_acct)=qsearchs('svc_acct',{'svcnum'=>$i_cust_svc->getfield('svcnum')}); - $username{$svc_acct->getfield('uid')}=$svc_acct->getfield('username'); - } - } - } - - #find all possible domains (and domsvc's) - - my($d_part_svc,@d_acct_svcparts); - foreach $d_part_svc ( qsearch('part_svc',{'svcdb'=>'svc_domain'}) ) { - push @d_acct_svcparts,$d_part_svc->getfield('svcpart'); - } - - foreach $i_cust_pkg ( qsearch('cust_pkg',{'custnum'=>$custnum}) ) { - my($cust_pkgnum)=$i_cust_pkg->getfield('pkgnum'); - my($acct_svcpart); - foreach $acct_svcpart (@d_acct_svcparts) { - my($i_cust_svc); - foreach $i_cust_svc ( qsearch('cust_svc',{'pkgnum'=>$cust_pkgnum,'svcpart'=>$acct_svcpart}) ) { - my($svc_domain)=qsearch('svc_domain',{'svcnum'=>$i_cust_svc->getfield('svcnum')}); - $domain{$svc_domain->getfield('svcnum')}=$svc_domain->getfield('domain'); - } - } - } - -} elsif ( $action eq 'Edit' ) { - - my($svc_acct)=qsearchs('svc_acct',{'uid'=>$svc_acct_sm->domuid}); - $username{$svc_acct_sm->uid} = $svc_acct->username; - - my($svc_domain)=qsearchs('svc_domain',{'svcnum'=>$svc_acct_sm->domsvc}); - $domain{$svc_acct_sm->domsvc} = $svc_domain->domain; - -} else { - die "\$action eq Add, but \$pkgnum is null!\n"; -} - -print <<END; -<HTML> - <HEAD> - <TITLE>Mail Alias $action</TITLE> - </HEAD> - <BODY> - <CENTER> - <H1>Mail Alias $action</H1> - </CENTER> - <FORM ACTION="process/svc_acct_sm.cgi" METHOD=POST> -END - -#display - - #formatting - print "<PRE>"; - -#svcnum -print qq!<INPUT TYPE="hidden" NAME="svcnum" VALUE="$svcnum">!; -print qq!Service #<FONT SIZE=+1><B>!, $svcnum ? $svcnum : " (NEW)", "</B></FONT>"; - -#pkgnum -print qq!<INPUT TYPE="hidden" NAME="pkgnum" VALUE="$pkgnum">!; - -#svcpart -print qq!<INPUT TYPE="hidden" NAME="svcpart" VALUE="$svcpart">!; - -my($domuser,$domsvc,$domuid)=( - $svc_acct_sm->domuser, - $svc_acct_sm->domsvc, - $svc_acct_sm->domuid, -); - -#domuser -print qq!\n\nMail to <INPUT TYPE="text" NAME="domuser" VALUE="$domuser"> <I>( * for anything )</I>!; - -#domsvc -print qq! \@ <SELECT NAME="domsvc" SIZE=1>!; -foreach $_ (keys %domain) { - print "<OPTION", $_ eq $domsvc ? " SELECTED" : "", ">$_: $domain{$_}"; -} -print "</SELECT>"; - -#uid -print qq!\nforwards to <SELECT NAME="domuid" SIZE=1>!; -foreach $_ (keys %username) { - print "<OPTION", ($_ eq $domuid) ? " SELECTED" : "", ">$_: $username{$_}"; -} -print "</SELECT>\@$mydomain mailbox."; - - #formatting - print "</PRE>\n"; - -print qq!<CENTER><INPUT TYPE="submit" VALUE="Submit"></CENTER>!; - -print <<END; - - </FORM> - </BODY> -</HTML> -END - diff --git a/htdocs/edit/svc_domain.cgi b/htdocs/edit/svc_domain.cgi deleted file mode 100755 index 0717a2c..0000000 --- a/htdocs/edit/svc_domain.cgi +++ /dev/null @@ -1,120 +0,0 @@ -#!/usr/bin/perl -Tw -# -# svc_domain.cgi: Add domain (output form) -# -# Usage: svc_domain.cgi pkgnum{pkgnum}-svcpart{svcpart} -# http://server.name/path/svc_domain.cgi?pkgnum{pkgnum}-svcpart{svcpart} -# -# Note: Should be run setuid freeside as user nobody -# -# ivan@voicenet.com 97-jan-5 -> 97-jan-6 -# -# changes for domain template 3.5 -# ivan@voicenet.com 97-jul-24 -# -# rewrite ivan@sisd.com 98-mar-14 -# -# no GOV in instructions ivan@sisd.com 98-jul-17 - -use strict; -use CGI::Base qw(:DEFAULT :CGI); -use FS::UID qw(cgisuidsetup getotaker); -use FS::Record qw(qsearch qsearchs); -use FS::svc_domain qw(fields); - -my($cgi) = new CGI::Base; -$cgi->get; -&cgisuidsetup($cgi); - -my($action,$svcnum,$svc_domain,$pkgnum,$svcpart,$part_svc); - -if ( $QUERY_STRING =~ /^(\d+)$/ ) { #editing - - $svcnum=$1; - $svc_domain=qsearchs('svc_domain',{'svcnum'=>$svcnum}) - or die "Unknown (svc_domain) svcnum!"; - - my($cust_svc)=qsearchs('cust_svc',{'svcnum'=>$svcnum}) - or die "Unknown (cust_svc) svcnum!"; - - $pkgnum=$cust_svc->pkgnum; - $svcpart=$cust_svc->svcpart; - - $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart}); - die "No part_svc entry!" unless $part_svc; - - $action="Edit"; - -} else { #adding - - $svc_domain=create FS::svc_domain({}); - - foreach $_ (split(/-/,$QUERY_STRING)) { - $pkgnum=$1 if /^pkgnum(\d+)$/; - $svcpart=$1 if /^svcpart(\d+)$/; - } - $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart}); - die "No part_svc entry!" unless $part_svc; - - $svcnum=''; - - #set fixed and default fields from part_svc - my($field); - foreach $field ( fields('svc_domain') ) { - if ( $part_svc->getfield('svc_domain__'. $field. '_flag') ne '' ) { - $svc_domain->setfield($field,$part_svc->getfield('svc_domain__'. $field) ); - } - } - - $action="Add"; - -} - -my($svc)=$part_svc->getfield('svc'); - -my($otaker)=getotaker; - -my($domain)=( - $svc_domain->domain, -); - -SendHeaders(); -print <<END; -<HTML> - <HEAD> - <TITLE>$action $svc</TITLE> - </HEAD> - <BODY> - <CENTER> - <H1>$action $svc</H1> - </CENTER><HR> - <FORM ACTION="process/svc_domain.cgi" METHOD=POST> - <INPUT TYPE="hidden" NAME="svcnum" VALUE="$svcnum"> - <INPUT TYPE="hidden" NAME="pkgnum" VALUE="$pkgnum"> - <INPUT TYPE="hidden" NAME="svcpart" VALUE="$svcpart"> - <INPUT TYPE="radio" NAME="action" VALUE="N">New - <BR><INPUT TYPE="radio" NAME="action" VALUE="M">Transfer - -<P>Customer agrees to be bound by NSI's -<A HREF="http://rs.internic.net/help/agreement.txt"> -Domain Name Registration Agreement</A> -<SELECT NAME="legal" SIZE=1><OPTION SELECTED>No<OPTION>Yes</SELECT> -<P>Domain <INPUT TYPE="text" NAME="domain" VALUE="$domain" SIZE=28 MAXLENGTH=26> -<BR>Purpose/Description: <INPUT TYPE="text" NAME="purpose" VALUE="" SIZE=64> -<P><CENTER><INPUT TYPE="submit" VALUE="Submit"></CENTER> -<UL> - <LI>COM is for commercial, for-profit organziations - <LI>ORG is for miscellaneous, usually, non-profit organizations - <LI>NET is for network infrastructure machines and organizations - <LI>EDU is for 4-year, degree granting institutions -<!-- <LI>GOV is for United States federal government agencies -!--> -</UL> -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. -<P>GOV registrations are limited to top-level US Federal Government agencies (see RFC 1816). - </FORM> - </BODY> -</HTML> -END - diff --git a/htdocs/images/mid-logo.gif b/htdocs/images/mid-logo.gif Binary files differdeleted file mode 100644 index 4ceb3ad..0000000 --- a/htdocs/images/mid-logo.gif +++ /dev/null diff --git a/htdocs/images/small-logo.gif b/htdocs/images/small-logo.gif Binary files differdeleted file mode 100644 index a8e9c57..0000000 --- a/htdocs/images/small-logo.gif +++ /dev/null diff --git a/htdocs/index.html b/htdocs/index.html deleted file mode 100755 index de0667e..0000000 --- a/htdocs/index.html +++ /dev/null @@ -1,96 +0,0 @@ -<HTML> - <HEAD> - <TITLE> - Freeside Main Menu - </TITLE> - </HEAD> - <BODY BGCOLOR="#FFFFFF"> - <table> - <tr><td> - <P ALIGN=CENTER> - <IMG BORDER=0 ALT="Silicon Interactive Software Design" SRC="images/small-logo.gif"> - </td><td> - <center><font color="#ff0000" size=7>freeside main menu</font></center> - </td></tr> - </table> - <A HREF="http://www.sisd.com/freeside"> - Information - </A> - <BR><A HREF="docs/"> - Documentation - </A> - </P> - <HR> - <H3><A HREF="edit/cust_main.cgi">New Customer</A></H3> - <A NAME="search"><H3>Search</H3></A> - <MENU> - <LI><A HREF="search/cust_main.html"> - customers (by last name and/or company) - </A> - <LI><A HREF="search/cust_main-payinfo.html">customers (by credit card number)</A> - <LI><A HREF="search/svc_acct.html">accounts (by username)</A> - <LI><A HREF="search/svc_domain.html">domains (by domain)</A> - <LI><A HREF="search/svc_acct_sm.html">mail aliases (by domain, and optionally username)</A> - <LI><A HREF="search/cust_bill.html">invoices (by invoice number)</A> - </MENU> - <A NAME="browse"><H3>Browse</H3></A> - <MENU> - <LI><A HREF="search/cust_main.cgi?custnum">customers (by customer number)</A> - <LI><A HREF="search/cust_main.cgi?last">customers (by last name)</A> - <LI><A HREF="search/cust_main.cgi?company">customers (by company)</A> - <LI><A HREF="search/cust_pkg.cgi?pkgnum">packages (by package number)</A> - <LI><A HREF="search/cust_pkg.cgi?APKG_pkgnum">packages with unconfigured services (by package number)</A> - <LI><A HREF="search/svc_acct.cgi?svcnum">accounts (by service number)</A> - <LI><A HREF="search/svc_acct.cgi?username">accounts (by username)</A> - <LI><A HREF="search/svc_acct.cgi?uid">accounts (by uid)</A> - <LI><A HREF="search/svc_acct.cgi?UN_svcnum">unlinked accounts (by service number)</A> - <LI><A HREF="search/svc_acct.cgi?UN_username">unlinked accounts (by username)</A> - <LI><A HREF="search/svc_acct.cgi?UN_uid">unlinked accounts (by uid)</A> - <LI><A HREF="search/svc_domain.cgi?svcnum">domains (by service number)</A> - <LI><A HREF="search/svc_domain.cgi?domain">domains (by domain)</A> - <LI><A HREF="search/svc_domain.cgi?UN_svcnum">unlinked domains (by service number)</A> - <LI><A HREF="search/svc_domain.cgi?UN_domain">unlinked domains (by domain)</A> - </MENU> - <A NAME="admin"><H3>Administration</H3></a> - <MENU> - <LI><A HREF="browse/part_svc.cgi"> - View/Edit services - </A> - - Services are items you offer to your customers. - <LI><A HREF="browse/part_pkg.cgi"> - View/Edit packages - </A> - - One or more services are grouped together into a package and - given pricing information. Customers purchase packages, not - services. - <LI><A HREF="browse/agent_type.cgi"> - View/Edit agent types - </A> - - Agent types define groups of packages that you can then assign - to particular agents. - <LI><A HREF="browse/agent.cgi"> - View/Edit agents - </A> - - Agents are resellers of your service. Agents may be limited - to a subset of your full offerings (via their agent type). - <BR> - <LI><A HREF="browse/part_referral.cgi"> - View/Edit referrals - </A> - - Where a customer heard about your service. Tracked for - informational purposes. - <BR> - <LI><A HREF="browse/cust_main_county.cgi"> - View/Edit locales and tax rates - </A> - - Change tax rates by state, or break down a state into counties - and assign different tax rates to each county. - <BR> - <LI><A HREF="browse/svc_acct_pop.cgi"> - View/Edit POPs - </A> - - Points of Presence - </MENU> - </FONT> - </BODY> -</HTML> diff --git a/htdocs/misc/bill.cgi b/htdocs/misc/bill.cgi deleted file mode 100755 index d41f6d1..0000000 --- a/htdocs/misc/bill.cgi +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/perl -Tw -# -# s/FS:Search/FS::Record/ and cgisuidsetup($cgi) ivan@sisd.com 98-mar-13 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 - -use strict; -use CGI::Base qw(:DEFAULT :CGI); -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearchs); -use FS::Bill; - -my($cgi) = new CGI::Base; -$cgi->get; -&cgisuidsetup($cgi); - -#untaint custnum -$QUERY_STRING =~ /^(\d*)$/; -my($custnum)=$1; -my($cust_main)=qsearchs('cust_main',{'custnum'=>$custnum}); -die "Can't find customer!\n" unless $cust_main; - -# ? -bless($cust_main,"FS::Bill"); - -my($error); - -$error = $cust_main->bill( -# 'time'=>$time - ); -&idiot($error) if $error; - -$error = $cust_main->collect( -# 'invoice-time'=>$time, -# 'batch_card'=> 'yes', - 'batch_card'=> 'no', - 'report_badcard'=> 'yes', - ); -&idiot($error) if $error; - -$cgi->redirect("../view/cust_main.cgi?$custnum#history"); - -sub idiot { - my($error)=@_; - CGI::Base::SendHeaders(); # one guess - print <<END; -<HTML> - <HEAD> - <TITLE>Error billing customer</TITLE> - </HEAD> - <BODY> - <CENTER> - <H4>Error billing customer</H4> - </CENTER> - Your update did not occur because of the following error: - <P><B>$error</B> - </BODY> -</HTML> -END - - exit; - -} - diff --git a/htdocs/misc/cancel-unaudited.cgi b/htdocs/misc/cancel-unaudited.cgi deleted file mode 100755 index 929274f..0000000 --- a/htdocs/misc/cancel-unaudited.cgi +++ /dev/null @@ -1,85 +0,0 @@ -#!/usr/bin/perl -Tw -# -# cancel-unaudited.cgi: Cancel an unaudited account -# -# Usage: cancel-unaudited.cgi svcnum -# http://server.name/path/cancel-unaudited.cgi pkgnum -# -# Note: Should be run setuid freeside as user nobody -# -# ivan@voicenet.com 97-apr-23 -# -# rewrote for new API -# ivan@voicenet.com 97-jul-21 -# -# Search->Record, cgisuidsetup($cgi) ivan@sids.com 98-mar-19 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 - -use strict; -use CGI::Base qw(:DEFAULT :CGI); # CGI module -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearchs); -use FS::cust_svc; -use FS::svc_acct; - -my($cgi) = new CGI::Base; -$cgi->get; -&cgisuidsetup($cgi); - -#untaint svcnum -$QUERY_STRING =~ /^(\d+)$/; -my($svcnum)=$1; - -my($svc_acct) = qsearchs('svc_acct',{'svcnum'=>$svcnum}); -&idiot("Unknown svcnum!") unless $svc_acct; - -my($cust_svc) = qsearchs('cust_svc',{'svcnum'=>$svcnum}); -&idiot(qq!This account has already been audited. Cancel the - <A HREF="../view/cust_pkg.cgi?! . $cust_svc->getfield('pkgnum') . - qq!pkgnum"> package</A> instead.!) - if $cust_svc->getfield('pkgnum') ne ''; - -local $SIG{HUP} = 'IGNORE'; -local $SIG{INT} = 'IGNORE'; -local $SIG{QUIT} = 'IGNORE'; -local $SIG{TERM} = 'IGNORE'; -local $SIG{TSTP} = 'IGNORE'; - -my($error); - -bless($svc_acct,"FS::svc_acct"); -$error = $svc_acct->cancel; -&idiot($error) if $error; -$error = $svc_acct->delete; -&idiot($error) if $error; - -bless($cust_svc,"FS::cust_svc"); -$error = $cust_svc->delete; -&idiot($error) if $error; - -$cgi->redirect("../"); - -sub idiot { - my($error)=@_; - SendHeaders(); - print <<END; -<HTML> - <HEAD> - <TITLE>Error cancelling account</TITLE> - </HEAD> - <BODY> - <CENTER> - <H1>Error cancelling account</H1> - </CENTER> - <HR> - There has been an error cancelling this acocunt: $error - </BODY> - </HEAD> -</HTML> -END - exit; -} - diff --git a/htdocs/misc/cancel_pkg.cgi b/htdocs/misc/cancel_pkg.cgi deleted file mode 100755 index 6702a03..0000000 --- a/htdocs/misc/cancel_pkg.cgi +++ /dev/null @@ -1,54 +0,0 @@ -#!/usr/bin/perl -Tw -# -# cancel_pkg.cgi: Cancel a package -# -# Usage: cancel_pkg.cgi pkgnum -# http://server.name/path/cancel_pkg.cgi pkgnum -# -# Note: Should be run setuid freeside as user nobody -# -# IT DOESN'T RUN THE APPROPRIATE PROGRAMS YET!!!! -# -# probably should generalize this to do cancels, suspensions, unsuspensions, etc. -# -# ivan@voicenet.com 97-jan-2 -# -# still kludgy, but now runs /dbin/cancel $pkgnum -# ivan@voicenet.com 97-feb-27 -# -# doesn't run if pkgnum doesn't match regex -# ivan@voicenet.com 97-mar-6 -# -# now redirects to enter comments -# ivan@voicenet.com 97-may-8 -# -# rewrote for new API -# ivan@voicenet.com 97-jul-21 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 - -use strict; -use CGI::Base qw(:DEFAULT :CGI); # CGI module -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearchs); -use FS::cust_pkg; -use FS::CGI qw(idiot); - -my($cgi) = new CGI::Base; -$cgi->get; -&cgisuidsetup($cgi); - -#untaint pkgnum -$QUERY_STRING =~ /^(\d+)$/ || die "Illegal pkgnum"; -my($pkgnum)=$1; - -my($cust_pkg) = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum}); - -bless($cust_pkg,'FS::cust_pkg'); -my($error)=$cust_pkg->cancel; -idiot($error) if $error; - -$cgi->redirect("../view/cust_main.cgi?".$cust_pkg->getfield('custnum')); - diff --git a/htdocs/misc/expire_pkg.cgi b/htdocs/misc/expire_pkg.cgi deleted file mode 100755 index 1635166..0000000 --- a/htdocs/misc/expire_pkg.cgi +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/perl -Tw -# -# expire_pkg.cgi: Expire a package -# -# Usage: post form to: -# http://server.name/path/expire_pkg.cgi -# -# Note: Should be run setuid freeside as user nobody -# -# based on susp_pkg -# ivan@voicenet.com 97-jul-29 -# -# ivan@sisd.com 98-mar-17 FS::Search->FS::Record -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 - -use strict; -use Date::Parse; -use CGI::Request; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearchs); -use FS::cust_pkg; - -my($req) = new CGI::Request; -&cgisuidsetup($req->cgi); - -#untaint date & pkgnum - -my($date); -if ( $req->param('date') ) { - str2time($req->param('date')) =~ /^(\d+)$/ or die "Illegal date"; - $date=$1; -} else { - $date=''; -} - -$req->param('pkgnum') =~ /^(\d+)$/ or die "Illegal pkgnum"; -my($pkgnum)=$1; - -my($cust_pkg) = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum}); -my(%hash)=$cust_pkg->hash; -$hash{expire}=$date; -my($new)=create FS::cust_pkg ( \%hash ); -my($error) = $new->replace($cust_pkg); -&idiot($error) if $error; - -$req->cgi->redirect("../view/cust_main.cgi?".$cust_pkg->getfield('custnum')); - -sub idiot { - my($error)=@_; - SendHeaders(); - print <<END; -<HTML> - <HEAD> - <TITLE>Error expiring package</TITLE> - </HEAD> - <BODY> - <CENTER> - <H1>Error expiring package</H1> - </CENTER> - <HR> - There has been an error expiring this package: $error - </BODY> - </HEAD> -</HTML> -END - exit; -} - diff --git a/htdocs/misc/link.cgi b/htdocs/misc/link.cgi deleted file mode 100755 index d1db000..0000000 --- a/htdocs/misc/link.cgi +++ /dev/null @@ -1,72 +0,0 @@ -#!/usr/bin/perl -Tw -# -# link: instead of adding a new account, link to an existing. (output form) -# -# Note: Should be run setuid freeside as user nobody -# -# ivan@voicenet.com 97-feb-5 -# -# rewrite ivan@sisd.com 98-mar-17 -# -# can also link on some other fields now (about time) ivan@sisd.com 98-jun-24 - -use strict; -use CGI::Base qw(:DEFAULT :CGI); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearchs); - -my(%link_field)=( - 'svc_acct' => 'username', - 'svc_domain' => 'domain', - 'svc_acct_sm' => '', - 'svc_charge' => '', - 'svc_wo' => '', -); - -my($cgi) = new CGI::Base; -$cgi->get; -cgisuidsetup($cgi); - -my($pkgnum,$svcpart); -foreach $_ (split(/-/,$QUERY_STRING)) { #get & untaint pkgnum & svcpart - $pkgnum=$1 if /^pkgnum(\d+)$/; - $svcpart=$1 if /^svcpart(\d+)$/; -} - -my($part_svc) = qsearchs('part_svc',{'svcpart'=>$svcpart}); -my($svc) = $part_svc->getfield('svc'); -my($svcdb) = $part_svc->getfield('svcdb'); -my($link_field) = $link_field{$svcdb}; - -CGI::Base::SendHeaders(); -print <<END; -<HTML> - <HEAD> - <TITLE>Link to existing $svc account</TITLE> - </HEAD> - <BODY> - <CENTER> - <H1>Link to existing $svc account</H1> - </CENTER><HR> - <FORM ACTION="process/link.cgi" METHOD=POST> -END - -if ( $link_field ) { - print <<END; - <INPUT TYPE="hidden" NAME="svcnum" VALUE=""> - <INPUT TYPE="hidden" NAME="link_field" VALUE="$link_field"> - $link_field of existing service: <INPUT TYPE="text" NAME="link_value"> -END -} else { - print qq!Service # of existing service: <INPUT TYPE="text" NAME="svcnum" VALUE="">!; -} - -print <<END; -<INPUT TYPE="hidden" NAME="pkgnum" VALUE="$pkgnum"> -<INPUT TYPE="hidden" NAME="svcpart" VALUE="$svcpart"> -<P><CENTER><INPUT TYPE="submit" VALUE="Link"></CENTER> - </FORM> - </BODY> -</HTML> -END - diff --git a/htdocs/misc/print-invoice.cgi b/htdocs/misc/print-invoice.cgi deleted file mode 100755 index 084dcc1..0000000 --- a/htdocs/misc/print-invoice.cgi +++ /dev/null @@ -1,57 +0,0 @@ -#!/usr/bin/perl -Tw -# -# just a kludge for now, since this duplicates in a way it shouldn't stuff from -# Bill.pm (like $lpr) ivan@sisd.com 98-jun-16 - -use strict; -use CGI::Base qw(:DEFAULT :CGI); -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearchs); -use FS::Invoice; - -my($lpr) = "|lpr -h"; - -my($cgi) = new CGI::Base; -$cgi->get; -&cgisuidsetup($cgi); - -#untaint invnum -$QUERY_STRING =~ /^(\d*)$/; -my($invnum)=$1; -my($cust_bill)=qsearchs('cust_bill',{'invnum'=>$invnum}); -die "Can't find invoice!\n" unless $cust_bill; - - bless($cust_bill,"FS::Invoice"); - open(LPR,$lpr) or die "Can't open $lpr: $!"; - print LPR $cust_bill->print_text; #( date ) - close LPR - or die $! ? "Error closing $lpr: $!" - : "Exit status $? from $lpr"; - -my($custnum)=$cust_bill->getfield('custnum'); - -$cgi->redirect("../view/cust_main.cgi?$custnum#history"); - -sub idiot { - my($error)=@_; - CGI::Base::SendHeaders(); # one guess - print <<END; -<HTML> - <HEAD> - <TITLE>Error printing invoice</TITLE> - </HEAD> - <BODY> - <CENTER> - <H4>Error printing invoice</H4> - </CENTER> - Your update did not occur because of the following error: - <P><B>$error</B> - </BODY> -</HTML> -END - - exit; - -} - diff --git a/htdocs/misc/process/link.cgi b/htdocs/misc/process/link.cgi deleted file mode 100755 index 23fb053..0000000 --- a/htdocs/misc/process/link.cgi +++ /dev/null @@ -1,73 +0,0 @@ -#!/usr/bin/perl -Tw -# -# process/link.cgi: link to existing customer (process form) -# -# ivan@voicenet.com 97-feb-5 -# -# rewrite ivan@sisd.com 98-mar-18 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 -# -# can also link on some other fields now (about time) ivan@sisd.com 98-jun-24 - -use strict; -use CGI::Request; -use CGI::Carp qw(fatalsToBrowser); -use FS::CGI qw(idiot); -use FS::UID qw(cgisuidsetup); -use FS::cust_svc; -use FS::Record qw(qsearchs); - -my($req)=new CGI::Request; # create form object -cgisuidsetup($req->cgi); - -#$req->import_names('R'); #import CGI variables into package 'R'; - -$req->param('pkgnum') =~ /^(\d+)$/; my($pkgnum)=$1; -$req->param('svcpart') =~ /^(\d+)$/; my($svcpart)=$1; - -$req->param('svcnum') =~ /^(\d*)$/; my($svcnum)=$1; -unless ( $svcnum ) { - my($part_svc) = qsearchs('part_svc',{'svcpart'=>$svcpart}); - my($svcdb) = $part_svc->getfield('svcdb'); - $req->param('link_field') =~ /^(\w+)$/; my($link_field)=$1; - my($svc_acct)=qsearchs($svcdb,{$link_field => $req->param('link_value') }); - idiot("$link_field not found!") unless $svc_acct; - $svcnum=$svc_acct->svcnum; -} - -my($old)=qsearchs('cust_svc',{'svcnum'=>$svcnum}); -die "svcnum not found!" unless $old; -my($new)=create FS::cust_svc ({ - 'svcnum' => $svcnum, - 'pkgnum' => $pkgnum, - 'svcpart' => $svcpart, -}); - -my($error); -$error = $new->replace($old); - -unless ($error) { - #no errors, so let's view this customer. - $req->cgi->redirect("../../view/cust_pkg.cgi?$pkgnum"); -} else { - CGI::Base::SendHeaders(); # one guess - print <<END; -<HTML> - <HEAD> - <TITLE>Error</TITLE> - </HEAD> - <BODY> - <CENTER> - <H4>Error</H4> - </CENTER> - Your update did not occur because of the following error: - <P><B>$error</B> - <P>Hit the <I>Back</I> button in your web browser, correct this mistake, and submit the form again. - </BODY> -</HTML> -END - -} - diff --git a/htdocs/misc/susp_pkg.cgi b/htdocs/misc/susp_pkg.cgi deleted file mode 100755 index 7b23cae..0000000 --- a/htdocs/misc/susp_pkg.cgi +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/perl -Tw -# -# susp_pkg.cgi: Suspend a package -# -# Usage: susp_pkg.cgi pkgnum -# http://server.name/path/susp_pkg.cgi pkgnum -# -# Note: Should be run setuid freeside as user nobody -# -# probably should generalize this to do cancels, suspensions, unsuspensions, etc. -# -# ivan@voicenet.com 97-feb-27 -# -# now redirects to enter comments -# ivan@voicenet.com 97-may-8 -# -# rewrote for new API -# ivan@voicenet.com 97-jul-21 -# -# FS::Search -> FS::Record ivan@sisd.com 98-mar-17 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 - -use strict; -use CGI::Base qw(:DEFAULT :CGI); # CGI module -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearchs); -use FS::cust_pkg; - -my($cgi) = new CGI::Base; -$cgi->get; -&cgisuidsetup($cgi); - -#untaint pkgnum -$QUERY_STRING =~ /^(\d+)$/ || die "Illegal pkgnum"; -my($pkgnum)=$1; - -my($cust_pkg) = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum}); - -bless($cust_pkg,'FS::cust_pkg'); -my($error)=$cust_pkg->suspend; -&idiot($error) if $error; - -$cgi->redirect("../view/cust_main.cgi?".$cust_pkg->getfield('custnum')); - -sub idiot { - my($error)=@_; - SendHeaders(); - print <<END; -<HTML> - <HEAD> - <TITLE>Error suspending package</TITLE> - </HEAD> - <BODY> - <CENTER> - <H1>Error suspending package</H1> - </CENTER> - <HR> - There has been an error suspending this package: $error - </BODY> - </HEAD> -</HTML> -END - exit; -} - diff --git a/htdocs/misc/unsusp_pkg.cgi b/htdocs/misc/unsusp_pkg.cgi deleted file mode 100755 index 2f340c6..0000000 --- a/htdocs/misc/unsusp_pkg.cgi +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/perl -Tw -# -# susp_pkg.cgi: Unsuspend a package -# -# Usage: susp_pkg.cgi pkgnum -# http://server.name/path/susp_pkg.cgi pkgnum -# -# Note: Should be run setuid freeside as user nobody -# -# probably should generalize this to do cancels, suspensions, unsuspensions, etc. -# -# ivan@voicenet.com 97-feb-27 -# -# now redirects to enter comments -# ivan@voicenet.com 97-may-8 -# -# rewrote for new API -# ivan@voicenet.com 97-jul-21 -# -# FS::Search -> FS::Record ivan@sisd.com 98-mar-17 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 - -use strict; -use CGI::Base qw(:DEFAULT :CGI); # CGI module -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearchs); -use FS::cust_pkg; - -my($cgi) = new CGI::Base; -$cgi->get; -&cgisuidsetup($cgi); - -#untaint pkgnum -$QUERY_STRING =~ /^(\d+)$/ || die "Illegal pkgnum"; -my($pkgnum)=$1; - -my($cust_pkg) = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum}); - -bless($cust_pkg,'FS::cust_pkg'); -my($error)=$cust_pkg->unsuspend; -&idiot($error) if $error; - -$cgi->redirect("../view/cust_main.cgi?".$cust_pkg->getfield('custnum')); - -sub idiot { - my($error)=@_; - SendHeaders(); - print <<END; -<HTML> - <HEAD> - <TITLE>Error unsuspending package</TITLE> - </HEAD> - <BODY> - <CENTER> - <H1>Error unsuspending package</H1> - </CENTER> - <HR> - There has been an error unsuspending this package: $error - </BODY> - </HEAD> -</HTML> -END - exit; -} - diff --git a/htdocs/search/cust_bill.cgi b/htdocs/search/cust_bill.cgi deleted file mode 100755 index 5be84b7..0000000 --- a/htdocs/search/cust_bill.cgi +++ /dev/null @@ -1,46 +0,0 @@ -#!/usr/bin/perl -Tw -# -# cust_bill.cgi: Search for invoices (process form) -# -# Usage: post form to: -# http://server.name/path/cust_bill.cgi -# -# Note: Should be run setuid freeside as user nobody. -# -# ivan@voicenet.com 97-apr-4 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 - -use strict; -use CGI::Request; -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearchs); - -my($req)=new CGI::Request; -cgisuidsetup($req->cgi); - -$req->param('invnum') =~ /^\s*(FS-)?(\d+)\s*$/; -my($invnum)=$2; - -if ( qsearchs('cust_bill',{'invnum'=>$invnum}) ) { - $req->cgi->redirect("../view/cust_bill.cgi?$invnum"); #redirect -} else { #error - CGI::Base::SendHeaders(); # one guess - print <<END; -<HTML> - <HEAD> - <TITLE>Invoice Search Error</TITLE> - </HEAD> - <BODY> - <CENTER> - <H3>Invoice Search Error</H3> - <HR> - Invoice not found. - </CENTER> - </BODY> -</HTML> -END - -} - diff --git a/htdocs/search/cust_bill.html b/htdocs/search/cust_bill.html deleted file mode 100755 index 4adb40e..0000000 --- a/htdocs/search/cust_bill.html +++ /dev/null @@ -1,21 +0,0 @@ -<HTML> - <HEAD> - <TITLE>Invoice Search</TITLE> - </HEAD> - <BODY> - <CENTER> - <H1>Invoice Search</H1> - </CENTER> - <HR> - <FORM ACTION="cust_bill.cgi" METHOD="post"> - Search for <B>invoice #</B>: - <INPUT TYPE="text" NAME="invnum"> - - <P><INPUT TYPE="submit" VALUE="Search"> - - </FORM> - - <HR> - </BODY> -</HTML> - diff --git a/htdocs/search/cust_main-payinfo.html b/htdocs/search/cust_main-payinfo.html deleted file mode 100755 index 92341ad..0000000 --- a/htdocs/search/cust_main-payinfo.html +++ /dev/null @@ -1,21 +0,0 @@ -<HTML> - <HEAD> - <TITLE>Customer Search</TITLE> - </HEAD> - <BODY> - <CENTER> - <H1>Customer Search</H1> - </CENTER> - <HR> - <FORM ACTION="cust_main.cgi" METHOD="post"> - Search for <B>Credit card #</B>: - <INPUT TYPE="hidden" NAME="card_on" VALUE="TRUE"> - <INPUT TYPE="text" NAME="card"> - - <P><INPUT TYPE="submit" VALUE="Search"> - - </FORM> - <HR> - </BODY> -</HTML> - diff --git a/htdocs/search/cust_main.cgi b/htdocs/search/cust_main.cgi deleted file mode 100755 index 70ce991..0000000 --- a/htdocs/search/cust_main.cgi +++ /dev/null @@ -1,235 +0,0 @@ -#!/usr/bin/perl -Tw -# -# process/cust_main.cgi: Search for customers (process form) -# -# Usage: post form to: -# http://server.name/path/cust_main.cgi -# -# Note: Should be run setuid freeside as user nobody. -# -# ivan@voicenet.com 96-dec-12 -# -# rewrite ivan@sisd.com 98-mar-4 -# -# now does browsing too ivan@sisd.com 98-mar-6 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 -# -# display total, use FS::CGI ivan@sisd.com 98-jul-17 - -use strict; -use CGI::Request; -use CGI::Carp qw(fatalsToBrowser); -use IO::Handle; -use IPC::Open2; -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearch qsearchs); -use FS::CGI qw(header idiot); - -my($fuzziness)=2; #fuzziness for fuzzy searches, see man agrep - #0-4: 0=no fuzz, 4=very fuzzy (too much fuzz!) - -my($req)=new CGI::Request; -&cgisuidsetup($req->cgi); - -my(@cust_main); -my($sortby); - -my($query)=$req->cgi->var('QUERY_STRING'); -if ( $query eq 'custnum' ) { - $sortby=\*custnum_sort; - @cust_main=qsearch('cust_main',{}); -} elsif ( $query eq 'last' ) { - $sortby=\*last_sort; - @cust_main=qsearch('cust_main',{}); -} elsif ( $query eq 'company' ) { - $sortby=\*company_sort; - @cust_main=qsearch('cust_main',{}); -} else { - &cardsearch if ($req->param('card_on') ); - &lastsearch if ($req->param('last_on') ); - &companysearch if ($req->param('company_on') ); -} - -if ( scalar(@cust_main) == 1 ) { - $req->cgi->redirect("../view/cust_main.cgi?". $cust_main[0]->custnum); - exit; -} elsif ( scalar(@cust_main) == 0 ) { - idiot "No matching customers found!\n"; - exit; -} else { - - my($total)=scalar(@cust_main); - CGI::Base::SendHeaders(); # one guess - print header("Customer Search Results",''), <<END; - - $total matching customers found - <TABLE BORDER=4 CELLSPACING=0 CELLPADDING=0> - <TR> - <TH>Cust. #</TH> - <TH>Contact name</TH> - <TH>Company</TH> - </TR> -END - - my($lines)=16; - my($lcount)=$lines; - my(%saw,$cust_main); - foreach $cust_main ( - sort $sortby grep(!$saw{$_->custnum}++, @cust_main) - ) { - my($custnum,$last,$first,$company)=( - $cust_main->custnum, - $cust_main->getfield('last'), - $cust_main->getfield('first'), - $cust_main->company, - ); - print <<END; - <TR> - <TD><A HREF="../view/cust_main.cgi?$custnum"><FONT SIZE=-1>$custnum</FONT></A></TD> - <TD><FONT SIZE=-1>$last, $first</FONT></TD> - <TD><FONT SIZE=-1>$company</FONT></TD> - </TR> -END - if ($lcount-- == 0) { # lots of little tables instead of one big one - $lcount=$lines; - print <<END; - </TABLE> - <TABLE BORDER=4 CELLSPACING=0 CELLPADDING=0> - <TR> - <TH>Cust. #</TH> - <TH>Contact name</TH> - <TH>Company<TH> - </TR> -END - } - } - - print <<END; - </TABLE> - </CENTER> - </BODY> -</HTML> -END - -} - -# - -sub last_sort { - $a->getfield('last') cmp $b->getfield('last'); -} - -sub company_sort { - $a->getfield('company') cmp $b->getfield('company'); -} - -sub custnum_sort { - $a->getfield('custnum') <=> $b->getfield('custnum'); -} - -sub cardsearch { - - my($card)=$req->param('card'); - $card =~ s/\D//g; - $card =~ /^(\d{13,16})$/ or do { idiot "Illegal card number\n"; exit; }; - my($payinfo)=$1; - - push @cust_main, qsearch('cust_main',{'payinfo'=>$payinfo, 'payby'=>'CARD'}); - -} - -sub lastsearch { - my(%last_type); - foreach ( $req->param('last_type') ) { - $last_type{$_}++; - } - - $req->param('last_text') =~ /^([\w \,\.\-\']*)$/ - or do { idiot "Illegal last name"; exit; }; - my($last)=$1; - - if ( $last_type{'Exact'} - && ! $last_type{'Fuzzy'} - # && ! $last_type{'Sound-alike'} - ) { - - push @cust_main, qsearch('cust_main',{'last'=>$last}); - - } else { - - my(%last); - - my(@all_last)=map $_->getfield('last'), qsearch('cust_main',{}); - if ($last_type{'Fuzzy'}) { - my($reader,$writer) = ( new IO::Handle, new IO::Handle ); - open2($reader,$writer,'agrep',"-$fuzziness",'-i','-k', - substr($last,0,30)); - print $writer join("\n",@all_last),"\n"; - close $writer; - while (<$reader>) { - chop; - $last{$_}++; - } - close $reader; - } - - #if ($last_type{'Sound-alike'}) { - #} - - foreach ( keys %last ) { - push @cust_main, qsearch('cust_main',{'last'=>$_}); - } - - } - $sortby=\*last_sort; -} - -sub companysearch { - - my(%company_type); - foreach ( $req->param('company_type') ) { - $company_type{$_}++ - }; - - $req->param('company_text') =~ /^([\w \,\.\-\']*)$/ - or do { idiot "Illegal company"; exit; }; - my($company)=$1; - - if ( $company_type{'Exact'} - && ! $company_type{'Fuzzy'} - # && ! $company_type{'Sound-alike'} - ) { - - push @cust_main, qsearch('cust_main',{'company'=>$company}); - - } else { - - my(%company); - my(@all_company)=map $_->company, qsearch('cust_main',{}); - - if ($company_type{'Fuzzy'}) { - my($reader,$writer) = ( new IO::Handle, new IO::Handle ); - open2($reader,$writer,'agrep',"-$fuzziness",'-i','-k', - substr($company,0,30)); - print $writer join("\n",@all_company),"\n"; - close $writer; - while (<$reader>) { - chop; - $company{$_}++; - } - close $reader; - } - - #if ($company_type{'Sound-alike'}) { - #} - - foreach ( keys %company ) { - push @cust_main, qsearch('cust_main',{'company'=>$_}); - } - - } - $sortby=\*company_sort; - -} diff --git a/htdocs/search/cust_main.html b/htdocs/search/cust_main.html deleted file mode 100755 index 656943f..0000000 --- a/htdocs/search/cust_main.html +++ /dev/null @@ -1,36 +0,0 @@ -<HTML> - <HEAD> - <TITLE>Customer Search</TITLE> - </HEAD> - <BODY> - <CENTER> - <H1>Customer Search</H1> - </CENTER> - <HR> - <FORM ACTION="cust_main.cgi" METHOD="post"> - <INPUT TYPE="checkbox" NAME="last_on"> Search for <B>last name</B>: - <INPUT TYPE="text" NAME="last_text"> - using search method(s): <SELECT NAME="last_type" MULTIPLE> - <OPTION SELECTED>Fuzzy - <OPTION>Exact - </SELECT> - - <P><INPUT TYPE="checkbox" NAME="company_on"> Search for <B>company</B>: - <INPUT TYPE="text" NAME="company_text"> - using search methods(s): <SELECT NAME="company_type" MULTIPLE> - <OPTION SELECTED>Fuzzy - <OPTION>Exact - </SELECT> - - <P><INPUT TYPE="submit" VALUE="Search"> Note: Fuzzy searching can take a while. Please be patient. - - </FORM> - - <HR>Explanation of search methods: - <UL> - <LI><B>Fuzzy</B> - Searches for matches that are close to your text. - <LI><B>Exact</B> - Finds exact matches only, but much faster than the other search methods. - </UL> - </BODY> -</HTML> - diff --git a/htdocs/search/cust_pkg.cgi b/htdocs/search/cust_pkg.cgi deleted file mode 100755 index 967068f..0000000 --- a/htdocs/search/cust_pkg.cgi +++ /dev/null @@ -1,122 +0,0 @@ -#!/usr/bin/perl -Tw -# -# cust_pkg.cgi: search/browse for packages -# -# based on search/svc_acct.cgi ivan@sisd.com 98-jul-17 - -use strict; -use CGI::Request; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearch qsearchs); -use FS::CGI qw(header idiot); - -my($req)=new CGI::Request; -&cgisuidsetup($req->cgi); - -my(@cust_pkg,$sortby); - -my($query)=$req->cgi->var('QUERY_STRING'); -#this tree is a little bit redundant -if ( $query eq 'pkgnum' ) { - $sortby=\*pkgnum_sort; - @cust_pkg=qsearch('cust_pkg',{}); -} elsif ( $query eq 'APKG_pkgnum' ) { - $sortby=\*pkgnum_sort; - - #perhaps this should go in cust_pkg as a qsearch-like constructor? - my($cust_pkg); - foreach $cust_pkg (qsearch('cust_pkg',{})) { - my($flag)=0; - my($pkg_svc); - PKG_SVC: - foreach $pkg_svc (qsearch('pkg_svc',{ 'pkgpart' => $cust_pkg->pkgpart })) { - if ( $pkg_svc->quantity - > scalar(qsearch('cust_svc',{ - 'pkgnum' => $cust_pkg->pkgnum, - 'svcpart' => $pkg_svc->svcpart, - })) - ) - { - $flag=1; - last PKG_SVC; - } - } - push @cust_pkg, $cust_pkg if $flag; - } -} else { - die "Empty QUERY_STRING!"; -} - -if ( scalar(@cust_pkg) == 1 ) { - my($pkgnum)=$cust_pkg[0]->pkgnum; - $req->cgi->redirect("../view/cust_pkg.cgi?$pkgnum"); - exit; -} elsif ( scalar(@cust_pkg) == 0 ) { #error - &idiot("No packages found"); - exit; -} else { - my($total)=scalar(@cust_pkg); - CGI::Base::SendHeaders(); # one guess - print header('Package Search Results',''), <<END; - $total matching packages found - <TABLE BORDER=4 CELLSPACING=0 CELLPADDING=0> - <TR> - <TH>Package #</TH> - <TH>Customer #</TH> - <TH>Name</TH> - <TH>Company</TH> - </TR> -END - - my($lines)=16; - my($lcount)=$lines; - my(%saw,$cust_pkg); - foreach $cust_pkg ( - sort $sortby grep(!$saw{$_->pkgnum}++, @cust_pkg) - ) { - my($cust_main)=qsearchs('cust_main',{'custnum'=>$cust_pkg->custnum}); - my($pkgnum,$custnum,$name,$company)=( - $cust_pkg->pkgnum, - $cust_main->custnum, - $cust_main->last. ', '. $cust_main->first, - $cust_main->company, - ); - print <<END; - <TR> - <TD><A HREF="../view/cust_pkg.cgi?$pkgnum"><FONT SIZE=-1>$pkgnum</FONT></A></TD> - <TD><FONT SIZE=-1>$custnum</FONT></TD> - <TD><FONT SIZE=-1>$name</FONT></TD> - <TD><FONT SIZE=-1>$company</FONT></TD> - </TR> -END - if ($lcount-- == 0) { # lots of little tables instead of one big one - $lcount=$lines; - print <<END; - </TABLE> - <TABLE BORDER=4 CELLSPACING=0 CELLPADDING=0> - <TR> - <TH>Package #</TH> - <TH>Customer #</TH> - <TH>Name</TH> - <TH>Company</TH> - <TH> - </TR> -END - } - } - - print <<END; - </TABLE> - </CENTER> - </BODY> -</HTML> -END - exit; - -} - -sub pkgnum_sort { - $a->getfield('pkgnum') <=> $b->getfield('pkgnum'); -} - diff --git a/htdocs/search/svc_acct.cgi b/htdocs/search/svc_acct.cgi deleted file mode 100755 index 250a741..0000000 --- a/htdocs/search/svc_acct.cgi +++ /dev/null @@ -1,186 +0,0 @@ -#!/usr/bin/perl -Tw -# -# svc_acct.cgi: Search for customers (process form) -# -# Usage: post form to: -# http://server.name/path/svc_acct.cgi -# -# Note: Should be run setuid freeside as user nobody. -# -# loosely (sp?) based on search/cust_main.cgi -# -# ivan@voicenet.com 96-jan-3 -> 96-jan-4 -# -# rewrite (now does browsing too) ivan@sisd.com 98-mar-9 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 -# -# show unlinked accounts ivan@sisd.com 98-jun-22 -# -# use FS::CGI, show total ivan@sisd.com 98-jul-17 -# -# give service and customer info too ivan@sisd.com 98-aug-16 - -use strict; -use CGI::Request; # form processing module -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearch qsearchs); -use FS::CGI qw(header idiot); - -my($req)=new CGI::Request; # create form object -&cgisuidsetup($req->cgi); - -my(@svc_acct,$sortby); - -my($query)=$req->cgi->var('QUERY_STRING'); -#this tree is a little bit redundant -if ( $query eq 'svcnum' ) { - $sortby=\*svcnum_sort; - @svc_acct=qsearch('svc_acct',{}); -} elsif ( $query eq 'username' ) { - $sortby=\*username_sort; - @svc_acct=qsearch('svc_acct',{}); -} elsif ( $query eq 'uid' ) { - $sortby=\*uid_sort; - @svc_acct=grep $_->uid ne '', qsearch('svc_acct',{}); -} elsif ( $query eq 'UN_svcnum' ) { - $sortby=\*svcnum_sort; - @svc_acct = grep qsearchs('cust_svc',{ - 'svcnum' => $_->svcnum, - 'pkgnum' => '', - }), qsearch('svc_acct',{}); -} elsif ( $query eq 'UN_username' ) { - $sortby=\*username_sort; - @svc_acct = grep qsearchs('cust_svc',{ - 'svcnum' => $_->svcnum, - 'pkgnum' => '', - }), qsearch('svc_acct',{}); -} elsif ( $query eq 'UN_uid' ) { - $sortby=\*uid_sort; - @svc_acct = grep qsearchs('cust_svc',{ - 'svcnum' => $_->svcnum, - 'pkgnum' => '', - }), qsearch('svc_acct',{}); -} else { - &usernamesearch; -} - -if ( scalar(@svc_acct) == 1 ) { - my($svcnum)=$svc_acct[0]->svcnum; - $req->cgi->redirect("../view/svc_acct.cgi?$svcnum"); #redirect - exit; -} elsif ( scalar(@svc_acct) == 0 ) { #error - idiot("Account not found"); - exit; -} else { - my($total)=scalar(@svc_acct); - CGI::Base::SendHeaders(); # one guess - print header("Account Search Results",''), <<END; - $total matching accounts found - <TABLE BORDER=4 CELLSPACING=0 CELLPADDING=0> - <TR> - <TH>Service #</TH> - <TH>Username</TH> - <TH>UID</TH> - <TH>Service</TH> - <TH>Customer #</TH> - <TH>Contact name</TH> - <TH>Company</TH> - </TR> -END - - my($lines)=16; - my($lcount)=$lines; - my(%saw,$svc_acct); - foreach $svc_acct ( - sort $sortby grep(!$saw{$_->svcnum}++, @svc_acct) - ) { - my $cust_svc = qsearchs('cust_svc', { 'svcnum' => $svc_acct->svcnum }) - or die "No cust_svc record for svcnum ". $svc_acct->svcnum; - my $part_svc = qsearchs('part_svc', { 'svcpart' => $cust_svc->svcpart }) - or die "No part_svc record for svcpart ". $cust_svc->svcpart; - my($cust_pkg,$cust_main); - if ( $cust_svc->pkgnum ) { - $cust_pkg = qsearchs('cust_pkg', { 'pkgnum' => $cust_svc->pkgnum }) - or die "No cust_pkg record for pkgnum ". $cust_svc->pkgnum; - $cust_main = qsearchs('cust_main', { 'custnum' => $cust_pkg->custnum }) - or die "No cust_main record for custnum ". $cust_pkg->custnum; - } - my($svcnum,$username,$uid,$svc,$custnum,$last,$first,$company)=( - $svc_acct->svcnum, - $svc_acct->getfield('username'), - $svc_acct->getfield('uid'), - $part_svc->svc, - $cust_svc->pkgnum ? $cust_main->custnum : '', - $cust_svc->pkgnum ? $cust_main->getfield('last') : '', - $cust_svc->pkgnum ? $cust_main->getfield('first') : '', - $cust_svc->pkgnum ? $cust_main->company : '', - ); - my($pcustnum) = $custnum - ? "<A HREF=\"../view/cust_main.cgi?$custnum\"><FONT SIZE=-1>$custnum</FONT></A>" - : "<I>(unlinked)</I>" - ; - my($pname) = $custnum ? "$last, $first" : ''; - print <<END; - <TR> - <TD><A HREF="../view/svc_acct.cgi?$svcnum"><FONT SIZE=-1>$svcnum</FONT></A></TD> - <TD><FONT SIZE=-1>$username</FONT></TD> - <TD><FONT SIZE=-1>$uid</FONT></TD> - <TD><FONT SIZE=-1>$svc</FONT></TH> - <TD><FONT SIZE=-1>$pcustnum</FONT></TH> - <TD><FONT SIZE=-1>$pname<FONT></TH> - <TD><FONT SIZE=-1>$company</FONT></TH> - </TR> -END - if ($lcount-- == 0) { # lots of little tables instead of one big one - $lcount=$lines; - print <<END; - </TABLE> - <TABLE BORDER=4 CELLSPACING=0 CELLPADDING=0> - <TR> - <TH>Service #</TH> - <TH>Userame</TH> - <TH>UID</TH> - <TH>Service</TH> - <TH>Customer #</TH> - <TH>Contact name</TH> - <TH>Company</TH> - </TR> -END - } - } - - print <<END; - </TABLE> - </CENTER> - </BODY> -</HTML> -END - exit; - -} - -sub svcnum_sort { - $a->getfield('svcnum') <=> $b->getfield('svcnum'); -} - -sub username_sort { - $a->getfield('username') cmp $b->getfield('username'); -} - -sub uid_sort { - $a->getfield('uid') <=> $b->getfield('uid'); -} - -sub usernamesearch { - - $req->param('username') =~ /^([\w\d\-]{2,8})$/; #untaint username_text - my($username)=$1; - - @svc_acct=qsearch('svc_acct',{'username'=>$username}); - -} - - diff --git a/htdocs/search/svc_acct.html b/htdocs/search/svc_acct.html deleted file mode 100755 index 91291be..0000000 --- a/htdocs/search/svc_acct.html +++ /dev/null @@ -1,21 +0,0 @@ -<HTML> - <HEAD> - <TITLE>Account Search</TITLE> - </HEAD> - <BODY> - <CENTER> - <H1>Account Search</H1> - </CENTER> - <HR> - <FORM ACTION="svc_acct.cgi" METHOD="post"> - Search for <B>username</B>: - <INPUT TYPE="text" NAME="username"> - - <P><INPUT TYPE="submit" VALUE="Search"> - - </FORM> - - <HR> - </BODY> -</HTML> - diff --git a/htdocs/search/svc_acct_sm.cgi b/htdocs/search/svc_acct_sm.cgi deleted file mode 100755 index 3b1a4cf..0000000 --- a/htdocs/search/svc_acct_sm.cgi +++ /dev/null @@ -1,128 +0,0 @@ -#!/usr/bin/perl -Tw -# -# svc_acct_sm.cgi: Search for domains (process form) -# -# Usage: post form to: -# http://server.name/path/svc_domain.cgi -# -# Note: Should be run setuid freeside as user nobody. -# -# ivan@voicenet.com 96-mar-5 -# -# need to look at table in results to make it more readable -# -# ivan@voicenet.com -# -# rewrite ivan@sisd.com 98-mar-15 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 - -use strict; -use CGI::Request; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearch qsearchs); - -my($conf_domain)="/var/spool/freeside/conf/domain"; -open(DOMAIN,$conf_domain) or die "Can't open $conf_domain: $!"; -my($mydomain)=map { - /^(.*)$/ or die "Illegal line in $conf_domain!"; #yes, we trust the file - $1 -} grep $_ !~ /^(#|$)/, <DOMAIN>; -close DOMAIN; - -my($req)=new CGI::Request; # create form object -&cgisuidsetup($req->cgi); - -$req->param('domuser') =~ /^([a-z0-9_\-]{0,32})$/; -my($domuser)=$1; - -$req->param('domain') =~ /^([\w\-\.]+)$/ or die "Illegal domain"; -my($svc_domain)=qsearchs('svc_domain',{'domain'=>$1}) - or die "Unknown domain"; -my($domsvc)=$svc_domain->svcnum; - -my(@svc_acct_sm); -if ($domuser) { - @svc_acct_sm=qsearch('svc_acct_sm',{ - 'domuser' => $domuser, - 'domsvc' => $domsvc, - }); -} else { - @svc_acct_sm=qsearch('svc_acct_sm',{'domsvc' => $domsvc}); -} - -if ( scalar(@svc_acct_sm) == 1 ) { - my($svcnum)=$svc_acct_sm[0]->svcnum; - $req->cgi->redirect("../view/svc_acct_sm.cgi?$svcnum"); #redirect -} elsif ( scalar(@svc_acct_sm) > 1 ) { - CGI::Base::SendHeaders(); - print <<END; -<HTML> - <HEAD> - <TITLE>Mail Alias Search Results</TITLE> - </HEAD> - <BODY> - <CENTER> - <H4>Mail Alias Search Results</H4> - <TABLE BORDER=4 CELLSPACING=0 CELLPADDING=0> - <TR> - <TH>Mail to<BR><FONT SIZE=-2>(click here to view mail alias)</FONT></TH> - <TH>Forwards to<BR><FONT SIZE=-2>(click here to view account)</FONT></TH> - </TR> -END - - my($svc_acct_sm); - foreach $svc_acct_sm (@svc_acct_sm) { - my($svcnum,$domuser,$domuid,$domsvc)=( - $svc_acct_sm->svcnum, - $svc_acct_sm->domuser, - $svc_acct_sm->domuid, - $svc_acct_sm->domsvc, - ); - my($svc_domain)=qsearchs('svc_domain',{'svcnum'=>$domsvc}); - my($domain)=$svc_domain->domain; - my($svc_acct)=qsearchs('svc_acct',{'uid'=>$domuid}); - my($username)=$svc_acct->username; - my($svc_acct_svcnum)=$svc_acct->svcnum; - - print <<END; -<TR>\n <TD> <A HREF="../view/svc_acct_sm.cgi?$svcnum"> -END - - print '', ( ($domuser eq '*') ? "<I>(anything)</I>" : $domuser ); - - print <<END; -\@$domain</A> </TD>\n -<TD> <A HREF="../view/svc_acct.cgi?$svc_acct_svcnum">$username\@$mydomain</A> </TD>\n </TR>\n -END - - } - - print <<END; - </TABLE> - </CENTER> - </BODY> -</HTML> -END - -} else { #error - CGI::Base::SendHeaders(); # one guess - print <<END; -<HTML> - <HEAD> - <TITLE>Mail Alias Search Error</TITLE> - </HEAD> - <BODY> - <CENTER> - <H3>Mail Alias Search Error</H3> - <HR> - Mail Alias not found. - </CENTER> - </BODY> -</HTML> -END - -} - diff --git a/htdocs/search/svc_acct_sm.html b/htdocs/search/svc_acct_sm.html deleted file mode 100755 index 0719856..0000000 --- a/htdocs/search/svc_acct_sm.html +++ /dev/null @@ -1,23 +0,0 @@ -<HTML> - <HEAD> - <TITLE>Mail Alias Search</TITLE> - </HEAD> - <BODY> - <CENTER> - <H1>Mail Alias Search</H1> - </CENTER> - <HR> - <FORM ACTION="svc_acct_sm.cgi" METHOD="post"> - Search for <B>mail alias</B>: - <INPUT TYPE="text" NAME="domuser"><FONT SIZE=-1>(opt.)</FONT> @ - <INPUT TYPE="text" NAME="domain"><FONT SIZE=-1>(req.)</FONT> - - <P><INPUT TYPE="submit" VALUE="Search"> - - </FORM> - - <HR> - - </BODY> -</HTML> - diff --git a/htdocs/search/svc_domain.cgi b/htdocs/search/svc_domain.cgi deleted file mode 100755 index d527703..0000000 --- a/htdocs/search/svc_domain.cgi +++ /dev/null @@ -1,139 +0,0 @@ -#!/usr/bin/perl -Tw -# -# svc_domain.cgi: Search for domains (process form) -# -# Usage: post form to: -# http://server.name/path/svc_domain.cgi -# -# Note: Should be run setuid freeside as user nobody. -# -# ivan@voicenet.com 97-mar-5 -# -# rewrite ivan@sisd.com 98-mar-14 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 -# -# display total, use FS::CGI now does browsing too ivan@sisd.com 98-jul-17 - -use strict; -use CGI::Request; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearch qsearchs); -use FS::CGI qw(header idiot); - -my($req)=new CGI::Request; -&cgisuidsetup($req->cgi); - -my(@svc_domain); -my($sortby); - -my($query)=$req->cgi->var('QUERY_STRING'); -if ( $query eq 'svcnum' ) { - $sortby=\*svcnum_sort; - @svc_domain=qsearch('svc_domain',{}); -} elsif ( $query eq 'domain' ) { - $sortby=\*domain_sort; - @svc_domain=qsearch('svc_domain',{}); -} elsif ( $query eq 'UN_svcnum' ) { - $sortby=\*svcnum_sort; - @svc_domain = grep qsearchs('cust_svc',{ - 'svcnum' => $_->svcnum, - 'pkgnum' => '', - }), qsearch('svc_domain',{}); -} elsif ( $query eq 'UN_domain' ) { - $sortby=\*domain_sort; - @svc_domain = grep qsearchs('cust_svc',{ - 'svcnum' => $_->svcnum, - 'pkgnum' => '', - }), qsearch('svc_domain',{}); -} else { - $req->param('domain') =~ /^([\w\-\.]+)$/; - my($domain)=$1; - push @svc_domain, qsearchs('svc_domain',{'domain'=>$domain}); -} - -if ( scalar(@svc_domain) == 1 ) { - $req->cgi->redirect("../view/svc_domain.cgi?". $svc_domain[0]->svcnum); - exit; -} elsif ( scalar(@svc_domain) == 0 ) { - idiot "No matching domains found!\n"; - exit; -} else { - CGI::Base::SendHeaders(); # one guess - - my($total)=scalar(@svc_domain); - CGI::Base::SendHeaders(); # one guess - print header("Domain Search Results",''), <<END; - - $total matching domains found - <TABLE BORDER=4 CELLSPACING=0 CELLPADDING=0> - <TR> - <TH>Service #</TH> - <TH>Domain</TH> - <TH></TH> - </TR> -END - - my($lines)=16; - my($lcount)=$lines; - my(%saw,$svc_domain); - foreach $svc_domain ( - sort $sortby grep(!$saw{$_->svcnum}++, @svc_domain) - ) { - my($svcnum,$domain)=( - $svc_domain->svcnum, - $svc_domain->domain, - ); - my($malias); - if ( qsearch('svc_acct_sm',{'domsvc'=>$svcnum}) ) { - $malias=( - qq|<FORM ACTION="svc_acct_sm.cgi" METHOD="post">|. - qq|<INPUT TYPE="hidden" NAME="domuser" VALUE="">|. - qq|<INPUT TYPE="hidden" NAME="domain" VALUE="$domain">|. - qq|<INPUT TYPE="submit" VALUE="(mail aliases)">|. - qq|</FORM>| - ); - } else { - $malias=''; - } - print <<END; - <TR> - <TD><A HREF="../view/svc_domain.cgi?$svcnum"><FONT SIZE=-1>$svcnum</FONT></A></TD> - <TD><FONT SIZE=-1>$domain</FONT></TD> - <TD><FONT SIZE=-1>$malias</FONT></TD> - </TR> -END - if ($lcount-- == 0) { # lots of little tables instead of one big one - $lcount=$lines; - print <<END; - </TABLE> - <TABLE BORDER=4 CELLSPACING=0 CELLPADDING=0> - <TR> - <TH>Service #</TH> - <TH>Domain</TH> - <TH></TH> - </TR> -END - } - } - - print <<END; - </TABLE> - </CENTER> - </BODY> -</HTML> -END - -} - -sub svcnum_sort { - $a->getfield('svcnum') <=> $b->getfield('svcnum'); -} - -sub domain_sort { - $a->getfield('domain') cmp $b->getfield('doimain'); -} - - diff --git a/htdocs/search/svc_domain.html b/htdocs/search/svc_domain.html deleted file mode 100755 index 533743b..0000000 --- a/htdocs/search/svc_domain.html +++ /dev/null @@ -1,22 +0,0 @@ -<HTML> - <HEAD> - <TITLE>Domain Search</TITLE> - </HEAD> - <BODY> - <CENTER> - <H1>Domain Search</H1> - </CENTER> - <HR> - <FORM ACTION="svc_domain.cgi" METHOD="post"> - Search for <B>domain</B>: - <INPUT TYPE="text" NAME="domain"> - - <P><INPUT TYPE="submit" VALUE="Search"> - - </FORM> - - <HR> - - </BODY> -</HTML> - diff --git a/htdocs/view/cust_bill.cgi b/htdocs/view/cust_bill.cgi deleted file mode 100755 index 96101d0..0000000 --- a/htdocs/view/cust_bill.cgi +++ /dev/null @@ -1,79 +0,0 @@ -#!/usr/bin/perl -Tw -# -# Usage: cust_bill.cgi invnum -# http://server.name/path/cust_bill.cgi?invnum -# -# Note: Should be run setuid freeside as user nobody. -# -# this is a quick & ugly hack which does little more than add some formatting to the ascii output from /dbin/print-invoice -# -# ivan@voicenet.com 96-dec-05 -# -# added navigation bar -# ivan@voicenet.com 97-jan-30 -# -# now uses Invoice.pm -# ivan@voicenet.com 97-jun-30 -# -# what to do if cust_bill search errors? -# ivan@voicenet.com 97-jul-7 -# -# s/FS::Search/FS::Record/; $cgisuidsetup($cgi); ivan@sisd.com 98-mar-14 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 -# -# also print 'printed' field ivan@sisd.com 98-jul-10 - -use strict; -use IO::File; -use CGI::Base qw(:DEFAULT :CGI); # CGI module -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearchs); -use FS::Invoice; - -my($cgi) = new CGI::Base; -$cgi->get; -&cgisuidsetup($cgi); - -#untaint invnum -$QUERY_STRING =~ /^(\d+)$/; -my($invnum)=$1; - -my($cust_bill) = qsearchs('cust_bill',{'invnum'=>$invnum}); -die "Invoice #$invnum not found!" unless $cust_bill; -my($custnum) = $cust_bill->getfield('custnum'); - -my($printed) = $cust_bill->printed; - -SendHeaders(); # one guess. -print <<END; -<HTML> - <HEAD> - <TITLE>Invoice View</TITLE> - </HEAD> - <BODY> - <CENTER> - <H1>Invoice View</H1> - <A HREF="../view/cust_main.cgi?$custnum">View this customer (#$custnum)</A> | <A HREF="../">Main menu</A> - </CENTER><HR> - <BASEFONT SIZE=3> - <CENTER> - <A HREF="../edit/cust_pay.cgi?$invnum">Enter payments (check/cash) against this invoice</A> - <BR><A HREF="../misc/print-invoice.cgi?$invnum">Reprint this invoice</A> - <BR><BR>(Printed $printed times) - </CENTER> - <FONT SIZE=-1><PRE> -END - -bless($cust_bill,"FS::Invoice"); -print $cust_bill->print_text; - - #formatting - print <<END; - </PRE></FONT> - </BODY> -</HTML> -END - diff --git a/htdocs/view/cust_main.cgi b/htdocs/view/cust_main.cgi deleted file mode 100755 index ca5fcd9..0000000 --- a/htdocs/view/cust_main.cgi +++ /dev/null @@ -1,336 +0,0 @@ -#!/usr/bin/perl -Tw -# -# cust_main.cgi: View a customer -# -# Usage: cust_main.cgi custnum -# http://server.name/path/cust_main.cgi?custnum -# -# Note: Should be run setuid freeside as user nobody. -# -# the payment history section could use some work, see below -# -# ivan@voicenet.com 96-nov-29 -> 96-dec-11 -# -# added navigation bar (go to main menu ;) -# ivan@voicenet.com 97-jan-30 -# -# changes to the way credits/payments are applied (the links are here). -# ivan@voicenet.com 97-apr-21 -# -# added debugging code to diagnose CPU sucking problem. -# ivan@voicenet.com 97-may-19 -# -# CPU sucking problem was in comment code? fixed? -# ivan@voicenet.com 97-may-22 -# -# rewrote for new API -# ivan@voicenet.com 97-jul-22 -# -# Changes to allow page to work at a relative position in server -# Changed 'day' to 'daytime' because Pg6.3 reserves the day word -# bmccane@maxbaud.net 98-apr-3 -# -# lose background, FS::CGI ivan@sisd.com 98-sep-2 - -use strict; -use CGI::Base qw(:DEFAULT :CGI); # CGI module -use CGI::Carp qw(fatalsToBrowser); -use Date::Format; -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearchs qsearch); -use FS::CGI qw(header menubar); - -my($cgi) = new CGI::Base; -$cgi->get; -&cgisuidsetup($cgi); - -SendHeaders(); # one guess. -print header("Customer View", menubar( - 'Main Menu' => '../', -)),<<END; - <BASEFONT SIZE=3> -END - -#untaint custnum & get customer record -$QUERY_STRING =~ /^(\d+)$/; -my($custnum)=$1; -my($cust_main)=qsearchs('cust_main',{'custnum'=>$custnum}); -die "Customer not found!" unless $cust_main; -my($hashref)=$cust_main->hashref; - -#custnum -print "<FONT SIZE=+1><CENTER>Customer #<B>$custnum</B></CENTER></FONT>", - qq!<CENTER><A HREF="#cust_main">Customer Information</A> | !, - qq!<A HREF="#cust_comments">Comments</A> | !, - qq!<A HREF="#cust_pkg">Packages</A> | !, - qq!<A HREF="#history">Payment History</A> </CENTER>!; - -#bill now linke -print qq!<HR><CENTER><A HREF="../misc/bill.cgi?$custnum">!, - qq!Bill this customer now</A></CENTER>!; - -#formatting -print qq!<HR><A NAME="cust_main"><CENTER><FONT SIZE=+1>Customer Information!, - qq!</FONT>!, - qq!<BR><A HREF="../edit/cust_main.cgi?$custnum!, - qq!">Edit this information</A></CENTER><FONT SIZE=-1>!; - -#agentnum -my($agent)=qsearchs('agent',{ - 'agentnum' => $cust_main->getfield('agentnum') -} ); -die "Agent not found!" unless $agent; -print "<BR>Agent #<B>" , $agent->getfield('agentnum') , ": " , - $agent->getfield('agent') , "</B>"; - -#refnum -my($referral)=qsearchs('part_referral',{'refnum' => $cust_main->refnum}); -die "Referral not found!" unless $referral; -print "<BR>Referral #<B>", $referral->refnum, ": ", - $referral->referral, "<\B>"; - -#last, first -print "<P><B>", $hashref->{'last'}, ", ", $hashref->{first}, "</B>"; - -#ss -print " (SS# <B>", $hashref->{ss}, "</B>)" if $hashref->{ss}; - -#company -print "<BR><B>", $hashref->{company}, "</B>" if $hashref->{company}; - -#address1 -print "<BR><B>", $hashref->{address1}, "</B>"; - -#address2 -print "<BR><B>", $hashref->{address2}, "</B>" if $hashref->{address2}; - -#city -print "<BR><B>", $hashref->{city}, "</B>"; - -#county -print " (<B>", $hashref->{county}, "</B> county)" if $hashref->{county}; - -#state -print ",<B>", $hashref->{state}, "</B>"; - -#zip -print " <B>", $hashref->{zip}, "</B>"; - -#country -print "<BR><B>", $hashref->{country}, "</B>" - unless $hashref->{country} eq "US"; - -#daytime -print "<P><B>", $hashref->{daytime}, "</B>" if $hashref->{daytime}; -print " (Day)" if $hashref->{daytime} && $hashref->{night}; - -#night -print "<BR><B>", $hashref->{night}, "</B>" if $hashref->{night}; -print " (Night)" if $hashref->{daytime} && $hashref->{night}; - -#fax -print "<BR><B>", $hashref->{fax}, "</B> (Fax)" if $hashref->{fax}; - -#payby/payinfo/paydate/payname -if ($hashref->{payby} eq "CARD") { - print "<P>Card #<B>", $hashref->{payinfo}, "</B> Exp. <B>", - $hashref->{paydate}, "</B>"; - print " (<B>", $hashref->{payname}, "</B>)" if $hashref->{payname}; -} elsif ($hashref->{payby} eq "BILL") { - print "<P>Bill"; - print " on P.O. #<B>", $hashref->{payinfo}, "</B>" - if $hashref->{payinfo}; - print " until <B>", $hashref->{paydate}, "</B>" - if $hashref->{paydate}; - print " to <B>", $hashref->{payname}, "</B> at above address" - if $hashref->{payname}; -} elsif ($hashref->{payby} eq "COMP") { - print "<P>Access complimentary"; - print " courtesy of <B>", $hashref->{payinfo}, "</B>" - if $hashref->{payinfo}; - print " until <B>", $hashref->{paydate}, "</B>" - if $hashref->{paydate}; -} else { - print "Unknown payment type ", $hashref->{payby}, "!"; -} - -#tax -print "<BR>(Tax exempt)" if $hashref->{tax}; - -#otaker -print "<P>Order taken by <B>", $hashref->{otaker}, "</B>"; - -#formatting -print qq!<HR><FONT SIZE=+1><A NAME="cust_pkg"><CENTER>Packages</A></FONT>!, - qq!<BR>Click on package number to view/edit package.!, - qq!<BR><A HREF="../edit/cust_pkg.cgi?$custnum">Add/Edit packages</A>!, - qq!</CENTER><BR>!; - -#display packages - -#formatting -print qq!<CENTER><TABLE BORDER=4>\n!, - qq!<TR><TH ROWSPAN=2>#</TH><TH ROWSPAN=2>Package</TH><TH COLSPAN=5>!, - qq!Dates</TH></TR>\n!, - qq!<TR><TH><FONT SIZE=-1>Setup</FONT></TH><TH>!, - qq!<FONT SIZE=-1>Next bill</FONT>!, - qq!</TH><TH><FONT SIZE=-1>Susp.</FONT></TH><TH><FONT SIZE=-1>Expire!, - qq!</FONT></TH>!, - qq!<TH><FONT SIZE=-1>Cancel</FONT></TH>!, - qq!</TR>\n!; - -#get package info -my(@packages)=qsearch('cust_pkg',{'custnum'=>$custnum}); -my($package); -foreach $package (@packages) { - my($pref)=$package->hashref; - my($part_pkg)=qsearchs('part_pkg',{ - 'pkgpart' => $pref->{pkgpart} - } ); - print qq!<TR><TD><FONT SIZE=-1><A HREF="../view/cust_pkg.cgi?!, - $pref->{pkgnum}, qq!">!, - $pref->{pkgnum}, qq!</A></FONT></TD>!, - "<TD><FONT SIZE=-1>", $part_pkg->getfield('pkg'), " - ", - $part_pkg->getfield('comment'), "</FONT></TD>", - "<TD><FONT SIZE=-1>", - $pref->{setup} ? time2str("%D",$pref->{setup} ) : "" , - "</FONT></TD>", - "<TD><FONT SIZE=-1>", - $pref->{bill} ? time2str("%D",$pref->{bill} ) : "" , - "</FONT></TD>", - "<TD><FONT SIZE=-1>", - $pref->{susp} ? time2str("%D",$pref->{susp} ) : "" , - "</FONT></TD>", - "<TD><FONT SIZE=-1>", - $pref->{expire} ? time2str("%D",$pref->{expire} ) : "" , - "</FONT></TD>", - "<TD><FONT SIZE=-1>", - $pref->{cancel} ? time2str("%D",$pref->{cancel} ) : "" , - "</FONT></TD>", - "</TR>"; -} - -#formatting -print "</TABLE></CENTER>"; - -#formatting -print qq!<CENTER><HR><A NAME="history"><FONT SIZE=+1>Payment History!, - qq!</FONT></A><BR>!, - qq!Click on invoice to view invoice/enter payment.<BR>!, - qq!<A HREF="../edit/cust_credit.cgi?$custnum">!, - qq!Post Credit / Refund</A></CENTER><BR>!; - -#get payment history -# -# major problem: this whole thing is way too sloppy. -# minor problem: the description lines need better formatting. - -my(@history); - -my(@bills)=qsearch('cust_bill',{'custnum'=>$custnum}); -my($bill); -foreach $bill (@bills) { - my($bref)=$bill->hashref; - push @history, - $bref->{_date} . qq!\t<A HREF="../view/cust_bill.cgi?! . - $bref->{invnum} . qq!">Invoice #! . $bref->{invnum} . - qq! (Balance \$! . $bref->{owed} . qq!)</A>\t! . - $bref->{charged} . qq!\t\t\t!; - - my(@payments)=qsearch('cust_pay',{'invnum'=> $bref->{invnum} } ); - my($payment); - foreach $payment (@payments) { -# my($pref)=$payment->hashref; - my($date,$invnum,$payby,$payinfo,$paid)=($payment->getfield('_date'), - $payment->getfield('invnum'), - $payment->getfield('payby'), - $payment->getfield('payinfo'), - $payment->getfield('paid'), - ); - push @history, - "$date\tPayment, Invoice #$invnum ($payby $payinfo)\t\t$paid\t\t"; - } -} - -my(@credits)=qsearch('cust_credit',{'custnum'=>$custnum}); -my($credit); -foreach $credit (@credits) { - my($cref)=$credit->hashref; - push @history, - $cref->{_date} . "\tCredit #" . $cref->{crednum} . ", (Balance \$" . - $cref->{credited} . ") by " . $cref->{otaker} . " - " . - $cref->{reason} . "\t\t\t" . $cref->{amount} . "\t"; - - my(@refunds)=qsearch('cust_refund',{'crednum'=> $cref->{crednum} } ); - my($refund); - foreach $refund (@refunds) { - my($rref)=$refund->hashref; - push @history, - $rref->{_date} . "\tRefund, Credit #" . $rref->{crednum} . " (" . - $rref->{payby} . " " . $rref->{payinfo} . ") by " . - $rref->{otaker} . " - ". $rref->{reason} . "\t\t\t\t" . - $rref->{refund}; - } -} - - #formatting - print <<END; -<CENTER><TABLE BORDER=4> -<TR> - <TH>Date</TH> - <TH>Description</TH> - <TH><FONT SIZE=-1>Charge</FONT></TH> - <TH><FONT SIZE=-1>Payment</FONT></TH> - <TH><FONT SIZE=-1>In-house<BR>Credit</FONT></TH> - <TH><FONT SIZE=-1>Refund</FONT></TH> - <TH><FONT SIZE=-1>Balance</FONT></TH> -</TR> -END - -#display payment history - -my($balance)=0; -my($item); -foreach $item (sort keyfield_numerically @history) { - my($date,$desc,$charge,$payment,$credit,$refund)=split(/\t/,$item); - $charge ||= 0; - $payment ||= 0; - $credit ||= 0; - $refund ||= 0; - $balance += $charge - $payment; - $balance -= $credit - $refund; - - print "<TR><TD><FONT SIZE=-1>",time2str("%D",$date),"</FONT></TD>", - "<TD><FONT SIZE=-1>$desc</FONT></TD>", - "<TD><FONT SIZE=-1>", - ( $charge ? "\$".sprintf("%.2f",$charge) : '' ), - "</FONT></TD>", - "<TD><FONT SIZE=-1>", - ( $payment ? "- \$".sprintf("%.2f",$payment) : '' ), - "</FONT></TD>", - "<TD><FONT SIZE=-1>", - ( $credit ? "- \$".sprintf("%.2f",$credit) : '' ), - "</FONT></TD>", - "<TD><FONT SIZE=-1>", - ( $refund ? "\$".sprintf("%.2f",$refund) : '' ), - "</FONT></TD>", - "<TD><FONT SIZE=-1>\$" . sprintf("%.2f",$balance), - "</FONT></TD>", - "\n"; -} - -#formatting -print "</TABLE></CENTER>"; - -#end - -#formatting -print <<END; - - </BODY> -</HTML> -END - -#subroutiens -sub keyfield_numerically { (split(/\t/,$a))[0] <=> (split(/\t/,$b))[0] ; } - diff --git a/htdocs/view/cust_pkg.cgi b/htdocs/view/cust_pkg.cgi deleted file mode 100755 index 04e3832..0000000 --- a/htdocs/view/cust_pkg.cgi +++ /dev/null @@ -1,181 +0,0 @@ -#!/usr/bin/perl -Tw -# -# cust_pkg.cgi: View a package -# -# Usage: cust_pkg.cgi pkgnum -# http://server.name/path/cust_pkg.cgi?pkgnum -# -# Note: Should be run setuid freeside as user nobody. -# -# ivan@voicenet.com 96-dec-15 -# -# services section needs to be cleaned up, needs to display extraneous -# entries in cust_pkg! -# ivan@voicenet.com 96-dec-31 -# -# added navigation bar -# ivan@voicenet.com 97-jan-30 -# -# changed and fixed up suspension and cancel stuff, now you can't add -# services to a cancelled package -# ivan@voicenet.com 97-feb-27 -# -# rewrote for new API, still needs to be cleaned up! -# ivan@voicenet.com 97-jul-29 -# -# no FS::Search ivan@sisd.com 98-mar-7 - -use strict; -use Date::Format; -use CGI::Base qw(:DEFAULT :CGI); # CGI module -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearch qsearchs); - -my($cgi) = new CGI::Base; -$cgi->get; -&cgisuidsetup($cgi); - -my(%uiview,%uiadd); -my($part_svc); -foreach $part_svc ( qsearch('part_svc',{}) ) { - $uiview{$part_svc->svcpart}="../view/". $part_svc->svcdb . ".cgi"; - $uiadd{$part_svc->svcpart}="../edit/". $part_svc->svcdb . ".cgi"; -} - -SendHeaders(); # one guess. -print <<END; -<HTML> - <HEAD> - <TITLE>Package View</TITLE> - </HEAD> - <BODY> - <CENTER> - <H1>Package View</H1> - </CENTER> - <BASEFONT SIZE=3> -END - -#untaint pkgnum -$QUERY_STRING =~ /^(\d+)$/; -my($pkgnum)=$1; - -#get package record -my($cust_pkg)=qsearchs('cust_pkg',{'pkgnum'=>$pkgnum}); -die "No package!" unless $cust_pkg; -my($part_pkg)=qsearchs('part_pkg',{'pkgpart'=>$cust_pkg->getfield('pkgpart')}); - -#nav bar -my($custnum)=$cust_pkg->getfield('custnum'); -print qq!<CENTER><A HREF="../view/cust_main.cgi?$custnum">View this customer!, - qq! (#$custnum)</A> | <A HREF="../">Main menu</A></CENTER><BR>!; - -#print info -my($susp,$cancel,$expire)=( - $cust_pkg->getfield('susp'), - $cust_pkg->getfield('cancel'), - $cust_pkg->getfield('expire'), -); -print "<FONT SIZE=+1><CENTER>Package #<B>$pkgnum</B></FONT>"; -print qq!<BR><A HREF="#package">Package Information</A>!; -print qq! | <A HREF="#services">Service Information</A>! unless $cancel; -print qq!</CENTER><HR>\n!; - -my($pkg,$comment)=($part_pkg->getfield('pkg'),$part_pkg->getfield('comment')); -print qq!<A NAME="package"><CENTER><FONT SIZE=+1>Package Information!, - qq!</FONT></A>!; -print qq!<BR><A HREF="../unimp.html">Edit this information</A></CENTER>!; -print "<P>Package: <B>$pkg - $comment</B>"; - -my($setup,$bill)=($cust_pkg->getfield('setup'),$cust_pkg->getfield('bill')); -print "<BR>Setup: <B>", $setup ? time2str("%D",$setup) : "(Not setup)" ,"</B>"; -print "<BR>Next bill: <B>", $bill ? time2str("%D",$bill) : "" ,"</B>"; - -if ($susp) { - print "<BR>Suspended: <B>", time2str("%D",$susp), "</B>"; - print qq! <A HREF="../misc/unsusp_pkg.cgi?$pkgnum">Unsuspend</A>! unless $cancel; -} else { - print qq!<BR><A HREF="../misc/susp_pkg.cgi?$pkgnum">Suspend</A>! unless $cancel; -} - -if ($expire) { - print "<BR>Expire: <B>", time2str("%D",$expire), "</B>"; -} - print <<END; -<FORM ACTION="../misc/expire_pkg.cgi" METHOD="post"> -<INPUT TYPE="hidden" NAME="pkgnum" VALUE="$pkgnum"> -Expire (date): <INPUT TYPE="text" NAME="date" VALUE="" > -<INPUT TYPE="submit" VALUE="Cancel later"> -END - -if ($cancel) { - print "<BR>Cancelled: <B>", time2str("%D",$cancel), "</B>"; -} else { - print qq!<BR><A HREF="../misc/cancel_pkg.cgi?$pkgnum">Cancel now</A>!; -} - -#otaker -my($otaker)=$cust_pkg->getfield('otaker'); -print "<P>Order taken by <B>$otaker</B>"; - -unless ($cancel) { - - #services - print <<END; -<HR><A NAME="services"><CENTER><FONT SIZE=+1>Service Information</FONT></A> -<BR>Click on service to view/edit/add service.</CENTER><BR> -<CENTER><B>Do NOT pick the "Link to existing" option unless you are auditing!!!</B></CENTER> -<CENTER><TABLE BORDER=4> -<TR><TH>Service</TH> -END - - #list of services this pkgpart includes - my($pkg_svc,%pkg_svc); - foreach $pkg_svc ( qsearch('pkg_svc',{'pkgpart'=> $cust_pkg->pkgpart }) ) { - $pkg_svc{$pkg_svc->svcpart} = $pkg_svc->quantity if $pkg_svc->quantity; - } - - #list of records from cust_svc - my($svcpart); - foreach $svcpart (sort {$a <=> $b} keys %pkg_svc) { - - my($svc)=qsearchs('part_svc',{'svcpart'=>$svcpart})->getfield('svc'); - - my(@cust_svc)=qsearch('cust_svc',{'pkgnum'=>$pkgnum, - 'svcpart'=>$svcpart, - }); - - my($enum); - for $enum ( 1 .. $pkg_svc{$svcpart} ) { - - my($cust_svc); - if ( $cust_svc=shift @cust_svc ) { - my($svcnum)=$cust_svc->svcnum; - print <<END; -<TR><TD><A HREF="$uiview{$svcpart}?$svcnum">(View) $svc<A></TD></TR> -END - } else { - print <<END; -<TR> - <TD><A HREF="$uiadd{$svcpart}?pkgnum$pkgnum-svcpart$svcpart"> - (Add) $svc</A> - or <A HREF="../misc/link.cgi?pkgnum$pkgnum-svcpart$svcpart"> - (Link to existing) $svc</A> - </TD> -</TR> -END - } - - } - warn "WARNING: Leftover services pkgnum $pkgnum!" if @cust_svc;; - } - - print "</TABLE></CENTER>"; - -} - -#formatting -print <<END; - </BODY> -</HTML> -END - diff --git a/htdocs/view/svc_acct.cgi b/htdocs/view/svc_acct.cgi deleted file mode 100755 index 7096c2f..0000000 --- a/htdocs/view/svc_acct.cgi +++ /dev/null @@ -1,172 +0,0 @@ -#!/usr/bin/perl -Tw -# -# View svc_acct records -# -# Usage: svc_acct.cgi svcnum -# http://server.name/path/svc_acct.cgi?svcnum -# -# Note: Should be run setuid freeside as user nobody. -# -# ivan@voicenet.com 96-dec-17 -# -# added link to send info -# ivan@voicenet.com 97-jan-4 -# -# added navigation bar and ability to change username, etc. -# ivan@voicenet.com 97-jan-30 -# -# activate 800 service -# ivan@voicenet.com 97-feb-10 -# -# modified navbar code (should be a subroutine?), added link to cancel account (only if not audited) -# ivan@voicenet.com 97-apr-16 -# -# INCOMPLETELY rewrote some things for new API -# ivan@voicenet.com 97-jul-29 -# -# FS::Search became FS::Record, use strict, etc. ivan@sisd.com 98-mar-9 -# -# Changes to allow page to work at a relative position in server -# Changed 'password' to '_password' because Pg6.3 reserves the password word -# bmccane@maxbaud.net 98-apr-3 -# -# /var/spool/freeside/conf/domain ivan@sisd.com 98-jul-17 -# -# displays arbitrary radius attributes ivan@sisd.com 98-aug-16 - -use strict; -use CGI::Base qw(:DEFAULT :CGI); -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearchs fields); - -my($conf_domain)="/var/spool/freeside/conf/domain"; -open(DOMAIN,$conf_domain) or die "Can't open $conf_domain: $!"; -my($mydomain)=map { - /^(.*)$/ or die "Illegal line in $conf_domain!"; #yes, we trust the file - $1; -} grep $_ !~ /^(#|$)/, <DOMAIN>; - -my($cgi) = new CGI::Base; -$cgi->get; -&cgisuidsetup($cgi); - -#untaint svcnum -$QUERY_STRING =~ /^(\d+)$/; -my($svcnum)=$1; -my($svc_acct)=qsearchs('svc_acct',{'svcnum'=>$svcnum}); -die "Unkonwn svcnum" unless $svc_acct; - -my($cust_svc)=qsearchs('cust_svc',{'svcnum'=>$svcnum}); -my($pkgnum)=$cust_svc->getfield('pkgnum'); -my($cust_pkg,$custnum); -if ($pkgnum) { - $cust_pkg=qsearchs('cust_pkg',{'pkgnum'=>$pkgnum}); - $custnum=$cust_pkg->getfield('custnum'); -} - -my($part_svc)=qsearchs('part_svc',{'svcpart'=> $cust_svc->svcpart } ); -die "Unkonwn svcpart" unless $part_svc; - -SendHeaders(); # one guess. -print <<END; -<HTML> - <HEAD> - <TITLE>Account View</TITLE> - </HEAD> - <BODY> - <CENTER><H1>Account View</H1> - <BASEFONT SIZE=3> -<CENTER> -END - -if ($pkgnum || $custnum) { - print <<END; -<A HREF="../view/cust_pkg.cgi?$pkgnum">View this package (#$pkgnum)</A> | -<A HREF="../view/cust_main.cgi?$custnum">View this customer (#$custnum)</A> | -END -} else { - print <<END; -<A HREF="../misc/cancel-unaudited.cgi?$svcnum">Cancel this (unaudited)account</A> | -END -} - -print <<END; -<A HREF="../">Main menu</A></CENTER><BR> -<FONT SIZE=+1>Service #$svcnum</FONT> -END - -print qq!<BR><A HREF="../edit/svc_acct.cgi?$svcnum">Edit this information</A>!; -#print qq!<BR><A HREF="../misc/sendconfig.cgi?$svcnum">Send account information</A>!; -print qq!<BR><BR><A HREF="#general">General</A> | <A HREF="#shell">Shell account</A> | !; -print qq!<A HREF="#slip">SLIP/PPP account</A></CENTER>!; - -#formatting -print qq!<HR><CENTER><FONT SIZE=+1><A NAME="general">General</A></FONT></CENTER>!; - -#svc -print "Service: <B>", $part_svc->svc, "</B>"; - -#username -print "<BR>Username: <B>", $svc_acct->username, "</B>"; - -#password -if (substr($svc_acct->_password,0,1) eq "*") { - print "<BR>Password: <I>(Login disabled)</I><BR>"; -} else { - print "<BR>Password: <I>(hidden)</I><BR>"; -} - -# popnum -> svc_acct_pop record -my($svc_acct_pop)=qsearchs('svc_acct_pop',{'popnum'=>$svc_acct->popnum}); - -#pop -print "POP: <B>", $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!<HR><CENTER><FONT SIZE=+1><A NAME="shell">!; -if ($svc_acct->uid ne '') { - print "Shell account"; - print "</A></FONT></CENTER>"; - print "Uid: <B>", $svc_acct->uid, "</B>"; - print "<BR>Gid: <B>", $svc_acct->gid, "</B>"; - - print qq!<BR>Finger name: <B>!, $svc_acct->finger, qq!</B><BR>!; - - print "Home directory: <B>", $svc_acct->dir, "</B><BR>"; - - print "Shell: <B>", $svc_acct->shell, "</B><BR>"; - - print "Quota: <B>", $svc_acct->quota, "</B> <I>(unimplemented)</I>"; -} else { - print "No shell account.</A></FONT></CENTER>"; -} - -# SLIP/PPP -print qq!<HR><CENTER><FONT SIZE=+1><A NAME="slip">!; -if ($svc_acct->slipip) { - print "SLIP/PPP account</A></FONT></CENTER>"; - print "IP address: <B>", ( $svc_acct->slipip eq "0.0.0.0" || $svc_acct->slipip eq '0e0' ) ? "<I>(Dynamic)</I>" : $svc_acct->slipip ,"</B>"; - my($attribute); - foreach $attribute ( grep /^radius_/, fields('svc_acct') ) { - #warn $attribute; - $attribute =~ /^radius_(.*)$/; - my($pattribute) = ($1); - $pattribute =~ s/_/-/g; - print "<BR>Radius $pattribute: <B>". $svc_acct->getfield($attribute), "</B>"; - } -} else { - print "No SLIP/PPP account</A></FONT></CENTER>" -} - -print "<HR>"; - - #formatting - print <<END; - - </BODY> -</HTML> -END - diff --git a/htdocs/view/svc_acct_sm.cgi b/htdocs/view/svc_acct_sm.cgi deleted file mode 100755 index 42623ee..0000000 --- a/htdocs/view/svc_acct_sm.cgi +++ /dev/null @@ -1,114 +0,0 @@ -#!/usr/bin/perl -Tw -# -# View svc_acct_sm records -# -# Usage: svc_acct_sm.cgi svcnum -# http://server.name/path/svc_acct_sm.cgi?svcnum -# -# Note: Should be run setuid freeside as user nobody. -# -# based on view/svc_acct.cgi -# -# ivan@voicenet.com 97-jan-5 -# -# added navigation bar -# ivan@voicenet.com 97-jan-30 -# -# rewrite ivan@sisd.com 98-mar-15 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 -# -# /var/spool/freeside/conf/domain ivan@sisd.com 98-jul-17 - -use strict; -use CGI::Base qw(:DEFAULT :CGI); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearchs); - -my($conf_domain)="/var/spool/freeside/conf/domain"; -open(DOMAIN,$conf_domain) or die "Can't open $conf_domain: $!"; -my($mydomain)=map { - /^(.*)$/ or die "Illegal line in $conf_domain!"; #yes, we trust the file - $1 -} grep $_ !~ /^(#|$)/, <DOMAIN>; -close DOMAIN; - -my($cgi) = new CGI::Base; -$cgi->get; -cgisuidsetup($cgi); - -#untaint svcnum -$QUERY_STRING =~ /^(\d+)$/; -my($svcnum)=$1; -my($svc_acct_sm)=qsearchs('svc_acct_sm',{'svcnum'=>$svcnum}); -die "Unknown svcnum" unless $svc_acct_sm; - -my($cust_svc)=qsearchs('cust_svc',{'svcnum'=>$svcnum}); -my($pkgnum)=$cust_svc->getfield('pkgnum'); -my($cust_pkg,$custnum); -if ($pkgnum) { - $cust_pkg=qsearchs('cust_pkg',{'pkgnum'=>$pkgnum}); - $custnum=$cust_pkg->getfield('custnum'); -} - -my($part_svc)=qsearchs('part_svc',{'svcpart'=> $cust_svc->svcpart } ); -die "Unkonwn svcpart" unless $part_svc; - -SendHeaders(); # one guess. -print <<END; -<HTML> - <HEAD> - <TITLE>Mail Alias View</TITLE> - </HEAD> - <BODY> - <CENTER><H1>Mail Alias View</H1> -END -if ($pkgnum || $custnum) { - print <<END; -<A HREF="../view/cust_pkg.cgi?$pkgnum">View this package (#$pkgnum)</A> | -<A HREF="../view/cust_main.cgi?$custnum">View this customer (#$custnum)</A> | -END -} else { - print <<END; -<A HREF="../misc/cancel-unaudited.cgi?$svcnum">Cancel this (unaudited)account</A> | -END -} - -print <<END; - <A HREF="../">Main menu</A></CENTER><BR< - <FONT SIZE=+1>Service #$svcnum</FONT> - <P><A HREF="../edit/svc_acct_sm.cgi?$svcnum">Edit this information</A> - <BASEFONT SIZE=3> -END - -my($domsvc,$domuid,$domuser)=( - $svc_acct_sm->domsvc, - $svc_acct_sm->domuid, - $svc_acct_sm->domuser, -); -my($svc) = $part_svc->svc; -my($svc_domain)=qsearchs('svc_domain',{'svcnum'=>$domsvc}); -my($domain)=$svc_domain->domain; -my($svc_acct)=qsearchs('svc_acct',{'uid'=>$domuid}); -my($username)=$svc_acct->username; - -#formatting -print qq!<HR>!; - -#svc -print "Service: <B>$svc</B>"; - -print "<HR>"; - -print qq!Mail to <B>!, ( ($domuser eq '*') ? "<I>(anything)</I>" : $domuser ) , qq!</B>\@<B>$domain</B> forwards to <B>$username</B>\@$mydomain mailbox.!; - -print "<HR>"; - - #formatting - print <<END; - - </BODY> -</HTML> -END - diff --git a/htdocs/view/svc_domain.cgi b/htdocs/view/svc_domain.cgi deleted file mode 100755 index 78ff6ac..0000000 --- a/htdocs/view/svc_domain.cgi +++ /dev/null @@ -1,76 +0,0 @@ -#!/usr/bin/perl -Tw -# -# View svc_domain records -# -# Usage: svc_domain svcnum -# http://server.name/path/svc_domain.cgi?svcnum -# -# Note: Should be run setuid freeside as user nobody. -# -# ivan@voicenet.com 97-jan-6 -# -# rewrite ivan@sisd.com 98-mar-14 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 - -use strict; -use CGI::Base qw(:DEFAULT :CGI); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearchs); - -my($cgi) = new CGI::Base; -$cgi->get; -cgisuidsetup($cgi); - -#untaint svcnum -$QUERY_STRING =~ /^(\d+)$/; -my($svcnum)=$1; -my($svc_domain)=qsearchs('svc_domain',{'svcnum'=>$svcnum}); -die "Unknown svcnum" unless $svc_domain; -my($domain)=$svc_domain->domain; - -my($cust_svc)=qsearchs('cust_svc',{'svcnum'=>$svcnum}); -my($pkgnum)=$cust_svc->getfield('pkgnum'); -my($cust_pkg,$custnum); -if ($pkgnum) { - $cust_pkg=qsearchs('cust_pkg',{'pkgnum'=>$pkgnum}); - $custnum=$cust_pkg->getfield('custnum'); -} - -my($part_svc)=qsearchs('part_svc',{'svcpart'=> $cust_svc->svcpart } ); -die "Unkonwn svcpart" unless $part_svc; - -SendHeaders(); # one guess. -print <<END; -<HTML> - <HEAD> - <TITLE>Domain View</TITLE> - </HEAD> - <BODY> - <CENTER><H1>Domain View</H1> - <BASEFONT SIZE=3> -<CENTER> -<A HREF="../view/cust_pkg.cgi?$pkgnum">View this package (#$pkgnum)</A> | -<A HREF="../view/cust_main.cgi?$custnum">View this customer (#$custnum)</A> | -<A HREF="../">Main menu</A></CENTER><BR> - <FONT SIZE=+1>Service #$svcnum</FONT> - </CENTER> -END - -print "<HR>"; -print "Service: <B>", $part_svc->svc, "</B>"; -print "<HR>"; - -print qq!Domain name <B>$domain</B>.!; -print qq!<P><A HREF="http://rs.internic.net/cgi-bin/whois?do+$domain">View whois information.</A>!; - -print "<HR>"; - - #formatting - print <<END; - - </BODY> -</HTML> -END - |