enable CardFortress in test database, #71513
[freeside.git] / FS / bin / freeside-selfservice-server
index 1c2086e..8ce74d5 100644 (file)
@@ -16,6 +16,7 @@ use FS::UID qw(adminsuidsetup forksuidsetup);
 use FS::ClientAPI qw( load_clientapi_modules );
 use FS::ClientAPI_SessionCache;
 use FS::Record qw( qsearch qsearchs );
+use FS::TicketSystem;
 
 use FS::Conf;
 use FS::cust_svc;
@@ -108,28 +109,7 @@ while (1) {
       if ( $keepalives && $keepalive_count++ > 10 ) {
         $keepalive_count = 0;
         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
-          );
-        }
         unlock_write;
       }
       next;
@@ -178,12 +158,10 @@ while (1) {
       warn "child $pid spawned\n" if $Debug;
     } else { #kid time
 
-      ##get new db handle
       $FS::UID::dbh->{InactiveDestroy} = 1;
       forksuidsetup($user);
 
-      #get db handle
-      #adminsuidsetup($user);
+      FS::TicketSystem->init();
 
       my $type = $packet->{_packet};
       warn "calling $type handler\n" if $Debug;