From 49d9007518d248a18cf4ab87df108916127f6106 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Sun, 7 Mar 2004 10:00:18 +0000 Subject: [PATCH] fixed function to send xmlrpc-faults (error-msg) from the handler, was not loged in the log-file --- phpgwapi/inc/class.xmlrpc_server_epi.inc.php | 22 ++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/phpgwapi/inc/class.xmlrpc_server_epi.inc.php b/phpgwapi/inc/class.xmlrpc_server_epi.inc.php index a4cc03b777..89df7089ff 100644 --- a/phpgwapi/inc/class.xmlrpc_server_epi.inc.php +++ b/phpgwapi/inc/class.xmlrpc_server_epi.inc.php @@ -23,7 +23,7 @@ { var $server = ''; var $authed = True; - var $log = '/tmp/xmlrpc_request_log'; + var $log = False; //'/tmp/xmlrpc.log'; var $last_method = ''; function xmlrpc_server($dispMap='', $serviceNow=0) @@ -43,9 +43,12 @@ { } - function service() + function service($r = False) { - $r = $this->parseRequest(); + if (!$r) // do we have a response, or we need to parse the request + { + $r = $this->parseRequest(); + } if(!$r) { header('WWW-Authenticate: Basic realm="eGroupWare xmlrpc"'); @@ -308,7 +311,7 @@ xmlrpc_error(1005,$error_string); } } - +/* function xmlrpc_error($error_number, $error_string) { $values = array( @@ -321,4 +324,15 @@ xmlrpc_server_destroy($GLOBALS['xmlrpc_server']); exit; } +*/ + function xmlrpc_error($error_number, $error_string) + { + $r = CreateObject('phpgwapi.xmlrpcresp', + '', + $error_number, + $error_string . ': ' . $this->last_method + ); + $this->service($r); + exit; + } }