fix 'Can't call method "setup" on an undefined value' error when using into rates...
[freeside.git] / FS / bin / freeside-selfservice-server
index f72d0ab..c10623c 100644 (file)
@@ -13,7 +13,7 @@ use Storable 2.09 qw(nstore_fd fd_retrieve);
 use Net::SSH qw(sshopen2);
 use FS::Daemon qw(daemonize1 drop_root logfile daemonize2 sigint sigterm);
 use FS::UID qw(adminsuidsetup forksuidsetup);
-use FS::ClientAPI;
+use FS::ClientAPI qw( load_clientapi_modules );
 use FS::ClientAPI_SessionCache;
 use FS::Record qw( qsearch qsearchs );
 
@@ -52,6 +52,8 @@ drop_root();
 
 $ENV{HOME} = (getpwuid($>))[7]; #for ssh
 
+load_clientapi_modules;
+
 adminsuidsetup $user;
 
 #logfile("/usr/local/etc/freeside/selfservice.". $FS::UID::datasrc); #MACHINE
@@ -108,26 +110,29 @@ while (1) {
         lock_write;
 
         nstore_fd( { _token => '_keepalive' }, $writer );
-        foreach my $agent ( qsearch( 'agent', { disabled => '' } ) ) {
-          my $config = qsearchs( 'conf', { name  => 'selfservice-bulk_ftp_dir',
-                                           agentnum => $agent->agentnum,
-                               } )
-            or next;
-
-          my $session =
-            FS::ClientAPI->dispatch( 'Agent/agent_login',
-                                     { username => $agent->username,
-                                       password => $agent->_password,
-                                     }
-            );
-
-          nstore_fd( { _token     => '_ftp_scan',
-                       dir        => $config->value,
-                       session_id => $session->{session_id},
-                     },
-                     $writer
-          );
-        }
+
+#commenting izoom stuff out until we can move it to a branch (or just remove)
+#        foreach my $agent ( qsearch( 'agent', { disabled => '' } ) ) {
+#          my $config = qsearchs( 'conf', { name  => 'selfservice-bulk_ftp_dir',
+#                                           agentnum => $agent->agentnum,
+#                               } )
+#            or next;
+#
+#          my $session =
+#            FS::ClientAPI->dispatch( 'Agent/agent_login',
+#                                     { username => $agent->username,
+#                                       password => $agent->_password,
+#                                     }
+#            );
+#
+#          nstore_fd( { _token     => '_ftp_scan',
+#                       dir        => $config->value,
+#                       session_id => $session->{session_id},
+#                     },
+#                     $writer
+#          );
+#        }
+
         unlock_write;
       }
       next;