added function to send xmlrpc-faults (error-msg) from the handler

This commit is contained in:
Ralf Becker 2004-03-07 09:58:22 +00:00
parent 99e4e9efec
commit 9ed6f2e60d

View File

@ -42,7 +42,7 @@
var $resp_struct = array();
var $debug = False;
var $method_requested;
var $log = False; //'/tmp/xmlrpc.log';
var $log = False; //'/tmp/xmlrpc.log';
function xmlrpc_server($dispMap='', $serviceNow=0)
{
@ -75,12 +75,15 @@
}
}
function service()
function service($r=False)
{
global $HTTP_RAW_POST_DATA;
$r = $this->parseRequest();
if ($r == False)
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"');
header('HTTP/1.0 401 Unauthorized');
@ -469,5 +472,16 @@
fputs($fp,$HTTP_RAW_POST_DATA);
fclose($fp);
}
function xmlrpc_error($error_number, $error_string)
{
$r = CreateObject('phpgwapi.xmlrpcresp',
'',
$error_number,
$error_string . ': ' . $this->last_method
);
$this->service($r);
exit;
}
}
?>