mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-23 00:13:35 +01:00
Finally fix return values, I hope
This commit is contained in:
parent
6d507464c0
commit
60e82152d5
@ -198,13 +198,13 @@
|
||||
if (!$r->faultCode())
|
||||
{
|
||||
$this->debug('<hr>I got this value back<br><pre>' . htmlentities($r->serialize()) . '</pre><hr>',$debug);
|
||||
$this->result = xmlrpc_decode($v);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->debug('Fault Code: ' . $r->faultCode() . ' Reason "' . $r->faultString() . '"<br>',$debug);
|
||||
$this->result = htmlentities($r->serialize());
|
||||
}
|
||||
|
||||
$this->result = xmlrpc_decode($v);
|
||||
return $this->result;
|
||||
}
|
||||
|
||||
@ -251,13 +251,13 @@
|
||||
if (!$r->faultCode())
|
||||
{
|
||||
$this->debug('<hr>I got this value back<br><pre>' . htmlentities($r->serialize()) . '</pre><hr>',$debug);
|
||||
$this->result = xmlrpc_decode($v);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->debug('Fault Code: ' . $r->faultCode() . ' Reason "' . $r->faultString() . '"<br>',$debug);
|
||||
$this->result = htmlentities($r->serialize());
|
||||
}
|
||||
|
||||
$this->result = xmlrpc_decode($v);
|
||||
return $this->result;
|
||||
}
|
||||
|
||||
|
@ -114,20 +114,21 @@
|
||||
}
|
||||
if($timeout>0)
|
||||
{
|
||||
$fp = fsockopen($server, $port,&$this->errno, &$this->errstr, $timeout);
|
||||
$fp = fsockopen($server, $port, &$this->errno, &$this->errstr, $timeout);
|
||||
}
|
||||
else
|
||||
{
|
||||
$fp = fsockopen($server, $port,&$this->errno, &$this->errstr);
|
||||
$fp = fsockopen($server, $port, &$this->errno, &$this->errstr);
|
||||
}
|
||||
if (!$fp)
|
||||
{
|
||||
return CreateObject(
|
||||
$r = CreateObject(
|
||||
'phpgwapi.xmlrpcresp',
|
||||
0,
|
||||
'',
|
||||
$GLOBALS['xmlrpcerr']['http_error'],
|
||||
$GLOBALS['xmlrpcstr']['http_error']
|
||||
);
|
||||
return $r;
|
||||
}
|
||||
// Only create the payload if it was not created previously
|
||||
if(empty($msg->payload))
|
||||
@ -157,7 +158,7 @@
|
||||
$this->errstr = 'Write error';
|
||||
return CreateObject(
|
||||
'phpgwapi.xmlrpcresp',
|
||||
0,
|
||||
'',
|
||||
$GLOBALS['xmlrpcerr']['http_error'],
|
||||
$GLOBALS['xmlrpcstr']['http_error']
|
||||
);
|
||||
@ -174,7 +175,7 @@
|
||||
{
|
||||
return CreateObject(
|
||||
'phpgwapi.xmlrpcresp',
|
||||
0,
|
||||
'',
|
||||
$GLOBALS['xmlrpcerr']['no_ssl'],
|
||||
$GLOBALS['xmlrpcstr']['no_ssl']
|
||||
);
|
||||
@ -236,7 +237,7 @@
|
||||
$this->errstr = 'Write error';
|
||||
$resp = CreateObject(
|
||||
'phpgwapi.xmlrpcresp',
|
||||
0,
|
||||
'',
|
||||
$GLOBALS['xmlrpcerr']['curl_fail'],
|
||||
$GLOBALS['xmlrpcstr']['curl_fail'] . ': ' . curl_error($curl)
|
||||
);
|
||||
|
@ -249,7 +249,7 @@
|
||||
if (!xml_parse($parser, $data, 1))
|
||||
{
|
||||
// return XML error as a faultCode
|
||||
$r = CreateObject('phpgwapi.xmlrpcresp',0,
|
||||
$r = CreateObject('phpgwapi.xmlrpcresp','',
|
||||
$GLOBALS['xmlrpcerrxml'] + xml_get_error_code($parser),
|
||||
sprintf('XML error: %s at line %d',
|
||||
xml_error_string(xml_get_error_code($parser)),
|
||||
@ -293,10 +293,9 @@
|
||||
if($sysCall && $this->authed)
|
||||
{
|
||||
$r = CreateObject('phpgwapi.xmlrpcresp',
|
||||
CreateObject('phpgwapi.xmlrpcval',
|
||||
$GLOBALS['xmlrpcstr']['unknown_method'] . ': ' . $methName,
|
||||
'string'
|
||||
)
|
||||
'',
|
||||
$GLOBALS['xmlrpcerr']['unknown_method'],
|
||||
$GLOBALS['xmlrpcstr']['unknown_method'] . ': ' . $methName
|
||||
);
|
||||
return $r;
|
||||
}
|
||||
@ -384,10 +383,9 @@
|
||||
else
|
||||
{
|
||||
$r = CreateObject('phpgwapi.xmlrpcresp',
|
||||
CreateObject('phpgwapi.xmlrpcval',
|
||||
$GLOBALS['xmlrpcstr']['incorrect_params'] . ': ' . $sr[1],
|
||||
'string'
|
||||
)
|
||||
'',
|
||||
$GLOBALS['xmlrpcerr']['incorrect_params'],
|
||||
$GLOBALS['xmlrpcstr']['incorrect_params'] . ': ' . $sr[1]
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -396,15 +394,19 @@
|
||||
// else prepare error response
|
||||
if(!$this->authed)
|
||||
{
|
||||
$r = CreateObject('phpgwapi.xmlrpcresp',CreateObject('phpgwapi.xmlrpcval','UNAUTHORIZED','string'));
|
||||
$r = CreateObject('phpgwapi.xmlrpcresp',
|
||||
CreateObject('phpgwapi.xmlrpcval',
|
||||
'UNAUTHORIZED',
|
||||
'string'
|
||||
)
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
$r = CreateObject('phpgwapi.xmlrpcresp',
|
||||
CreateObject('phpgwapi.xmlrpcval',
|
||||
$GLOBALS['xmlrpcstr']['unknown_method'] . ': ' . $methName,
|
||||
'string'
|
||||
)
|
||||
'',
|
||||
$GLOBALS['xmlrpcerr']['unknown_method'],
|
||||
$GLOBALS['xmlrpcstr']['unknown_method'] . ': ' . $methName
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -151,7 +151,7 @@
|
||||
{
|
||||
$errstr = substr($data, 0, strpos($data, "\n")-1);
|
||||
error_log('HTTP error, got response: ' .$errstr);
|
||||
$r = CreateObject('phpgwapi.xmlrpcresp',0, $GLOBALS['xmlrpcerr']['http_error'],
|
||||
$r = CreateObject('phpgwapi.xmlrpcresp','', $GLOBALS['xmlrpcerr']['http_error'],
|
||||
$GLOBALS['xmlrpcstr']['http_error'] . ' (' . $errstr . ')');
|
||||
xml_parser_free($parser);
|
||||
return $r;
|
||||
@ -199,7 +199,7 @@
|
||||
xml_get_current_line_number($parser));
|
||||
}
|
||||
error_log($errstr);
|
||||
$r = CreateObject('phpgwapi.xmlrpcresp', 0, $GLOBALS['xmlrpcerr']['invalid_return'],$GLOBALS['xmlrpcstr']['invalid_return']);
|
||||
$r = CreateObject('phpgwapi.xmlrpcresp', '', $GLOBALS['xmlrpcerr']['invalid_return'],$GLOBALS['xmlrpcstr']['invalid_return']);
|
||||
xml_parser_free($parser);
|
||||
return $r;
|
||||
}
|
||||
@ -215,7 +215,7 @@
|
||||
// then something odd has happened
|
||||
// and it's time to generate a client side error
|
||||
// indicating something odd went on
|
||||
$r = CreateObject('phpgwapi.xmlrpcresp', 0, $GLOBALS['xmlrpcerr']['invalid_return'],$GLOBALS['xmlrpcstr']['invalid_return']);
|
||||
$r = CreateObject('phpgwapi.xmlrpcresp', '', $GLOBALS['xmlrpcerr']['invalid_return'],$GLOBALS['xmlrpcstr']['invalid_return']);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -68,7 +68,7 @@
|
||||
function serialize()
|
||||
{
|
||||
$rs='<methodResponse>'."\n";
|
||||
if ($this->fn)
|
||||
if (isset($this->fn) && !empty($this->fn))
|
||||
{
|
||||
$rs .= '<fault>
|
||||
<value>
|
||||
|
Loading…
Reference in New Issue
Block a user