From 68d5b555f4f51ade6d3a2627e9c3e3b22a21a5a3 Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 30 Jun 2003 13:18:39 +0000 Subject: removing deprecated freeside-overdue --- FS/MANIFEST | 30 ++++---- FS/bin/freeside-overdue | 196 ------------------------------------------------ 2 files changed, 16 insertions(+), 210 deletions(-) delete mode 100755 FS/bin/freeside-overdue diff --git a/FS/MANIFEST b/FS/MANIFEST index 272b5b731..846f37310 100644 --- a/FS/MANIFEST +++ b/FS/MANIFEST @@ -3,31 +3,31 @@ MANIFEST MANIFEST.SKIP Makefile.PL README -bin/freeside-bill -bin/freeside-daily -bin/freeside-email -bin/freeside-queued bin/freeside-addoutsource bin/freeside-addoutsourceuser +bin/freeside-adduser +bin/freeside-apply-credits +bin/freeside-bill +bin/freeside-cc-receipts-report +bin/freeside-count-active-customers +bin/freeside-credit-report +bin/freeside-daily bin/freeside-deloutsource bin/freeside-deloutsourceuser -bin/freeside-apply-credits -bin/freeside-adduser bin/freeside-deluser -bin/freeside-setup -bin/freeside-setinvoice -bin/freeside-overdue +bin/freeside-email +bin/freeside-expiration-alerter +bin/freeside-queued bin/freeside-radgroup bin/freeside-receivables-report +bin/freeside-reexport bin/freeside-selfservice-server +bin/freeside-setinvoice +bin/freeside-setup bin/freeside-sqlradius-radacctd bin/freeside-sqlradius-reset bin/freeside-sqlradius-seconds bin/freeside-tax-report -bin/freeside-cc-receipts-report -bin/freeside-credit-report -bin/freeside-expiration-alerter -bin/freeside-reexport FS.pm FS/CGI.pm FS/InitHandler.pm @@ -130,6 +130,7 @@ t/Misc.t t/Record.t t/UID.t t/Msgcat.t +t/SearchCache.t t/cust_bill.t t/cust_bill_event.t t/cust_bill_pay.t @@ -146,6 +147,7 @@ t/cust_pay_batch.t t/cust_pkg.t t/cust_refund.t t/cust_svc.t +t/cust_tax_exempt.t t/domain_record.t t/nas.t t/part_bill_event.t @@ -190,6 +192,6 @@ t/svc_www.t t/type_pkgs.t t/queue.t t/queue_arg.t +t/queue_depend.t t/msgcat.t t/raddb.t -t/cust_tax_exempt.t diff --git a/FS/bin/freeside-overdue b/FS/bin/freeside-overdue deleted file mode 100755 index 116245f9c..000000000 --- a/FS/bin/freeside-overdue +++ /dev/null @@ -1,196 +0,0 @@ -#!/usr/bin/perl -w - -use strict; -use vars qw( $days_to_pay $cust_main $cust_pkg - $cust_svc $svc_acct ); -use Getopt::Std; -use FS::cust_main; -use FS::cust_pkg; -use FS::cust_svc; -use FS::svc_acct; -use FS::Record qw(qsearch qsearchs); -use FS::UID qw(adminsuidsetup); - -&untaint_argv; -my %opt; -getopts('ed:qpl:scbyoi', \%opt); -my $user = shift or die &usage; - -adminsuidsetup $user; - -my $now = time; #eventually take a time option like freeside-bill -my ($sec,$min,$hour,$mday,$mon,$year) = - (localtime($now) )[0,1,2,3,4,5]; -$mon++; -$year += 1900; - -foreach $cust_main ( qsearch('cust_main',{} ) ) { - - my ( $eyear, $emon, $eday ) = ( 2037, 12, 31 ); - if ( $cust_main->paydate =~ /^(\d{4})\-(\d{1,2})\-(\d{1,2})$/ - && $cust_main->payby eq 'BILL') { - ( $eyear, $emon, $eday ) = ( $1, $2, $3 ); - } - - if ( ( $opt{d} - && $cust_main->balance_date(time - $opt{d} * 86400) > 0 - && qsearchs( 'cust_pkg', { 'custnum' => $cust_main->custnum, - 'susp' => "" } ) ) - || ( $opt{e} - && $cust_main->payby eq 'BILL' - && ( $eyear < $year - || ( $eyear == $year && $emon < $mon ) ) ) - ) { - - unless ( $opt{q} ) { - print $cust_main->custnum, "\t", - $cust_main->last, "\t", $cust_main->first, "\t", - $cust_main->balance_date(time-$opt{d} * 86400); - } - - if ( $opt{p} && ! grep { $_ eq 'POST' } $cust_main->invoicing_list ) { - print "\n\tAdding postal invoicing" unless $opt{q}; - my @invoicing_list = $cust_main->invoicing_list; - push @invoicing_list, 'POST'; - $cust_main->invoicing_list(\@invoicing_list); - } - - if ( $opt{l} ) { - print "\n\tCharging late fee of \$$opt{l}" unless $opt{q}; - my $error = $cust_main->charge($opt{l}, 'Late fee'); - # comment or plandata with info so we don't redo the same late fee every - # day - } - - foreach $cust_pkg ( qsearch( 'cust_pkg', - { 'custnum' => $cust_main->custnum } ) ) { - - if ($opt{s}) { - print "\n\tSuspending pkgnum " . $cust_pkg->pkgnum unless $opt{q}; - $cust_pkg->suspend; - } - - if ($opt{c}) { - print "\n\tCancelling pkgnum " . $cust_pkg->pkgnum unless $opt{q}; - $cust_pkg->cancel; - } - - } - - if ( $opt{b} ) { - print "\n\tBilling" unless $opt{q}; - my $error = $cust_main->bill('time'=>$now); - warn "Error billing, customer #" . $cust_main->custnum . - ":" . $error if $error; - } - - if ( $opt{y} ) { - print "\n\tApplying outstanding payments and credits" unless $opt{q}; - $cust_main->apply_payments; - $cust_main->apply_credits; - } - - if ( $opt{o} ) { - print "\n\tCollecting" unless $opt{q}; - my $error = $cust_main->collect( - 'invoice_time' => $now, - 'batch_card' => $opt{i} ? 'no' : 'yes', - 'force_print' => 'yes', - ); - warn "Error collecting from customer #" . $cust_main->custnum. ":$error" - if $error; - } - - print "\n" unless $opt{q}; - - } - -} - -sub untaint_argv { - foreach $_ ( $[ .. $#ARGV ) { - $ARGV[$_] =~ /^([\w\-\/\.]*)$/ || die "Illegal arguement \"$ARGV[$_]\""; - $ARGV[$_]=$1; - } -} - -sub usage { - die "Usage:\n\n freeside-overdue [ -e ] [ -d days ] [ -q ] [ -p ] [ -l amount ] [ -s ] [ -c ] [ -b ] [ -y ] [ -o [ -i ] ] user\n"; -} - - -=head1 NAME - -freeside-overdue - Perform actions on overdue and/or expired accounts. - -=head1 SYNOPSIS - - freeside-overdue [ -e ] [ -d days ] [ -q ] [ -p ] [ -l amount ] [ -s ] [ -c ] [ -b ] [ -y ] [ -o [ -i ] ] user - -=head1 DESCRIPTION - -This script is deprecated in 1.4.0. You should use freeside-daily and invoice -events instead. - -Performs actions on overdue and/or expired accounts. - -Selection options (at least one selection option is required): - - -d: Customers with a balance due on invoices older than the supplied number - of days. Requires an integer argument. - - -e: Customers with a billing expiration date in the past. - -Action options: - - -q: Be quiet (by default, selected accounts are printed). - - -p: Add postal invoicing to the relevant customers. - - -l: Add a charge of the given amount to the relevant customers. - - -s: Suspend accounts. - - -c: Cancel accounts. - - -b: Bill customers (create invoices) - - -y: Apply unapplied payments and credits - - -o: Collect from customers (charge cards, print invoices) - - -i: real-time billing (as opposed to batch billing). only relevant - for credit cards. - - user: From the mapsecrets file - see config.html from the base documentation - -=head1 CRONTAB - -Example crontab entries: - -# suspend expired accounts -20 4 * * * freeside-overdue -e -s user - -# quietly add postal invoicing to customers over 30 days past due -20 4 * * * freeside-overdue -d 30 -p -q user - -# suspend accounts and charge a $10.23 fee for customers over 60 days past due -20 4 * * * freeside-overdue -d 60 -s -l 10.23 user - -# cancel accounts over 90 days past due -20 4 * * * freeside-overdue -d 90 -c user - -=head1 ORIGINAL AUTHORS - -Original disable-overdue version by mw/kwh: Mark W.? and Kristian Hoffmann ? - -Ivan seems to be turning it into the "do-everything" CLI. - -=head1 BUGS - -Hell now that this is the do-everything CLI it should have --longoptions - -=cut - -1; - -- cgit v1.2.1 From f78217427dce10b328e4140c6e6c796aa212c599 Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 30 Jun 2003 18:56:05 +0000 Subject: pass additional fields to ACH processors (Authorize.Net should work now) --- FS/FS/cust_main.pm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm index b45540095..ea6f032f4 100644 --- a/FS/FS/cust_main.pm +++ b/FS/FS/cust_main.pm @@ -1556,6 +1556,10 @@ sub realtime_bop { ( $content{account_number}, $content{routing_code} ) = split('@', $self->payinfo); $content{bank_name} = $self->payname; + $content{account_type} = 'CHECKING'; + $content{account_name} = $payname; + $content{customer_org} = $self->company ? 'B' : 'I'; + $content{customer_ssn} = $self->ss; } elsif ( $method eq 'LEC' ) { $content{phone} = $self->payinfo; } -- cgit v1.2.1 From 40c5ef8814185ba19b68edc8aab96afc75b95e06 Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 30 Jun 2003 19:16:50 +0000 Subject: bugfix for manual re-charging changes (Bug#423) --- FS/FS/cust_main.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm index ea6f032f4..165e6962b 100644 --- a/FS/FS/cust_main.pm +++ b/FS/FS/cust_main.pm @@ -1451,7 +1451,7 @@ sub retry_realtime { && $_->status eq 'done' && $_->statustext } - $_->cust_bill_event; + $cust_bill->cust_bill_event; next unless @cust_bill_event; my $error = $cust_bill_event[0]->retry; if ( $error ) { -- cgit v1.2.1 From e0bbe0e15d90b4fe8abf45b0cb3e4eee3c9810e2 Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 1 Jul 2003 00:27:41 +0000 Subject: typo --- FS/FS/part_export.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FS/FS/part_export.pm b/FS/FS/part_export.pm index 0941da1fb..ff519969d 100644 --- a/FS/FS/part_export.pm +++ b/FS/FS/part_export.pm @@ -902,7 +902,7 @@ tie my %forward_shellcommands_options, 'Tie::IxHash', 'desc' => 'Real-time export to SQL-backed RADIUS (ICRADIUS, FreeRADIUS)', 'options' => \%sqlradius_options, 'nodomain' => 'Y', - 'notes' => 'Real-time export of radcheck, radreply and usergroup tables to any SQL database for FreeRADIUS or ICRADIUS. This export does not export RADIUS realms (see also sqlradius_withdomain). AAn existing RADIUS database will be updated in realtime, but you can use freeside-sqlradius-reset to delete the entire RADIUS database and repopulate the tables from the Freeside database. See the DBI documentation and the documentation for your DBD for the exact syntax of a DBI data source.', + 'notes' => 'Real-time export of radcheck, radreply and usergroup tables to any SQL database for FreeRADIUS or ICRADIUS. This export does not export RADIUS realms (see also sqlradius_withdomain). An existing RADIUS database will be updated in realtime, but you can use freeside-sqlradius-reset to delete the entire RADIUS database and repopulate the tables from the Freeside database. See the DBI documentation and the documentation for your DBD for the exact syntax of a DBI data source.', }, 'sqlradius_withdomain' => { -- cgit v1.2.1 From b0b6550717b6507a7cb27ea5a8c5cd5719d7d9c6 Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 1 Jul 2003 09:00:45 +0000 Subject: larger textareas in export options --- httemplate/edit/part_export.cgi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/httemplate/edit/part_export.cgi b/httemplate/edit/part_export.cgi index 24d646b8b..cc60f1aeb 100644 --- a/httemplate/edit/part_export.cgi +++ b/httemplate/edit/part_export.cgi @@ -67,7 +67,7 @@ my $widget = new HTML::Widgets::SelectLayers( } $html .= ''; } elsif ( $type eq 'textarea' ) { - $html .= qq!!; } elsif ( $type eq 'text' ) { $html .= qq!!; -- cgit v1.2.1 From 4f4ba96481821fb7e9c25e7258737d4a0de7c26b Mon Sep 17 00:00:00 2001 From: ivan Date: Wed, 2 Jul 2003 12:34:25 +0000 Subject: change license to GPL only --- Artistic | 125 --------------------------------------------------------------- README | 16 +++----- 2 files changed, 5 insertions(+), 136 deletions(-) delete mode 100644 Artistic diff --git a/Artistic b/Artistic deleted file mode 100644 index 4ffc78e97..000000000 --- a/Artistic +++ /dev/null @@ -1,125 +0,0 @@ - The "Artistic License" - - Preamble - -The intent of this document is to state the conditions under which a -Package may be copied, such that the Copyright Holder maintains some -semblance of artistic control over the development of the Package, -while giving the users of the package the right to use and distribute -the Package in a more-or-less customary fashion, plus the right to make -reasonable modifications. - -It also grants you the rights to reuse parts of a Package in your own -programs without transferring this License to those programs, provided -that you meet some reasonable requirements. - -Definitions: - - "Package" refers to the collection of files distributed by the - Copyright Holder, and derivatives of that collection of files - created through textual modification. - - "Standard Version" refers to such a Package if it has not been - modified, or has been modified in accordance with the wishes - of the Copyright Holder as specified below. - - "Copyright Holder" is whoever is named in the copyright or - copyrights for the package. - - "You" is you, if you're thinking about copying or distributing - this Package. - - "Reasonable copying fee" is whatever you can justify on the - basis of media cost, duplication charges, time of people involved, - and so on. (You will not be required to justify it to the - Copyright Holder, but only to the computing community at large - as a market that must bear the fee.) - - "Freely Available" means that no fee is charged for the item - itself, though there may be fees involved in handling the item. - It also means that recipients of the item may redistribute it - under the same conditions they received it. - -1. You may make and give away verbatim copies of the source form of the -Standard Version of this Package without restriction, provided that you -duplicate all of the original copyright notices and associated disclaimers. - -2. You may apply bug fixes, portability fixes and other modifications -derived from the Public Domain or from the Copyright Holder. A Package -modified in such a way shall still be considered the Standard Version. - -3. You may otherwise modify your copy of this Package in any way, provided -that you insert a prominent notice in each changed file stating how and -when you changed that file, and provided that you do at least ONE of the -following: - - a) place your modifications in the Public Domain or otherwise make them - Freely Available, such as by posting said modifications to Usenet or - an equivalent medium, or placing the modifications on a major archive - site such as uunet.uu.net, or by allowing the Copyright Holder to include - your modifications in the Standard Version of the Package. - - b) use the modified Package only within your corporation or organization. - - c) rename any non-standard executables so the names do not conflict - with standard executables, which must also be provided, and provide - a separate manual page for each non-standard executable that clearly - documents how it differs from the Standard Version. - - d) make other distribution arrangements with the Copyright Holder. - -4. You may distribute the programs of this Package in object code or -executable form, provided that you do at least ONE of the following: - - a) distribute a Standard Version of the executables and library files, - together with instructions (in the manual page or equivalent) on where - to get the Standard Version. - - b) accompany the distribution with the machine-readable source of - the Package with your modifications. - - c) give non-standard executables non-standard names, and clearly - document the differences in manual pages (or equivalent), together - with instructions on where to get the Standard Version. - - d) make other distribution arrangements with the Copyright Holder. - -5. You may charge a reasonable copying fee for any distribution of this -Package. You may charge any fee you choose for support of this -Package. You may not charge a fee for this Package itself. However, -you may distribute this Package in aggregate with other (possibly -commercial) programs as part of a larger (possibly commercial) software -distribution provided that you do not advertise this Package as a -product of your own. - -6. The scripts and library files supplied as input to or produced as -output from the programs of this Package do not automatically fall -under the copyright of this Package, but belong to whomever generated -them, and may be sold commercially, and may be aggregated with this -Package. If such scripts or library files are aggregated with this -Package via the so-called "undump" or "unexec" methods of producing a -binary executable image, then distribution of such an image shall -neither be construed as a distribution of this Package nor shall it -fall under the restrictions of Paragraphs 3 and 4, provided that you do -not represent such an executable image as a Standard Version of this -Package. - -7. You may reuse parts of this Package in your own programs, provided that -you explicitly state where you got them from, in the source code (and, left -to your courtesy, in the documentation), duplicating all the associated -copyright notices and disclaimers. Besides your changes, if any, must be -clearly marked as such. Parts reused that way will no longer fall under this -license if, and only if, the name of your program(s) have no immediate -connection with the name of the Package itself or its associated programs. -You may then apply whatever restrictions you wish on the reused parts or -choose to place them in the Public Domain--this will apply only within the -context of your package. - -8. The name of the Copyright Holder may not be used to endorse or promote -products derived from this software without specific prior written permission. - -9. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR -IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED -WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. - - The End diff --git a/README b/README index 44692e6f9..1030b3857 100644 --- a/README +++ b/README @@ -1,32 +1,26 @@ Freeside -Copyright (C) 2000,2001,2002 Ivan Kohler +Copyright (C) 2000,2001,2002,2003 Ivan Kohler Copyright (C) 1999 Silicon Interactive Software Design All rights reserved This program is free software; you can redistribute it and/or modify - it under the terms of either: + it under the terms of: a) the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any - later version, or - - b) the "Artistic License" + later version This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See either the - GNU General Public License or the Artistic License for more details. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program, in the file `GPL'; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - You should have received a copy of the Artistic License along with - this program, in the file `Artistic'; if not, download it from - http://www.perl.com/CPAN/doc/misc/license/Artistic - Freeside is a billing and administration package for Internet Service Providers. -- cgit v1.2.1 From 035d0767d78b76853a8804a67325de10165df220 Mon Sep 17 00:00:00 2001 From: ivan Date: Wed, 2 Jul 2003 12:56:04 +0000 Subject: relaxed "first package" restrictions; will find any appropriate service with quantity 1 --- FS/FS/part_pkg.pm | 12 +++++++----- fs_signup/fs_signup_server | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/FS/FS/part_pkg.pm b/FS/FS/part_pkg.pm index 60b0e01f9..6571c529b 100644 --- a/FS/FS/part_pkg.pm +++ b/FS/FS/part_pkg.pm @@ -267,12 +267,14 @@ SVCDB is specified and does not match the svcdb of the service definition, sub svcpart { my $self = shift; - my $svcdb = shift; - my @pkg_svc = $self->pkg_svc; - return '' if scalar(@pkg_svc) != 1 - || $pkg_svc[0]->quantity != 1 - || ( $svcdb && $pkg_svc[0]->part_svc->svcdb ne $svcdb ); + my $svcdb = scalar(@_) ? shift : ''; + my @pkg_svc = grep { + $_->quantity == 1 + && ( $svcdb eq $_->part_svc->svcdb || !$svcdb ) + } $self->pkg_svc; + return '' if scalar(@pkg_svc) != 1; $pkg_svc[0]->svcpart; + } =item payby diff --git a/fs_signup/fs_signup_server b/fs_signup/fs_signup_server index 36af40a57..d6eb4a8d5 100755 --- a/fs_signup/fs_signup_server +++ b/fs_signup/fs_signup_server @@ -162,7 +162,7 @@ while (1) { my $part_pkg = qsearchs( 'part_pkg', { 'pkgpart' => $pkgpart } ) or $error ||= "WARNING: unknown pkgpart: $pkgpart"; - my $svcpart = $part_pkg->svcpart unless $error; + my $svcpart = $part_pkg->svcpart('svc_acct') unless $error; my $cust_pkg = new FS::cust_pkg ( { #later#'custnum' => $custnum, -- cgit v1.2.1 From 1116af6d9150abdf8e0438f45c78b357ab8820a6 Mon Sep 17 00:00:00 2001 From: ivan Date: Wed, 2 Jul 2003 12:58:55 +0000 Subject: tyop --- FS/FS/part_pkg.pm | 1 - 1 file changed, 1 deletion(-) diff --git a/FS/FS/part_pkg.pm b/FS/FS/part_pkg.pm index 6571c529b..6525864c4 100644 --- a/FS/FS/part_pkg.pm +++ b/FS/FS/part_pkg.pm @@ -274,7 +274,6 @@ sub svcpart { } $self->pkg_svc; return '' if scalar(@pkg_svc) != 1; $pkg_svc[0]->svcpart; - } =item payby -- cgit v1.2.1 From d3eefd3591dbd54a1626cca247c7a34b57d89f96 Mon Sep 17 00:00:00 2001 From: ivan Date: Thu, 3 Jul 2003 23:00:07 +0000 Subject: working DBIx::Profile again --- htetc/global.asa | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/htetc/global.asa b/htetc/global.asa index 555364223..d87f1eac6 100644 --- a/htetc/global.asa +++ b/htetc/global.asa @@ -110,8 +110,12 @@ sub Script_OnFlush { my $ref = $Response->{BinaryRef}; #$$ref = $cgi->header( @FS::CGI::header ) . $$ref; #$$ref = $cgi->header() . $$ref; - if ( dbh->can('sprintProfile') ) { - if ( lc($Response->{ContentType}) eq 'text/html' ) { + #warn "Script_OnFlush called with dbh ". dbh. "\n"; + #if ( dbh->can('sprintProfile') ) { + if ( UNIVERSAL::can(dbh,'sprintProfile') ) { + #warn "dbh can sprintProfile\n"; + if ( lc($Response->{ContentType}) eq 'text/html' ) { #con + #warn "contenttype is sprintProfile\n"; $$ref =~ s/<\/BODY>[\s\n]*<\/HTML>[\s\n]*$//i or warn "can't remove"; -- cgit v1.2.1 From af213c494294f73750b6b5b07ca828782ff3a9e4 Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 4 Jul 2003 00:51:29 +0000 Subject: optimize javascript to handle large numbers of POPs --- FS/FS/svc_acct_pop.pm | 5 ++--- fs_signup/FS-SignupClient/cgi/signup.cgi | 8 +++----- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/FS/FS/svc_acct_pop.pm b/FS/FS/svc_acct_pop.pm index 3c9ea0130..404816b47 100644 --- a/FS/FS/svc_acct_pop.pm +++ b/FS/FS/svc_acct_pop.pm @@ -142,8 +142,7 @@ sub popselector { function popstate_changed(what) { state = what.options[what.selectedIndex].text; - for (var i = what.form.popnum.length;i > 0;i--) - what.form.popnum.options[i] = null; + what.form.popnum.options.length = 0 what.form.popnum.options[0] = new Option("", "", false, true); END @@ -182,7 +181,7 @@ END =head1 VERSION -$Id: svc_acct_pop.pm,v 1.7 2002-04-10 13:42:48 ivan Exp $ +$Id: svc_acct_pop.pm,v 1.8 2003-07-04 00:51:29 ivan Exp $ =head1 BUGS diff --git a/fs_signup/FS-SignupClient/cgi/signup.cgi b/fs_signup/FS-SignupClient/cgi/signup.cgi index de142a1c4..09bdd43fa 100755 --- a/fs_signup/FS-SignupClient/cgi/signup.cgi +++ b/fs_signup/FS-SignupClient/cgi/signup.cgi @@ -1,6 +1,6 @@ #!/usr/bin/perl -Tw # -# $Id: signup.cgi,v 1.37 2003-06-24 15:34:45 ivan Exp $ +# $Id: signup.cgi,v 1.38 2003-07-04 00:51:29 ivan Exp $ use strict; use vars qw( @payby $cgi $locales $packages $pops $init_data $error @@ -401,8 +401,7 @@ sub popselector { function acstate_changed(what) { state = what.options[what.selectedIndex].text; - for (var i = what.form.popac.length;i > 0;i--) - what.form.popac.options[i] = null; + what.form.popac.options.length = 0 what.form.popac.options[0] = new Option("Area code", "-1", false, true); END @@ -422,8 +421,7 @@ END $text .= < 0;i--) - what.form.popnum.options[i] = null; + what.form.popnum.options.length = 0; what.form.popnum.options[0] = new Option("City", "-1", false, true); END -- cgit v1.2.1 From f2098c54512150c098f28f59ffe4a62464ef630e Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 4 Jul 2003 01:37:46 +0000 Subject: don't populate the whole initial list if there are tons of POPs --- FS/FS/svc_acct_pop.pm | 10 ++++++-- fs_signup/FS-SignupClient/cgi/signup.cgi | 41 +++++++++++++++++++------------- 2 files changed, 32 insertions(+), 19 deletions(-) diff --git a/FS/FS/svc_acct_pop.pm b/FS/FS/svc_acct_pop.pm index 404816b47..196ab7ebb 100644 --- a/FS/FS/svc_acct_pop.pm +++ b/FS/FS/svc_acct_pop.pm @@ -166,7 +166,13 @@ END $text .= ''; #callback? return 3 html pieces? #''; $text .= qq!' if scalar(@$pops) == 1; - my %pop = (); - foreach (@$pops) { - push @{ $pop{ $_->{state} }->{ $_->{ac} } }, $_; - } + #my %pop = (); + #my %popnum2pop = (); + #foreach (@$pops) { + # push @{ $pop{ $_->{state} }->{ $_->{ac} } }, $_; + # $popnum2pop{$_->{popnum}} = $_; + #} my $text = < @@ -460,8 +461,14 @@ END $text .= qq!'; + } else { + $text .= <'; #callback? return 3 html pieces? #''; $text .= -- cgit v1.2.1 From 1d98e81e8fabbe245a50a16b080c72ad51aca598 Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 4 Jul 2003 03:21:42 +0000 Subject: properly pass init_popstate to error pages --- fs_signup/FS-SignupClient/cgi/signup.cgi | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fs_signup/FS-SignupClient/cgi/signup.cgi b/fs_signup/FS-SignupClient/cgi/signup.cgi index 28b739eec..57b93d4f0 100755 --- a/fs_signup/FS-SignupClient/cgi/signup.cgi +++ b/fs_signup/FS-SignupClient/cgi/signup.cgi @@ -1,6 +1,6 @@ #!/usr/bin/perl -Tw # -# $Id: signup.cgi,v 1.42 2003-07-04 03:12:21 ivan Exp $ +# $Id: signup.cgi,v 1.43 2003-07-04 03:21:42 ivan Exp $ use strict; use vars qw( @payby $cgi $locales $packages @@ -405,7 +405,8 @@ sub popselector { END if ( $init_popstate ) { - $text .=''; + $text .= ''; } else { $text .= < Date: Fri, 4 Jul 2003 03:27:35 +0000 Subject: removing ancient cybercash example --- etc/example-direct-cardin | 67 ----------------------------------------------- 1 file changed, 67 deletions(-) delete mode 100755 etc/example-direct-cardin diff --git a/etc/example-direct-cardin b/etc/example-direct-cardin deleted file mode 100755 index 1a4097221..000000000 --- a/etc/example-direct-cardin +++ /dev/null @@ -1,67 +0,0 @@ -#!/usr/local/bin/perl - -### -# THIS IS FROM CYBERCASH (is there a newer version?) -### - -$paymentserverhost = 'localhost'; -$paymentserverport = 8000; -$paymentserversecret = 'two-turntables'; -use CCLib qw(sendmserver); - -# first lets fake up some data -# use time of day and pid to give me my pretend -# order number -# you obviously need to get real data from somewhere... - -$oid = "test$$"; #fake order number. -$amount = 'usd 42.42'; -$ramount = 'usd 24.24'; -$pan = '4111111111111111'; -$name = 'John Q. Doe'; -$addr = '17 Richard Rd.'; -$city = 'Ivyland'; -$state = 'PA'; -$zip = '18974'; -$country = 'USA'; -$exp = '7/97'; - - -%result = &sendmserver('mauthcapture', - 'Order-ID', $oid, - 'Amount', $amount, - 'Card-Number', $pan, - 'Card-Name', $name, - 'Card-Address', $addr, - 'Card-City', $city, - 'Card-State', $state, - 'Card-Zip', $zip, - 'Card-Country', $country, - 'Card-Exp', $exp); - -# -# just dump results to stdout. -# you should process them... -# to allow results to affect operation of your fulfillment... -# -foreach (keys(%result)) { - print " $_ ==> $result{$_}\n"; -} - -print "\n"; - -exit; - -$trans=$result{'MTransactionNumber'}; -$code=$result{'MRetrievalCode'}; - -%result = &sendmserver('return', - 'Order-ID', $oid, - 'Return-Amount',$ramount, - 'Amount',$amount, - ); - -foreach (keys(%result)) { - print " $_ ==> $result{$_}\n"; -} - -- cgit v1.2.1 From 0fd96aa47e2d0abe220fa703f3b44620b246d581 Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 4 Jul 2003 03:31:26 +0000 Subject: adding states --- etc/abbr_state.txt | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 etc/abbr_state.txt diff --git a/etc/abbr_state.txt b/etc/abbr_state.txt new file mode 100644 index 000000000..7e4f57f78 --- /dev/null +++ b/etc/abbr_state.txt @@ -0,0 +1,72 @@ +State/Possession Abbreviation + +ALABAMA AL +ALASKA AK +AMERICAN SAMOA AS +ARIZONA AZ +ARKANSAS AR +CALIFORNIA CA +COLORADO CO +CONNECTICUT CT +DELAWARE DE +DISTRICT OF COLUMBIA DC +FEDERATED STATES OF MICRONESIA FM +FLORIDA FL +GEORGIA GA +GUAM GU +HAWAII HI +IDAHO ID +ILLINOIS IL +INDIANA IN +IOWA IA +KANSAS KS +KENTUCKY KY +LOUISIANA LA +MAINE ME +MARSHALL ISLANDS MH +MARYLAND MD +MASSACHUSETTS MA +MICHIGAN MI +MINNESOTA MN +MISSISSIPPI MS +MISSOURI MO +MONTANA MT +NEBRASKA NE +NEVADA NV +NEW HAMPSHIRE NH +NEW JERSEY NJ +NEW MEXICO NM +NEW YORK NY +NORTH CAROLINA NC +NORTH DAKOTA ND +NORTHERN MARIANA ISLANDS MP +OHIO OH +OKLAHOMA OK +OREGON OR +PALAU PW +PENNSYLVANIA PA +PUERTO RICO PR +RHODE ISLAND RI +SOUTH CAROLINA SC +SOUTH DAKOTA SD +TENNESSEE TN +TEXAS TX +UTAH UT +VERMONT VT +VIRGIN ISLANDS VI +VIRGINIA VA +WASHINGTON WA +WEST VIRGINIA WV +WISCONSIN WI +WYOMING WY + + +Military "State" Abbreviation + +Armed Forces Africa AE +Armed Forces Americas AA +(except Canada) +Armed Forces Canada AE +Armed Forces Europe AE +Armed Forces Middle East AE +Armed Forces Pacific AP -- cgit v1.2.1 From aa053ef3fc28343d0951c61519c4f1846bf61b1f Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 4 Jul 2003 03:34:33 +0000 Subject: removing obsolete file --- etc/acp_logfile-parse | 197 -------------------------------------------------- 1 file changed, 197 deletions(-) delete mode 100755 etc/acp_logfile-parse diff --git a/etc/acp_logfile-parse b/etc/acp_logfile-parse deleted file mode 100755 index 5e258991b..000000000 --- a/etc/acp_logfile-parse +++ /dev/null @@ -1,197 +0,0 @@ -#!/usr/bin/perl - -### -# WHO WROTE THIS??? -### - -#require "perldb.pl"; - -# Compute SLIP/PPP log times -# Arguments -a Process entire file with totals -# -t Process only totals -# -f File to be processed if not current -# -d processing start date (default is entire file) -# -l to return all totals for dayuse -# -w name of tmp work file for dayuse -# user names - -require "time.pl"; - -$space=' '; - -unless (@ARGV[0]) { - print "Missing Arguments\n"; - print "-a - entire file\n"; - print "-t - totals only\n"; - print "-f - file name to be processed\n"; - print "-d - processing start date (yymmdd)\n"; - print "-l - return totals for dayuse\n"; - print "-w - tmp work file for dayuse\n"; - exit; -} # end if test for missing arguments - -$infile = "/usr/annex/acp_logfile"; -$tmpfile = "/tmp/ppp"; -$n = $#ARGV; -$start_yymmdd = ""; -for ($i = 0; $i <= $n; $i++) { - if ($ARGV[$i] eq "-a") { - $allflag = "true"; - } - elsif ($ARGV[$i] eq "-t") { - $totalflag = "true"; - } - elsif ($ARGV[$i] eq "-f") { - $i++; - $infile = $ARGV[$i]; - } - elsif ($ARGV[$i] eq "-d") { - $i++; - $start_yymmdd = $ARGV[$i]; - } #end start yymmdd - elsif ($ARGV[$i] eq "-l") { - $logflag = "true"; - $totalflag = "true"; - } # end log - elsif ($ARGV[$i] eq "-w") { - $i++; - $tmpfile = $ARGV[$i]; - } # end tmp file - else { - ($arg_user,$arg_yymmdd) = split (/:/, $ARGV[$i]); - $ip_user_date {$arg_user} = $ARGV[$i]; - $userflag = "true"; - } # end else - } # end for 1 = 1 to n - -open (IN,$infile) - || die "Can't open acp_logfile"; - -NEXTUSER: while () { - chop; - ($add,$ether,$port,$date,$time,$type,$action,$user) = split(/:/); - - if ($logflag) { - $start_yymmdd = ''; - if ($ip_user_date{$user}) { - ($ip_user, $start_yymmdd) = - split (/:/, $ip_user_date{$user}); - } # end get date - } # end log flag - if ($start_yymmdd) { - if ($date < $start_yymmdd) { - next NEXTUSER; - } #end date compare - } #end if date - if ($userflag){ - if (!$ip_user_date{$user}) { - next NEXTUSER; - } # end user test - } # end by user or all - if (($totalflag) || - ($allflag) || - ($ip_user_date{$user})) { - if (($type eq 'ppp') || ($type eq 'slip')) { - - if ($action eq 'login') { - $login{$user} = "$time:$date"; - - } - elsif ($action eq 'logout') { - if (!$login{$user}) { - $login{$user} = "010101:$date"; - } #end pad user if carry over - ($stime,$sdate) = split(':',$login{$user}); - $start = &annex2sec($stime); - $end = &annex2sec($time); - - #If we went through midnight, add a day; - if ($end < $start) {$end += 86400;} - $timeon = $end - $start; - - $elapsed{$user} += $timeon; - - if (!$totalflag) { - print (&fmt_user($user), - ' ', &fmt_date($sdate), ' In: ', - &fmt_time($stime),' Out: ', - &fmt_time($time), - ' Elapsed: ', &fmt_sec($timeon), "\n"); - } # end total test - } #end elsif action - } # type = ppp of slip - } # check arguments -} -close IN; - -if ($logflag) { - open (TMPPPP, ">$tmpfile") - || die "Can't open ppp tmp file"; - foreach $user ( sort((keys(%elapsed))) ) { - $log_time = &fmt_sec($elapsed{$user}); - $tmp = join (':', - $user, - $log_time); - print (TMPPPP "$tmp\n"); - } - close (TMPPPP); -} - else { - print "\n\nTotal Time On For Period:\n"; - print "-------------------------\n"; - - foreach $user ( sort((keys(%elapsed))) ) { - print (&fmt_user($user), " ",&fmt_sec($elapsed{$user}), "\n"); - } - } -exit(0); - -#------------------------------------------------------- -#--------------- Subroutines Start Here ---------------- -#------------------------------------------------------- - -sub annex2sec { - local($time) = @_; - return( &time2sec( &break_annex($time) ) ); -} - -sub fmt_date { - local($date) = @_; - - return( substr($date,2,2).'/'.substr($date,4,2).'/'.substr($date,0,2) ); -} - -sub fmt_time { - local($time) = @_; - local($s,$m,$h) = &break_annex($time); - return ("$h:$m:$s"); -} - - -sub break_annex { - local($time) = @_; - local($h,$m,$s); - - $h=substr($time,0,2); - $m=substr($time,2,2); - $s=substr($time,4,2); - - return ($s,$m,$h); -} - -sub fmt_sec { - local(@t) = &sec2time(@_); - @t[2] += (@t[3]*24); - - foreach $a (@t) { - if ($a < 10) {$a = "0$a";} - } - - return ("@t[2]:@t[1]:@t[0]"); -} - -sub fmt_user { - local($user) = @_; - return( $user.substr($space,0,8 - length($user) ).' ' ); -} - -- cgit v1.2.1 From 243a197e349180c5ce181ba0771d316b423597eb Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 4 Jul 2003 03:47:35 +0000 Subject: adding --- fs_signup/FS-SignupClient/cgi/stateselect.html | 80 ++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 fs_signup/FS-SignupClient/cgi/stateselect.html diff --git a/fs_signup/FS-SignupClient/cgi/stateselect.html b/fs_signup/FS-SignupClient/cgi/stateselect.html new file mode 100644 index 000000000..39823be83 --- /dev/null +++ b/fs_signup/FS-SignupClient/cgi/stateselect.html @@ -0,0 +1,80 @@ +ISP Signup +ISP Signup - state selection

+ +
+Select your state: + +
+ + -- cgit v1.2.1