summaryrefslogtreecommitdiff
path: root/FS/FS
diff options
context:
space:
mode:
authorivan <ivan>2005-02-05 23:39:43 +0000
committerivan <ivan>2005-02-05 23:39:43 +0000
commit85b4db91819ef43709a7d9728af3a7f1aa37b07a (patch)
treeeb52da5e159b180ae4c328804e745647fb114f15 /FS/FS
parenta06550f5269b610009cf89b3698eed2bd13be261 (diff)
remove unnecessary complication from ClientAPI dispatch foo
Diffstat (limited to 'FS/FS')
-rw-r--r--FS/FS/ClientAPI.pm19
-rw-r--r--FS/FS/ClientAPI/Agent.pm8
-rw-r--r--FS/FS/ClientAPI/MyAccount.pm21
-rw-r--r--FS/FS/ClientAPI/Signup.pm6
-rw-r--r--FS/FS/ClientAPI/passwd.pm7
5 files changed, 4 insertions, 57 deletions
diff --git a/FS/FS/ClientAPI.pm b/FS/FS/ClientAPI.pm
index 1109ede..902f58b 100644
--- a/FS/FS/ClientAPI.pm
+++ b/FS/FS/ClientAPI.pm
@@ -3,7 +3,7 @@ package FS::ClientAPI;
use strict;
use vars qw(%handler $domain $DEBUG);
-$DEBUG = 1;
+$DEBUG = 0;
%handler = ();
@@ -23,24 +23,13 @@ foreach my $INC ( @INC ) {
}
}
-#(sub for modules)
-sub register_handlers {
- my $self = shift;
- my %new_handlers = @_;
- foreach my $key ( keys %new_handlers ) {
- warn "WARNING: redefining sub $key" if exists $handler{$key};
- #warn "registering $key";
- $handler{$key} = $new_handlers{$key};
- }
-}
-
#---
sub dispatch {
my ( $self, $name ) = ( shift, shift );
- my $sub = $handler{$name}
- or die "unknown FS::ClientAPI sub $name (known: ". join(" ", keys %handler );
- #or die "unknown FS::ClientAPI sub $name";
+ $name =~ s(/)(::)g;
+ my $sub = "FS::ClientAPI::$name";
+ no strict 'refs';
&{$sub}(@_);
}
diff --git a/FS/FS/ClientAPI/Agent.pm b/FS/FS/ClientAPI/Agent.pm
index 749934d..e4a58c0 100644
--- a/FS/FS/ClientAPI/Agent.pm
+++ b/FS/FS/ClientAPI/Agent.pm
@@ -10,14 +10,6 @@ use FS::Record qw(qsearchs); # qsearch dbdef dbh);
use FS::agent;
use FS::cust_main qw(smart_search);
-#use FS::ClientAPI;
-FS::ClientAPI->register_handlers(
- 'Agent/agent_login' => \&agent_login,
- 'Agent/agent_logout' => \&agent_logout,
- 'Agent/agent_info' => \&agent_info,
- 'Agent/agent_list_customers' => \&agent_list_customers,
-);
-
#store in db?
my $cache = new Cache::SharedMemoryCache( {
'namespace' => 'FS::ClientAPI::Agent',
diff --git a/FS/FS/ClientAPI/MyAccount.pm b/FS/FS/ClientAPI/MyAccount.pm
index c74f6ea..58966b3 100644
--- a/FS/FS/ClientAPI/MyAccount.pm
+++ b/FS/FS/ClientAPI/MyAccount.pm
@@ -19,27 +19,6 @@ use FS::cust_bill;
use FS::cust_main_county;
use FS::cust_pkg;
-#use FS::ClientAPI; #hmm
-FS::ClientAPI->register_handlers(
- 'MyAccount/login' => \&login,
- 'MyAccount/logout' => \&logout,
- 'MyAccount/customer_info' => \&customer_info,
- 'MyAccount/edit_info' => \&edit_info,
- 'MyAccount/invoice' => \&invoice,
- 'MyAccount/list_invoices' => \&list_invoices,
- 'MyAccount/cancel' => \&cancel,
- 'MyAccount/payment_info' => \&payment_info,
- 'MyAccount/process_payment' => \&process_payment,
- 'MyAccount/list_pkgs' => \&list_pkgs,
- 'MyAccount/order_pkg' => \&order_pkg,
- 'MyAccount/cancel_pkg' => \&cancel_pkg,
- 'MyAccount/charge' => \&charge,
- 'MyAccount/part_svc_info' => \&part_svc_info,
- 'MyAccount/provision_acct' => \&provision_acct,
- 'MyAccount/provision_external' => \&provision_external,
- 'MyAccount/unprovision_svc' => \&unprovision_svc,
-);
-
use vars qw( @cust_main_editable_fields );
@cust_main_editable_fields = qw(
first last company address1 address2 city
diff --git a/FS/FS/ClientAPI/Signup.pm b/FS/FS/ClientAPI/Signup.pm
index 0089e30..4947a64 100644
--- a/FS/FS/ClientAPI/Signup.pm
+++ b/FS/FS/ClientAPI/Signup.pm
@@ -16,12 +16,6 @@ use FS::acct_snarf;
use FS::queue;
use FS::reg_code;
-#use FS::ClientAPI; #hmm
-FS::ClientAPI->register_handlers(
- 'Signup/signup_info' => \&signup_info,
- 'Signup/new_customer' => \&new_customer,
-);
-
sub signup_info {
my $packet = shift;
diff --git a/FS/FS/ClientAPI/passwd.pm b/FS/FS/ClientAPI/passwd.pm
index b5c098b..b22d761 100644
--- a/FS/FS/ClientAPI/passwd.pm
+++ b/FS/FS/ClientAPI/passwd.pm
@@ -5,13 +5,6 @@ use FS::Record qw(qsearchs);
use FS::svc_acct;
use FS::svc_domain;
-#use FS::ClientAPI; #hmm
-FS::ClientAPI->register_handlers(
- 'passwd/passwd' => \&passwd,
- 'passwd/chfn' => \&chfn,
- 'passwd/chsh' => \&chsh,
-);
-
sub passwd {
my $packet = shift;