RT# 81961 Repair broken links in POD documentation
[freeside.git] / FS / bin / freeside-selfservice-xmlrpcd
index fa745ec..9a8481e 100755 (executable)
@@ -3,9 +3,11 @@
 # based on http://www.perlmonks.org/?node_id=582781 by Justin Hawkins
 # and http://poe.perl.org/?POE_Cookbook/Web_Server_With_Forking
 
-###
-# modules and constants and variables, oh my
-###
+=head1 NAME
+
+freeside-selfservice-xmlrpcd
+
+=cut
 
 use warnings;
 use strict;
@@ -28,6 +30,7 @@ use FS::UID qw( adminsuidsetup forksuidsetup dbh );
 use FS::Conf;
 use FS::ClientAPI qw( load_clientapi_modules );
 use FS::ClientAPI_XMLRPC; #FS::SelfService::XMLRPC;
+use FS::TicketSystem;
 
 #freeside
 my $FREESIDE_LOG = "%%%FREESIDE_LOG%%%";
@@ -36,7 +39,7 @@ my $lock_file = "$FREESIDE_LOCK/selfservice-xmlrpcd.writelock";
 
 #freeside xmlrpc.cgi
 my %typelookup = (
-  base64 => [10, sub {$_[0] =~ /[^\x09\x0a\x0d\x20-\x7f]/}, 'as_base64'],
+#not utf-8 safe#  base64 => [10, sub {$_[0] =~ /[^\x09\x0a\x0d\x20-\x7f]/}, 'as_base64'],
   dateTime => [35, sub {$_[0] =~ /^\d{8}T\d\d:\d\d:\d\d$/}, 'as_dateTime'],
   string => [40, sub {1}, 'as_string'],
 );
@@ -63,6 +66,8 @@ logfile("$FREESIDE_LOG/selfservice-xmlrpcd.log");
 
 daemonize2();
 
+FS::ClientAPI::Signup::clear_cache();
+
 my $conf = new FS::Conf;
 
 die "not running; selfservice-xmlrpc conf option is off\n"
@@ -193,6 +198,9 @@ sub server_do_fork {
         #freeside db connection, etc.
         forksuidsetup($user);
 
+        #why isn't this needed ala freeside-selfservice-server??
+        #FS::TicketSystem->init();
+
         return;
     }
 }
@@ -307,6 +315,9 @@ sub client_got_request {
 
     $soap->request($request);
     $soap->handle;
+
+    $FS::UID::dbh->commit() if $FS::UID::dbh; #XXX handle commit error
+
     my $response = $soap->response;
 
     $heap->{client}->put($response);