diff options
Diffstat (limited to 'htdocs')
115 files changed, 0 insertions, 9301 deletions
diff --git a/htdocs/browse/agent.cgi b/htdocs/browse/agent.cgi deleted file mode 100755 index cf5f2281f..000000000 --- a/htdocs/browse/agent.cgi +++ /dev/null @@ -1,72 +0,0 @@ -#!/usr/bin/perl -Tw -# -# agent.cgi: browse agent -# -# ivan@sisd.com 97-dec-12 -# -# changes to allow pages to load from a relative location in the web tree. -# bmccane@maxbaud.net 98-mar-25 -# -# changed 'type' to 'atype' because type is reserved word in Pg6.3 -# bmccane@maxbaud.net 98-apr-3 -# -# agent type was linking to wrong cgi ivan@sisd.com 98-jul-18 -# -# lose background, FS::CGI ivan@sisd.com 98-sep-2 - -use strict; -use CGI::Base; -use FS::UID qw(cgisuidsetup swapuid); -use FS::Record qw(qsearch qsearchs); -use FS::CGI qw(header menubar); - -my($cgi) = new CGI::Base; -$cgi->get; - -&cgisuidsetup($cgi); - -SendHeaders(); # one guess. -print header('Agent Listing', menubar( - 'Main Menu' => '../', - 'Add new agent' => '../edit/agent.cgi' -)), <<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 5f05bd514..000000000 --- a/htdocs/browse/agent_type.cgi +++ /dev/null @@ -1,81 +0,0 @@ -#!/usr/bin/perl -Tw -# -# agent_type.cgi: browse agent_type -# -# ivan@sisd.com 97-dec-10 -# -# Changes to allow page to work at a relative position in server -# Changes to make "Packages" display 2-wide in table (old way was too vertical) -# bmccane@maxbaud.net 98-apr-3 -# -# lose background, FS::CGI ivan@sisd.com 98-sep-2 - -use strict; -use CGI::Base; -use FS::UID qw(cgisuidsetup swapuid); -use FS::Record qw(qsearch qsearchs); -use FS::CGI qw(header menubar); - -my($cgi) = new CGI::Base; -$cgi->get; - -&cgisuidsetup($cgi); - -SendHeaders(); # one guess. - -print header("Agent Type Listing", menubar( - 'Main Menu' => '../', - 'Add new agent type' => "../edit/agent_type.cgi", -)), <<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 d615198c9..000000000 --- a/htdocs/browse/cust_main_county.cgi +++ /dev/null @@ -1,65 +0,0 @@ -#!/usr/bin/perl -Tw -# -# cust_main_county.cgi: browse cust_main_county -# -# ivan@sisd.com 97-dec-13 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 -# -# lose background, FS::CGI ivan@sisd.com 98-sep-2 - -use strict; -use CGI::Base; -use FS::UID qw(cgisuidsetup swapuid); -use FS::Record qw(qsearch qsearchs); -use FS::CGI qw(header menubar); - -my($cgi) = new CGI::Base; -$cgi->get; - -&cgisuidsetup($cgi); - -SendHeaders(); # one guess. -print header("Tax Rate Listing", menubar( - 'Main Menu' => '../', - 'Edit tax rates' => "../edit/cust_main_county.cgi", -)),<<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 e5ff31e9e..000000000 --- a/htdocs/browse/part_pkg.cgi +++ /dev/null @@ -1,81 +0,0 @@ -#!/usr/bin/perl -Tw -# -# part_svc.cgi: browse part_pkg -# -# ivan@sisd.com 97-dec-5,9 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 -# -# lose background, FS::CGI ivan@sisd.com 98-sep-2 - -use strict; -use CGI::Base; -use FS::UID qw(cgisuidsetup swapuid); -use FS::Record qw(qsearch qsearchs); -use FS::CGI qw(header menubar); - -my($cgi) = new CGI::Base; -$cgi->get; - -&cgisuidsetup($cgi); - -SendHeaders(); # one guess. - -print header("Package Part Listing",menubar( - 'Main Menu' => '../', - 'Add new package' => "../edit/part_pkg.cgi", -)), <<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 b16fa896d..000000000 --- a/htdocs/browse/part_referral.cgi +++ /dev/null @@ -1,57 +0,0 @@ -#!/usr/bin/perl -Tw -# -# part_referral.cgi: Browse part_referral -# -# ivan@sisd.com 98-feb-23 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 -# -# lose background, FS::CGI ivan@sisd.com 98-sep-2 - -use strict; -use CGI::Base; -use FS::UID qw(cgisuidsetup swapuid); -use FS::Record qw(qsearch); -use FS::CGI qw(header menubar); - -my($cgi) = new CGI::Base; -$cgi->get; - -&cgisuidsetup($cgi); - -SendHeaders(); # one guess. -print header("Referral Listing", menubar( - 'Main Menu' => '../', - 'Add new referral' => "../edit/part_referral.cgi", -)), <<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 71a556421..000000000 --- a/htdocs/browse/part_svc.cgi +++ /dev/null @@ -1,81 +0,0 @@ -#!/usr/bin/perl -Tw -# -# part_svc.cgi: browse part_svc -# -# ivan@sisd.com 97-nov-14, 97-dec-9 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 -# -# lose background, FS::CGI ivan@sisd.com 98-sep-2 - -use strict; -use CGI::Base; -use FS::UID qw(cgisuidsetup swapuid); -use FS::Record qw(qsearch); -use FS::part_svc qw(fields); -use FS::CGI qw(header menubar); - -my($cgi) = new CGI::Base; -$cgi->get; - -&cgisuidsetup($cgi); - -SendHeaders(); # one guess. -print header('Service Part Listing', menubar( - 'Main Menu' => '../', - 'Add new service' => "../edit/part_svc.cgi", -)),<<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 a8a3a9224..000000000 --- a/htdocs/browse/svc_acct_pop.cgi +++ /dev/null @@ -1,63 +0,0 @@ -#!/usr/bin/perl -Tw -# -# svc_acct_pop.cgi: browse pops -# -# ivan@sisd.com 98-mar-8 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 -# -# lose background, FS::CGI ivan@sisd.com 98-sep-2 - -use strict; -use CGI::Base; -use FS::UID qw(cgisuidsetup swapuid); -use FS::Record qw(qsearch qsearchs); -use FS::CGI qw(header menubar); - -my($cgi) = new CGI::Base; -$cgi->get; - -&cgisuidsetup($cgi); - -SendHeaders(); # one guess. -print header('POP Listing', menubar( - 'Main Menu' => '../', - 'Add new POP' => "../edit/svc_acct_pop.cgi", -)), <<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 deleted file mode 100755 index 55b50bbbe..000000000 --- a/htdocs/docs/CGI-modules-2.76-patch.txt +++ /dev/null @@ -1,23 +0,0 @@ -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 -*************** -*** 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"); - 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"); - my $hdrs = SendHeaders($msg, LocationHdr($to_uri)); - $self->log($hdrs); - } - diff --git a/htdocs/docs/admin.html b/htdocs/docs/admin.html deleted file mode 100644 index 8adddbe92..000000000 --- a/htdocs/docs/admin.html +++ /dev/null @@ -1,6 +0,0 @@ -<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 02bfbd783..000000000 --- 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 9b8002601..000000000 --- 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 f760b97dd..000000000 --- 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 20051ca4d..000000000 --- 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 c4784ebf6..000000000 --- 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 40e09cb3c..000000000 --- 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/Bill.txt b/htdocs/docs/man/Bill.txt deleted file mode 100644 index 545dd1a4c..000000000 --- a/htdocs/docs/man/Bill.txt +++ /dev/null @@ -1,29 +0,0 @@ -NAME - FS::Bill - Legacy stub - -SYNOPSIS - The functionality of FS::Bill has been integrated into - FS::cust_main. - -HISTORY - ivan@voicenet.com 97-jul-24 - 25 - 28 - - use Safe; evaluate all fees with perl (still on TODO list until - I write some examples & test opmask to see if we can read db) - %hash=$obj->hash later ivan@sisd.com 98-mar-13 - - packages with no next bill date start at $time not time, this - should eliminate the last of the problems with billing at a past - date also rewrite the invoice priting logic not to print - invoices for things that haven't happended yet and update - $cust_bill->printed when we print so PAST DUE notices work, and - s/date/_date/ ivan@sisd.com 98-jun-4 - - more logic for past due stuff - packages with no next bill date - start at $cust_pkg->setup || $time ivan@sisd.com 98-jul-13 - - moved a few things in collection logic; negative charges should - work ivan@sisd.com 98-aug-6 - - pod, moved everything to FS::cust_main ivan@sisd.com 98-sep-19 - diff --git a/htdocs/docs/man/CGI.txt b/htdocs/docs/man/CGI.txt deleted file mode 100644 index 54f9b8a6a..000000000 --- a/htdocs/docs/man/CGI.txt +++ /dev/null @@ -1,47 +0,0 @@ -NAME - FS::CGI - Subroutines for the web interface - -SYNOPSIS - use FS::CGI qw(header menubar idiot eidiot); - - print header( 'Title', '' ); - print header( 'Title', menubar('item', 'URL', ... ) ); - - idiot "error message"; - eidiot "error message"; - -DESCRIPTION - Provides a few common subroutines for the web interface. - -SUBROUTINES - header TITLE, MENUBAR - Returns an HTML header. - - menubar ITEM, URL, ... - Returns an HTML menubar. - - idiot ERROR - Sends headers and an HTML error message. - - eidiot ERROR - Sends headers and an HTML error message, then exits. - -BUGS - Not OO. - - Not complete. - - Uses CGI-modules instead of CGI.pm - -SEE ALSO - the CGI::Base manpage - -HISTORY - subroutines for the HTML/CGI GUI, not properly OO. :( - - ivan@sisd.com 98-apr-16 ivan@sisd.com 98-jun-22 - - lose the background, eidiot ivan@sisd.com 98-sep-2 - - pod ivan@sisd.com 98-sep-12 - diff --git a/htdocs/docs/man/Conf.txt b/htdocs/docs/man/Conf.txt deleted file mode 100644 index c46c9ee6a..000000000 --- a/htdocs/docs/man/Conf.txt +++ /dev/null @@ -1,47 +0,0 @@ -NAME - FS::Conf - Read access to Freeside configuration values - -SYNOPSIS - use FS::Conf; - - $conf = new FS::Conf; - $conf = new FS::Conf "/non/standard/config/directory"; - - $dir = $conf->dir; - - $value = $conf->config('key'); - @list = $conf->config('key'); - $bool = $conf->exists('key'); - -DESCRIPTION - Read access to Freeside configuration values. Keys currently map - to filenames, but this may change in the future. - -METHODS - new [ DIRECTORY ] - Create a new configuration object. Optionally, a non-default - directory may be specified. - - dir Returns the directory. - - config - Returns the configuration value or values (depending on - context) for key. - - exists - Returns true if the specified key exists, even if the - corresponding value is undefined. - -BUGS - The option to specify a non-default directory should probably be - removed. - - Write access (with locking) should be implemented. - -SEE ALSO - config.html from the base documentation contains a list of - configuration files. - -HISTORY - Ivan Kohler <ivan@sisd.com> 98-sep-6 - diff --git a/htdocs/docs/man/Invoice.txt b/htdocs/docs/man/Invoice.txt deleted file mode 100644 index 17953d51d..000000000 --- a/htdocs/docs/man/Invoice.txt +++ /dev/null @@ -1,23 +0,0 @@ -NAME - FS::Invoice - Legacy stub - -SYNOPSIS - The functioanlity of FS::invoice has been integrated in - FS::cust_bill. - -HISTORY - ivan@voicenet.com 97-jun-25 - 27 - - maybe should be changed to be OO-functions on $cust_bill - objects? (instead of passing invnum, ugh). - - ISA cust_bill and return inovice instead of passing filehandle - ivan@sisd.com 98-mar-13 (add postscript output!) - - close our kid when we're done ivan@sisd.com 98-jun-4 - - separated code which shuffled data from code which formatted. - (so i could) fixed past due notices showing up when balance due - =< 0 return address comes from /var/spool/freeside/conf/address - ivan@sisd.com 98-jul-2 - diff --git a/htdocs/docs/man/Record.txt b/htdocs/docs/man/Record.txt deleted file mode 100644 index 0accb65d1..000000000 --- a/htdocs/docs/man/Record.txt +++ /dev/null @@ -1,332 +0,0 @@ -NAME - FS::Record - Database record objects - -SYNOPSIS - use FS::Record; - use FS::Record qw(dbh fields hfields qsearch qsearchs dbdef); - - $record = new FS::Record 'table', \%hash; - $record = new FS::Record 'table', { 'column' => 'value', ... }; - - $record = qsearchs FS::Record 'table', \%hash; - $record = qsearchs FS::Record 'table', { 'column' => 'value', ... }; - @records = qsearch FS::Record 'table', \%hash; - @records = qsearch FS::Record 'table', { 'column' => 'value', ... }; - - $table = $record->table; - $dbdef_table = $record->dbdef_table; - - $value = $record->get('column'); - $value = $record->getfield('column'); - $value = $record->column; - - $record->set( 'column' => 'value' ); - $record->setfield( 'column' => 'value' ); - $record->column('value'); - - %hash = $record->hash; - - $hashref = $record->hashref; - - $error = $record->add; - - $error = $record->del; - - $error = $new_record->rep($old_record); - - $value = $record->unique('column'); - - $value = $record->ut_float('column'); - $value = $record->ut_number('column'); - $value = $record->ut_numbern('column'); - $value = $record->ut_money('column'); - $value = $record->ut_text('column'); - $value = $record->ut_textn('column'); - $value = $record->ut_alpha('column'); - $value = $record->ut_alphan('column'); - $value = $record->ut_phonen('column'); - $value = $record->ut_anythingn('column'); - - $dbdef = reload_dbdef; - $dbdef = reload_dbdef "/non/standard/filename"; - $dbdef = dbdef; - - $quoted_value = _quote($value,'table','field'); - - #depriciated - $fields = hfields('table'); - if ( $fields->{Field} ) { # etc. - - @fields = fields 'table'; - -DESCRIPTION - (Mostly) object-oriented interface to database records. Records - are currently implemented on top of DBI. FS::Record is intended - as a base class for table-specific classes to inherit from, i.e. - FS::cust_main. - -METHODS - new TABLE, HASHREF - Creates a new record. It doesn't store it in the database, - though. See the section on "add" for that. - - Note that the object stores this hash reference, not a - distinct copy of the hash it points to. You can ask the - object for a copy with the *hash* method. - - qsearch TABLE, HASHREF - Searches the database for all records matching (at least) - the key/value pairs in HASHREF. Returns all the records - found as FS::Record objects. - - qsearchs TABLE, HASHREF - Searches the database for a record matching (at least) the - key/value pairs in HASHREF, and returns the record found as - an FS::Record object. If more than one record matches, it - carps but returns the first. If this happens, you either - made a logic error in asking for a single item, or your data - is corrupted. - - table - Returns the table name. - - dbdef_table - Returns the FS::dbdef_table object for the table. - - get, getfield COLUMN - Returns the value of the column/field/key COLUMN. - - set, setfield COLUMN, VALUE - Sets the value of the column/field/key COLUMN to VALUE. - Returns VALUE. - - AUTLOADED METHODS - $record->column is a synonym for $record->get('column'); - - $record->column('value') is a synonym for $record- - >set('column','value'); - - hash - Returns a list of the column/value pairs, usually for - assigning to a new hash. - - To make a distinct duplicate of an FS::Record object, you - can do: - - $new = new FS::Record ( $old->table, { $old->hash } ); - - hashref - Returns a reference to the column/value hash. - - add Adds this record to the database. If there is an error, returns - the error, otherwise returns false. - - del Delete this record from the database. If there is an error, - returns the error, otherwise returns false. - - rep OLD_RECORD - Replace the OLD_RECORD with this one in the database. If - there is an error, returns the error, otherwise returns - false. - - unique COLUMN - Replaces COLUMN in record with a unique number. Called by - the add method on primary keys and single-field unique - columns (see the FS::dbdef_table manpage). Returns the new - value. - - ut_float COLUMN - Check/untaint floating point numeric data: 1.1, 1, 1.1e10, - 1e10. May not be null. If there is an error, returns the - error, otherwise returns false. - - ut_number COLUMN - Check/untaint simple numeric data (whole numbers). May not - be null. If there is an error, returns the error, otherwise - returns false. - - ut_numbern COLUMN - Check/untaint simple numeric data (whole numbers). May be - null. If there is an error, returns the error, otherwise - returns false. - - ut_money COLUMN - Check/untaint monetary numbers. May be negative. Set to 0 if - null. If there is an error, returns the error, otherwise - returns false. - - ut_text COLUMN - Check/untaint text. Alphanumerics, spaces, and the following - punctuation symbols are currently permitted: ! @ # $ % & ( ) - - + ; : ' " , . ? / May not be null. If there is an error, - returns the error, otherwise returns false. - - ut_textn COLUMN - Check/untaint text. Alphanumerics, spaces, and the following - punctuation symbols are currently permitted: ! @ # $ % & ( ) - - + ; : ' " , . ? / May be null. If there is an error, - returns the error, otherwise returns false. - - ut_alpha COLUMN - Check/untaint alphanumeric strings (no spaces). May not be - null. If there is an error, returns the error, otherwise - returns false. - - ut_alpha COLUMN - Check/untaint alphanumeric strings (no spaces). May be null. - If there is an error, returns the error, otherwise returns - false. - - ut_phonen COLUMN - Check/untaint phone numbers. May be null. If there is an - error, returns the error, otherwise returns false. - - ut_anything COLUMN - Untaints arbitrary data. Be careful. - -SUBROUTINES - reload_dbdef([FILENAME]) - Load a database definition (see the FS::dbdef manpage), - optionally from a non-default filename. This command is - executed at startup unless *$FS::Record::setup_hack* is - true. Returns a FS::dbdef object. - - dbdef Returns the current database definition. See the FS::dbdef - manpage. - - _quote VALUE, TABLE, COLUMN - This is an internal function used to construct SQL - statements. It returns VALUE DBI-quoted (see the section - on "quote" in the DBI manpage) unless VALUE is a number - and the column type (see the dbdef_column manpage) does - not end in `char' or `binary'. - - hfields TABLE - This is depriciated. Don't use it. - - It returns a hash-type list with the fields of this - record's table set true. - - fields TABLE - This returns a list of the columns in this record's - table (See the dbdef_table manpage). - -BUGS - This module should probably be renamed, since much of the - functionality is of general use. It is not completely unlike - Adapter::DBI (see below). - - Exported qsearch and qsearchs should be depriciated in favor - of method calls (against an FS::Record object like the old - search and searchs that qsearch and qsearchs were on top - of.) - - The whole fields / hfields mess should be removed. - - The various WHERE clauses should be subroutined. - - table string should be depriciated in favor of - FS::dbdef_table. - - No doubt we could benefit from a Tied hash. Documenting how - exists / defined true maps to the database (and WHERE - clauses) would also help. - - The ut_ methods should ask the dbdef for a default length. - - ut_sqltype (like ut_varchar) should all be defined - - A fallback check method should be provided with uses the - dbdef. - - The ut_money method assumes money has two decimal digits. - - The Pg money kludge in the new method only strips `$'. - - The ut_phonen method assumes US-style phone numbers. - - The _quote function should probably use ut_float instead of - a regex. - - All the subroutines probably should be methods, here or - elsewhere. - -SEE ALSO - the FS::dbdef manpage, the FS::UID manpage, the DBI manpage - - Adapter::DBI from Ch. 11 of Advanced Perl Programming by - Sriram Srinivasan. - -HISTORY - ivan@voicenet.com 97-jun-2 - 9, 19, 25, 27, 30 - - DBI version ivan@sisd.com 97-nov-8 - 12 - - cleaned up, added autoloaded $self->any_field calls, moved - DBI login stuff to FS::UID ivan@sisd.com 97-nov-21-23 - - since AUTO_INCREMENT is MySQL specific, use my own unique - number generator (again) ivan@sisd.com 97-dec-4 - - untaint $user in unique (web demo hack...bah) make unique - skip multiple-field unique's from dbdef ivan@sisd.com 97- - dec-11 - - merge with FS::Search, which after all was just alternate - constructors for FS::Record objects. Makes lots of things - cleaner. :) ivan@sisd.com 97-dec-13 - - use FS::dbdef::primary key in replace searches, hopefully - for all practical purposes the string/number problem in SQL - statements should be gone? (SQL bites) ivan@sisd.com 98-jan- - 20 - - Put all SQL statments in $statment before we $sth=$dbh- - >prepare( them, for debugging reasons (warn $statement) - ivan@sisd.com 98-feb-19 - - (sigh)... use dbdef type (char, etc.) instead of a regex to - decide what to quote in _quote (more sillines...) SQL bites. - ivan@sisd.com 98-feb-20 - - more friendly error messages ivan@sisd.com 98-mar-13 - - Added import of datasrc from FS::UID to allow Pg6.3 to work - Added code to right-trim strings read from Pg6.3 databases - Modified 'add' to only insert fields that actually have data - Added ut_float to handle floating point numbers (for sales - tax). Pg6.3 does not have a "SHOW FIELDS" statement, so I - faked it 8). bmccane@maxbaud.net 98-apr-3 - - commented out Pg wrapper around `` Modified 'add' to only - insert fields that actually have data '' ivan@sisd.com 98- - apr-16 - - dbdef usage changes ivan@sisd.com 98-jun-1 - - sub fields now asks dbdef, not database ivan@sisd.com 98- - jun-2 - - added debugging method ->_dump ivan@sisd.com 98-jun-16 - - use FS::dbdef::primary key in delete searches as well as - replace searches (SQL still bites) ivan@sisd.com 98-jun-22 - - sub dbdef_table ivan@sisd.com 98-jun-28 - - removed Pg wrapper around `` Modified 'add' to only insert - fields that actually have data '' ivan@sisd.com 98-jul-14 - - sub fields croaks on errors ivan@sisd.com 98-jul-17 - - $rc eq '0E0' doesn't mean we couldn't delete for all rdbmss - ivan@sisd.com 98-jul-18 - - commented out code to right-trim strings read from Pg6.3 - databases; ChopBlanks is in UID.pm ivan@sisd.com 98-aug-16 - - added code (with Pg wrapper) to deal with Pg money fields - ivan@sisd.com 98-aug-18 - - added pod documentation ivan@sisd.com 98-sep-6 - diff --git a/htdocs/docs/man/SSH.txt b/htdocs/docs/man/SSH.txt deleted file mode 100644 index b6d205b55..000000000 --- a/htdocs/docs/man/SSH.txt +++ /dev/null @@ -1,63 +0,0 @@ -NAME - FS::SSH - Subroutines to call ssh and scp - -SYNOPSIS - use FS::SSH qw(ssh scp issh iscp sshopen2 sshopen3); - - ssh($host, $command); - - issh($host, $command); - - scp($source, $destination); - - iscp($source, $destination); - - sshopen2($host, $reader, $writer, $command); - - sshopen3($host, $reader, $writer, $error, $command); - -DESCRIPTION - Simple wrappers around ssh and scp commands. - -SUBROUTINES - ssh HOST, COMMAND - Calls ssh in batch mode. - - issh HOST, COMMAND - Prints the ssh command to be executed, waits for the user to - confirm, and (optionally) executes the command. - - scp SOURCE, DESTINATION - Calls scp in batch mode. - - iscp SOURCE, DESTINATION - Prints the scp command to be executed, waits for the user to - confirm, and (optionally) executes the command. - - sshopen2 HOST, READER, WRITER, COMMAND - Connects the supplied filehandles to the ssh process (in - batch mode). - - sshopen3 HOST, WRITER, READER, ERROR, COMMAND - Connects the supplied filehandles to the ssh process (in - batch mode). - -BUGS - Not OO. - - scp stuff should transparantly use rsync-over-ssh instead. - -SEE ALSO - the ssh manpage, the scp manpage, the IPC::Open2 manpage, - the IPC::Open3 manpage - -HISTORY - ivan@voicenet.com 97-jul-17 - - added sshopen2 and sshopen3 ivan@sisd.com 98-mar-9 - - added iscp ivan@sisd.com 98-jul-25 now iscp asks y/n, issh - and took out path ivan@sisd.com 98-jul-30 - - pod ivan@sisd.com 98-sep-21 - diff --git a/htdocs/docs/man/UID.txt b/htdocs/docs/man/UID.txt deleted file mode 100644 index bf9f6b4bd..000000000 --- a/htdocs/docs/man/UID.txt +++ /dev/null @@ -1,79 +0,0 @@ -NAME - FS::UID - Subroutines for database login and assorted other - stuff - -SYNOPSIS - use FS::UID qw(adminsuidsetup cgisuidsetup dbh datasrc getotaker - checkeuid checkruid swapuid); - - adminsuidsetup; - - $cgi = new CGI::Base; - $cgi->get; - $dbh = cgisuidsetup($cgi); - - $dbh = dbh; - - $datasrc = datasrc; - -DESCRIPTION - Provides a hodgepodge of subroutines. - -SUBROUTINES - adminsuidsetup - Cleans the environment. Make sure the script is running as - freeside, or setuid freeside. Opens a connection to the - database. Swaps real and effective UIDs. Returns the DBI - database handle (usually you don't need this). - - dbh Returns the DBI database handle. - - datasrc - Returns the DBI data source. - - getotaker - Returns the current Freeside user. Currently that means the - CGI REMOTE_USER, or 'freeside'. - - checkeuid - Returns true if effective UID is that of the freeside user. - - checkruid - Returns true if the real UID is that of the freeside user. - - swapuid - Swaps real and effective UIDs. - -BUGS - Not OO. - - No capabilities yet. When mod_perl and Authen::DBI are - implemented, cgisuidsetup will go away as well. - -SEE ALSO - the FS::Record manpage, the CGI::Base manpage, the DBI manpage - -HISTORY - ivan@voicenet.com 97-jun-4 - 9 untaint otaker ivan@voicenet.com - 97-jul-7 - - generalize and auto-get uid (getotaker still needs to be db'ed) - ivan@sisd.com 97-nov-10 - - &cgisuidsetup logs into database. other cleaning. ivan@sisd.com - 97-nov-22,23 - - &adminsuidsetup logs into database with otaker='freeside' (for - automated tasks like billing) ivan@sisd.com 97-dec-13 - - added sub datasrc for fs-setup ivan@sisd.com 98-feb-21 - - datasrc, user and pass now come from conf/secrets ivan@sisd.com - 98-jun-28 - - added ChopBlanks to DBI call (see man DBI) ivan@sisd.com 98-aug- - 16 - - pod, use FS::Conf, implemented cgisuidsetup as adminsuidsetup, - inlined suidsetup ivan@sisd.com 98-sep-12 - diff --git a/htdocs/docs/man/agent.txt b/htdocs/docs/man/agent.txt deleted file mode 100644 index b0317f6f7..000000000 --- a/htdocs/docs/man/agent.txt +++ /dev/null @@ -1,65 +0,0 @@ -NAME - FS::agent - Object methods for agent records - -SYNOPSIS - use FS::agent; - - $record = create FS::agent \%hash; - $record = create FS::agent { 'column' => 'value' }; - - $error = $record->insert; - - $error = $new_record->replace($old_record); - - $error = $record->delete; - - $error = $record->check; - -DESCRIPTION - An FS::agent object represents an agent. Every customer has an - agent. Agents can be used to track things like resellers or - salespeople. FS::agent inherits from FS::Record. The following - fields are currently supported: - - agemtnum - primary key (assigned automatically for new agents) - agent - Text name of this agent - typenum - Agent type. See the FS::agent_type manpage - prog - For future use. - freq - For future use. -METHODS - create HASHREF - Creates a new agent. To add the agent to the database, see - the section on "insert". - - insert - Adds this agent to the database. If there is an error, - returns the error, otherwise returns false. - - delete - Deletes this agent from the database. Only agents with no - customers can be deleted. If there is an error, returns the - error, otherwise returns false. - - replace OLD_RECORD - Replaces OLD_RECORD with this one in the database. If there - is an error, returns the error, otherwise returns false. - - check - Checks all fields to make sure this is a valid agent. If - there is an error, returns the error, otherwise returns - false. Called by the insert and replace methods. - -BUGS - It doesn't properly override FS::Record yet. - -SEE ALSO - the FS::Record manpage, the FS::agent_type manpage, the - FS::cust_main manpage, schema.html from the base documentation. - -HISTORY - Class dealing with agent (resellers) - - ivan@sisd.com 97-nov-13, 97-dec-10 - - pod, added check in ->delete ivan@sisd.com 98-sep-22 - diff --git a/htdocs/docs/man/agent_type.txt b/htdocs/docs/man/agent_type.txt deleted file mode 100644 index ea1edec0c..000000000 --- a/htdocs/docs/man/agent_type.txt +++ /dev/null @@ -1,72 +0,0 @@ -NAME - FS::agent_type - Object methods for agent_type records - -SYNOPSIS - use FS::agent_type; - - $record = create FS::agent_type \%hash; - $record = create FS::agent_type { 'column' => 'value' }; - - $error = $record->insert; - - $error = $new_record->replace($old_record); - - $error = $record->delete; - - $error = $record->check; - -DESCRIPTION - An FS::agent_type object represents an agent type. Every agent - (see the FS::agent manpage) has an agent type. Agent types - define which packages (see the FS::part_pkg manpage) may be - purchased by customers (see the FS::cust_main manpage), via - FS::type_pkgs records (see the FS::type_pkgs manpage). - FS::agent_type inherits from FS::Record. The following fields - are currently supported: - - typenum - primary key (assigned automatically for new agent types) - atype - Text name of this agent type -METHODS - create HASHREF - Creates a new agent type. To add the agent type to the - database, see the section on "insert". - - insert - Adds this agent type to the database. If there is an error, - returns the error, otherwise returns false. - - delete - Deletes this agent type from the database. Only agent types - with no agents can be deleted. If there is an error, returns - the error, otherwise returns false. - - replace OLD_RECORD - Replaces OLD_RECORD with this one in the database. If there - is an error, returns the error, otherwise returns false. - - check - Checks all fields to make sure this is a valid agent type. - If there is an error, returns the error, otherwise returns - false. Called by the insert and replace methods. - -BUGS - It doesn't properly override FS::Record yet. - -SEE ALSO - the FS::Record manpage, the FS::agent manpage, the FS::type_pkgs - manpage, the FS::cust_main manpage, the FS::part_pkg manpage, - schema.html from the base documentation. - -HISTORY - Class for the different sets of allowable packages you can - assign to an agent. - - ivan@sisd.com 97-nov-13 - - ut_ FS::Record methods ivan@sisd.com 97-dec-10 - - Changed 'type' to 'atype' because Pg6.3 reserves the type word - bmccane@maxbaud.net 98-apr-3 - - pod, added check in delete ivan@sisd.com 98-sep-21 - diff --git a/htdocs/docs/man/cust_bill.txt b/htdocs/docs/man/cust_bill.txt deleted file mode 100644 index 9762dd3ca..000000000 --- a/htdocs/docs/man/cust_bill.txt +++ /dev/null @@ -1,140 +0,0 @@ -NAME - FS::cust_bill - Object methods for cust_bill records - -SYNOPSIS - use FS::cust_bill; - - $record = create FS::cust_bill \%hash; - $record = create FS::cust_bill { 'column' => 'value' }; - - $error = $record->insert; - - $error = $new_record->replace($old_record); - - $error = $record->delete; - - $error = $record->check; - - ( $total_previous_balance, @previous_cust_bill ) = $record->previous; - - @cust_bill_pkg_objects = $cust_bill->cust_bill_pkg; - - ( $total_previous_credits, @previous_cust_credit ) = $record->cust_credit; - - @cust_pay_objects = $cust_bill->cust_pay; - - @lines = $cust_bill->print_text; - @lines = $cust_bill->print_text $time; - -DESCRIPTION - An FS::cust_bill object represents an invoice. FS::cust_bill - inherits from FS::Record. The following fields are currently - supported: - - invnum - primary key (assigned automatically for new invoices) - custnum - customer (see the FS::cust_main manpage) - _date - specified as a UNIX timestamp; see the section on "time" in the perlfunc manpage. Also see - the Time::Local manpage and the Date::Parse manpage for conversion functions. - charged - amount of this invoice - owed - amount still outstanding on this invoice, which is charged minus - all payments (see the FS::cust_pay manpage). - printed - how many times this invoice has been printed automatically - (see the section on "collect" in the FS::cust_main manpage). -METHODS - create HASHREF - Creates a new invoice. To add the invoice to the database, - see the section on "insert". Invoices are normally created - by calling the bill method of a customer object (see the - FS::cust_main manpage). - - insert - Adds this invoice to the database ("Posts" the invoice). If - there is an error, returns the error, otherwise returns - false. - - When adding new invoices, owed must be charged (or null, in - which case it is automatically set to charged). - - delete - Currently unimplemented. I don't remove invoices because - there would then be no record you ever posted this invoice - (which is bad, no?) - - replace OLD_RECORD - Replaces the OLD_RECORD with this one in the database. If - there is an error, returns the error, otherwise returns - false. - - Only owed and printed may be changed. Owed is normally - updated by creating and inserting a payment (see the - FS::cust_pay manpage). Printed is normally updated by - calling the collect method of a customer object (see the - FS::cust_main manpage). - - check - Checks all fields to make sure this is a valid invoice. If - there is an error, returns the error, otherwise returns - false. Called by the insert and replace methods. - - previous - Returns a list consisting of the total previous balance for - this customer, followed by the previous outstanding invoices - (as FS::cust_bill objects also). - - cust_bill_pkg - Returns the line items (see the FS::cust_bill_pkg manpage) - for this invoice. - - cust_credit - Returns a list consisting of the total previous credited - (see the FS::cust_credit manpage) for this customer, - followed by the previous outstanding credits - (FS::cust_credit objects). - - cust_pay - Returns all payments (see the FS::cust_pay manpage) for this - invoice. - - print_text [TIME]; - Returns an ASCII invoice, as a list of lines. - - TIME an optional value used to control the printing of - overdue messages. The default is now. It isn't the date of - the invoice; that's the `_date' field. It is specified as a - UNIX timestamp; see the section on "time" in the perlfunc - manpage. Also see the Time::Local manpage and the - Date::Parse manpage for conversion functions. - -BUGS - The delete method. - - It doesn't properly override FS::Record yet. - - print_text formatting (and some logic :/) is in source as a - format declaration, which needs to be slurped in from a file. - the fork is rather kludgy as well. It could be cleaned with - swrite from man perlform, and the picture could be put in a - /var/spool/freeside/conf file. Also number of lines ($=). - - missing print_ps for a nice postscript copy (maybe HylaFAX- - cover-page-style or something similar so the look can be - completely customized?) - - There is an off-by-one error in print_text which causes a visual - error: "Page 1 of 2" printed on some single-page invoices? - -SEE ALSO - the FS::Record manpage, the FS::cust_main manpage, the - FS::cust_pay manpage, the FS::cust_bill_pkg manpage, the - FS::cust_credit manpage, schema.html from the base - documentation. - -HISTORY - ivan@voicenet.com 97-jul-1 - - small fix for new API ivan@sisd.com 98-mar-14 - - charges can be negative ivan@sisd.com 98-jul-13 - - pod, ingegrate with FS::Invoice ivan@sisd.com 98-sep-20 - diff --git a/htdocs/docs/man/cust_bill_pkg.txt b/htdocs/docs/man/cust_bill_pkg.txt deleted file mode 100644 index 1ca4b8cca..000000000 --- a/htdocs/docs/man/cust_bill_pkg.txt +++ /dev/null @@ -1,72 +0,0 @@ -NAME - FS::cust_bill_pkg - Object methods for cust_bill_pkg records - -SYNOPSIS - use FS::cust_bill_pkg; - - $record = create FS::cust_bill_pkg \%hash; - $record = create FS::cust_bill_pkg { 'column' => 'value' }; - - $error = $record->insert; - - $error = $new_record->replace($old_record); - - $error = $record->delete; - - $error = $record->check; - -DESCRIPTION - An FS::cust_bill_pkg object represents an invoice line item. - FS::cust_bill_pkg inherits from FS::Record. The following fields - are currently supported: - - invnum - invoice (see the FS::cust_bill manpage) - pkgnum - package (see the FS::cust_pkg manpage) - setup - setup fee - recur - recurring fee - sdate - starting date of recurring fee - edate - ending date of recurring fee - sdate and edate are specified as UNIX timestamps; see the - section on "time" in the perlfunc manpage. Also see the - Time::Local manpage and the Date::Parse manpage for conversion - functions. - -METHODS - create HASHREF - Creates a new line item. To add the line item to the - database, see the section on "insert". Line items are - normally created by calling the bill method of a customer - object (see the FS::cust_main manpage). - - insert - Adds this line item to the database. If there is an error, - returns the error, otherwise returns false. - - delete - Currently unimplemented. I don't remove line items because - there would then be no record the items ever existed (which - is bad, no?) - - replace OLD_RECORD - Currently unimplemented. This would be even more of an - accounting nightmare than deleteing the items. Just don't do - it. - - check - Checks all fields to make sure this is a valid line item. If - there is an error, returns the error, otherwise returns - false. Called by the insert method. - -BUGS - It doesn't properly override FS::Record yet. - -SEE ALSO - the FS::Record manpage, the FS::cust_bill manpage, the - FS::cust_pkg manpage, the FS::cust_main manpage, schema.html - from the base documentation. - -HISTORY - ivan@sisd.com 98-mar-13 - - pod ivan@sisd.com 98-sep-21 - diff --git a/htdocs/docs/man/cust_credit.txt b/htdocs/docs/man/cust_credit.txt deleted file mode 100644 index 84591ee81..000000000 --- a/htdocs/docs/man/cust_credit.txt +++ /dev/null @@ -1,75 +0,0 @@ -NAME - FS::cust_credit - Object methods for cust_credit records - -SYNOPSIS - use FS::cust_credit; - - $record = create FS::cust_credit \%hash; - $record = create FS::cust_credit { 'column' => 'value' }; - - $error = $record->insert; - - $error = $new_record->replace($old_record); - - $error = $record->delete; - - $error = $record->check; - -DESCRIPTION - An FS::cust_credit object represents a credit. FS::cust_credit - inherits from FS::Record. The following fields are currently - supported: - - crednum - primary key (assigned automatically for new credits) - custnum - customer (see the FS::cust_main manpage) - amount - amount of the credit - credited - how much of this credit that is still outstanding, which is - amount minus all refunds (see the FS::cust_refund manpage). - _date - specified as a UNIX timestamp; see the section on "time" in the perlfunc manpage. Also see - the Time::Local manpage and the Date::Parse manpage for conversion functions. - otaker - order taker (assigned automatically, see the FS::UID manpage) - reason - text -METHODS - create HASHREF - Creates a new credit. To add the credit to the database, see - the section on "insert". - - insert - Adds this credit to the database ("Posts" the credit). If - there is an error, returns the error, otherwise returns - false. - - When adding new invoices, credited must be amount (or null, - in which case it is automatically set to amount). - - delete - Currently unimplemented. - - replace OLD_RECORD - Replaces the OLD_RECORD with this one in the database. If - there is an error, returns the error, otherwise returns - false. - - Only credited may be changed. Credited is normally updated - by creating and inserting a refund (see the FS::cust_refund - manpage). - - check - Checks all fields to make sure this is a valid credit. If - there is an error, returns the error, otherwise returns - false. Called by the insert and replace methods. - -BUGS - The delete method. - - It doesn't properly override FS::Record yet. - -SEE ALSO - the FS::Record manpage, the FS::cust_refund manpage, the - FS::cust_bill manpage, schema.html from the base documentation. - -HISTORY - ivan@sisd.com 98-mar-17 - - pod, otaker from FS::UID ivan@sisd.com 98-sep-21 - diff --git a/htdocs/docs/man/cust_main.txt b/htdocs/docs/man/cust_main.txt deleted file mode 100644 index df7848744..000000000 --- a/htdocs/docs/man/cust_main.txt +++ /dev/null @@ -1,200 +0,0 @@ -NAME - FS::cust_main - Object methods for cust_main records - -SYNOPSIS - use FS::cust_main; - - $record = create FS::cust_main \%hash; - $record = create FS::cust_main { 'column' => 'value' }; - - $error = $record->insert; - - $error = $new_record->replace($old_record); - - $error = $record->delete; - - $error = $record->check; - - @cust_pkg = $record->all_pkgs; - - @cust_pkg = $record->ncancelled_pkgs; - - $error = $record->bill; - $error = $record->bill %options; - $error = $record->bill 'time' => $time; - - $error = $record->collect; - $error = $record->collect %options; - $error = $record->collect 'invoice_time' => $time, - 'batch_card' => 'yes', - 'report_badcard' => 'yes', - ; - -DESCRIPTION - An FS::cust_main object represents a customer. FS::cust_main - inherits from FS::Record. The following fields are currently - supported: - - custnum - primary key (assigned automatically for new customers) - agentnum - agent (see the FS::agent manpage) - refnum - referral (see the FS::part_referral manpage) - first - name - last - name - ss - social security number (optional) - company - (optional) - address1 - address2 - (optional) - city - county - (optional, see the FS::cust_main_county manpage) - state - (see the FS::cust_main_county manpage) - zip - country - (see the FS::cust_main_county manpage) - daytime - phone (optional) - night - phone (optional) - payby - `CARD' (credit cards), `BILL' (billing), or `COMP' (free) - payinfo - card number, P.O.#, or comp issuer (4-8 lowercase alphanumerics; think username) - paydate - expiration date, mm/yyyy, m/yyyy, mm/yy or m/yy - payname - name on card or billing name - tax - tax exempt, empty or `Y' - otaker - order taker (assigned automatically, see the FS::UID manpage) -METHODS - create HASHREF - Creates a new customer. To add the customer to the database, - see the section on "insert". - - Note that this stores the hash reference, not a distinct - copy of the hash it points to. You can ask the object for a - copy with the *hash* method. - - insert - Adds this customer to the database. If there is an error, - returns the error, otherwise returns false. - - delete - Currently unimplemented. Maybe cancel all of this customer's - packages (cust_pkg)? - - I don't remove the customer record in the database because - there would then be no record the customer ever existed - (which is bad, no?) - - replace OLD_RECORD - Replaces the OLD_RECORD with this one in the database. If - there is an error, returns the error, otherwise returns - false. - - check - Checks all fields to make sure this is a valid customer - record. If there is an error, returns the error, otherwise - returns false. Called by the insert and repalce methods. - - all_pkgs - Returns all packages (see the FS::cust_pkg manpage) for this - customer. - - ncancelled_pkgs - Returns all non-cancelled packages (see the FS::cust_pkg - manpage) for this customer. - - bill OPTIONS - Generates invoices (see the FS::cust_bill manpage) for this - customer. Usually used in conjunction with the collect - method. - - The only currently available option is `time', which bills - the customer as if it were that time. It is specified as a - UNIX timestamp; see the section on "time" in the perlfunc - manpage). Also see the Time::Local manpage and the - Date::Parse manpage for conversion functions. - - If there is an error, returns the error, otherwise returns - false. - - collect OPTIONS - (Attempt to) collect money for this customer's outstanding - invoices (see the FS::cust_bill manpage). Usually used after - the bill method. - - Depending on the value of `payby', this may print an invoice - (`BILL'), charge a credit card (`CARD'), or just add any - necessary (pseudo-)payment (`COMP'). - - If there is an error, returns the error, otherwise returns - false. - - Currently available options are: - - invoice_time - Use this time when deciding when to print - invoices and late notices on those invoices. The default is - now. It is specified as a UNIX timestamp; see the section on - "time" in the perlfunc manpage). Also see the Time::Local - manpage and the Date::Parse manpage for conversion - functions. - - batch_card - Set this true to batch cards (see the - cust_pay_batch manpage). By default, cards are processed - immediately, which will generate an error if CyberCash is - not installed. - - report_badcard - Set this true if you want bad card - transactions to return an error. By default, they don't. - - total_owed - Returns the total owed for this customer on all invoices - (see the FS::cust_bill manpage). - - total_credited - Returns the total credits (see the FS::cust_credit manpage) - for this customer. - - balance - Returns the balance for this customer (total owed minus - total credited). - -BUGS - The delete method. - - It doesn't properly override FS::Record yet. - - hfields should be removed. - - Bill and collect options should probably be passed as references - instead of a list. - - CyberCash v2 forces us to define some variables in package main. - -SEE ALSO - the FS::Record manpage, the FS::cust_pkg manpage, the - FS::cust_bill manpage, the FS::cust_credit manpage the - FS::cust_pay_batch manpage, the FS::agent manpage, the - FS::part_referral manpage, the FS::cust_main_county manpage, the - FS::UID manpage, schema.html from the base documentation. - -HISTORY - ivan@voicenet.com 97-jul-28 - - Changed to standard Business::CreditCard no more TableUtil - EXPORT_OK FS::Record's hfields removed unique calls and locking - (not needed here now) wrapped the (now) optional fields in if - statements in sub check (notyetdone!) ivan@sisd.com 97-nov-12 - - updated paydate with SQL-type date info ivan@sisd.com 98-mar-5 - - Added export of datasrc from UID.pm for Pg6.3 changed 'day' to - 'daytime' because Pg6.3 reserves the day word - bmccane@maxbaud.net 98-apr-3 - - in ->create, s/svc_acct/cust_main/, now it should actually - eliminate the warnings it was meant to ivan@sisd.com 98-jul-16 - - don't require a phone number and allow '/' in company names - ivan@sisd.com 98-jul-18 - - use ut_ and rewrite &check, &*_pkgs ivan@sisd.com 98-sep-5 - - pod, merge with FS::Bill (about time!), total_owed, - total_credited and balance methods, cleaned collect method, - source modifications no longer necessary to enable cybercash, - cybercash v3 support, don't need to import - FS::UID::{datasrc,checkruid} ivan@sisd.com 98-sep-19-21 - diff --git a/htdocs/docs/man/cust_main_county.txt b/htdocs/docs/man/cust_main_county.txt deleted file mode 100644 index 8e99397cc..000000000 --- a/htdocs/docs/man/cust_main_county.txt +++ /dev/null @@ -1,67 +0,0 @@ -NAME - FS::cust_main_county - Object methods for cust_main_county - objects - -SYNOPSIS - use FS::cust_main_county; - - $record = create FS::cust_main_county \%hash; - $record = create FS::cust_main_county { 'column' => 'value' }; - - $error = $record->insert; - - $error = $new_record->replace($old_record); - - $error = $record->delete; - - $error = $record->check; - -DESCRIPTION - An FS::cust_main_county object represents a tax rate, defined by - locale. FS::cust_main_county inherits from FS::Record. The - following fields are currently supported: - - taxnum - primary key (assigned automatically for new tax rates) - state - county - tax - percentage -METHODS - create HASHREF - Creates a new tax rate. To add the tax rate to the database, - see the section on "insert". - - insert - Adds this tax rate to the database. If there is an error, - returns the error, otherwise returns false. - - delete - Deletes this tax rate from the database. If there is an - error, returns the error, otherwise returns false. - - replace OLD_RECORD - Replaces the OLD_RECORD with this one in the database. If - there is an error, returns the error, otherwise returns - false. - - check - Checks all fields to make sure this is a valid tax rate. If - there is an error, returns the error, otherwise returns - false. Called by the insert and replace methods. - -BUGS - It doesn't properly override FS::Record yet. - - A country field (and possibly a currency field) should be added. - -SEE ALSO - the FS::Record manpage, the FS::cust_main manpage, the - FS::cust_bill manpage, schema.html from the base documentation. - -HISTORY - ivan@voicenet.com 97-dec-16 - - Changed check for 'tax' to use the new ut_float subroutine - bmccane@maxbaud.net 98-apr-3 - - pod ivan@sisd.com 98-sep-21 - diff --git a/htdocs/docs/man/cust_pay.txt b/htdocs/docs/man/cust_pay.txt deleted file mode 100644 index 9f28d0822..000000000 --- a/htdocs/docs/man/cust_pay.txt +++ /dev/null @@ -1,66 +0,0 @@ -NAME - FS::cust_pay - Object methods for cust_pay objects - -SYNOPSIS - use FS::cust_pay; - - $record = create FS::cust_pay \%hash; - $record = create FS::cust_pay { 'column' => 'value' }; - - $error = $record->insert; - - $error = $new_record->replace($old_record); - - $error = $record->delete; - - $error = $record->check; - -DESCRIPTION - An FS::cust_pay object represents a payment. FS::cust_pay - inherits from FS::Record. The following fields are currently - supported: - - paynum - primary key (assigned automatically for new payments) - invnum - Invoice (see the FS::cust_bill manpage) - paid - Amount of this payment - _date - specified as a UNIX timestamp; see the section on "time" in the perlfunc manpage. Also see - the Time::Local manpage and the Date::Parse manpage for conversion functions. - payby - `CARD' (credit cards), `BILL' (billing), or `COMP' (free) - payinfo - card number, P.O.#, or comp issuer (4-8 lowercase alphanumerics; think username) - paybatch - text field for tracking card processing -METHODS - create HASHREF - Creates a new payment. To add the payment to the databse, - see the section on "insert". - - insert - Adds this payment to the databse, and updates the invoice - (see the FS::cust_bill manpage). - - delete - Currently unimplemented (accounting reasons). - - replace OLD_RECORD - Currently unimplemented (accounting reasons). - - check - Checks all fields to make sure this is a valid payment. If - there is an error, returns the error, otherwise returns - false. Called by the insert method. - -BUGS - It doesn't properly override FS::Record yet. - - Delete and replace methods. - -SEE ALSO - the FS::Record manpage, the FS::cust_bill manpage, schema.html - from the base documentation. - -HISTORY - ivan@voicenet.com 97-jul-1 - 25 - 29 - - new api ivan@sisd.com 98-mar-13 - - pod ivan@sisd.com 98-sep-21 - diff --git a/htdocs/docs/man/cust_pkg.txt b/htdocs/docs/man/cust_pkg.txt deleted file mode 100644 index 5409083d8..000000000 --- a/htdocs/docs/man/cust_pkg.txt +++ /dev/null @@ -1,150 +0,0 @@ -NAME - FS::cust_pkg - Object methods for cust_pkg objects - -SYNOPSIS - use FS::cust_pkg; - - $record = create FS::cust_pkg \%hash; - $record = create FS::cust_pkg { 'column' => 'value' }; - - $error = $record->insert; - - $error = $new_record->replace($old_record); - - $error = $record->delete; - - $error = $record->check; - - $error = $record->cancel; - - $error = $record->suspend; - - $error = $record->unsuspend; - - $error = FS::cust_pkg::order( $custnum, \@pkgparts ); - $error = FS::cust_pkg::order( $custnum, \@pkgparts, \@remove_pkgnums ] ); - -DESCRIPTION - An FS::cust_pkg object represents a customer billing item. - FS::cust_pkg inherits from FS::Record. The following fields are - currently supported: - - pkgnum - primary key (assigned automatically for new billing items) - custnum - Customer (see the FS::cust_main manpage) - pkgpart - Billing item definition (see the FS::part_pkg manpage) - setup - date - bill - date - susp - date - expire - date - cancel - date - otaker - order taker (assigned automatically if null, see the FS::UID manpage) - Note: setup, bill, susp, expire and cancel are specified as UNIX - timestamps; see the section on "time" in the perlfunc manpage. - Also see the Time::Local manpage and the Date::Parse manpage for - conversion functions. - -METHODS - create HASHREF - Create a new billing item. To add the item to the database, - see the section on "insert". - - insert - Adds this billing item to the database ("Orders" the item). - If there is an error, returns the error, otherwise returns - false. - - delete - Currently unimplemented. You don't want to delete billing - items, because there would then be no record the customer - ever purchased the item. Instead, see the cancel method. - - sub delete { return "Can't delete cust_pkg records!"; } - - replace OLD_RECORD - Replaces the OLD_RECORD with this one in the database. If - there is an error, returns the error, otherwise returns - false. - - Currently, custnum, setup, bill, susp, expire, and cancel - may be changed. - - pkgpart may not be changed, but see the order subroutine. - - setup and bill are normally updated by calling the bill - method of a customer object (see the FS::cust_main manpage). - - suspend is normally updated by the suspend and unsuspend - methods. - - cancel is normally updated by the cancel method (and also - the order subroutine in some cases). - - check - Checks all fields to make sure this is a valid billing item. - If there is an error, returns the error, otherwise returns - false. Called by the insert and replace methods. - - cancel - Cancels and removes all services (see the FS::cust_svc - manpage and the FS::part_svc manpage) in this package, then - cancels the package itself (sets the cancel field to now). - - If there is an error, returns the error, otherwise returns - false. - - suspend - Suspends all services (see the FS::cust_svc manpage and the - FS::part_svc manpage) in this package, then suspends the - package itself (sets the susp field to now). - - If there is an error, returns the error, otherwise returns - false. - - unsuspend - Unsuspends all services (see the FS::cust_svc manpage and - the FS::part_svc manpage) in this package, then unsuspends - the package itself (clears the susp field). - - If there is an error, returns the error, otherwise returns - false. - -SUBROUTINES - order CUSTNUM, PKGPARTS_ARYREF, [ REMOVE_PKGNUMS_ARYREF ] - CUSTNUM is a customer (see the FS::cust_main manpage) - - PKGPARTS is a list of pkgparts specifying the the billing - item definitions (see the FS::part_pkg manpage) to order for - this customer. Duplicates are of course permitted. - - REMOVE_PKGNUMS is an optional list of pkgnums specifying the - billing items to remove for this customer. The services (see - the FS::cust_svc manpage) are moved to the new billing - items. An error is returned if this is not possible (see the - FS::pkg_svc manpage). - -BUGS - It doesn't properly override FS::Record yet. - - sub order is not OO. Perhaps it should be moved to FS::cust_main - and made so? - - In sub order, the @pkgparts array (passed by reference) is - clobbered. - - Also in sub order, no money is adjusted. Once FS::part_pkg - defines a standard method to pass dates to the recur_prog - expression, it should do so. - -SEE ALSO - the FS::Record manpage, the FS::cust_main manpage, the - FS::part_pkg manpage, the FS::cust_svc manpage , the FS::pkg_svc - manpage, schema.html from the base documentation - -HISTORY - ivan@voicenet.com 97-jul-1 - 21 - - fixed for new agent->agent_type->type_pkgs in &order - ivan@sisd.com 98-mar-7 - - pod ivan@sisd.com 98-sep-21 - diff --git a/htdocs/docs/man/cust_refund.txt b/htdocs/docs/man/cust_refund.txt deleted file mode 100644 index 392a0b57a..000000000 --- a/htdocs/docs/man/cust_refund.txt +++ /dev/null @@ -1,66 +0,0 @@ -NAME - FS::cust_refund - Object method for cust_refund objects - -SYNOPSIS - use FS::cust_refund; - - $record = create FS::cust_refund \%hash; - $record = create FS::cust_refund { 'column' => 'value' }; - - $error = $record->insert; - - $error = $new_record->replace($old_record); - - $error = $record->delete; - - $error = $record->check; - -DESCRIPTION - An FS::cust_refund represents a refund. FS::cust_refund inherits - from FS::Record. The following fields are currently supported: - - refundnum - primary key (assigned automatically for new refunds) - crednum - Credit (see the FS::cust_credit manpage) - refund - Amount of the refund - _date - specified as a UNIX timestamp; see the section on "time" in the perlfunc manpage. Also see - the Time::Local manpage and the Date::Parse manpage for conversion functions. - payby - `CARD' (credit cards), `BILL' (billing), or `COMP' (free) - payinfo - card number, P.O.#, or comp issuer (4-8 lowercase alphanumerics; think username) - otaker - order taker (assigned automatically, see the FS::UID manpage) -METHODS - create HASHREF - Creates a new refund. To add the refund to the database, see - the section on "insert". - - insert - Adds this refund to the database, and updates the credit - (see the FS::cust_credit manpage). - - delete - Currently unimplemented (accounting reasons). - - replace OLD_RECORD - Currently unimplemented (accounting reasons). - - check - Checks all fields to make sure this is a valid refund. If - there is an error, returns the error, otherwise returns - false. Called by the insert method. - -BUGS - It doesn't properly override FS::Record yet. - - Delete and replace methods. - -SEE ALSO - the FS::Record manpage, the FS::cust_credit manpage, schema.html - from the base documentation. - -HISTORY - ivan@sisd.com 98-mar-18 - - ->create had wrong tablename ivan@sisd.com 98-jun-16 (finish - me!) - - pod and finish up ivan@sisd.com 98-sep-21 - diff --git a/htdocs/docs/man/cust_svc.txt b/htdocs/docs/man/cust_svc.txt deleted file mode 100644 index d863ea852..000000000 --- a/htdocs/docs/man/cust_svc.txt +++ /dev/null @@ -1,72 +0,0 @@ -NAME - FS::cust_svc - Object method for cust_svc objects - -SYNOPSIS - use FS::cust_svc; - - $record = create FS::cust_svc \%hash - $record = create FS::cust_svc { 'column' => 'value' }; - - $error = $record->insert; - - $error = $new_record->replace($old_record); - - $error = $record->delete; - - $error = $record->check; - -DESCRIPTION - An FS::cust_svc represents a service. FS::cust_svc inherits from - FS::Record. The following fields are currently supported: - - svcnum - primary key (assigned automatically for new services) - pkgnum - Package (see the FS::cust_pkg manpage) - svcpart - Service definition (see the FS::part_svc manpage) -METHODS - create HASHREF - Creates a new service. To add the refund to the database, - see the section on "insert". Services are normally created - by creating FS::svc_ objects (see the FS::svc_acct manpage, - the FS::svc_domain manpage, and the FS::svc_acct_sm manpage, - among others). - - insert - Adds this service to the database. If there is an error, - returns the error, otherwise returns false. - - delete - Deletes this service from the database. If there is an - error, returns the error, otherwise returns false. - - Called by the cancel method of the package (see the - FS::cust_pkg manpage). - - replace OLD_RECORD - Replaces the OLD_RECORD with this one in the database. If - there is an error, returns the error, otherwise returns - false. - - check - Checks all fields to make sure this is a valid service. If - there is an error, returns the error, otehrwise returns - false. Called by the insert and replace methods. - -BUGS - Behaviour of changing the svcpart of cust_svc records is - undefined and should possibly be prohibited, and pkg_svc records - are not checked. - - pkg_svc records are not checket in general (here). - -SEE ALSO - the FS::Record manpage, the FS::cust_pkg manpage, the - FS::part_svc manpage, the FS::pkg_svc manpage, schema.html from - the base documentation - -HISTORY - ivan@voicenet.com 97-jul-10,14 - - no TableUtil, no FS::Lock ivan@sisd.com 98-mar-7 - - pod ivan@sisd.com 98-sep-21 - diff --git a/htdocs/docs/man/dbdef.txt b/htdocs/docs/man/dbdef.txt deleted file mode 100644 index 6f1215a84..000000000 --- a/htdocs/docs/man/dbdef.txt +++ /dev/null @@ -1,80 +0,0 @@ -NAME - FS::dbdef - Database objects - -SYNOPSIS - use FS::dbdef; - - $dbdef = new FS::dbdef (@dbdef_table_objects); - $dbdef = load FS::dbdef "filename"; - - $dbdef->save("filename"); - - $dbdef->addtable($dbdef_table_object); - - @table_names = $dbdef->tables; - - $FS_dbdef_table_object = $dbdef->table; - -DESCRIPTION - FS::dbdef objects are collections of FS::dbdef_table objects and - represnt a database (a collection of tables). - -METHODS - new TABLE, TABLE, ... - Creates a new FS::dbdef object - - load FILENAME - Loads an FS::dbdef object from a file. - - save FILENAME - Saves an FS::dbdef object to a file. - - addtable TABLE - Adds this FS::dbdef_table object. - - tables - Returns the names of all tables. - - table TABLENAME - Returns the named FS::dbdef_table object. - -BUGS - Each FS::dbdef object should have a name which corresponds - to its name within the SQL database engine. - -SEE ALSO - the FS::dbdef_table manpage, the FS::Record manpage, - -HISTORY - beginning of abstraction into a class (not really) - - ivan@sisd.com 97-dec-4 - - added primary_key ivan@sisd.com 98-jan-20 - - added datatype (very kludgy and needs to be cleaned) - ivan@sisd.com 98-feb-21 - - perltrap (sigh) masked by mysql 3.20->3,21 ivan@sisd.com 98- - mar-2 - - Change 'type' to 'atype' in agent_type Changed attributes to - special words which are changed in fs-setup ie. double(10,2) - <=> MONEYTYPE Changed order of some of the field definitions - because Pg6.3 is picky Changed 'day' to 'daytime' in - cust_main Changed type of tax from tinyint to real Change - 'password' to '_password' in svc_acct Pg6.3 does not allow - 'field char(x) NULL' bmccane@maxbaud.net 98-apr-3 - - rewrite: now properly OO. See also - FS::dbdef_{table,column,unique,index} - - ivan@sisd.com 98-apr-17 - - gained some extra functions ivan@sisd.com 98-may-11 - - now knows how to Freeze and Thaw itself ivan@sisd.com 98- - jun-2 - - pod ivan@sisd.com 98-sep-23 - diff --git a/htdocs/docs/man/dbdef_colgroup.txt b/htdocs/docs/man/dbdef_colgroup.txt deleted file mode 100644 index a7eebc6c7..000000000 --- a/htdocs/docs/man/dbdef_colgroup.txt +++ /dev/null @@ -1,51 +0,0 @@ -NAME - FS::dbdef_colgroup - Column group objects - -SYNOPSIS - use FS::dbdef_colgroup; - - $colgroup = new FS::dbdef_colgroup ( $lol ); - $colgroup = new FS::dbdef_colgroup ( - [ - [ 'single_column' ], - [ 'multiple_columns', 'another_column', ], - ] - ); - - @sql_lists = $colgroup->sql_list; - - @singles = $colgroup->singles; - -DESCRIPTION - FS::dbdef_colgroup objects represent sets of sets of columns. - -METHODS - new Creates a new FS::dbdef_colgroup object. - - sql_list - Returns a flat list of comma-separated values, for SQL - statements. - - singles - Returns a flat list of all single item lists. - -BUGS -SEE ALSO - the FS::dbdef_table manpage, the FS::dbdef_unique manpage, the - FS::dbdef_index manpage, the FS::dbdef_column manpage, the - FS::dbdef manpage, the perldsc manpage - -HISTORY - class for dealing with groups of groups of columns (used as a - base class by FS::dbdef_{unique,index} ) - - ivan@sisd.com 98-apr-19 - - added singles, fixed sql_list to skip empty lists ivan@sisd.com - 98-jun-2 - - untaint things we're returning in sub singels ivan@sisd.com 98- - jun-4 - - pod ivan@sisd.com 98-sep-24 - diff --git a/htdocs/docs/man/dbdef_column.txt b/htdocs/docs/man/dbdef_column.txt deleted file mode 100644 index 93e239517..000000000 --- a/htdocs/docs/man/dbdef_column.txt +++ /dev/null @@ -1,69 +0,0 @@ -NAME - FS::dbdef_column - Column object - -SYNOPSIS - use FS::dbdef_column; - - $column_object = new FS::dbdef_column ( $name, $sql_type, '' ); - $column_object = new FS::dbdef_column ( $name, $sql_type, 'NULL' ); - $column_object = new FS::dbdef_column ( $name, $sql_type, '', $length ); - $column_object = new FS::dbdef_column ( $name, $sql_type, 'NULL', $length ); - - $name = $column_object->name; - $column_object->name ( 'name' ); - - $name = $column_object->type; - $column_object->name ( 'sql_type' ); - - $name = $column_object->null; - $column_object->name ( 'NOT NULL' ); - - $name = $column_object->length; - $column_object->name ( $length ); - - $sql_line = $column->line; - $sql_line = $column->line $datasrc; - -DESCRIPTION - FS::dbdef::column objects represend columns in tables (see the - FS::dbdef_table manpage). - -METHODS - new Creates a new FS::dbdef_column object. - - name - Returns or sets the column name. - - type - Returns or sets the column type. - - null - Returns or sets the column null flag. - - type - Returns or sets the column length. - - 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. - -BUGS -SEE ALSO - the FS::dbdef_table manpage, the FS::dbdef manpage, the DBI - manpage - -HISTORY - class for dealing with column definitions - - ivan@sisd.com 98-apr-17 - - now methods can be used to get or set data ivan@sisd.com 98-may- - 11 - - mySQL-specific hack for null (what should be default?) - ivan@sisd.com 98-jun-2 - diff --git a/htdocs/docs/man/dbdef_index.txt b/htdocs/docs/man/dbdef_index.txt deleted file mode 100644 index 8cf339b84..000000000 --- a/htdocs/docs/man/dbdef_index.txt +++ /dev/null @@ -1,27 +0,0 @@ -NAME - FS::dbdef_unique.pm - Index object - -SYNOPSIS - use FS::dbdef_index; - - # see FS::dbdef_colgroup methods - -DESCRIPTION - FS::dbdef_unique objects represent the (non-unique) indices of a - table (the FS::dbdef_table manpage). FS::dbdef_unique inherits - from FS::dbdef_colgroup. - -BUGS - Is this empty subclass needed? - -SEE ALSO - the FS::dbdef_colgroup manpage, the FS::dbdef_record manpage, - the FS::Record manpage - -HISTORY - class for dealing with index definitions - - ivan@sisd.com 98-apr-19 - - pod ivan@sisd.com 98-sep-24 - diff --git a/htdocs/docs/man/dbdef_table.txt b/htdocs/docs/man/dbdef_table.txt deleted file mode 100644 index 25e010d8b..000000000 --- a/htdocs/docs/man/dbdef_table.txt +++ /dev/null @@ -1,94 +0,0 @@ -NAME - FS::dbdef_table - Table objects - -SYNOPSIS - use FS::dbdef_table; - - $dbdef_table = new FS::dbdef_table ( - "table_name", - "primary_key", - $FS_dbdef_unique_object, - $FS_dbdef_index_object, - @FS_dbdef_column_objects, - ); - - $dbdef_table->addcolumn ( $FS_dbdef_column_object ); - - $table_name = $dbdef_table->name; - $dbdef_table->name ("table_name"); - - $table_name = $dbdef_table->primary_keye; - $dbdef_table->primary_key ("primary_key"); - - $FS_dbdef_unique_object = $dbdef_table->unique; - $dbdef_table->unique ( $FS_dbdef_unique_object ); - - $FS_dbdef_index_object = $dbdef_table->index; - $dbdef_table->index ( $FS_dbdef_index_object ); - - @column_names = $dbdef->columns; - - $FS_dbdef_column_object = $dbdef->column; - - @sql_statements = $dbdef->sql_create_table; - @sql_statements = $dbdef->sql_create_table $datasrc; - -DESCRIPTION - FS::dbdef_table objects represent a single database table. - -METHODS - new Creates a new FS::dbdef_table object. - - addcolumn - Adds this FS::dbdef_column object. - - name - Returns or sets the table name. - - primary_key - Returns or sets the primary key. - - unique - Returns or sets the FS::dbdef_unique object. - - index - Returns or sets the FS::dbdef_index object. - - columns - Returns a list consisting of the names of all columns. - - column "column" - Returns the column object (see the FS::dbdef_column manpage) - for "column". - - sql_create_table [ $datasrc ] - Returns an array of SQL statments to create this table. - - 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. - -BUGS -SEE ALSO - the FS::dbdef manpage, the FS::dbdef_unique manpage, the - FS::dbdef_index manpage, the FS::dbdef_unique manpage, the DBI - manpage - -HISTORY - class for dealing with table definitions - - ivan@sisd.com 98-apr-18 - - gained extra functions (should %columns be an IxHash?) - ivan@sisd.com 98-may-11 - - sql_create_table returns a list of statments, not just one, and - now it does indices (plus mysql hack) ivan@sisd.com 98-jun-2 - - untaint primary_key... hmm. is this a hack around a bigger - problem? looks like, did the same thing singles in colgroup! - ivan@sisd.com 98-jun-4 - - pod ivan@sisd.com 98-sep-24 - diff --git a/htdocs/docs/man/dbdef_unique.txt b/htdocs/docs/man/dbdef_unique.txt deleted file mode 100644 index 0e4f0150b..000000000 --- a/htdocs/docs/man/dbdef_unique.txt +++ /dev/null @@ -1,27 +0,0 @@ -NAME - FS::dbdef_unique.pm - Unique object - -SYNOPSIS - use FS::dbdef_unique; - - # see FS::dbdef_colgroup methods - -DESCRIPTION - FS::dbdef_unique objects represent the unique indices of a - database table (the FS::dbdef_table manpage). FS::dbdef_unique - inherits from FS::dbdef_colgroup. - -BUGS - Is this empty subclass needed? - -SEE ALSO - the FS::dbdef_colgroup manpage, the FS::dbdef_record manpage, - the FS::Record manpage - -HISTORY - class for dealing with unique definitions - - ivan@sisd.com 98-apr-19 - - pod ivan@sisd.com 98-sep-24 - diff --git a/htdocs/docs/man/index.html b/htdocs/docs/man/index.html deleted file mode 100644 index 4f33dd485..000000000 --- a/htdocs/docs/man/index.html +++ /dev/null @@ -1,48 +0,0 @@ -<head> - <title>Perl API</title> -</head> -<body> - <h1>Perl API</h1> - <ul> -<li><a href="agent.txt">FS::agent</a> -<li><a href="agent_type.txt">FS::agent_type</a> -<li><a href="cust_bill.txt">FS::cust_bill</a> -<li><a href="cust_bill_pkg.txt">FS::cust_bill_pkg</a> -<li><a href="cust_credit.txt">FS::cust_credit</a> -<li><a href="cust_main.txt">FS::cust_main</a> -<li><a href="cust_main_county.txt">FS::cust_main_county</a> -<li><a href="cust_pay.txt">FS::cust_pay</a> -<li><a href="cust_pkg.txt">FS::cust_pkg</a> -<li><a href="cust_refund.txt">FS::cust_refund</a> -<li><a href="cust_svc.txt">FS::cust_svc</a> -<li><a href="part_pkg.txt">FS::part_pkg</a> -<li><a href="part_referral.txt">FS::part_referral</a> -<li><a href="part_svc.txt">FS::part_svc</a> -<li><a href="pkg_svc.txt">FS::pkg_svc</a> -<li><a href="svc_acct.txt">FS::svc_acct</a> -<li><a href="svc_acct_pop.txt">FS::svc_acct_pop</a> -<li><a href="svc_acct_sm.txt">FS::svc_acct_sm</a> -<li><a href="svc_domain.txt">FS::svc_domain</a> -<li><a href="type_pkgs.txt">FS::type_pkgs</a> -</ul> -<br> -<ul> -<li><a href="Bill.txt">FS::Bill</a> -<li><a href="CGI.txt">FS::CGI</a> -<li><a href="Conf.txt">FS::Conf</a> -<li><a href="Invoice.txt">FS::Invoice</a> -<li><a href="Record.txt">FS::Record</a> -<li><a href="SSH.txt">FS::SSH</a> -<li><a href="UID.txt">FS::UID</a> -</ul> -<br> -<ul> -<li><a href="dbdef.txt">FS::dbdef</a> -<li><a href="dbdef_colgroup.txt">FS::dbdef_colgroup</a> -<li><a href="dbdef_column.txt">FS::dbdef_column</a> -<li><a href="dbdef_index.txt">FS::dbdef_index</a> -<li><a href="dbdef_table.txt">FS::dbdef_table</a> -<li><a href="dbdef_unique.txt">FS::dbdef_unique</a> - -<ul> -</body> diff --git a/htdocs/docs/man/part_pkg.txt b/htdocs/docs/man/part_pkg.txt deleted file mode 100644 index dc1bce423..000000000 --- a/htdocs/docs/man/part_pkg.txt +++ /dev/null @@ -1,73 +0,0 @@ -NAME - FS::part_pkg - Object methods for part_pkg objects - -SYNOPSIS - use FS::part_pkg; - - $record = create FS::part_pkg \%hash - $record = create FS::part_pkg { 'column' => 'value' }; - - $error = $record->insert; - - $error = $new_record->replace($old_record); - - $error = $record->delete; - - $error = $record->check; - -DESCRIPTION - An FS::part_pkg represents a billing item definition. - FS::part_pkg inherits from FS::Record. The following fields are - currently supported: - - pkgpart - primary key (assigned automatically for new billing item definitions) - pkg - Text name of this billing item definition (customer-viewable) - comment - Text name of this billing item definition (non-customer-viewable) - setup - Setup fee - freq - Frequency of recurring fee - recur - Recurring fee - setup and recur are evaluated as Safe perl expressions. You can - use numbers just as you would normally. More advanced semantics - are not yet defined. - -METHODS - create HASHREF - Creates a new billing item definition. To add the billing - item definition to the database, see the section on - "insert". - - insert - Adds this billing item definition to the database. If there - is an error, returns the error, otherwise returns false. - - delete - Currently unimplemented. - - replace OLD_RECORD - Replaces OLD_RECORD with this one in the database. If there - is an error, returns the error, otherwise returns false. - - check - Checks all fields to make sure this is a valid billing item - definition. If there is an error, returns the error, - otherwise returns false. Called by the insert and replace - methods. - -BUGS - It doesn't properly override FS::Record yet. - - The delete method is unimplemented. - - setup and recur semantics are not yet defined (and are - implemented in FS::cust_bill. hmm.). - -SEE ALSO - the FS::Record manpage, the FS::cust_pkg manpage, the - FS::type_pkgs manpage, the FS::pkg_svc manpage, the Safe - manpage. schema.html from the base documentation. - -HISTORY - ivan@sisd.com 97-dec-5 - - pod ivan@sisd.com 98-sep-21 - diff --git a/htdocs/docs/man/part_referral.txt b/htdocs/docs/man/part_referral.txt deleted file mode 100644 index 534996323..000000000 --- a/htdocs/docs/man/part_referral.txt +++ /dev/null @@ -1,63 +0,0 @@ -NAME - FS::part_referral - Object methods for part_referral objects - -SYNOPSIS - use FS::part_referral; - - $record = create FS::part_referral \%hash - $record = create FS::part_referral { 'column' => 'value' }; - - $error = $record->insert; - - $error = $new_record->replace($old_record); - - $error = $record->delete; - - $error = $record->check; - -DESCRIPTION - An FS::part_referral represents a referral - where a customer - heard of your services. This can be used to track the - effectiveness of a particular piece of advertising, for example. - FS::part_referral inherits from FS::Record. The following fields - are currently supported: - - refnum - primary key (assigned automatically for new referrals) - referral - Text name of this referral -METHODS - create HASHREF - Creates a new referral. To add the referral to the database, - see the section on "insert". - - insert - Adds this referral to the database. If there is an error, - returns the error, otherwise returns false. - - delete - Currently unimplemented. - - replace OLD_RECORD - Replaces OLD_RECORD with this one in the database. If there - is an error, returns the error, otherwise returns false. - - check - Checks all fields to make sure this is a valid referral. If - there is an error, returns the error, otherwise returns - false. Called by the insert and replace methods. - -BUGS - It doesn't properly override FS::Record yet. - - The delete method is unimplemented. - -SEE ALSO - the FS::Record manpage, the FS::cust_main manpage, schema.html - from the base documentation. - -HISTORY - Class dealing with referrals - - ivan@sisd.com 98-feb-23 - - pod ivan@sisd.com 98-sep-21 - diff --git a/htdocs/docs/man/part_svc.txt b/htdocs/docs/man/part_svc.txt deleted file mode 100644 index 680944e2f..000000000 --- a/htdocs/docs/man/part_svc.txt +++ /dev/null @@ -1,69 +0,0 @@ -NAME - FS::part_svc - Object methods for part_svc objects - -SYNOPSIS - use FS::part_svc; - - $record = create FS::part_referral \%hash - $record = create FS::part_referral { 'column' => 'value' }; - - $error = $record->insert; - - $error = $new_record->replace($old_record); - - $error = $record->delete; - - $error = $record->check; - -DESCRIPTION - An FS::part_svc represents a service definition. FS::part_svc - inherits from FS::Record. The following fields are currently - supported: - - svcpart - primary key (assigned automatically for new service definitions) - svc - text name of this service definition - svcdb - table used for this service. See the FS::svc_acct manpage, - the FS::svc_domain manpage, and the FS::svc_acct_sm manpage, among others. - *svcdb*__*field* - Default or fixed value for *field* in *svcdb*. - *svcdb*__*field*_flag - defines *svcdb*__*field* action: null, `D' for default, or `F' for fixed -METHODS - create HASHREF - Creates a new service definition. To add the service - definition to the database, see the section on "insert". - - insert - Adds this service definition to the database. If there is an - error, returns the error, otherwise returns false. - - delete - Currently unimplemented. - - replace OLD_RECORD - Replaces OLD_RECORD with this one in the database. If there - is an error, returns the error, otherwise returns false. - - check - Checks all fields to make sure this is a valid service - definition. If there is an error, returns the error, - otherwise returns false. Called by the insert and replace - methods. - -BUGS - It doesn't properly override FS::Record yet. - - Delete is unimplemented. - -SEE ALSO - the FS::Record manpage, the FS::part_pkg manpage, the - FS::pkg_svc manpage, the FS::cust_svc manpage, the FS::svc_acct - manpage, the FS::svc_acct_sm manpage, the FS::svc_domain - manpage, schema.html from the base documentation. - -HISTORY - ivan@sisd.com 97-nov-14 - - data checking/untainting calls into FS::Record added - ivan@sisd.com 97-dec-6 - - pod ivan@sisd.com 98-sep-21 - diff --git a/htdocs/docs/man/pkg_svc.txt b/htdocs/docs/man/pkg_svc.txt deleted file mode 100644 index bde0043f1..000000000 --- a/htdocs/docs/man/pkg_svc.txt +++ /dev/null @@ -1,61 +0,0 @@ -NAME - FS::pkg_svc - Object methods for pkg_svc records - -SYNOPSIS - use FS::pkg_svc; - - $record = create FS::pkg_svc \%hash; - $record = create FS::pkg_svc { 'column' => 'value' }; - - $error = $record->insert; - - $error = $new_record->replace($old_record); - - $error = $record->delete; - - $error = $record->check; - -DESCRIPTION - An FS::pkg_svc record links a billing item definition (see the - FS::part_pkg manpage) to a service definition (see the - FS::part_svc manpage). FS::pkg_svc inherits from FS::Record. The - following fields are currently supported: - - pkgpart - Billing item definition (see the FS::part_pkg manpage) - svcpart - Service definition (see the FS::part_svc manpage) - quantity - Quantity of this service definition that this billing item - definition includes -METHODS - create HASHREF - Create a new record. To add the record to the database, see - the section on "insert". - - insert - Adds this record to the database. If there is an error, - returns the error, otherwise returns false. - - delete - Deletes this record from the database. If there is an error, - returns the error, otherwise returns false. - - replace OLD_RECORD - Replaces OLD_RECORD with this one in the database. If there - is an error, returns the error, otherwise returns false. - - check - Checks all fields to make sure this is a valid record. If - there is an error, returns the error, otherwise returns - false. Called by the insert and replace methods. - -BUGS - It doesn't properly override FS::Record yet. - -SEE ALSO - the FS::Record manpage, the FS::part_pkg manpage, the - FS::part_svc manpage, schema.html from the base documentation. - -HISTORY - ivan@voicenet.com 97-jul-1 added hfields ivan@sisd.com 97-nov-13 - - pod ivan@sisd.com 98-sep-22 - diff --git a/htdocs/docs/man/svc_acct.txt b/htdocs/docs/man/svc_acct.txt deleted file mode 100644 index 1c9caf5fb..000000000 --- a/htdocs/docs/man/svc_acct.txt +++ /dev/null @@ -1,168 +0,0 @@ -NAME - FS::svc_acct - Object methods for svc_acct records - -SYNOPSIS - use FS::svc_acct; - - $record = create FS::svc_acct \%hash; - $record = create FS::svc_acct { 'column' => 'value' }; - - $error = $record->insert; - - $error = $new_record->replace($old_record); - - $error = $record->delete; - - $error = $record->check; - - $error = $record->suspend; - - $error = $record->unsuspend; - - $error = $record->cancel; - -DESCRIPTION - An FS::svc_acct object represents an account. FS::svc_acct - inherits from FS::Record. The following fields are currently - supported: - - svcnum - primary key (assigned automatcially for new accounts) - username - _password - generated if blank - popnum - Point of presence (see the FS::svc_acct_pop manpage) - uid - gid - finger - GECOS - dir - set automatically if blank (and uid is not) - shell - quota - (unimplementd) - slipip - IP address - radius_*Radius_Attribute* - *Radius-Attribute* -METHODS - create HASHREF - Creates a new account. To add the account to the database, - see the section on "insert". - - insert - Adds this account to the database. If there is an error, - returns the error, otherwise returns false. - - The additional fields pkgnum and svcpart (see the - FS::cust_svc manpage) should be defined. An FS::cust_svc - record will be created and inserted. - - If the configuration value (see the FS::Conf manpage) - shellmachine exists, and the username, uid, and dir fields - are defined, the command - - useradd -d $dir -m -s $shell -u $uid $username - - is executed on shellmachine via ssh. This behaviour can be - surpressed by setting $FS::svc_acct::nossh_hack true. - - delete - Deletes this account from the database. If there is an - error, returns the error, otherwise returns false. - - The corresponding FS::cust_svc record will be deleted as - well. - - If the configuration value (see the FS::Conf manpage) - shellmachine exists, the command: - - userdel $username - - is executed on shellmachine via ssh. This behaviour can be - surpressed by setting $FS::svc_acct::nossh_hack true. - - replace OLD_RECORD - Replaces OLD_RECORD with this one in the database. If there - is an error, returns the error, otherwise returns false. - - If the configuration value (see the FS::Conf manpage) - shellmachine exists, and the dir field has changed, the - command: - - [ -d $old_dir ] && ( - chmod u+t $old_dir; - umask 022; - mkdir $new_dir; - cd $old_dir; - find . -depth -print | cpio -pdm $new_dir; - chmod u-t $new_dir; - chown -R $uid.$gid $new_dir; - rm -rf $old_dir - ) - - is executed on shellmachine via ssh. This behaviour can be - surpressed by setting $FS::svc_acct::nossh_hack true. - - suspend - Suspends this account by prefixing *SUSPENDED* to the - password. If there is an error, returns the error, otherwise - returns false. - - Called by the suspend method of FS::cust_pkg (see the - FS::cust_pkg manpage). - - unsuspend - Unsuspends this account by removing *SUSPENDED* from the - password. If there is an error, returns the error, otherwise - returns false. - - Called by the unsuspend method of FS::cust_pkg (see the - FS::cust_pkg manpage). - - cancel - Just returns false (no error) for now. - - Called by the cancel method of FS::cust_pkg (see the - FS::cust_pkg manpage). - - check - Checks all fields to make sure this is a valid service. If - there is an error, returns the error, otherwise returns - false. Called by the insert and replace methods. - - Sets any fixed values; see the FS::part_svc manpage. - -BUGS - It doesn't properly override FS::Record yet. - - The remote commands should be configurable. - - The create method should set defaults from part_svc (like the - check method sets fixed values). - -SEE ALSO - the FS::Record manpage, the FS::Conf manpage, the FS::cust_svc - manpage, the FS::part_svc manpage, the FS::cust_pkg manpage, the - FS::SSH manpage, the ssh manpage, the FS::svc_acct_pop manpage, - schema.html from the base documentation. - -HISTORY - ivan@voicenet.com 97-jul-16 - 21 - - rewrite (among other things, now know about part_svc) - ivan@sisd.com 98-mar-8 - - Changed 'password' to '_password' because Pg6.3 reserves the - password word bmccane@maxbaud.net 98-apr-3 - - username length and shell no longer hardcoded ivan@sisd.com 98- - jun-28 - - eww but needed: ignore uid duplicates for 'fax' and 'hylafax' - ivan@sisd.com 98-jun-29 - - $nossh_hack ivan@sisd.com 98-jul-13 - - protections against UID/GID of 0 for incorrectly-setup RDBMSs - (also in bin/svc_acct.export) ivan@sisd.com 98-jul-13 - - arbitrary radius attributes ivan@sisd.com 98-aug-13 - - /var/spool/freeside/conf/shellmachine ivan@sisd.com 98-aug-13 - - pod and FS::conf ivan@sisd.com 98-sep-22 - diff --git a/htdocs/docs/man/svc_acct_pop.txt b/htdocs/docs/man/svc_acct_pop.txt deleted file mode 100644 index ac0965413..000000000 --- a/htdocs/docs/man/svc_acct_pop.txt +++ /dev/null @@ -1,65 +0,0 @@ -NAME - FS::svc_acct_pop - Object methods for svc_acct_pop records - -SYNOPSIS - use FS::svc_acct_pop; - - $record = create FS::svc_acct_pop \%hash; - $record = create FS::svc_acct_pop { 'column' => 'value' }; - - $error = $record->insert; - - $error = $new_record->replace($old_record); - - $error = $record->delete; - - $error = $record->check; - -DESCRIPTION - An FS::svc_acct object represents an point of presence. - FS::svc_acct_pop inherits from FS::Record. The following fields - are currently supported: - - popnum - primary key (assigned automatically for new accounts) - city - state - ac - area code - exch - exchange -METHODS - create HASHREF - Creates a new point of presence (if only it were that - easy!). To add the point of presence to the database, see - the section on "insert". - - insert - Adds this point of presence to the databaes. If there is an - error, returns the error, otherwise returns false. - - delete - Currently unimplemented. - - replace OLD_RECORD - Replaces OLD_RECORD with this one in the database. If there - is an error, returns the error, otherwise returns false. - - check - Checks all fields to make sure this is a valid point of - presence. If there is an error, returns the error, otherwise - returns false. Called by the insert and replace methods. - -BUGS - It doesn't properly override FS::Record yet. - - It should be renamed to part_pop. - -SEE ALSO - the FS::Record manpage, the svc_acct manpage, schema.html from - the base documentation. - -HISTORY - Class dealing with pops - - ivan@sisd.com 98-mar-8 - - pod ivan@sisd.com 98-sep-23 - diff --git a/htdocs/docs/man/svc_acct_sm.txt b/htdocs/docs/man/svc_acct_sm.txt deleted file mode 100644 index e9940af9a..000000000 --- a/htdocs/docs/man/svc_acct_sm.txt +++ /dev/null @@ -1,121 +0,0 @@ -NAME - FS::svc_acct_sm - Object methods for svc_acct_sm records - -SYNOPSIS - use FS::svc_acct_sm; - - $record = create FS::svc_acct_sm \%hash; - $record = create FS::svc_acct_sm { 'column' => 'value' }; - - $error = $record->insert; - - $error = $new_record->replace($old_record); - - $error = $record->delete; - - $error = $record->check; - - $error = $record->suspend; - - $error = $record->unsuspend; - - $error = $record->cancel; - -DESCRIPTION - An FS::svc_acct object represents a virtual mail alias. - FS::svc_acct inherits from FS::Record. The following fields are - currently supported: - - svcnum - primary key (assigned automatcially for new accounts) - domsvc - svcnum of the virtual domain (see the FS::svc_domain manpage) - domuid - uid of the target account (see the FS::svc_acct manpage) - domuser - virtual username -METHODS - create HASHREF - Creates a new virtual mail alias. To add the virtual mail - alias to the database, see the section on "insert". - - insert - Adds this virtual mail alias to the database. If there is an - error, returns the error, otherwise returns false. - - The additional fields pkgnum and svcpart (see the - FS::cust_svc manpage) should be defined. An FS::cust_svc - record will be created and inserted. - - If the configuration values (see the FS::Conf manpage) - shellmachine and qmailmachines exist, and domuser is `*' - (meaning a catch-all mailbox), the command: - - [ -e $dir/.qmail-$qdomain-default ] || { - touch $dir/.qmail-$qdomain-default; - chown $uid:$gid $dir/.qmail-$qdomain-default; - } - - is executed on shellmachine via ssh (see the section on - "EXTENSION ADDRESSES" in the dot-qmail manpage). This - behaviour can be surpressed by setting - $FS::svc_acct_sm::nossh_hack true. - - delete - Deletes this virtual mail alias from the database. If there - is an error, returns the error, otherwise returns false. - - The corresponding FS::cust_svc record will be deleted as - well. - - replace OLD_RECORD - Replaces OLD_RECORD with this one in the database. If there - is an error, returns the error, otherwise returns false. - - suspend - Just returns false (no error) for now. - - Called by the suspend method of FS::cust_pkg (see the - FS::cust_pkg manpage). - - unsuspend - Just returns false (no error) for now. - - Called by the unsuspend method of FS::cust_pkg (see the - FS::cust_pkg manpage). - - cancel - Just returns false (no error) for now. - - Called by the cancel method of FS::cust_pkg (see the - FS::cust_pkg manpage). - - check - Checks all fields to make sure this is a valid virtual mail - alias. If there is an error, returns the error, otherwise - returns false. Called by the insert and replace methods. - - Sets any fixed values; see the FS::part_svc manpage. - -BUGS - It doesn't properly override FS::Record yet. - - The remote commands should be configurable. - -SEE ALSO - the FS::Record manpage, the FS::Conf manpage, the FS::cust_svc - manpage, the FS::part_svc manpage, the FS::cust_pkg manpage, the - FS::svc_acct manpage, the FS::svc_domain manpage, the FS::SSH - manpage, the ssh manpage, the dot-qmail manpage, schema.html - from the base documentation. - -HISTORY - ivan@voicenet.com 97-jul-16 - 21 - - rewrite ivan@sisd.com 98-mar-10 - - s/qsearchs/qsearch/ to eliminate warning ivan@sisd.com 98-apr-19 - - uses conf/shellmachine and has an nossh_hack ivan@sisd.com 98- - jul-14 - - s/\./:/g in .qmail-domain:com ivan@sisd.com 98-aug-13 - - pod, FS::Conf, moved .qmail file from check to insert 98-sep-23 - diff --git a/htdocs/docs/man/svc_domain.txt b/htdocs/docs/man/svc_domain.txt deleted file mode 100644 index 03d3dbc27..000000000 --- a/htdocs/docs/man/svc_domain.txt +++ /dev/null @@ -1,131 +0,0 @@ -NAME - FS::svc_domain - Object methods for svc_domain records - -SYNOPSIS - use FS::svc_domain; - - $record = create FS::svc_domain \%hash; - $record = create FS::svc_domain { 'column' => 'value' }; - - $error = $record->insert; - - $error = $new_record->replace($old_record); - - $error = $record->delete; - - $error = $record->check; - - $error = $record->suspend; - - $error = $record->unsuspend; - - $error = $record->cancel; - -DESCRIPTION - An FS::svc_domain object represents a domain. FS::svc_domain - inherits from FS::Record. The following fields are currently - supported: - - svcnum - primary key (assigned automatically for new accounts) - domain -METHODS - create HASHREF - Creates a new domain. To add the domain to the database, see - the section on "insert". - - insert - Adds this domain to the database. If there is an error, - returns the error, otherwise returns false. - - The additional fields *pkgnum* and *svcpart* (see the - FS::cust_svc manpage) should be defined. An FS::cust_svc - record will be created and inserted. - - The additional field *action* should be set to *N* for new - domains or *M* for transfers. - - A registration or transfer email will be submitted unless - $FS::svc_domain::whois_hack is true. - - delete - Deletes this domain from the database. If there is an error, - returns the error, otherwise returns false. - - The corresponding FS::cust_svc record will be deleted as - well. - - replace OLD_RECORD - Replaces OLD_RECORD with this one in the database. If there - is an error, returns the error, otherwise returns false. - - suspend - Just returns false (no error) for now. - - Called by the suspend method of FS::cust_pkg (see the - FS::cust_pkg manpage). - - unsuspend - Just returns false (no error) for now. - - Called by the unsuspend method of FS::cust_pkg (see the - FS::cust_pkg manpage). - - cancel - Just returns false (no error) for now. - - Called by the cancel method of FS::cust_pkg (see the - FS::cust_pkg manpage). - - check - Checks all fields to make sure this is a valid domain. If - there is an error, returns the error, otherwise returns - false. Called by the insert and replace methods. - - Sets any fixed values; see the FS::part_svc manpage. - - _whois - Executes the command: - - whois do $domain - - and returns the output. - - (Always returns *No match for domian "$domain".* if - $FS::svc_domain::whois_hack is set true.) - - submit_internic - Submits a registration email for this domain. - -BUGS - It doesn't properly override FS::Record yet. - - All BIND/DNS fields should be included (and exported). - - All registries should be supported. - - Not all configuration access is through FS::Conf! - - Should change action to a real field. - -SEE ALSO - the FS::Record manpage, the FS::Conf manpage, the FS::cust_svc - manpage, the FS::part_svc manpage, the FS::cust_pkg manpage, the - FS::SSH manpage, the ssh manpage, the dot-qmail manpage, - schema.html from the base documentation, config.html from the - base documentation. - -HISTORY - ivan@voicenet.com 97-jul-21 - - rewrite ivan@sisd.com 98-mar-10 - - add internic bits ivan@sisd.com 98-mar-14 - - Changed 'day' to 'daytime' because Pg6.3 reserves the day word - bmccane@maxbaud.net 98-apr-3 - - /var/spool/freeside/conf/registries/internic/, Mail::Internet, - etc. ivan@sisd.com 98-jul-17-19 - - pod, some FS::Conf (not complete) ivan@sisd.com 98-sep-23 - diff --git a/htdocs/docs/man/type_pkgs.txt b/htdocs/docs/man/type_pkgs.txt deleted file mode 100644 index 9822b4802..000000000 --- a/htdocs/docs/man/type_pkgs.txt +++ /dev/null @@ -1,55 +0,0 @@ -NAME - FS::type_pkgs - Object methods for type_pkgs records - -SYNOPSIS - use FS::type_pkgs; - - $record = create FS::type_pkgs \%hash; - $record = create FS::type_pkgs { 'column' => 'value' }; - - $error = $record->insert; - - $error = $new_record->replace($old_record); - - $error = $record->delete; - - $error = $record->check; - -DESCRIPTION - An FS::type_pkgs record links an agent type (see the - FS::agent_type manpage) to a billing item definition (see the - FS::part_pkg manpage). FS::type_pkgs inherits from FS::Record. - The following fields are currently supported: - - typenum - Agent type, see the FS::agent_type manpage - pkgpart - Billing item definition, see the FS::part_pkg manpage -METHODS - create HASHREF - Create a new record. To add the record to the database, see - the section on "insert". - - insert - Adds this record to the database. If there is an error, - returns the error, otherwise returns false. - - delete - Deletes this record from the database. If there is an error, - returns the error, otherwise returns false. - - replace OLD_RECORD - Replaces OLD_RECORD with this one in the database. If there - is an error, returns the error, otherwise returns false. - - check - Checks all fields to make sure this is a valid record. If - there is an error, returns the error, otherwise returns - false. Called by the insert and replace methods. - -HISTORY - Defines the relation between agent types and pkgparts (Which - pkgparts can the different [types of] agents sell?) - - ivan@sisd.com 97-nov-13 - - change to ut_ FS::Record, fixed bugs ivan@sisd.com 97-dec-10 - diff --git a/htdocs/docs/passwd.html b/htdocs/docs/passwd.html deleted file mode 100644 index a8f8151e2..000000000 --- a/htdocs/docs/passwd.html +++ /dev/null @@ -1,16 +0,0 @@ -<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 5a296ec83..000000000 --- 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 2cf6d4e71..000000000 --- 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 d2201f601..000000000 --- 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 4bf7ea45a..000000000 --- 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 5bd116528..000000000 --- a/htdocs/edit/agent.cgi +++ /dev/null @@ -1,77 +0,0 @@ -#!/usr/bin/perl -Tw -# -# agent.cgi: Add/Edit agent (output form) -# -# ivan@sisd.com 97-dec-12 -# -# Changes to allow page to work at a relative position in server -# Changed 'type' to 'atype' because Pg6.3 reserves the type word -# bmccane@maxbaud.net 98-apr-3 -# -# use FS::CGI, added inline documentation ivan@sisd.com 98-jul-12 - -use strict; -use CGI::Base; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearch qsearchs); -use FS::agent; -use FS::CGI qw(header menubar); - -my($cgi) = new CGI::Base; -$cgi->get; - -&cgisuidsetup($cgi); - -SendHeaders(); # one guess. - -my($agent,$action); -if ( $cgi->var('QUERY_STRING') =~ /^(\d+)$/ ) { #editing - $agent=qsearchs('agent',{'agentnum'=>$1}); - $action='Edit'; -} else { #adding - $agent=create FS::agent {}; - $action='Add'; -} -my($hashref)=$agent->hashref; - -print header("$action Agent", menubar( - 'Main Menu' => '../', - 'View all agents' => '../browse/agent.cgi', -)), '<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 b9fff4530..000000000 --- a/htdocs/edit/agent_type.cgi +++ /dev/null @@ -1,75 +0,0 @@ -#!/usr/bin/perl -Tw -# -# agent_type.cgi: Add/Edit agent type (output form) -# -# ivan@sisd.com 97-dec-10 -# -# Changes to allow page to work at a relative position in server -# Changed 'type' to 'atype' because Pg6.3 reserves the type word -# bmccane@maxbaud.net 98-apr-3 -# -# use FS::CGI, added inline documentation ivan@sisd.com 98-jul-12 - -use strict; -use CGI::Base; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearch qsearchs); -use FS::agent_type; -use FS::CGI qw(header menubar); - -my($cgi) = new CGI::Base; -$cgi->get; - -&cgisuidsetup($cgi); - -SendHeaders(); # one guess. - -my($agent_type,$action); -if ( $cgi->var('QUERY_STRING') =~ /^(\d+)$/ ) { #editing - $agent_type=qsearchs('agent_type',{'typenum'=>$1}); - $action='Edit'; -} else { #adding - $agent_type=create FS::agent_type {}; - $action='Add'; -} -my($hashref)=$agent_type->hashref; - -print header("$action Agent Type", menubar( - 'Main Menu' => '../', - 'View all agent types' => '../browse/agent_type.cgi', -)), '<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 75ef21208..000000000 --- a/htdocs/edit/cust_credit.cgi +++ /dev/null @@ -1,97 +0,0 @@ -#!/usr/bin/perl -Tw -# -# cust_credit.cgi: Add a credit (output form) -# -# Usage: cust_credit.cgi custnum [ -paybatch ] -# http://server.name/path/cust_credit?custnum [ -paybatch ] -# -# Note: Should be run setuid root as user nobody. -# -# some hooks in here for modifications as well as additions, but needs (lots) more work. -# also see process/cust_credit.cgi, the script that processes the form. -# -# ivan@voicenet.com 96-dec-05 -# -# paybatch field, differentiates between credits & credits+refunds by commandline -# ivan@voicenet.com 96-dec-08 -# -# added (but commented out) sprintf("%.2f" in amount field. Hmm. -# ivan@voicenet.com 97-jan-3 -# -# paybatch stuff thrown out - has checkbox now instead. -# (well, sort of. still passed around for backward compatability and possible editing hook) -# ivan@voicenet.com 97-apr-21 -# -# rewrite ivan@sisd.com 98-mar-16 - -use strict; -use Date::Format; -use CGI::Base qw(:DEFAULT :CGI); #CGI module -use FS::UID qw(cgisuidsetup getotaker); - -my($cgi) = new CGI::Base; -$cgi->get; -cgisuidsetup($cgi); - -#untaint custnum -$QUERY_STRING =~ /^(\d+)$/; -my($custnum)=$1; - -#untaint otaker -my($otaker)=getotaker; - -SendHeaders(); # one guess. -print <<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 14556010c..000000000 --- a/htdocs/edit/cust_main.cgi +++ /dev/null @@ -1,214 +0,0 @@ -#!/usr/bin/perl -Tw -# -# cust_main.cgi: Edit a customer (output form) -# -# Usage: cust_main.cgi custnum -# http://server.name/path/cust_main.cgi?custnum -# -# Note: Should be run setuid freeside as user nobody. -# -# ivan@voicenet.com 96-nov-29 -> 96-dec-04 -# -# Blank custnum for new customer. -# ivan@voicenet.com 96-dec-16 -# -# referral defaults to blank, to force people to pick something -# ivan@voicenet.com 97-jun-4 -# -# rewrote for new API -# ivan@voicenet.com 97-jul-28 -# -# new customer is null, not '#' -# otaker gotten from &getotaker instead of $ENV{REMOTE_USER} -# ivan@sisd.com 97-nov-12 -# -# cgisuidsetup($cgi); -# no need for old_ fields. -# now state+county is a select field (took out PA hack) -# used autoloaded $cust_main->field methods -# ivan@sisd.com 97-dec-17 -# -# fixed quoting problems ivan@sisd.com 98-feb-23 -# -# paydate sql update ivan@sisd.com 98-mar-5 -# -# Changes to allow page to work at a relative position in server -# Changed 'day' to 'daytime' because Pg6.3 reserves the day word -# Added test for paydate in mm-dd-yyyy format for Pg6.3 default format -# bmccane@maxbaud.net 98-apr-3 -# -# fixed one missed day->daytime ivan@sisd.com 98-jul-13 - -use strict; -use CGI::Base; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup getotaker); -use FS::Record qw(qsearch qsearchs); -use FS::cust_main; - -my($cgi) = new CGI::Base; -$cgi->get; - -cgisuidsetup($cgi); - -SendHeaders(); # one guess. - -#get record -my($custnum,$action,$cust_main); -if ( $cgi->var('QUERY_STRING') =~ /^(\d+)$/ ) { #editing - $custnum=$1; - $cust_main = qsearchs('cust_main',{'custnum'=>$custnum}); - $action='Edit'; -} else { - $custnum=''; - $cust_main = create FS::cust_main ( {} ); - $cust_main->setfield('otaker',&getotaker); - $cust_main->setfield('country','US'); - $action='Add'; -} - -print <<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 59ff7043a..000000000 --- a/htdocs/edit/cust_main_county-expand.cgi +++ /dev/null @@ -1,49 +0,0 @@ -#!/usr/bin/perl -Tw -# -# cust_main_county-expand.cgi: Expand a state into counties (output form) -# -# ivan@sisd.com 97-dec-16 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 -# -# lose background, FS::CGI ivan@sisd.com 98-sep-2 - -use strict; -use CGI::Base; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearch qsearchs); -use FS::CGI qw(header menubar); - -my($cgi) = new CGI::Base; -$cgi->get; - -&cgisuidsetup($cgi); - -SendHeaders(); # one guess. - -$cgi->var('QUERY_STRING') =~ /^(\d+)$/ - or die "Illegal taxnum!"; -my($taxnum)=$1; - -my($cust_main_county)=qsearchs('cust_main_county',{'taxnum'=>$taxnum}); -die "Can't expand entry!" if $cust_main_county->getfield('county'); - -print header("Tax Rate (expand state)", menubar( - 'Main Menu' => '../', -)), <<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 904d58346..000000000 --- a/htdocs/edit/cust_main_county.cgi +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/perl -Tw -# -# cust_main_county.cgi: Edit tax rates (output form) -# -# ivan@sisd.com 97-dec-13-16 -# -# Changes to allow page to work at a relative position in server -# Changed tax field to accept 6 chars (MO uses 6.1%) -# bmccane@maxbaud.net 98-apr-3 -# -# lose background, FS::CGI ivan@sisd.com 98-sep-2 - -use strict; -use CGI::Base; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearch qsearchs); -use FS::CGI qw(header menubar); - -my($cgi) = new CGI::Base; -$cgi->get; - -&cgisuidsetup($cgi); - -SendHeaders(); # one guess. - -print header("Edit tax rates", menubar( - 'Main Menu' => '../', -)),<<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 a6cb204d1..000000000 --- a/htdocs/edit/cust_pay.cgi +++ /dev/null @@ -1,76 +0,0 @@ -#!/usr/bin/perl -Tw -# -# cust_pay.cgi: Add a payment (output form) -# -# Usage: cust_pay.cgi invnum -# http://server.name/path/cust_pay.cgi?invnum -# -# Note: Should be run setuid as user nobody. -# -# some hooks for modifications as well as additions, but needs work. -# -# ivan@voicenet.com 96-dec-11 -# -# rewrite ivan@sisd.com 98-mar-16 - -use strict; -use Date::Format; -use CGI::Base qw(:DEFAULT :CGI); -use FS::UID qw(cgisuidsetup); - -my($cgi) = new CGI::Base; -$cgi->get; -cgisuidsetup($cgi); - -#untaint invnum -$QUERY_STRING =~ /^(\d+)$/; -my($invnum)=$1; - -SendHeaders(); # one guess. -print <<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 d7f143db4..000000000 --- a/htdocs/edit/cust_pkg.cgi +++ /dev/null @@ -1,137 +0,0 @@ -#!/usr/bin/perl -Tw -# -# cust_pkg.cgi: Add/edit packages (output form) -# -# this is for changing packages around, not editing things within the package -# -# Usage: cust_pkg.cgi custnum -# http://server.name/path/cust_pkg.cgi?custnum -# -# Note: Should be run setuid freeside as user nobody -# -# started with /sales/add/cust_pkg.cgi, which added packages -# ivan@voicenet.com 97-jan-5, 97-mar-21 -# -# Rewrote for new API -# ivan@voicenet.com 97-jul-7 -# -# FS::Search is no more, &cgisuidsetup needs $cgi, ivan@sisd.com 98-mar-7 -# -# Changes to allow page to work at a relative position in server -# Changed to display packages 2-wide in a table -# bmccane@maxbaud.net 98-apr-3 -# -# fixed a pretty cool bug from above which caused a visual glitch ivan@sisd.com -# 98-jun-1 - -use strict; -use CGI::Base qw(:DEFAULT :CGI); # CGI module -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup getotaker); -use FS::Record qw(qsearch qsearchs); - -my($cgi) = new CGI::Base; -$cgi->get; -&cgisuidsetup($cgi); - -my(%pkg,%comment); -foreach (qsearch('part_pkg', {})) { - $pkg{ $_ -> getfield('pkgpart') } = $_->getfield('pkg'); - $comment{ $_ -> getfield('pkgpart') } = $_->getfield('comment'); -} - -#untaint custnum -$QUERY_STRING =~ /^(\d+)$/; -my($custnum)=$1; - -my($otaker)=&getotaker; - -SendHeaders(); -print <<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 9fe739bb7..000000000 --- a/htdocs/edit/part_pkg.cgi +++ /dev/null @@ -1,102 +0,0 @@ -#!/usr/bin/perl -Tw -# -# part_pkg.cgi: Add/Edit package (output form) -# -# ivan@sisd.com 97-dec-10 -# -# Changes to allow page to work at a relative position in server -# Changed to display services 2-wide in table -# bmccane@maxbaud.net 98-apr-3 -# -# use FS::CGI, added inline documentation ivan@sisd.com 98-jul-12 - -use strict; -use CGI::Base; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearch qsearchs); -use FS::part_pkg; -use FS::pkg_svc; -use FS::CGI qw(header menubar); - -my($cgi) = new CGI::Base; -$cgi->get; - -&cgisuidsetup($cgi); - -SendHeaders(); # one guess. - -my($part_pkg,$action); -if ( $cgi->var('QUERY_STRING') =~ /^(\d+)$/ ) { #editing - $part_pkg=qsearchs('part_pkg',{'pkgpart'=>$1}); - $action='Edit'; -} else { #adding - $part_pkg=create FS::part_pkg {}; - $action='Add'; -} -my($hashref)=$part_pkg->hashref; - -print header("$action Package Definition", menubar( - 'Main Menu' => '../', - 'View all packages' => '../browse/part_pkg.cgi', -)), '<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 f29802239..000000000 --- a/htdocs/edit/part_referral.cgi +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/perl -Tw -# -# agent.cgi: Add/Edit referral (output form) -# -# ivan@sisd.com 98-feb-23 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 -# -# confisuing typo on submit button ivan@sisd.com 98-jun-14 -# -# lose background, FS::CGI ivan@sisd.com 98-sep-2 - -use strict; -use CGI::Base; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearch qsearchs); -use FS::part_referral; -use FS::CGI qw(header menubar); - -my($cgi) = new CGI::Base; -$cgi->get; - -&cgisuidsetup($cgi); - -SendHeaders(); # one guess. - -my($part_referral,$action); -if ( $cgi->var('QUERY_STRING') =~ /^(\d+)$/ ) { #editing - $part_referral=qsearchs('part_referral',{'refnum'=>$1}); - $action='Edit'; -} else { #adding - $part_referral=create FS::part_referral {}; - $action='Add'; -} -my($hashref)=$part_referral->hashref; - -print header("$action Referral", menubar( - 'Main Menu' => '../', - 'View all referrals' => "../browse/part_referral.cgi", -)), <<END; - <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 491c013fe..000000000 --- a/htdocs/edit/part_svc.cgi +++ /dev/null @@ -1,148 +0,0 @@ -#!/usr/bin/perl -Tw -# -# part_svc.cgi: Add/Edit service (output form) -# -# ivan@sisd.com 97-nov-14 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 -# -# use FS::CGI, added inline documentation ivan@sisd.com 98-jul-12 - -use strict; -use CGI::Base; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearchs); -use FS::part_svc qw(fields); -use FS::CGI qw(header menubar); - -my($cgi) = new CGI::Base; -$cgi->get; - -&cgisuidsetup($cgi); - -SendHeaders(); # one guess. - -my($part_svc,$action); -if ( $cgi->var('QUERY_STRING') =~ /^(\d+)$/ ) { #editing - $part_svc=qsearchs('part_svc',{'svcpart'=>$1}); - $action='Edit'; -} else { #adding - $part_svc=create FS::part_svc {}; - $action='Add'; -} -my($hashref)=$part_svc->hashref; - -print header("$action Service Definition", menubar( - 'Main Menu' => '../', - 'View all services' => '../browse/part_svc.cgi', -)), '<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 5d1ce3232..000000000 --- a/htdocs/edit/process/agent.cgi +++ /dev/null @@ -1,53 +0,0 @@ -#!/usr/bin/perl -Tw -# -# process/agent.cgi: Edit agent (process form) -# -# ivan@sisd.com 97-dec-12 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 -# -# lose background, FS::CGI ivan@sisd.com 98-sep-2 - -use strict; -use CGI::Request; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearch qsearchs); -use FS::agent qw(fields); -use FS::CGI qw(idiot); - -my($req)=new CGI::Request; # create form object - -&cgisuidsetup($req->cgi); - -my($agentnum)=$req->param('agentnum'); - -my($old)=qsearchs('agent',{'agentnum'=>$agentnum}) if $agentnum; - -#unmunge typenum -$req->param('typenum') =~ /^(\d+)(:.*)?$/; -$req->param('typenum',$1); - -my($new)=create FS::agent ( { - map { - $_, $req->param($_); - } fields('agent') -} ); - -my($error); -if ( $agentnum ) { - $error=$new->replace($old); -} else { - $error=$new->insert; - $agentnum=$new->getfield('agentnum'); -} - -if ( $error ) { - &idiot($error); -} else { - #$req->cgi->redirect("../../view/agent.cgi?$agentnum"); - #$req->cgi->redirect("../../edit/agent.cgi?$agentnum"); - $req->cgi->redirect("../../browse/agent.cgi"); -} - diff --git a/htdocs/edit/process/agent_type.cgi b/htdocs/edit/process/agent_type.cgi deleted file mode 100755 index 43f129fd5..000000000 --- a/htdocs/edit/process/agent_type.cgi +++ /dev/null @@ -1,83 +0,0 @@ -#!/usr/bin/perl -Tw -# -# process/agent_type.cgi: Edit agent type (process form) -# -# ivan@sisd.com 97-dec-11 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 -# -# lose background, FS::CGI ivan@sisd.com 98-sep-2 - -use strict; -use CGI::Request; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearch qsearchs); -use FS::agent_type qw(fields); -use FS::type_pkgs; -use FS::CGI qw(idiot); - -my($req)=new CGI::Request; -&cgisuidsetup($req->cgi); - -my($typenum)=$req->param('typenum'); -my($old)=qsearchs('agent_type',{'typenum'=>$typenum}) if $typenum; - -my($new)=create FS::agent_type ( { - map { - $_, $req->param($_); - } fields('agent_type') -} ); - -my($error); -if ( $typenum ) { - $error=$new->replace($old); -} else { - $error=$new->insert; - $typenum=$new->getfield('typenum'); -} - -if ( $error ) { - idiot($error); - exit; -} - -my($part_pkg); -foreach $part_pkg (qsearch('part_pkg',{})) { - my($pkgpart)=$part_pkg->getfield('pkgpart'); - - my($type_pkgs)=qsearchs('type_pkgs',{ - 'typenum' => $typenum, - 'pkgpart' => $pkgpart, - }); - if ( $type_pkgs && ! $req->param("pkgpart$pkgpart") ) { - my($d_type_pkgs)=$type_pkgs; #need to save $type_pkgs for below. - $error=$d_type_pkgs->del; #FS::Record not FS::type_pkgs, - #so ->del not ->delete. hmm. hmm. - if ( $error ) { - idiot($error); - exit; - } - - } elsif ( $req->param("pkgpart$pkgpart") - && ! $type_pkgs - ) { - #ok to clobber it now (but bad form nonetheless?) - $type_pkgs=create FS::type_pkgs ({ - 'typenum' => $typenum, - 'pkgpart' => $pkgpart, - }); - $error= $type_pkgs->insert; - if ( $error ) { - idiot($error); - exit; - } - } - -} - -#$req->cgi->redirect("../../view/agent_type.cgi?$typenum"); -#$req->cgi->redirect("../../edit/agent_type.cgi?$typenum"); -$req->cgi->redirect("../../browse/agent_type.cgi"); - diff --git a/htdocs/edit/process/cust_credit.cgi b/htdocs/edit/process/cust_credit.cgi deleted file mode 100755 index e660b4c78..000000000 --- a/htdocs/edit/process/cust_credit.cgi +++ /dev/null @@ -1,70 +0,0 @@ -#!/usr/bin/perl -Tw -# -# process/cust_credit.cgi: Add a credit (process form) -# -# Usage: post form to: -# http://server.name/path/cust_credit.cgi -# -# Note: Should be run setuid root as user nobody. -# -# ivan@voicenet.com 96-dec-05 -> 96-dec-08 -# -# post a refund if $new_paybatch -# ivan@voicenet.com 96-dec-08 -# -# refunds are no longer applied against a specific payment (paybatch) -# paybatch field removed -# ivan@voicenet.com 97-apr-22 -# -# rewrite ivan@sisd.com 98-mar-16 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 - -use strict; -use CGI::Request; -use FS::UID qw(cgisuidsetup getotaker); -use FS::cust_credit; - -my($req)=new CGI::Request; # create form object -cgisuidsetup($req->cgi); - -$req->param('custnum') =~ /^(\d*)$/ or die "Illegal custnum!"; -my($custnum)=$1; - -$req->param('otaker',getotaker); - -my($new) = create FS::cust_credit ( { - map { - $_, $req->param($_); - } qw(custnum _date amount otaker reason) -} ); - -my($error); -$error=$new->insert; -&idiot($error) if $error; - -#no errors, no refund, so view our credit. -$req->cgi->redirect("../../view/cust_main.cgi?$custnum#history"); - -sub idiot { - my($error)=@_; - CGI::Base::SendHeaders(); # one guess - print <<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 7664dfcb8..000000000 --- a/htdocs/edit/process/cust_main.cgi +++ /dev/null @@ -1,102 +0,0 @@ -#!/usr/bin/perl -Tw -# -# process/cust_main.cgi: Edit a customer (process form) -# -# Usage: post form to: -# http://server.name/path/cust_main.cgi -# -# Note: Should be run setuid root as user nobody. -# -# ivan@voicenet.com 96-dec-04 -# -# added referral check -# ivan@voicenet.com 97-jun-4 -# -# rewrote for new API -# ivan@voicenet.com 97-jul-28 -# -# same as above (again) and clean up some stuff ivan@sisd.com 98-feb-23 -# -# Changes to allow page to work at a relative position in server -# Changed 'day' to 'daytime' because Pg6.3 reserves the day word -# bmccane@maxbaud.net 98-apr-3 - -use strict; -use CGI::Request; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearchs); -use FS::cust_main; - -my($req)=new CGI::Request; # create form object - -&cgisuidsetup($req->cgi); - -#create new record object - -#unmunge agentnum -$req->param('agentnum', - (split(/:/, ($req->param('agentnum'))[0] ))[0] -); - -#unmunge tax -$req->param('tax','') unless defined($req->param('tax')); - -#unmunge refnum -$req->param('refnum', - (split(/:/, ($req->param('refnum'))[0] ))[0] -); - -#unmunge state/county -$req->param('state') =~ /^(\w+)( \((\w+)\))?$/; -$req->param('state', $1); -$req->param('county', $3 || ''); - -my($new) = create FS::cust_main ( { - map { - $_, $req->param("$_") || '' - } qw(custnum agentnum last first ss company address1 address2 city county - state zip country daytime night fax payby payinfo paydate payname tax - otaker refnum) -} ); - -if ( $new->custnum eq '' ) { - - my($error)=$new->insert; - &idiot($error) if $error; - -} else { #create old record object - - my($old) = qsearchs( 'cust_main', { 'custnum', $new->custnum } ); - &idiot("Old record not found!") unless $old; - my($error)=$new->replace($old); - &idiot($error) if $error; - -} - -my($custnum)=$new->custnum; -$req->cgi->redirect("../../view/cust_main.cgi?$custnum#cust_main"); - -sub idiot { - my($error)=@_; - CGI::Base::SendHeaders(); # one guess - print <<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 a821560c6..000000000 --- a/htdocs/edit/process/cust_main_county-expand.cgi +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/perl -Tw -# -# process/cust_main_county-expand.cgi: Expand counties (process form) -# -# ivan@sisd.com 97-dec-16 -# -# Changes to allow page to work at a relative position in server -# Added import of datasrc from UID.pm for Pg6.3 -# Default tax to 0.0 if using Pg6.3 -# bmccane@maxbaud.net 98-apr-3 -# -# lose background, FS::CGI -# undo default tax to 0.0 if using Pg6.3: comes from pre-expanded record -# for that state -#ivan@sisd.com 98-sep-2 - -use strict; -use CGI::Request; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup datasrc); -use FS::Record qw(qsearch qsearchs); -use FS::cust_main_county; -use FS::CGI qw(eidiot); - -my($req)=new CGI::Request; # create form object - -&cgisuidsetup($req->cgi); - -$req->param('taxnum') =~ /^(\d+)$/ or die "Illegal taxnum!"; -my($taxnum)=$1; -my($cust_main_county)=qsearchs('cust_main_county',{'taxnum'=>$taxnum}) - or die ("Unknown taxnum!"); - -my(@counties); -if ( $req->param('delim') eq 'n' ) { - @counties=split(/\n/,$req->param('counties')); -} elsif ( $req->param('delim') eq 's' ) { - @counties=split(/\s+/,$req->param('counties')); -} else { - die "Illegal delim!"; -} - -@counties=map { - /^\s*([\w\- ]+)\s*$/ or eidiot("Illegal county"); - $1; -} @counties; - -my($county); -foreach ( @counties) { - my(%hash)=$cust_main_county->hash; - my($new)=create FS::cust_main_county \%hash; - $new->setfield('taxnum',''); - $new->setfield('county',$_); - #if (datasrc =~ m/Pg/) - #{ - # $new->setfield('tax',0.0); - #} - my($error)=$new->insert; - die $error if $error; -} - -unless ( qsearch('cust_main',{ - 'state' => $cust_main_county->getfield('state'), - 'county' => $cust_main_county->getfield('county'), -} ) ) { - my($error)=($cust_main_county->delete); - die $error if $error; -} - -$req->cgi->redirect("../../edit/cust_main_county.cgi"); - diff --git a/htdocs/edit/process/cust_main_county.cgi b/htdocs/edit/process/cust_main_county.cgi deleted file mode 100755 index 58eaa63ce..000000000 --- a/htdocs/edit/process/cust_main_county.cgi +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/perl -Tw -# -# process/agent.cgi: Edit cust_main_county (process form) -# -# ivan@sisd.com 97-dec-16 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 -# -# lose background, FS::CGI ivan@sisd.com 98-sep-2 - -use strict; -use CGI::Request; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearch qsearchs); -use FS::cust_main_county; -use FS::CGI qw(eidiot); - -my($req)=new CGI::Request; # create form object - -&cgisuidsetup($req->cgi); - -foreach ( $req->params ) { - /^tax(\d+)$/ or die "Illegal form $_!"; - my($taxnum)=$1; - my($old)=qsearchs('cust_main_county',{'taxnum'=>$taxnum}) - or die "Couldn't find taxnum $taxnum!"; - next unless $old->getfield('tax') ne $req->param("tax$taxnum"); - my(%hash)=$old->hash; - $hash{tax}=$req->param("tax$taxnum"); - my($new)=create FS::cust_main_county \%hash; - my($error)=$new->replace($old); - eidiot($error) if $error; -} - -$req->cgi->redirect("../../browse/cust_main_county.cgi"); - diff --git a/htdocs/edit/process/cust_pay.cgi b/htdocs/edit/process/cust_pay.cgi deleted file mode 100755 index 9ec97532b..000000000 --- a/htdocs/edit/process/cust_pay.cgi +++ /dev/null @@ -1,57 +0,0 @@ -#!/usr/bin/perl -Tw -# -# process/cust_pay.cgi: Add a payment (process form) -# -# Usage: post form to: -# http://server.name/path/cust_pay.cgi -# -# Note: Should be run setuid root as user nobody. -# -# ivan@voicenet.com 96-dec-11 -# -# rewrite ivan@sisd.com 98-mar-16 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 - -use strict; -use CGI::Request; -use FS::UID qw(cgisuidsetup); -use FS::cust_pay qw(fields); - -my($req)=new CGI::Request; -&cgisuidsetup($req->cgi); - -$req->param('invnum') =~ /^(\d*)$/ or die "Illegal svcnum!"; -my($invnum)=$1; - -my($new) = create FS::cust_pay ( { - map { - $_, $req->param($_); - } qw(invnum paid _date payby payinfo paybatch) -} ); - -my($error); -$error=$new->insert; - -if ($error) { #error! - CGI::Base::SendHeaders(); # one guess - print <<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 6f5bc875a..000000000 --- a/htdocs/edit/process/cust_pkg.cgi +++ /dev/null @@ -1,73 +0,0 @@ -#!/usr/bin/perl -Tw -# -# process/cust_pkg.cgi: Add/edit packages (process form) -# -# this is for changing packages around, not for editing things within the -# package -# -# Usage: post form to: -# http://server.name/path/cust_pkg.cgi -# -# Note: Should be run setuid root as user nobody. -# -# ivan@voicenet.com 97-mar-21 - 97-mar-24 -# -# rewrote for new API -# ivan@voicenet.com 97-jul-7 - 15 -# -# &cgisuidsetup($cgi) ivan@sisd.com 98-mar-7 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 - -use strict; -use CGI::Request; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::cust_pkg; - -my($req)=new CGI::Request; # create form object - -&cgisuidsetup($req->cgi); - -#untaint custnum -$req->param('new_custnum') =~ /^(\d+)$/; -my($custnum)=$1; - -my(@remove_pkgnums) = map { - /^(\d+)$/ or die "Illegal remove_pkg value!"; - $1; -} $req->param('remove_pkg'); - -my(@pkgparts); -my($pkgpart); -foreach $pkgpart ( map /^pkg(\d+)$/ ? $1 : (), $req->params ) { - my($num_pkgs)=$req->param("pkg$pkgpart"); - while ( $num_pkgs-- ) { - push @pkgparts,$pkgpart; - } -} - -my($error) = FS::cust_pkg::order($custnum,\@pkgparts,\@remove_pkgnums); - -if ($error) { - CGI::Base::SendHeaders(); - print <<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 7d787819a..000000000 --- a/htdocs/edit/process/part_pkg.cgi +++ /dev/null @@ -1,79 +0,0 @@ -#!/usr/bin/perl -Tw -# -# process/part_pkg.cgi: Edit package definitions (process form) -# -# ivan@sisd.com 97-dec-10 -# -# don't update non-changing records in part_svc (causing harmless but annoying -# "Records identical" errors). ivan@sisd.com 98-feb-19 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 -# -# Added `|| 0 ' when getting quantity off web page ivan@sisd.com 98-jun-4 -# -# lose background, FS::CGI ivan@sisd.com 98-sep-2 - -use strict; -use CGI::Request; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearch qsearchs); -use FS::part_pkg qw(fields); -use FS::pkg_svc; -use FS::CGI qw(eidiot); - -my($req)=new CGI::Request; # create form object - -&cgisuidsetup($req->cgi); - -my($pkgpart)=$req->param('pkgpart'); - -my($old)=qsearchs('part_pkg',{'pkgpart'=>$pkgpart}) if $pkgpart; - -my($new)=create FS::part_pkg ( { - map { - $_, $req->param($_); - } fields('part_pkg') -} ); - -if ( $pkgpart ) { - my($error)=$new->replace($old); - eidiot($error) if $error; -} else { - my($error)=$new->insert; - eidiot($error) if $error; - $pkgpart=$new->getfield('pkgpart'); -} - -my($part_svc); -foreach $part_svc (qsearch('part_svc',{})) { -# don't update non-changing records in part_svc (causing harmless but annoying -# "Records identical" errors). ivan@sisd.com 98-jan-19 - #my($quantity)=$req->param('pkg_svc'. $part_svc->getfield('svcpart')), - my($quantity)=$req->param('pkg_svc'. $part_svc->svcpart) || 0, - my($old_pkg_svc)=qsearchs('pkg_svc',{ - 'pkgpart' => $pkgpart, - 'svcpart' => $part_svc->getfield('svcpart'), - }); - my($old_quantity)=$old_pkg_svc ? $old_pkg_svc->quantity : 0; - next unless $old_quantity != $quantity; #!here - my($new_pkg_svc)=create FS::pkg_svc({ - 'pkgpart' => $pkgpart, - 'svcpart' => $part_svc->getfield('svcpart'), - #'quantity' => $req->param('pkg_svc'. $part_svc->getfield('svcpart')), - 'quantity' => $quantity, - }); - if ($old_pkg_svc) { - my($error)=$new_pkg_svc->replace($old_pkg_svc); - eidiot($error) if $error; - } else { - my($error)=$new_pkg_svc->insert; - eidiot($error) if $error; - } -} - -#$req->cgi->redirect("../../view/part_pkg.cgi?$pkgpart"); -#$req->cgi->redirect("../../edit/part_pkg.cgi?$pkgpart"); -$req->cgi->redirect("../../browse/part_pkg.cgi"); - diff --git a/htdocs/edit/process/part_referral.cgi b/htdocs/edit/process/part_referral.cgi deleted file mode 100755 index 08a4c01d0..000000000 --- a/htdocs/edit/process/part_referral.cgi +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/perl -Tw -# -# process/part_referral.cgi: Edit referrals (process form) -# -# ivan@sisd.com 98-feb-23 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 -# -# lose background, FS::CGI ivan@sisd.com 98-sep-2 - -use strict; -use CGI::Request; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearchs); -use FS::part_referral qw(fields); -use FS::CGI qw(eidiot); -use FS::CGI qw(eidiot); - -my($req)=new CGI::Request; # create form object - -&cgisuidsetup($req->cgi); - -my($refnum)=$req->param('refnum'); - -my($new)=create FS::part_referral ( { - map { - $_, $req->param($_); - } fields('part_referral') -} ); - -if ( $refnum ) { - my($old)=qsearchs('part_referral',{'refnum'=>$refnum}); - eidiot("(Old) Record not found!") unless $old; - my($error)=$new->replace($old); - eidiot($error) if $error; -} else { - my($error)=$new->insert; - eidiot($error) if $error; -} - -$refnum=$new->getfield('refnum'); -$req->cgi->redirect("../../browse/part_referral.cgi"); - diff --git a/htdocs/edit/process/part_svc.cgi b/htdocs/edit/process/part_svc.cgi deleted file mode 100755 index 0f0fbc6e8..000000000 --- a/htdocs/edit/process/part_svc.cgi +++ /dev/null @@ -1,47 +0,0 @@ -#!/usr/bin/perl -Tw -# -# process/part_svc.cgi: Edit service definitions (process form) -# -# ivan@sisd.com 97-nov-14 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 -# -# lose background, FS::CGI ivan@sisd.com 98-sep-2 - -use strict; -use CGI::Request; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearchs); -use FS::part_svc qw(fields); -use FS::CGI qw(eidiot); - -my($req)=new CGI::Request; # create form object - -&cgisuidsetup($req->cgi); - -my($svcpart)=$req->param('svcpart'); - -my($old)=qsearchs('part_svc',{'svcpart'=>$svcpart}) if $svcpart; - -my($new)=create FS::part_svc ( { - map { - $_, $req->param($_); -# } qw(svcpart svc svcdb) - } fields('part_svc') -} ); - -if ( $svcpart ) { - my($error)=$new->replace($old); - eidiot($error) if $error; -} else { - my($error)=$new->insert; - eidiot($error) if $error; - $svcpart=$new->getfield('svcpart'); -} - -#$req->cgi->redirect("../../view/part_svc.cgi?$svcpart"); -#$req->cgi->redirect("../../edit/part_svc.cgi?$svcpart"); -$req->cgi->redirect("../../browse/part_svc.cgi"); - diff --git a/htdocs/edit/process/svc_acct.cgi b/htdocs/edit/process/svc_acct.cgi deleted file mode 100755 index 8d77ba703..000000000 --- a/htdocs/edit/process/svc_acct.cgi +++ /dev/null @@ -1,87 +0,0 @@ -#!/usr/bin/perl -Tw -# -# process/svc_acct.cgi: Add/edit a customer (process form) -# -# Usage: post form to: -# http://server.name/path/svc_acct.cgi -# -# Note: Should br run setuid root as user nobody. -# -# ivan@voicenet.com 96-dec-18 -# -# Changed /u to /u2 -# ivan@voicenet.com 97-may-6 -# -# rewrote for new API -# ivan@voicenet.com 97-jul-17 - 21 -# -# no FS::Search, FS::svc_acct creates FS::cust_svc record, used for adding -# and editing ivan@sisd.com 98-mar-8 -# -# Changes to allow page to work at a relative position in server -# Changed 'password' to '_password' because Pg6.3 reserves the password word -# bmccane@maxbaud.net 98-apr-3 - -use strict; -use CGI::Request; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearchs); -use FS::svc_acct; - -my($req) = new CGI::Request; # create form object -&cgisuidsetup($req->cgi); - -$req->param('svcnum') =~ /^(\d*)$/ or die "Illegal svcnum!"; -my($svcnum)=$1; - -my($old)=qsearchs('svc_acct',{'svcnum'=>$svcnum}) if $svcnum; - -#unmunge popnum -$req->param('popnum', (split(/:/, $req->param('popnum') ))[0] ); - -#unmunge passwd -if ( $req->param('_password') eq '*HIDDEN*' ) { - $req->param('_password',$old->getfield('_password')); -} - -my($new) = create FS::svc_acct ( { - map { - $_, $req->param($_); - } qw(svcnum pkgnum svcpart username _password popnum uid gid finger dir - shell quota slipip) -} ); - -if ( $svcnum ) { - my($error) = $new->replace($old); - &idiot($error) if $error; -} else { - my($error) = $new->insert; - &idiot($error) if $error; - $svcnum = $new->getfield('svcnum'); -} - -#no errors, view account -$req->cgi->redirect("../../view/svc_acct.cgi?" . $svcnum ); - -sub idiot { - my($error)=@_; - CGI::Base::SendHeaders(); # one guess - print <<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 18d7940b4..000000000 --- a/htdocs/edit/process/svc_acct_pop.cgi +++ /dev/null @@ -1,43 +0,0 @@ -#!/usr/bin/perl -Tw -# -# process/svc_acct_pop.cgi: Edit POP (process form) -# -# ivan@sisd.com 98-mar-8 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 -# -# lose background, FS::CGI ivan@sisd.com 98-sep-2 - -use strict; -use CGI::Request; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearch qsearchs); -use FS::svc_acct_pop qw(fields); -use FS::CGI qw(eidiot); - -my($req)=new CGI::Request; # create form object - -&cgisuidsetup($req->cgi); - -my($popnum)=$req->param('popnum'); - -my($old)=qsearchs('svc_acct_pop',{'popnum'=>$popnum}) if $popnum; - -my($new)=create FS::svc_acct_pop ( { - map { - $_, $req->param($_); - } fields('svc_acct_pop') -} ); - -if ( $popnum ) { - my($error)=$new->replace($old); - eidiot($error) if $error; -} else { - my($error)=$new->insert; - eidiot($error) if $error; - $popnum=$new->getfield('popnum'); -} -$req->cgi->redirect("../../browse/svc_acct_pop.cgi"); - diff --git a/htdocs/edit/process/svc_acct_sm.cgi b/htdocs/edit/process/svc_acct_sm.cgi deleted file mode 100755 index 9ad546bf4..000000000 --- a/htdocs/edit/process/svc_acct_sm.cgi +++ /dev/null @@ -1,80 +0,0 @@ -#!/usr/bin/perl -Tw -# -# process/svc_acct_sm.cgi: Add/edit a mail alias (process form) -# -# Usage: post form to: -# http://server.name/path/svc_acct_sm.cgi -# -# Note: Should br run setuid root as user nobody. -# -# lots of crufty stuff from svc_acct still in here, and modifications are (unelegantly) disabled. -# -# ivan@voicenet.com 97-jan-6 -# -# enabled modifications -# -# ivan@voicenet.com 97-may-7 -# -# fixed removal of cust_svc record on modifications! -# ivan@voicenet.com 97-jun-5 -# -# rewrite ivan@sisd.com 98-mar-15 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 - -use strict; -use CGI::Request; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearchs); -use FS::svc_acct_sm; - -my($req)=new CGI::Request; # create form object -cgisuidsetup($req->cgi); - -$req->param('svcnum') =~ /^(\d*)$/ or die "Illegal svcnum!"; -my($svcnum)=$1; - -my($old)=qsearchs('svc_acct_sm',{'svcnum'=>$svcnum}) if $svcnum; - -#unmunge domsvc and domuid -$req->param('domsvc',(split(/:/, $req->param('domsvc') ))[0] ); -$req->param('domuid',(split(/:/, $req->param('domuid') ))[0] ); - -my($new) = create FS::svc_acct_sm ( { - map { - ($_, scalar($req->param($_))); - } qw(svcnum pkgnum svcpart domuser domuid domsvc) -} ); - -my($error); -if ( $svcnum ) { - $error = $new->replace($old); -} else { - $error = $new->insert; - $svcnum = $new->getfield('svcnum'); -} - -unless ($error) { - $req->cgi->redirect("../../view/svc_acct_sm.cgi?$svcnum"); -} else { - CGI::Base::SendHeaders(); # one guess - print <<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 0782772dd..000000000 --- a/htdocs/edit/process/svc_domain.cgi +++ /dev/null @@ -1,78 +0,0 @@ -#!/usr/bin/perl -Tw -# -# process/svc_domain.cgi: Add a domain (process form) -# -# Usage: post form to: -# http://server.name/path/svc_domain.cgi -# -# Note: Should br run setuid root as user nobody. -# -# lots of yucky stuff in this one... bleachlkjhui! -# -# ivan@voicenet.com 97-jan-6 -# -# kludged for new domain template 3.5 -# ivan@voicenet.com 97-jul-24 -# -# moved internic bits to svc_domain.pm ivan@sisd.com 98-mar-14 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 - -use strict; -use CGI::Request; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearchs); -use FS::svc_domain; - -#remove this to actually test the domains! -$FS::svc_domain::whois_hack = 1; - -my($req) = new CGI::Request; -&cgisuidsetup($req->cgi); - -$req->param('svcnum') =~ /^(\d*)$/ or die "Illegal svcnum!"; -my($svcnum)=$1; - -my($new) = create FS::svc_domain ( { - map { - $_, $req->param($_); - } qw(svcnum pkgnum svcpart domain action purpose) -} ); - -my($error); -if ($req->param('legal') ne "Yes") { - $error = "Customer did not agree to be bound by NSI's ". - qq!<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 61d0fdc28..000000000 --- a/htdocs/edit/svc_acct.cgi +++ /dev/null @@ -1,191 +0,0 @@ -#!/usr/bin/perl -Tw -# -# svc_acct.cgi: Add/edit account (output form) -# -# Usage: svc_acct.cgi {svcnum} | pkgnum{pkgnum}-svcpart{svcpart} -# http://server.name/path/svc_acct.cgi? {svcnum} | pkgnum{pkgnum}-svcpart{svcpart} -# -# Note: Should be run setuid freeside as user nobody -# -# ivan@voicenet.com 96-dec-18 -# -# rewrite ivan@sisd.com 98-mar-8 -# -# Changes to allow page to work at a relative position in server -# Changed 'password' to '_password' because Pg6.3 reserves the password word -# bmccane@maxbaud.net 98-apr-3 -# -# use conf/shells and dbdef username length ivan@sisd.com 98-jul-13 - -use strict; -use CGI::Base qw(:DEFAULT :CGI); -use FS::UID qw(cgisuidsetup getotaker); -use FS::Record qw(qsearch qsearchs); -use FS::svc_acct qw(fields); - -my($shells)="/var/spool/freeside/conf/shells"; -open(SHELLS,$shells) or die "Can't open $shells: $!"; -my(@shells)=map { - /^([\/\w]*)$/ or die "Illegal shell in conf/shells!"; - $1; -} grep $_ !~ /^#/, <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 46d803f07..000000000 --- a/htdocs/edit/svc_acct_pop.cgi +++ /dev/null @@ -1,67 +0,0 @@ -#!/usr/bin/perl -Tw -# -# svc_acct_pop.cgi: Add/Edit pop (output form) -# -# ivan@sisd.com 98-mar-8 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 -# -# lose background, FS::CGI ivan@sisd.com 98-sep-2 - -use strict; -use CGI::Base; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearch qsearchs); -use FS::svc_acct_pop; -use FS::CGI qw(header menubar); - -my($cgi) = new CGI::Base; -$cgi->get; - -&cgisuidsetup($cgi); - -SendHeaders(); # one guess. - -my($svc_acct_pop,$action); -if ( $cgi->var('QUERY_STRING') =~ /^(\d+)$/ ) { #editing - $svc_acct_pop=qsearchs('svc_acct_pop',{'popnum'=>$1}); - $action='Edit'; -} else { #adding - $svc_acct_pop=create FS::svc_acct_pop {}; - $action='Add'; -} -my($hashref)=$svc_acct_pop->hashref; - -print header("$action POP", menubar( - 'Main Menu' => '../', - 'View all POPs' => "../browse/svc_acct_pop.cgi", -)), <<END; - <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 45a8eb8fc..000000000 --- a/htdocs/edit/svc_acct_sm.cgi +++ /dev/null @@ -1,219 +0,0 @@ -#!/usr/bin/perl -Tw -# -# svc_acct_sm.cgi: Add/edit a mail alias (output form) -# -# Usage: svc_acct_sm.cgi {svcnum} | pkgnum{pkgnum}-svcpart{svcpart} -# http://server.name/path/svc_acct_sm.cgi? {svcnum} | pkgnum{pkgnum}-svcpart{svcpart} -# -# use {svcnum} for edit, pkgnum{pkgnum}-svcpart{svcpart} for add -# -# Note: Should be run setuid freeside as user nobody. -# -# should error out in a more CGI-friendly way, and should have more error checking (sigh). -# -# ivan@voicenet.com 97-jan-5 -# -# added debugging code; fixed CPU-sucking problem with trying to edit an (unaudited) mail alias (no pkgnum) -# -# ivan@voicenet.com 97-may-7 -# -# fixed uid selection -# ivan@voicenet.com 97-jun-4 -# -# uid selection across _CUSTOMER_, not just _PACKAGE_ -# -# ( i need to be rewritten with fast searches) -# -# ivan@voicenet.com 97-oct-3 -# -# added fast searches in some of the places where it is sorely needed... -# I see DBI::mysql in your future... -# ivan@voicenet.com 97-oct-23 -# -# rewrite ivan@sisd.com 98-mar-15 -# -# /var/spool/freeside/conf/domain ivan@sisd.com 98-jul-26 - -use strict; -use CGI::Base qw(:DEFAULT :CGI); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearch qsearchs); -use FS::svc_acct_sm qw(fields); - -my($conf_domain)="/var/spool/freeside/conf/domain"; -open(DOMAIN,$conf_domain) or die "Can't open $conf_domain: $!"; -my($mydomain)=map { - /^(.*)$/ or die "Illegal line in $conf_domain!"; #yes, we trust the file - $1 -} grep $_ !~ /^(#|$)/, <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 0717a2c09..000000000 --- a/htdocs/edit/svc_domain.cgi +++ /dev/null @@ -1,120 +0,0 @@ -#!/usr/bin/perl -Tw -# -# svc_domain.cgi: Add domain (output form) -# -# Usage: svc_domain.cgi pkgnum{pkgnum}-svcpart{svcpart} -# http://server.name/path/svc_domain.cgi?pkgnum{pkgnum}-svcpart{svcpart} -# -# Note: Should be run setuid freeside as user nobody -# -# ivan@voicenet.com 97-jan-5 -> 97-jan-6 -# -# changes for domain template 3.5 -# ivan@voicenet.com 97-jul-24 -# -# rewrite ivan@sisd.com 98-mar-14 -# -# no GOV in instructions ivan@sisd.com 98-jul-17 - -use strict; -use CGI::Base qw(:DEFAULT :CGI); -use FS::UID qw(cgisuidsetup getotaker); -use FS::Record qw(qsearch qsearchs); -use FS::svc_domain qw(fields); - -my($cgi) = new CGI::Base; -$cgi->get; -&cgisuidsetup($cgi); - -my($action,$svcnum,$svc_domain,$pkgnum,$svcpart,$part_svc); - -if ( $QUERY_STRING =~ /^(\d+)$/ ) { #editing - - $svcnum=$1; - $svc_domain=qsearchs('svc_domain',{'svcnum'=>$svcnum}) - or die "Unknown (svc_domain) svcnum!"; - - my($cust_svc)=qsearchs('cust_svc',{'svcnum'=>$svcnum}) - or die "Unknown (cust_svc) svcnum!"; - - $pkgnum=$cust_svc->pkgnum; - $svcpart=$cust_svc->svcpart; - - $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart}); - die "No part_svc entry!" unless $part_svc; - - $action="Edit"; - -} else { #adding - - $svc_domain=create FS::svc_domain({}); - - foreach $_ (split(/-/,$QUERY_STRING)) { - $pkgnum=$1 if /^pkgnum(\d+)$/; - $svcpart=$1 if /^svcpart(\d+)$/; - } - $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart}); - die "No part_svc entry!" unless $part_svc; - - $svcnum=''; - - #set fixed and default fields from part_svc - my($field); - foreach $field ( fields('svc_domain') ) { - if ( $part_svc->getfield('svc_domain__'. $field. '_flag') ne '' ) { - $svc_domain->setfield($field,$part_svc->getfield('svc_domain__'. $field) ); - } - } - - $action="Add"; - -} - -my($svc)=$part_svc->getfield('svc'); - -my($otaker)=getotaker; - -my($domain)=( - $svc_domain->domain, -); - -SendHeaders(); -print <<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 4ceb3add5..000000000 --- a/htdocs/images/mid-logo.gif +++ /dev/null diff --git a/htdocs/images/sisd.jpg b/htdocs/images/sisd.jpg Binary files differdeleted file mode 100755 index 908a5eaff..000000000 --- a/htdocs/images/sisd.jpg +++ /dev/null diff --git a/htdocs/images/small-logo.gif b/htdocs/images/small-logo.gif Binary files differdeleted file mode 100644 index a8e9c5763..000000000 --- a/htdocs/images/small-logo.gif +++ /dev/null diff --git a/htdocs/index.html b/htdocs/index.html deleted file mode 100755 index de0667e59..000000000 --- a/htdocs/index.html +++ /dev/null @@ -1,96 +0,0 @@ -<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 d41f6d1c9..000000000 --- a/htdocs/misc/bill.cgi +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/perl -Tw -# -# s/FS:Search/FS::Record/ and cgisuidsetup($cgi) ivan@sisd.com 98-mar-13 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 - -use strict; -use CGI::Base qw(:DEFAULT :CGI); -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearchs); -use FS::Bill; - -my($cgi) = new CGI::Base; -$cgi->get; -&cgisuidsetup($cgi); - -#untaint custnum -$QUERY_STRING =~ /^(\d*)$/; -my($custnum)=$1; -my($cust_main)=qsearchs('cust_main',{'custnum'=>$custnum}); -die "Can't find customer!\n" unless $cust_main; - -# ? -bless($cust_main,"FS::Bill"); - -my($error); - -$error = $cust_main->bill( -# 'time'=>$time - ); -&idiot($error) if $error; - -$error = $cust_main->collect( -# 'invoice-time'=>$time, -# 'batch_card'=> 'yes', - 'batch_card'=> 'no', - 'report_badcard'=> 'yes', - ); -&idiot($error) if $error; - -$cgi->redirect("../view/cust_main.cgi?$custnum#history"); - -sub idiot { - my($error)=@_; - CGI::Base::SendHeaders(); # one guess - print <<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 929274f38..000000000 --- a/htdocs/misc/cancel-unaudited.cgi +++ /dev/null @@ -1,85 +0,0 @@ -#!/usr/bin/perl -Tw -# -# cancel-unaudited.cgi: Cancel an unaudited account -# -# Usage: cancel-unaudited.cgi svcnum -# http://server.name/path/cancel-unaudited.cgi pkgnum -# -# Note: Should be run setuid freeside as user nobody -# -# ivan@voicenet.com 97-apr-23 -# -# rewrote for new API -# ivan@voicenet.com 97-jul-21 -# -# Search->Record, cgisuidsetup($cgi) ivan@sids.com 98-mar-19 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 - -use strict; -use CGI::Base qw(:DEFAULT :CGI); # CGI module -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearchs); -use FS::cust_svc; -use FS::svc_acct; - -my($cgi) = new CGI::Base; -$cgi->get; -&cgisuidsetup($cgi); - -#untaint svcnum -$QUERY_STRING =~ /^(\d+)$/; -my($svcnum)=$1; - -my($svc_acct) = qsearchs('svc_acct',{'svcnum'=>$svcnum}); -&idiot("Unknown svcnum!") unless $svc_acct; - -my($cust_svc) = qsearchs('cust_svc',{'svcnum'=>$svcnum}); -&idiot(qq!This account has already been audited. Cancel the - <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 6702a0351..000000000 --- a/htdocs/misc/cancel_pkg.cgi +++ /dev/null @@ -1,54 +0,0 @@ -#!/usr/bin/perl -Tw -# -# cancel_pkg.cgi: Cancel a package -# -# Usage: cancel_pkg.cgi pkgnum -# http://server.name/path/cancel_pkg.cgi pkgnum -# -# Note: Should be run setuid freeside as user nobody -# -# IT DOESN'T RUN THE APPROPRIATE PROGRAMS YET!!!! -# -# probably should generalize this to do cancels, suspensions, unsuspensions, etc. -# -# ivan@voicenet.com 97-jan-2 -# -# still kludgy, but now runs /dbin/cancel $pkgnum -# ivan@voicenet.com 97-feb-27 -# -# doesn't run if pkgnum doesn't match regex -# ivan@voicenet.com 97-mar-6 -# -# now redirects to enter comments -# ivan@voicenet.com 97-may-8 -# -# rewrote for new API -# ivan@voicenet.com 97-jul-21 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 - -use strict; -use CGI::Base qw(:DEFAULT :CGI); # CGI module -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearchs); -use FS::cust_pkg; -use FS::CGI qw(idiot); - -my($cgi) = new CGI::Base; -$cgi->get; -&cgisuidsetup($cgi); - -#untaint pkgnum -$QUERY_STRING =~ /^(\d+)$/ || die "Illegal pkgnum"; -my($pkgnum)=$1; - -my($cust_pkg) = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum}); - -bless($cust_pkg,'FS::cust_pkg'); -my($error)=$cust_pkg->cancel; -idiot($error) if $error; - -$cgi->redirect("../view/cust_main.cgi?".$cust_pkg->getfield('custnum')); - diff --git a/htdocs/misc/expire_pkg.cgi b/htdocs/misc/expire_pkg.cgi deleted file mode 100755 index 163516627..000000000 --- a/htdocs/misc/expire_pkg.cgi +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/perl -Tw -# -# expire_pkg.cgi: Expire a package -# -# Usage: post form to: -# http://server.name/path/expire_pkg.cgi -# -# Note: Should be run setuid freeside as user nobody -# -# based on susp_pkg -# ivan@voicenet.com 97-jul-29 -# -# ivan@sisd.com 98-mar-17 FS::Search->FS::Record -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 - -use strict; -use Date::Parse; -use CGI::Request; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearchs); -use FS::cust_pkg; - -my($req) = new CGI::Request; -&cgisuidsetup($req->cgi); - -#untaint date & pkgnum - -my($date); -if ( $req->param('date') ) { - str2time($req->param('date')) =~ /^(\d+)$/ or die "Illegal date"; - $date=$1; -} else { - $date=''; -} - -$req->param('pkgnum') =~ /^(\d+)$/ or die "Illegal pkgnum"; -my($pkgnum)=$1; - -my($cust_pkg) = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum}); -my(%hash)=$cust_pkg->hash; -$hash{expire}=$date; -my($new)=create FS::cust_pkg ( \%hash ); -my($error) = $new->replace($cust_pkg); -&idiot($error) if $error; - -$req->cgi->redirect("../view/cust_main.cgi?".$cust_pkg->getfield('custnum')); - -sub idiot { - my($error)=@_; - SendHeaders(); - print <<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 d1db000ec..000000000 --- a/htdocs/misc/link.cgi +++ /dev/null @@ -1,72 +0,0 @@ -#!/usr/bin/perl -Tw -# -# link: instead of adding a new account, link to an existing. (output form) -# -# Note: Should be run setuid freeside as user nobody -# -# ivan@voicenet.com 97-feb-5 -# -# rewrite ivan@sisd.com 98-mar-17 -# -# can also link on some other fields now (about time) ivan@sisd.com 98-jun-24 - -use strict; -use CGI::Base qw(:DEFAULT :CGI); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearchs); - -my(%link_field)=( - 'svc_acct' => 'username', - 'svc_domain' => 'domain', - 'svc_acct_sm' => '', - 'svc_charge' => '', - 'svc_wo' => '', -); - -my($cgi) = new CGI::Base; -$cgi->get; -cgisuidsetup($cgi); - -my($pkgnum,$svcpart); -foreach $_ (split(/-/,$QUERY_STRING)) { #get & untaint pkgnum & svcpart - $pkgnum=$1 if /^pkgnum(\d+)$/; - $svcpart=$1 if /^svcpart(\d+)$/; -} - -my($part_svc) = qsearchs('part_svc',{'svcpart'=>$svcpart}); -my($svc) = $part_svc->getfield('svc'); -my($svcdb) = $part_svc->getfield('svcdb'); -my($link_field) = $link_field{$svcdb}; - -CGI::Base::SendHeaders(); -print <<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 084dcc1c4..000000000 --- a/htdocs/misc/print-invoice.cgi +++ /dev/null @@ -1,57 +0,0 @@ -#!/usr/bin/perl -Tw -# -# just a kludge for now, since this duplicates in a way it shouldn't stuff from -# Bill.pm (like $lpr) ivan@sisd.com 98-jun-16 - -use strict; -use CGI::Base qw(:DEFAULT :CGI); -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearchs); -use FS::Invoice; - -my($lpr) = "|lpr -h"; - -my($cgi) = new CGI::Base; -$cgi->get; -&cgisuidsetup($cgi); - -#untaint invnum -$QUERY_STRING =~ /^(\d*)$/; -my($invnum)=$1; -my($cust_bill)=qsearchs('cust_bill',{'invnum'=>$invnum}); -die "Can't find invoice!\n" unless $cust_bill; - - bless($cust_bill,"FS::Invoice"); - open(LPR,$lpr) or die "Can't open $lpr: $!"; - print LPR $cust_bill->print_text; #( date ) - close LPR - or die $! ? "Error closing $lpr: $!" - : "Exit status $? from $lpr"; - -my($custnum)=$cust_bill->getfield('custnum'); - -$cgi->redirect("../view/cust_main.cgi?$custnum#history"); - -sub idiot { - my($error)=@_; - CGI::Base::SendHeaders(); # one guess - print <<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 23fb05386..000000000 --- a/htdocs/misc/process/link.cgi +++ /dev/null @@ -1,73 +0,0 @@ -#!/usr/bin/perl -Tw -# -# process/link.cgi: link to existing customer (process form) -# -# ivan@voicenet.com 97-feb-5 -# -# rewrite ivan@sisd.com 98-mar-18 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 -# -# can also link on some other fields now (about time) ivan@sisd.com 98-jun-24 - -use strict; -use CGI::Request; -use CGI::Carp qw(fatalsToBrowser); -use FS::CGI qw(idiot); -use FS::UID qw(cgisuidsetup); -use FS::cust_svc; -use FS::Record qw(qsearchs); - -my($req)=new CGI::Request; # create form object -cgisuidsetup($req->cgi); - -#$req->import_names('R'); #import CGI variables into package 'R'; - -$req->param('pkgnum') =~ /^(\d+)$/; my($pkgnum)=$1; -$req->param('svcpart') =~ /^(\d+)$/; my($svcpart)=$1; - -$req->param('svcnum') =~ /^(\d*)$/; my($svcnum)=$1; -unless ( $svcnum ) { - my($part_svc) = qsearchs('part_svc',{'svcpart'=>$svcpart}); - my($svcdb) = $part_svc->getfield('svcdb'); - $req->param('link_field') =~ /^(\w+)$/; my($link_field)=$1; - my($svc_acct)=qsearchs($svcdb,{$link_field => $req->param('link_value') }); - idiot("$link_field not found!") unless $svc_acct; - $svcnum=$svc_acct->svcnum; -} - -my($old)=qsearchs('cust_svc',{'svcnum'=>$svcnum}); -die "svcnum not found!" unless $old; -my($new)=create FS::cust_svc ({ - 'svcnum' => $svcnum, - 'pkgnum' => $pkgnum, - 'svcpart' => $svcpart, -}); - -my($error); -$error = $new->replace($old); - -unless ($error) { - #no errors, so let's view this customer. - $req->cgi->redirect("../../view/cust_pkg.cgi?$pkgnum"); -} else { - CGI::Base::SendHeaders(); # one guess - print <<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 7b23caeb2..000000000 --- a/htdocs/misc/susp_pkg.cgi +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/perl -Tw -# -# susp_pkg.cgi: Suspend a package -# -# Usage: susp_pkg.cgi pkgnum -# http://server.name/path/susp_pkg.cgi pkgnum -# -# Note: Should be run setuid freeside as user nobody -# -# probably should generalize this to do cancels, suspensions, unsuspensions, etc. -# -# ivan@voicenet.com 97-feb-27 -# -# now redirects to enter comments -# ivan@voicenet.com 97-may-8 -# -# rewrote for new API -# ivan@voicenet.com 97-jul-21 -# -# FS::Search -> FS::Record ivan@sisd.com 98-mar-17 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 - -use strict; -use CGI::Base qw(:DEFAULT :CGI); # CGI module -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearchs); -use FS::cust_pkg; - -my($cgi) = new CGI::Base; -$cgi->get; -&cgisuidsetup($cgi); - -#untaint pkgnum -$QUERY_STRING =~ /^(\d+)$/ || die "Illegal pkgnum"; -my($pkgnum)=$1; - -my($cust_pkg) = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum}); - -bless($cust_pkg,'FS::cust_pkg'); -my($error)=$cust_pkg->suspend; -&idiot($error) if $error; - -$cgi->redirect("../view/cust_main.cgi?".$cust_pkg->getfield('custnum')); - -sub idiot { - my($error)=@_; - SendHeaders(); - print <<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 2f340c6fa..000000000 --- a/htdocs/misc/unsusp_pkg.cgi +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/perl -Tw -# -# susp_pkg.cgi: Unsuspend a package -# -# Usage: susp_pkg.cgi pkgnum -# http://server.name/path/susp_pkg.cgi pkgnum -# -# Note: Should be run setuid freeside as user nobody -# -# probably should generalize this to do cancels, suspensions, unsuspensions, etc. -# -# ivan@voicenet.com 97-feb-27 -# -# now redirects to enter comments -# ivan@voicenet.com 97-may-8 -# -# rewrote for new API -# ivan@voicenet.com 97-jul-21 -# -# FS::Search -> FS::Record ivan@sisd.com 98-mar-17 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 - -use strict; -use CGI::Base qw(:DEFAULT :CGI); # CGI module -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearchs); -use FS::cust_pkg; - -my($cgi) = new CGI::Base; -$cgi->get; -&cgisuidsetup($cgi); - -#untaint pkgnum -$QUERY_STRING =~ /^(\d+)$/ || die "Illegal pkgnum"; -my($pkgnum)=$1; - -my($cust_pkg) = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum}); - -bless($cust_pkg,'FS::cust_pkg'); -my($error)=$cust_pkg->unsuspend; -&idiot($error) if $error; - -$cgi->redirect("../view/cust_main.cgi?".$cust_pkg->getfield('custnum')); - -sub idiot { - my($error)=@_; - SendHeaders(); - print <<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 5be84b79e..000000000 --- a/htdocs/search/cust_bill.cgi +++ /dev/null @@ -1,46 +0,0 @@ -#!/usr/bin/perl -Tw -# -# cust_bill.cgi: Search for invoices (process form) -# -# Usage: post form to: -# http://server.name/path/cust_bill.cgi -# -# Note: Should be run setuid freeside as user nobody. -# -# ivan@voicenet.com 97-apr-4 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 - -use strict; -use CGI::Request; -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearchs); - -my($req)=new CGI::Request; -cgisuidsetup($req->cgi); - -$req->param('invnum') =~ /^\s*(FS-)?(\d+)\s*$/; -my($invnum)=$2; - -if ( qsearchs('cust_bill',{'invnum'=>$invnum}) ) { - $req->cgi->redirect("../view/cust_bill.cgi?$invnum"); #redirect -} else { #error - CGI::Base::SendHeaders(); # one guess - print <<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 4adb40e4a..000000000 --- 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 92341ad13..000000000 --- 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 70ce991f7..000000000 --- a/htdocs/search/cust_main.cgi +++ /dev/null @@ -1,235 +0,0 @@ -#!/usr/bin/perl -Tw -# -# process/cust_main.cgi: Search for customers (process form) -# -# Usage: post form to: -# http://server.name/path/cust_main.cgi -# -# Note: Should be run setuid freeside as user nobody. -# -# ivan@voicenet.com 96-dec-12 -# -# rewrite ivan@sisd.com 98-mar-4 -# -# now does browsing too ivan@sisd.com 98-mar-6 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 -# -# display total, use FS::CGI ivan@sisd.com 98-jul-17 - -use strict; -use CGI::Request; -use CGI::Carp qw(fatalsToBrowser); -use IO::Handle; -use IPC::Open2; -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearch qsearchs); -use FS::CGI qw(header idiot); - -my($fuzziness)=2; #fuzziness for fuzzy searches, see man agrep - #0-4: 0=no fuzz, 4=very fuzzy (too much fuzz!) - -my($req)=new CGI::Request; -&cgisuidsetup($req->cgi); - -my(@cust_main); -my($sortby); - -my($query)=$req->cgi->var('QUERY_STRING'); -if ( $query eq 'custnum' ) { - $sortby=\*custnum_sort; - @cust_main=qsearch('cust_main',{}); -} elsif ( $query eq 'last' ) { - $sortby=\*last_sort; - @cust_main=qsearch('cust_main',{}); -} elsif ( $query eq 'company' ) { - $sortby=\*company_sort; - @cust_main=qsearch('cust_main',{}); -} else { - &cardsearch if ($req->param('card_on') ); - &lastsearch if ($req->param('last_on') ); - &companysearch if ($req->param('company_on') ); -} - -if ( scalar(@cust_main) == 1 ) { - $req->cgi->redirect("../view/cust_main.cgi?". $cust_main[0]->custnum); - exit; -} elsif ( scalar(@cust_main) == 0 ) { - idiot "No matching customers found!\n"; - exit; -} else { - - my($total)=scalar(@cust_main); - CGI::Base::SendHeaders(); # one guess - print header("Customer Search Results",''), <<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 656943f9c..000000000 --- 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 967068f5e..000000000 --- a/htdocs/search/cust_pkg.cgi +++ /dev/null @@ -1,122 +0,0 @@ -#!/usr/bin/perl -Tw -# -# cust_pkg.cgi: search/browse for packages -# -# based on search/svc_acct.cgi ivan@sisd.com 98-jul-17 - -use strict; -use CGI::Request; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearch qsearchs); -use FS::CGI qw(header idiot); - -my($req)=new CGI::Request; -&cgisuidsetup($req->cgi); - -my(@cust_pkg,$sortby); - -my($query)=$req->cgi->var('QUERY_STRING'); -#this tree is a little bit redundant -if ( $query eq 'pkgnum' ) { - $sortby=\*pkgnum_sort; - @cust_pkg=qsearch('cust_pkg',{}); -} elsif ( $query eq 'APKG_pkgnum' ) { - $sortby=\*pkgnum_sort; - - #perhaps this should go in cust_pkg as a qsearch-like constructor? - my($cust_pkg); - foreach $cust_pkg (qsearch('cust_pkg',{})) { - my($flag)=0; - my($pkg_svc); - PKG_SVC: - foreach $pkg_svc (qsearch('pkg_svc',{ 'pkgpart' => $cust_pkg->pkgpart })) { - if ( $pkg_svc->quantity - > scalar(qsearch('cust_svc',{ - 'pkgnum' => $cust_pkg->pkgnum, - 'svcpart' => $pkg_svc->svcpart, - })) - ) - { - $flag=1; - last PKG_SVC; - } - } - push @cust_pkg, $cust_pkg if $flag; - } -} else { - die "Empty QUERY_STRING!"; -} - -if ( scalar(@cust_pkg) == 1 ) { - my($pkgnum)=$cust_pkg[0]->pkgnum; - $req->cgi->redirect("../view/cust_pkg.cgi?$pkgnum"); - exit; -} elsif ( scalar(@cust_pkg) == 0 ) { #error - &idiot("No packages found"); - exit; -} else { - my($total)=scalar(@cust_pkg); - CGI::Base::SendHeaders(); # one guess - print header('Package Search Results',''), <<END; - $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 250a741db..000000000 --- a/htdocs/search/svc_acct.cgi +++ /dev/null @@ -1,186 +0,0 @@ -#!/usr/bin/perl -Tw -# -# svc_acct.cgi: Search for customers (process form) -# -# Usage: post form to: -# http://server.name/path/svc_acct.cgi -# -# Note: Should be run setuid freeside as user nobody. -# -# loosely (sp?) based on search/cust_main.cgi -# -# ivan@voicenet.com 96-jan-3 -> 96-jan-4 -# -# rewrite (now does browsing too) ivan@sisd.com 98-mar-9 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 -# -# show unlinked accounts ivan@sisd.com 98-jun-22 -# -# use FS::CGI, show total ivan@sisd.com 98-jul-17 -# -# give service and customer info too ivan@sisd.com 98-aug-16 - -use strict; -use CGI::Request; # form processing module -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearch qsearchs); -use FS::CGI qw(header idiot); - -my($req)=new CGI::Request; # create form object -&cgisuidsetup($req->cgi); - -my(@svc_acct,$sortby); - -my($query)=$req->cgi->var('QUERY_STRING'); -#this tree is a little bit redundant -if ( $query eq 'svcnum' ) { - $sortby=\*svcnum_sort; - @svc_acct=qsearch('svc_acct',{}); -} elsif ( $query eq 'username' ) { - $sortby=\*username_sort; - @svc_acct=qsearch('svc_acct',{}); -} elsif ( $query eq 'uid' ) { - $sortby=\*uid_sort; - @svc_acct=grep $_->uid ne '', qsearch('svc_acct',{}); -} elsif ( $query eq 'UN_svcnum' ) { - $sortby=\*svcnum_sort; - @svc_acct = grep qsearchs('cust_svc',{ - 'svcnum' => $_->svcnum, - 'pkgnum' => '', - }), qsearch('svc_acct',{}); -} elsif ( $query eq 'UN_username' ) { - $sortby=\*username_sort; - @svc_acct = grep qsearchs('cust_svc',{ - 'svcnum' => $_->svcnum, - 'pkgnum' => '', - }), qsearch('svc_acct',{}); -} elsif ( $query eq 'UN_uid' ) { - $sortby=\*uid_sort; - @svc_acct = grep qsearchs('cust_svc',{ - 'svcnum' => $_->svcnum, - 'pkgnum' => '', - }), qsearch('svc_acct',{}); -} else { - &usernamesearch; -} - -if ( scalar(@svc_acct) == 1 ) { - my($svcnum)=$svc_acct[0]->svcnum; - $req->cgi->redirect("../view/svc_acct.cgi?$svcnum"); #redirect - exit; -} elsif ( scalar(@svc_acct) == 0 ) { #error - idiot("Account not found"); - exit; -} else { - my($total)=scalar(@svc_acct); - CGI::Base::SendHeaders(); # one guess - print header("Account Search Results",''), <<END; - $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 91291be99..000000000 --- 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 3b1a4cf4e..000000000 --- a/htdocs/search/svc_acct_sm.cgi +++ /dev/null @@ -1,128 +0,0 @@ -#!/usr/bin/perl -Tw -# -# svc_acct_sm.cgi: Search for domains (process form) -# -# Usage: post form to: -# http://server.name/path/svc_domain.cgi -# -# Note: Should be run setuid freeside as user nobody. -# -# ivan@voicenet.com 96-mar-5 -# -# need to look at table in results to make it more readable -# -# ivan@voicenet.com -# -# rewrite ivan@sisd.com 98-mar-15 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 - -use strict; -use CGI::Request; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearch qsearchs); - -my($conf_domain)="/var/spool/freeside/conf/domain"; -open(DOMAIN,$conf_domain) or die "Can't open $conf_domain: $!"; -my($mydomain)=map { - /^(.*)$/ or die "Illegal line in $conf_domain!"; #yes, we trust the file - $1 -} grep $_ !~ /^(#|$)/, <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 0719856db..000000000 --- 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 d5277037b..000000000 --- a/htdocs/search/svc_domain.cgi +++ /dev/null @@ -1,139 +0,0 @@ -#!/usr/bin/perl -Tw -# -# svc_domain.cgi: Search for domains (process form) -# -# Usage: post form to: -# http://server.name/path/svc_domain.cgi -# -# Note: Should be run setuid freeside as user nobody. -# -# ivan@voicenet.com 97-mar-5 -# -# rewrite ivan@sisd.com 98-mar-14 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 -# -# display total, use FS::CGI now does browsing too ivan@sisd.com 98-jul-17 - -use strict; -use CGI::Request; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearch qsearchs); -use FS::CGI qw(header idiot); - -my($req)=new CGI::Request; -&cgisuidsetup($req->cgi); - -my(@svc_domain); -my($sortby); - -my($query)=$req->cgi->var('QUERY_STRING'); -if ( $query eq 'svcnum' ) { - $sortby=\*svcnum_sort; - @svc_domain=qsearch('svc_domain',{}); -} elsif ( $query eq 'domain' ) { - $sortby=\*domain_sort; - @svc_domain=qsearch('svc_domain',{}); -} elsif ( $query eq 'UN_svcnum' ) { - $sortby=\*svcnum_sort; - @svc_domain = grep qsearchs('cust_svc',{ - 'svcnum' => $_->svcnum, - 'pkgnum' => '', - }), qsearch('svc_domain',{}); -} elsif ( $query eq 'UN_domain' ) { - $sortby=\*domain_sort; - @svc_domain = grep qsearchs('cust_svc',{ - 'svcnum' => $_->svcnum, - 'pkgnum' => '', - }), qsearch('svc_domain',{}); -} else { - $req->param('domain') =~ /^([\w\-\.]+)$/; - my($domain)=$1; - push @svc_domain, qsearchs('svc_domain',{'domain'=>$domain}); -} - -if ( scalar(@svc_domain) == 1 ) { - $req->cgi->redirect("../view/svc_domain.cgi?". $svc_domain[0]->svcnum); - exit; -} elsif ( scalar(@svc_domain) == 0 ) { - idiot "No matching domains found!\n"; - exit; -} else { - CGI::Base::SendHeaders(); # one guess - - my($total)=scalar(@svc_domain); - CGI::Base::SendHeaders(); # one guess - print header("Domain Search Results",''), <<END; - - $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 533743ba2..000000000 --- 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 96101d004..000000000 --- a/htdocs/view/cust_bill.cgi +++ /dev/null @@ -1,79 +0,0 @@ -#!/usr/bin/perl -Tw -# -# Usage: cust_bill.cgi invnum -# http://server.name/path/cust_bill.cgi?invnum -# -# Note: Should be run setuid freeside as user nobody. -# -# this is a quick & ugly hack which does little more than add some formatting to the ascii output from /dbin/print-invoice -# -# ivan@voicenet.com 96-dec-05 -# -# added navigation bar -# ivan@voicenet.com 97-jan-30 -# -# now uses Invoice.pm -# ivan@voicenet.com 97-jun-30 -# -# what to do if cust_bill search errors? -# ivan@voicenet.com 97-jul-7 -# -# s/FS::Search/FS::Record/; $cgisuidsetup($cgi); ivan@sisd.com 98-mar-14 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 -# -# also print 'printed' field ivan@sisd.com 98-jul-10 - -use strict; -use IO::File; -use CGI::Base qw(:DEFAULT :CGI); # CGI module -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearchs); -use FS::Invoice; - -my($cgi) = new CGI::Base; -$cgi->get; -&cgisuidsetup($cgi); - -#untaint invnum -$QUERY_STRING =~ /^(\d+)$/; -my($invnum)=$1; - -my($cust_bill) = qsearchs('cust_bill',{'invnum'=>$invnum}); -die "Invoice #$invnum not found!" unless $cust_bill; -my($custnum) = $cust_bill->getfield('custnum'); - -my($printed) = $cust_bill->printed; - -SendHeaders(); # one guess. -print <<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 ca5fcd94f..000000000 --- a/htdocs/view/cust_main.cgi +++ /dev/null @@ -1,336 +0,0 @@ -#!/usr/bin/perl -Tw -# -# cust_main.cgi: View a customer -# -# Usage: cust_main.cgi custnum -# http://server.name/path/cust_main.cgi?custnum -# -# Note: Should be run setuid freeside as user nobody. -# -# the payment history section could use some work, see below -# -# ivan@voicenet.com 96-nov-29 -> 96-dec-11 -# -# added navigation bar (go to main menu ;) -# ivan@voicenet.com 97-jan-30 -# -# changes to the way credits/payments are applied (the links are here). -# ivan@voicenet.com 97-apr-21 -# -# added debugging code to diagnose CPU sucking problem. -# ivan@voicenet.com 97-may-19 -# -# CPU sucking problem was in comment code? fixed? -# ivan@voicenet.com 97-may-22 -# -# rewrote for new API -# ivan@voicenet.com 97-jul-22 -# -# Changes to allow page to work at a relative position in server -# Changed 'day' to 'daytime' because Pg6.3 reserves the day word -# bmccane@maxbaud.net 98-apr-3 -# -# lose background, FS::CGI ivan@sisd.com 98-sep-2 - -use strict; -use CGI::Base qw(:DEFAULT :CGI); # CGI module -use CGI::Carp qw(fatalsToBrowser); -use Date::Format; -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearchs qsearch); -use FS::CGI qw(header menubar); - -my($cgi) = new CGI::Base; -$cgi->get; -&cgisuidsetup($cgi); - -SendHeaders(); # one guess. -print header("Customer View", menubar( - 'Main Menu' => '../', -)),<<END; - <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 04e38326a..000000000 --- a/htdocs/view/cust_pkg.cgi +++ /dev/null @@ -1,181 +0,0 @@ -#!/usr/bin/perl -Tw -# -# cust_pkg.cgi: View a package -# -# Usage: cust_pkg.cgi pkgnum -# http://server.name/path/cust_pkg.cgi?pkgnum -# -# Note: Should be run setuid freeside as user nobody. -# -# ivan@voicenet.com 96-dec-15 -# -# services section needs to be cleaned up, needs to display extraneous -# entries in cust_pkg! -# ivan@voicenet.com 96-dec-31 -# -# added navigation bar -# ivan@voicenet.com 97-jan-30 -# -# changed and fixed up suspension and cancel stuff, now you can't add -# services to a cancelled package -# ivan@voicenet.com 97-feb-27 -# -# rewrote for new API, still needs to be cleaned up! -# ivan@voicenet.com 97-jul-29 -# -# no FS::Search ivan@sisd.com 98-mar-7 - -use strict; -use Date::Format; -use CGI::Base qw(:DEFAULT :CGI); # CGI module -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearch qsearchs); - -my($cgi) = new CGI::Base; -$cgi->get; -&cgisuidsetup($cgi); - -my(%uiview,%uiadd); -my($part_svc); -foreach $part_svc ( qsearch('part_svc',{}) ) { - $uiview{$part_svc->svcpart}="../view/". $part_svc->svcdb . ".cgi"; - $uiadd{$part_svc->svcpart}="../edit/". $part_svc->svcdb . ".cgi"; -} - -SendHeaders(); # one guess. -print <<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 7096c2fb1..000000000 --- a/htdocs/view/svc_acct.cgi +++ /dev/null @@ -1,172 +0,0 @@ -#!/usr/bin/perl -Tw -# -# View svc_acct records -# -# Usage: svc_acct.cgi svcnum -# http://server.name/path/svc_acct.cgi?svcnum -# -# Note: Should be run setuid freeside as user nobody. -# -# ivan@voicenet.com 96-dec-17 -# -# added link to send info -# ivan@voicenet.com 97-jan-4 -# -# added navigation bar and ability to change username, etc. -# ivan@voicenet.com 97-jan-30 -# -# activate 800 service -# ivan@voicenet.com 97-feb-10 -# -# modified navbar code (should be a subroutine?), added link to cancel account (only if not audited) -# ivan@voicenet.com 97-apr-16 -# -# INCOMPLETELY rewrote some things for new API -# ivan@voicenet.com 97-jul-29 -# -# FS::Search became FS::Record, use strict, etc. ivan@sisd.com 98-mar-9 -# -# Changes to allow page to work at a relative position in server -# Changed 'password' to '_password' because Pg6.3 reserves the password word -# bmccane@maxbaud.net 98-apr-3 -# -# /var/spool/freeside/conf/domain ivan@sisd.com 98-jul-17 -# -# displays arbitrary radius attributes ivan@sisd.com 98-aug-16 - -use strict; -use CGI::Base qw(:DEFAULT :CGI); -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearchs fields); - -my($conf_domain)="/var/spool/freeside/conf/domain"; -open(DOMAIN,$conf_domain) or die "Can't open $conf_domain: $!"; -my($mydomain)=map { - /^(.*)$/ or die "Illegal line in $conf_domain!"; #yes, we trust the file - $1; -} grep $_ !~ /^(#|$)/, <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 42623eefd..000000000 --- a/htdocs/view/svc_acct_sm.cgi +++ /dev/null @@ -1,114 +0,0 @@ -#!/usr/bin/perl -Tw -# -# View svc_acct_sm records -# -# Usage: svc_acct_sm.cgi svcnum -# http://server.name/path/svc_acct_sm.cgi?svcnum -# -# Note: Should be run setuid freeside as user nobody. -# -# based on view/svc_acct.cgi -# -# ivan@voicenet.com 97-jan-5 -# -# added navigation bar -# ivan@voicenet.com 97-jan-30 -# -# rewrite ivan@sisd.com 98-mar-15 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 -# -# /var/spool/freeside/conf/domain ivan@sisd.com 98-jul-17 - -use strict; -use CGI::Base qw(:DEFAULT :CGI); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearchs); - -my($conf_domain)="/var/spool/freeside/conf/domain"; -open(DOMAIN,$conf_domain) or die "Can't open $conf_domain: $!"; -my($mydomain)=map { - /^(.*)$/ or die "Illegal line in $conf_domain!"; #yes, we trust the file - $1 -} grep $_ !~ /^(#|$)/, <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 78ff6ac0b..000000000 --- a/htdocs/view/svc_domain.cgi +++ /dev/null @@ -1,76 +0,0 @@ -#!/usr/bin/perl -Tw -# -# View svc_domain records -# -# Usage: svc_domain svcnum -# http://server.name/path/svc_domain.cgi?svcnum -# -# Note: Should be run setuid freeside as user nobody. -# -# ivan@voicenet.com 97-jan-6 -# -# rewrite ivan@sisd.com 98-mar-14 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 - -use strict; -use CGI::Base qw(:DEFAULT :CGI); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearchs); - -my($cgi) = new CGI::Base; -$cgi->get; -cgisuidsetup($cgi); - -#untaint svcnum -$QUERY_STRING =~ /^(\d+)$/; -my($svcnum)=$1; -my($svc_domain)=qsearchs('svc_domain',{'svcnum'=>$svcnum}); -die "Unknown svcnum" unless $svc_domain; -my($domain)=$svc_domain->domain; - -my($cust_svc)=qsearchs('cust_svc',{'svcnum'=>$svcnum}); -my($pkgnum)=$cust_svc->getfield('pkgnum'); -my($cust_pkg,$custnum); -if ($pkgnum) { - $cust_pkg=qsearchs('cust_pkg',{'pkgnum'=>$pkgnum}); - $custnum=$cust_pkg->getfield('custnum'); -} - -my($part_svc)=qsearchs('part_svc',{'svcpart'=> $cust_svc->svcpart } ); -die "Unkonwn svcpart" unless $part_svc; - -SendHeaders(); # one guess. -print <<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 - |