From 7bc5e95ab1fd7ce0da791560e8e8d48b0d2c53d8 Mon Sep 17 00:00:00 2001 From: kochi Date: Sat, 31 Oct 2015 21:05:42 +0100 Subject: [PATCH] #10008: Array/struct parameter in remove control function - list_participants The struct parameter is changed in array in XMLRPC function parameters. --- application/controllers/admin/remotecontrol.php | 11 +++++++++-- application/helpers/Zend/XmlRpc/Server.php | 8 ++++++++ .../helpers/remotecontrol/remotecontrol_handle.php | 1 + 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/application/controllers/admin/remotecontrol.php b/application/controllers/admin/remotecontrol.php index 08792a8a094..98fca7c565f 100644 --- a/application/controllers/admin/remotecontrol.php +++ b/application/controllers/admin/remotecontrol.php @@ -45,9 +45,16 @@ public function run() Yii::import('application.libraries.LSZend_XmlRpc_Response_Http'); $this->xmlrpc->setResponseClass('LSZend_XmlRpc_Response_Http'); $this->xmlrpc->setClass($oHandler); - /* @var LSZend_XmlRpc_Response_Http */ $result = $this->xmlrpc->handle(); - $result->printXml(); + if ($result instanceof LSZend_XmlRpc_Response_Http) + { + $result->printXml(); + } + else + { + // an Zend_XmlRpc_Server_Fault with exception message from XMLRPC + echo $result; + } } elseif($RPCType=='json') { diff --git a/application/helpers/Zend/XmlRpc/Server.php b/application/helpers/Zend/XmlRpc/Server.php index 2532f12b868..9f1f9c8f4f9 100644 --- a/application/helpers/Zend/XmlRpc/Server.php +++ b/application/helpers/Zend/XmlRpc/Server.php @@ -583,6 +583,14 @@ protected function _handle(Zend_XmlRpc_Request $request) } } + foreach ($sigCalled as $key => $param) { + // the struct of XMLRPC is an array in PHP + if ($param == 'struct') + { + $sigCalled[$key] = 'array'; + } + } + $signatures = $info->getPrototypes(); foreach ($signatures as $signature) { $sigParams = $signature->getParameters(); diff --git a/application/helpers/remotecontrol/remotecontrol_handle.php b/application/helpers/remotecontrol/remotecontrol_handle.php index 76c7bc2323e..18224022124 100644 --- a/application/helpers/remotecontrol/remotecontrol_handle.php +++ b/application/helpers/remotecontrol/remotecontrol_handle.php @@ -1802,6 +1802,7 @@ public function list_participants($sSessionKey, $iSurveyID, $iStart=0, $iLimit=1 if(count($oTokens)==0) return array('status' => 'No Tokens found'); + $extendedAttributes = array(); if($aAttributes) { $aBasicDestinationFields=Token::model($iSurveyID)->tableSchema->columnNames; $aTokenProperties=array_intersect($aAttributes,$aBasicDestinationFields);