remove unnecessary complication from ClientAPI dispatch foo
authorivan <ivan>
Sat, 5 Feb 2005 23:39:43 +0000 (23:39 +0000)
committerivan <ivan>
Sat, 5 Feb 2005 23:39:43 +0000 (23:39 +0000)
FS/FS/ClientAPI.pm
FS/FS/ClientAPI/Agent.pm
FS/FS/ClientAPI/MyAccount.pm
FS/FS/ClientAPI/Signup.pm
FS/FS/ClientAPI/passwd.pm

index 1109ede..902f58b 100644 (file)
@@ -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}(@_);
 }
 
index 749934d..e4a58c0 100644 (file)
@@ -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',
index c74f6ea..58966b3 100644 (file)
@@ -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
index 0089e30..4947a64 100644 (file)
@@ -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;
 
index b5c098b..b22d761 100644 (file)
@@ -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;