#826 - method locstor.getVersion added to XMLRPC interface.
This commit is contained in:
parent
2719d93419
commit
5dafafe049
5 changed files with 65 additions and 5 deletions
|
@ -23,7 +23,7 @@
|
||||||
|
|
||||||
|
|
||||||
Author : $Author: tomas $
|
Author : $Author: tomas $
|
||||||
Version : $Revision: 1.37 $
|
Version : $Revision: 1.38 $
|
||||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/LocStor.php,v $
|
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/LocStor.php,v $
|
||||||
|
|
||||||
------------------------------------------------------------------------------*/
|
------------------------------------------------------------------------------*/
|
||||||
|
@ -662,5 +662,17 @@ class LocStor extends BasicStor{
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*===================================================== auxiliary methods */
|
||||||
|
/**
|
||||||
|
* Dummy method - only returns livesupport version
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
function getVersion()
|
||||||
|
{
|
||||||
|
//return $this->config['version'];
|
||||||
|
return LS_VERSION;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
?>
|
?>
|
|
@ -23,7 +23,7 @@
|
||||||
|
|
||||||
|
|
||||||
Author : $Author: tomas $
|
Author : $Author: tomas $
|
||||||
Version : $Revision: 1.17 $
|
Version : $Revision: 1.18 $
|
||||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/conf.php,v $
|
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/conf.php,v $
|
||||||
|
|
||||||
------------------------------------------------------------------------------*/
|
------------------------------------------------------------------------------*/
|
||||||
|
@ -33,6 +33,8 @@
|
||||||
* storageServer configuration file
|
* storageServer configuration file
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
define('LS_VERSION', '0.9');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* configuration structure:
|
* configuration structure:
|
||||||
*
|
*
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
|
|
||||||
|
|
||||||
Author : $Author: tomas $
|
Author : $Author: tomas $
|
||||||
Version : $Revision: 1.15 $
|
Version : $Revision: 1.16 $
|
||||||
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 $
|
||||||
|
|
||||||
------------------------------------------------------------------------------*/
|
------------------------------------------------------------------------------*/
|
||||||
|
@ -36,6 +36,49 @@ require_once '../../../storageServer/var/LocStor.php';
|
||||||
*/
|
*/
|
||||||
class XR_LocStor extends LocStor{
|
class XR_LocStor extends LocStor{
|
||||||
|
|
||||||
|
/* ----------------------------------------------------------- getVersion */
|
||||||
|
/**
|
||||||
|
* Dummy method - only returns livesupport version
|
||||||
|
*
|
||||||
|
* The XML-RPC name of this method is "locstor.getVersion".
|
||||||
|
*
|
||||||
|
* Input parameters: XML-RPC struct with no fields.
|
||||||
|
*
|
||||||
|
* On success, returns a XML-RPC struct with the following fields:
|
||||||
|
* <ul>
|
||||||
|
* <li> version : string </li>
|
||||||
|
* </ul>
|
||||||
|
*
|
||||||
|
* On errors, returns an XML-RPC error response.
|
||||||
|
* The possible error codes and error message are:
|
||||||
|
* <ul>
|
||||||
|
* <li> 3 - Incorrect parameters passed to method:
|
||||||
|
* Wanted ... , got ... at param </li>
|
||||||
|
* <li> 801 - wrong 1st parameter, struct expected.</li>
|
||||||
|
* <li> 805 - xr_getVersion:
|
||||||
|
* <message from lower layer> </li>
|
||||||
|
* </ul>
|
||||||
|
*
|
||||||
|
* @param input XMLRPC struct
|
||||||
|
* @return XMLRPC struct
|
||||||
|
* @see Subjects::getVersion
|
||||||
|
*/
|
||||||
|
function xr_getVersion($input)
|
||||||
|
{
|
||||||
|
list($ok, $r) = $this->_xr_getPars($input);
|
||||||
|
if(!$ok) return $r;
|
||||||
|
$res = $this->getVersion();
|
||||||
|
if(PEAR::isError($res)){
|
||||||
|
return new XML_RPC_Response(0, 805,
|
||||||
|
"xr_getVersion: ".$res->getMessage().
|
||||||
|
" ".$res->getUserInfo()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return new XML_RPC_Response(
|
||||||
|
XML_RPC_encode(array('version'=>$res))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/* ------------------------------------------------------- authentication */
|
/* ------------------------------------------------------- authentication */
|
||||||
/**
|
/**
|
||||||
* Checks the login name and password of the user and return
|
* Checks the login name and password of the user and return
|
||||||
|
|
|
@ -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/xrLocStor.php,v $
|
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/xmlrpc/xrLocStor.php,v $
|
||||||
|
|
||||||
------------------------------------------------------------------------------*/
|
------------------------------------------------------------------------------*/
|
||||||
|
@ -78,6 +78,7 @@ $locStor = &new XR_LocStor($dbc, $config);
|
||||||
$methods = array(
|
$methods = array(
|
||||||
'test' => 'Tests toupper and checks sessid, params: '.
|
'test' => 'Tests toupper and checks sessid, params: '.
|
||||||
'teststring, sessid.',
|
'teststring, sessid.',
|
||||||
|
'getVersion' => 'Dummy function for connection testing.',
|
||||||
'authenticate' => 'Checks authentication.',
|
'authenticate' => 'Checks authentication.',
|
||||||
'login' => 'Login to storage.',
|
'login' => 'Login to storage.',
|
||||||
'logout' => 'Logout from storage.',
|
'logout' => 'Logout from storage.',
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
|
|
||||||
|
|
||||||
Author : $Author: tomas $
|
Author : $Author: tomas $
|
||||||
Version : $Revision: 1.6 $
|
Version : $Revision: 1.7 $
|
||||||
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 $
|
||||||
|
|
||||||
------------------------------------------------------------------------------*/
|
------------------------------------------------------------------------------*/
|
||||||
|
@ -64,6 +64,8 @@ $infos = array(
|
||||||
"methodSignature" => array('m'=>"system.methodSignature", 'p'=>0),
|
"methodSignature" => array('m'=>"system.methodSignature", 'p'=>0),
|
||||||
"test" =>
|
"test" =>
|
||||||
array('m'=>"locstor.test", 'p'=>array('sessid', 'teststring')),
|
array('m'=>"locstor.test", 'p'=>array('sessid', 'teststring')),
|
||||||
|
"getVersion" => array('m'=>"locstor.getVersion",
|
||||||
|
'p'=>array(), 'r'=>'version'),
|
||||||
"authenticate" => array('m'=>"locstor.authenticate",
|
"authenticate" => array('m'=>"locstor.authenticate",
|
||||||
'p'=>array('login', 'pass'), 'r'=>'authenticate'),
|
'p'=>array('login', 'pass'), 'r'=>'authenticate'),
|
||||||
"login" => array('m'=>"locstor.login",
|
"login" => array('m'=>"locstor.login",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue