The locstor.playlistIsAvailable method returns additional ownerid and ownerlogin

fields in the result. (#1293)
This commit is contained in:
tomas 2005-07-28 12:11:52 +00:00
parent da017f9200
commit 8427aae7ac
2 changed files with 13 additions and 5 deletions

View file

@ -23,7 +23,7 @@
Author : $Author: tomas $ Author : $Author: tomas $
Version : $Revision: 1.22 $ Version : $Revision: 1.23 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/xmlrpc/XR_LocStor.php,v $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/xmlrpc/XR_LocStor.php,v $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -1102,6 +1102,8 @@ class XR_LocStor extends LocStor{
* On success, returns a XML-RPC struct with single field: * On success, returns a XML-RPC struct with single field:
* <ul> * <ul>
* <li> available : boolean</li> * <li> available : boolean</li>
* <li> ownerid : int - local user id</li>
* <li> ownerlogin : string - local username</li>
* </ul> * </ul>
* *
* On errors, returns an XML-RPC error response. * On errors, returns an XML-RPC error response.
@ -1122,14 +1124,20 @@ class XR_LocStor extends LocStor{
{ {
list($ok, $r) = $this->_xr_getPars($input); list($ok, $r) = $this->_xr_getPars($input);
if(!$ok) return $r; if(!$ok) return $r;
$res = $this->playlistIsAvailable($r['sessid'], $r['plid']); $res = $this->playlistIsAvailable($r['sessid'], $r['plid'], TRUE);
$ownerId = ($res === TRUE ? NULL : $res);
$ownerLogin = (is_null($ownerId) ? NULL : $this->getSubjName($ownerId));
if(PEAR::isError($res)){ if(PEAR::isError($res)){
return new XML_RPC_Response(0, 805, return new XML_RPC_Response(0, 805,
"xr_playlistIsAvailable: ".$res->getMessage(). "xr_playlistIsAvailable: ".$res->getMessage().
" ".$res->getUserInfo() " ".$res->getUserInfo()
); );
} }
return new XML_RPC_Response(XML_RPC_encode(array('available'=>$res))); return new XML_RPC_Response(XML_RPC_encode(array(
'available' => ($res === TRUE),
'ownerid' => $ownerId,
'ownerlogin' => $ownerLogin,
)));
} }
/* --------------------------------------------------------- info methods */ /* --------------------------------------------------------- info methods */

View file

@ -23,7 +23,7 @@
Author : $Author: tomas $ Author : $Author: tomas $
Version : $Revision: 1.10 $ Version : $Revision: 1.11 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/xmlrpc/xr_cli_test.php,v $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/xmlrpc/xr_cli_test.php,v $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -128,7 +128,7 @@ $infos = array(
"existsPlaylist" => array('m'=>"locstor.existsPlaylist", "existsPlaylist" => array('m'=>"locstor.existsPlaylist",
'p'=>array('sessid', 'plid'), 'r'=>'exists'), 'p'=>array('sessid', 'plid'), 'r'=>'exists'),
"playlistIsAvailable" => array('m'=>"locstor.playlistIsAvailable", "playlistIsAvailable" => array('m'=>"locstor.playlistIsAvailable",
'p'=>array('sessid', 'plid'), 'r'=>'available'), 'p'=>array('sessid', 'plid'), 'r'=>array('available', 'ownerid', 'ownerlogin')),
"loadPref" => array('m'=>"locstor.loadPref", "loadPref" => array('m'=>"locstor.loadPref",
'p'=>array('sessid', 'key'), 'r'=>'value'), 'p'=>array('sessid', 'key'), 'r'=>'value'),