/**
  * Output the content of the resource
  *
  * @param array $options An array of options for the output
  */
 public function outputContent(array $options = array())
 {
     if (empty($options['rpc_type'])) {
         $options['rpc_type'] = 'XML';
     }
     $resourceClass = 'mod' . $options['rpc_type'] . 'RPCResource';
     if (!$this->modx->resource instanceof $resourceClass) {
         $this->modx->log(modX::LOG_LEVEL_FATAL, 'Could not load ' . $options['rpc_type'] . '-RPC Server class.');
     }
     $this->modx->resource->process();
     $this->modx->resource->_output = $this->modx->resource->_content;
     /* collect any uncached element tags in the content and process them */
     $this->modx->getParser();
     $maxIterations = intval($this->modx->getOption('parser_max_iterations', null, 10));
     $this->modx->parser->processElementTags('', $this->modx->resource->_output, true, false, '[[', ']]', array(), $maxIterations);
     $this->modx->parser->processElementTags('', $this->modx->resource->_output, true, true, '[[', ']]', array(), $maxIterations);
     if (!$this->getServer()) {
         $this->modx->log(modX::LOG_LEVEL_FATAL, 'Could not load ' . $options['rpc_type'] . '-RPC Server.');
     }
     $this->server->service();
     ob_get_level() && @ob_end_flush();
     while (ob_get_level() && @ob_end_clean()) {
     }
     exit;
 }
 function index($request)
 {
     // Create an xmlrpc server, and set up the method calls
     $service = new xmlrpc_server(array("blogger.getUsersBlogs" => array("function" => array($this, "getUsersBlogs")), "metaWeblog.getRecentPosts" => array('function' => array($this, 'getRecentPosts')), 'metaWeblog.getCategories' => array('function' => array($this, 'getCategories'))), false);
     // Use nice php functions, and call the service
     $service->functions_parameters_type = 'phpvals';
     $service->service();
     // Tell SilverStripe not to try render a template
     return false;
 }
Example #3
0
	public function service()
	{
		$app = JFactory::getApplication();

		$params = JComponentHelper::getParams('com_xmlrpc');

		$plugin = $params->get('plugin', 'joomla');

		JPluginHelper::importPlugin('xmlrpc', strtolower($plugin));
		$allCalls = $app->triggerEvent('onGetWebServices');
		if(count($allCalls) < 1){
			JError::raiseError(404, JText::_('COM_XMLRPC_SERVICE_WAS_NOT_FOUND'));
		}

		$methodsArray = array();

		foreach ($allCalls as $calls) {
			$methodsArray = array_merge($methodsArray, $calls);
		}

		@mb_regex_encoding('UTF-8');
		@mb_internal_encoding('UTF-8');

		require_once dirname(__FILE__).'/libraries/phpxmlrpc/xmlrpc.php';
		require_once dirname(__FILE__).'/libraries/phpxmlrpc/xmlrpcs.php';
		require_once (JPATH_SITE.'/components/com_content/helpers/route.php');
		JTable::addIncludePath(JPATH_ADMINISTRATOR.'/components/com_content/tables');

		$xmlrpc = new xmlrpc_server($methodsArray, false);
		$xmlrpc->functions_parameters_type = 'phpvals';

		$encoding = 'UTF-8';

		$xmlrpc->xml_header($encoding);
		$GLOBALS['xmlrpc_internalencoding'] = $encoding;
		$xmlrpc->setDebug($params->get('debug', JDEBUG));
		@ini_set( 'display_errors', $params->get('display_errors', 0));

		$data = file_get_contents('php://input');

		if(empty($data)){
			JError::raiseError(403, JText::_('COM_XMLRPC_INVALID_REQUEST'));
		}

		$xmlrpc->service($data);

		jexit();
	}
 /**
  * Handles incoming requests to the kapost service
  */
 public function index()
 {
     //If the request is not a post request 404
     if (!$this->request->isPOST()) {
         return ErrorPage::response_for(404);
     }
     //If the request is not the kapost user agent 404
     if (self::config()->check_user_agent == true && $this->request->getHeader('User-Agent') != 'Kapost XMLRPC::Client') {
         return ErrorPage::response_for(404);
     }
     $methods = array_fill_keys($this->exposed_methods, array('function' => array($this, 'handleRPCMethod')));
     //Disable Content Negotiator and send the text/xml header (which kapost expects)
     ContentNegotiator::config()->enabled = false;
     $this->response->addHeader('Content-Type', 'text/xml');
     $server = new xmlrpc_server($methods, false);
     $server->compress_response = true;
     if (Director::isDev()) {
         $server->setDebug(3);
         //Base 64 encoded debug information is included in the response
         $server->exception_handling = 2;
         //Exception's sent to the client
     }
     //Force the internal encoding of the XMLRPC library to utf-8
     $GLOBALS['xmlrpc_internalencoding'] = self::config()->database_charset;
     return $server->service($this->request->getBody(), true);
 }
Example #5
0
 public function display($cachable = false, $urlparams = array())
 {
     $mainframe = JFactory::getApplication();
     $methodsArray = $this->_getServices();
     $xmlrpcServer = new xmlrpc_server($methodsArray, false);
     // allow casting to be defined by that actual values passed
     $xmlrpcServer->functions_parameters_type = 'phpvals';
     // define UTF-8 as the internal encoding for the XML-RPC server
     $defaultEncoding = 'UTF-8';
     $xmlrpcServer->xml_header($defaultEncoding);
     $xmlrpc_internalencoding = $defaultEncoding;
     // debug level
     $xmlrpcServer->setDebug(0);
     // start the service
     $xmlrpcServer->service();
     exit;
 }
 public function import()
 {
     global $xmlrpcString, $xmlrpcBase64, $xmlrpc_internalencoding;
     /*
     		$db = JFactory::getDBO();
     		$query = $db->getQuery(true);
     		$query->select($db->quoteName('element'));
     		$query->from($db->quoteName('#__extensions'));
     		$query->where($db->quoteName('type') . ' = ' . $db->quote('library'));
     		$query->where($db->quoteName('element') . ' = ' . $db->quote('xmlrpc'));
     		$query->where($db->quoteName('enabled') . ' = 1');
     		$db->setQuery($query);
     		
     		if ($db->loadResult() == null)
     		{
     			echo '<?xml version="1.0"?>
     				<methodResponse><params><param><value><array><data><value><struct>
     				<member><name>code</name><value><int>15</int></value></member>
     				<member><name>string</name><value><string>XMLRC not supported</string></value></member>
     				</struct></value></data></array></value></param></params></methodResponse>';
     			return;	
     		}
     */
     $app = JFactory::getApplication();
     $params = JComponentHelper::getParams('com_j2xml');
     $xmlrpcServer = new xmlrpc_server(array('j2xml.import' => array('function' => 'plgXMLRPCJ2XMLServices::import', 'docstring' => 'Import articles from xml file', 'signature' => array(array($xmlrpcString, $xmlrpcBase64, $xmlrpcString, $xmlrpcString)))), false);
     // allow casting to be defined by that actual values passed
     $xmlrpcServer->functions_parameters_type = 'phpvals';
     // define UTF-8 as the internal encoding for the XML-RPC server
     $xmlrpcServer->xml_header('UTF-8');
     $xmlrpc_internalencoding = 'UTF-8';
     // debug level
     $xmlrpcServer->setDebug($params->get('debug'));
     // start the service
     $xmlrpcServer->service();
 }
Example #7
0
/* used for global variables */
$GLOBALS['exttMbqVarArr']['microtime'] = microtime();
if (function_exists('set_magic_quotes_runtime')) {
    @set_magic_quotes_runtime(0);
}
if (isset($_SERVER['HTTP_X_PHPDEBUG']) && $_SERVER['HTTP_X_PHPDEBUG']) {
    error_reporting($_SERVER['HTTP_X_PHPDEBUG']);
} else {
    error_reporting(0);
    ini_set('display_errors', '0');
}
$mobiquo_dir = 'mobiquo';
include_once 'lib/classTTJson.php';
include_once 'lib/classTTConnection.php';
require 'pretreat.php';
define('SMF', 1);
require 'MbqDataPage.php';
require 'lib/xmlrpc.inc';
require 'lib/xmlrpcs.inc';
require 'server_define.php';
require 'mobiquo_common.php';
require 'mobiquo_action.php';
require 'env_setting.php';
require 'smf_entry.php';
require 'xmlrpcresp.php';
$rpcServer = new xmlrpc_server($server_param, false);
$rpcServer->setDebug(1);
$rpcServer->compress_response = true;
$rpcServer->response_charset_encoding = 'UTF-8';
$rpcServer->service($server_data);
exit;
Example #8
0
	ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
	(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
	LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
	ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
	(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
	SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

	The views and conclusions contained in the software and documentation are those
	of the authors and should not be interpreted as representing official policies,
	either expressed or implied, of the NAS4Free Project.
*/
require_once "config.inc";
require_once "util.inc";
require_once "system.inc";
require_once "XMLRPC/xmlrpc.inc";
require_once "XMLRPC/xmlrpcs.inc";
function xmlrpc_system_getinfo($xmlrpcmsg)
{
    $value = system_get_sysinfo();
    return new xmlrpcresp(php_xmlrpc_encode($value));
}
// When an XML-RPC request is sent to this script, it can be found in the
// raw post data.
$request_xml = file_get_contents("php://input");
if (empty($request_xml)) {
    die;
}
// Create XMLRPC server.
$xmlrpc_server = new xmlrpc_server(array("systemGetInfo" => array("function" => "xmlrpc_system_getinfo", "signature" => array(array($xmlrpcStruct)), "docstring" => "Get various system informations.")), false);
// Process request.
$xmlrpc_server->service($request_xml);
Example #9
0
ob_start();
include './include/xmlrpc.inc';
include './include/xmlrpcs.inc';
include './config/config.php';
include './mobiquo_common.php';
define('PHPBB_MSG_HANDLER', 'xmlrpc_error_handler');
register_shutdown_function('xmlrpc_shutdown');
include $phpbb_root_path . 'common.' . $phpEx;
error_reporting(MOBIQUO_DEBUG);
if (MOBIQUO_DEBUG == 0) {
    ob_start();
}
require './server_define.php';
require './env_setting.php';
require './xmlrpcresp.php';
if ($request_file && isset($server_param[$request_method])) {
    if (strpos($request_file, 'm_') === 0) {
        require './function/moderation.php';
    } else {
        require './function/' . $request_file . '.php';
    }
} else {
    require 'web.php';
    exit;
}
$rpcServer = new xmlrpc_server($server_param, false);
$rpcServer->setDebug(1);
$rpcServer->compress_response = 'true';
$rpcServer->response_charset_encoding = 'UTF-8';
$rpcServer->service();
exit;
Example #10
0
            $status = false;
            // Replace "error" strings with their real, localised form
            $error = preg_replace('#^([A-Z_]+)$#e', "(!empty(\$user->lang['\\1'])) ? \$user->lang['\\1'] : '\\1'", $error);
            if (!$config['allow_avatar'] && $user->data['user_avatar_type']) {
                $error[] = $user->lang['AVATAR_NOT_ALLOWED'];
            } else {
                if ($user->data['user_avatar_type'] == AVATAR_UPLOAD && !$config['allow_avatar_upload'] || $user->data['user_avatar_type'] == AVATAR_REMOTE && !$config['allow_avatar_remote'] || $user->data['user_avatar_type'] == AVATAR_GALLERY && !$config['allow_avatar_local']) {
                    $error[] = $user->lang['AVATAR_TYPE_NOT_ALLOWED'];
                }
            }
        }
    }
    $warn_msg = strip_tags(join("\n", $error));
}
require './server_define.php';
$rpcServer = new xmlrpc_server($server_param, false);
$rpcServer->setDebug(1);
$rpcServer->compress_response = 'true';
$rpcServer->response_charset_encoding = 'UTF-8';
$raw_data = '<?xml version="1.0"?><methodCall><methodName>' . $_POST['method_name'] . '</methodName><params></params></methodCall>';
$response = $rpcServer->service($raw_data);
function upload_attach_func()
{
    global $attachment_id, $group_id, $warn_msg;
    $xmlrpc_result = new xmlrpcval(array('attachment_id' => new xmlrpcval($attachment_id), 'group_id' => new xmlrpcval($group_id), 'result' => new xmlrpcval($attachment_id ? true : false, 'boolean'), 'result_text' => new xmlrpcval(strip_tags($warn_msg), 'base64')), 'struct');
    return new xmlrpcresp($xmlrpc_result);
}
function upload_avatar_func()
{
    global $status, $warn_msg;
    $xmlrpc_result = new xmlrpcval(array('result' => new xmlrpcval($status, 'boolean'), 'result_text' => new xmlrpcval($warn_msg, 'base64')), 'struct');
Example #11
0
$user_info['id'] = $ID_MEMBER;
require_once './Mobiquo-Functions.php';
require_once './Mobiquo-Templates.php';
require_once './lib/xmlrpc.inc';
require_once './lib/xmlrpcs.inc';
require_once './method_define.php';
require_once './api/forum.php';
require_once './api/topic.php';
require_once './api/subscription.php';
require_once './api/search.php';
require_once './api/user.php';
require_once './api/post.php';
require_once './api/moderation.php';
header('Mobiquo_is_login: '******'is_guest'] ? 'false' : 'true'));
header('Content-type: text/xml');
$rpcServer = new xmlrpc_server($methods, false);
$rpcServer->setDebug(1);
$rpcServer->compress_response = true;
$rpcServer->response_charset_encoding = 'UTF-8';
$pass = $rpcServer->service();
if ($pass !== false) {
    exit;
}
// Load settings and the database
loadMobiquoSettings();
// Parse the request
parseMobRequest();
// Are we closed?
if (!empty($context['in_maintenance']) && !$user_info['is_admin'] && !in_array($context['mob_request']['method'], array('get_config', 'login'))) {
    createErrorResponse(5, ' due to maintenance');
}
Example #12
0
<?php

/**
 * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
 * CC-BY License - http://creativecommons.org/licenses/by/3.0/
 */
$GLOBALS['bx_profiler_disable'] = 1;
include "../inc/header.inc.php";
require_once BX_DIRECTORY_PATH_INC . 'admin.inc.php';
require_once BX_DIRECTORY_PATH_ROOT . 'xmlrpc/BxDolXMLRPCUtil.php';
require_once BX_DIRECTORY_PATH_ROOT . 'xmlrpc/BxDolXMLRPCUser.php';
require_once BX_DIRECTORY_PATH_ROOT . 'xmlrpc/BxDolXMLRPCMessages.php';
require_once BX_DIRECTORY_PATH_ROOT . 'xmlrpc/BxDolXMLRPCSearch.php';
require_once BX_DIRECTORY_PATH_ROOT . 'xmlrpc/BxDolXMLRPCFriends.php';
require_once BX_DIRECTORY_PATH_ROOT . 'xmlrpc/BxDolXMLRPCMedia.php';
require_once BX_DIRECTORY_PATH_ROOT . 'xmlrpc/BxDolXMLRPCImages.php';
require_once BX_DIRECTORY_PATH_ROOT . 'xmlrpc/BxDolXMLRPCMediaAudio.php';
require_once BX_DIRECTORY_PATH_ROOT . 'xmlrpc/BxDolXMLRPCMediaVideo.php';
require_once BX_DIRECTORY_PATH_ROOT . 'xmlrpc/BxDolXMLRPCProfileView.php';
require_once BX_DIRECTORY_PATH_ROOT . 'xmlrpc/lib/xmlrpc.inc';
require_once BX_DIRECTORY_PATH_ROOT . 'xmlrpc/lib/xmlrpcs.inc';
require_once BX_DIRECTORY_PATH_ROOT . 'xmlrpc/lib/xmlrpc_wrappers.inc';
$s = new xmlrpc_server(array("dolphin.concat" => array("function" => "BxDolXMLRPCUtil::concat", "signature" => array(array($xmlrpcString, $xmlrpcString, $xmlrpcString)), "docstring" => "concat two strings"), "dolphin.getContacts" => array("function" => "BxDolXMLRPCUtil::getContacts", "signature" => array(array($xmlrpcArray, $xmlrpcString, $xmlrpcString)), "docstring" => "get user contacts"), "dolphin.getCountries" => array("function" => "BxDolXMLRPCUtil::getCountries", "signature" => array(array($xmlrpcArray, $xmlrpcString, $xmlrpcString, $xmlrpcString)), "docstring" => "get countries list"), "dolphin.service" => array("function" => "BxDolXMLRPCUtil::service", "signature" => array(array($xmlrpcString, $xmlrpcString, $xmlrpcString, $xmlrpcArray, $xmlrpcString)), "docstring" => "perform serice call"), "dolphin.login" => array("function" => "BxDolXMLRPCUser::login", "signature" => array(array($xmlrpcInt, $xmlrpcString, $xmlrpcString)), "docstring" => "returns user id on success or 0 if login failed"), "dolphin.login2" => array("function" => "BxDolXMLRPCUser::login2", "signature" => array(array($xmlrpcInt, $xmlrpcString, $xmlrpcString)), "docstring" => "returns user id on success or 0 if login failed (v.2)"), "dolphin.login4" => array("function" => "BxDolXMLRPCUser::login4", "signature" => array(array($xmlrpcInt, $xmlrpcString, $xmlrpcString)), "docstring" => "returns user id on success or 0 if login failed (v.4)"), "dolphin.getHomepageInfo" => array("function" => "BxDolXMLRPCUser::getHomepageInfo", "signature" => array(array($xmlrpcStruct, $xmlrpcString, $xmlrpcString)), "docstring" => "return logged in user information to dispay on homepage"), "dolphin.getHomepageInfo2" => array("function" => "BxDolXMLRPCUser::getHomepageInfo2", "signature" => array(array($xmlrpcStruct, $xmlrpcString, $xmlrpcString, $xmlrpcString)), "docstring" => "return logged in user information to dispay on homepage (v.2)"), "dolphin.getUserInfo" => array("function" => "BxDolXMLRPCUser::getUserInfo", "signature" => array(array($xmlrpcStruct, $xmlrpcString, $xmlrpcString, $xmlrpcString, $xmlrpcString)), "docstring" => "return user information"), "dolphin.getUserInfo2" => array("function" => "BxDolXMLRPCUser::getUserInfo2", "signature" => array(array($xmlrpcStruct, $xmlrpcString, $xmlrpcString, $xmlrpcString, $xmlrpcString)), "docstring" => "return user information (v.2)"), "dolphin.getUserInfoExtra" => array("function" => "BxDolXMLRPCUser::getUserInfoExtra", "signature" => array(array($xmlrpcArray, $xmlrpcString, $xmlrpcString, $xmlrpcString, $xmlrpcString)), "docstring" => "return extended users information"), "dolphin.updateStatusMessage" => array("function" => "BxDolXMLRPCUser::updateStatusMessage", "signature" => array(array($xmlrpcString, $xmlrpcString, $xmlrpcString, $xmlrpcString)), "docstring" => "update user status message, returns 0 on error, or 1 on success"), "dolphin.getUserLocation" => array("function" => "BxDolXMLRPCUser::getUserLocation", "signature" => array(array($xmlrpcStruct, $xmlrpcString, $xmlrpcString, $xmlrpcString)), "docstring" => "get user location, returns struct on succees, 0 on error, -1 on access denied"), "dolphin.updateUserLocation" => array("function" => "BxDolXMLRPCUser::updateUserLocation", "signature" => array(array($xmlrpcString, $xmlrpcString, $xmlrpcString, $xmlrpcString, $xmlrpcString, $xmlrpcString, $xmlrpcString)), "docstring" => "update user location, returns 1 on succees, 0 on error"), "dolphin.getMessagesInbox" => array("function" => "BxDolXMLRPCMessages::getMessagesInbox", "signature" => array(array($xmlrpcArray, $xmlrpcString, $xmlrpcString)), "docstring" => "get user's inbox messages"), "dolphin.getMessagesSent" => array("function" => "BxDolXMLRPCMessages::getMessagesSent", "signature" => array(array($xmlrpcArray, $xmlrpcString, $xmlrpcString)), "docstring" => "get user's sent messages"), "dolphin.getMessageInbox" => array("function" => "BxDolXMLRPCMessages::getMessageInbox", "signature" => array(array($xmlrpcStruct, $xmlrpcString, $xmlrpcString, $xmlrpcString)), "docstring" => "get user's inbox message"), "dolphin.getMessageSent" => array("function" => "BxDolXMLRPCMessages::getMessageSent", "signature" => array(array($xmlrpcScruct, $xmlrpcString, $xmlrpcString, $xmlrpcString)), "docstring" => "get user's sent message"), "dolphin.sendMessage" => array("function" => "BxDolXMLRPCMessages::sendMessage", "signature" => array(array($xmlrpcScruct, $xmlrpcString, $xmlrpcString, $xmlrpcString, $xmlrpcString, $xmlrpcString, $xmlrpcString)), "docstring" => "send message"), "dolphin.getSeachHomeMenu3" => array("function" => "BxDolXMLRPCSearch::getSeachHomeMenu3", "signature" => array(array($xmlrpcStruct, $xmlrpcString, $xmlrpcString, $xmlrpcString)), "docstring" => "get search homepage menu"), "dolphin.getSearchResultsLocation" => array("function" => "BxDolXMLRPCSearch::getSearchResultsLocation", "signature" => array(array($xmlrpcArray, $xmlrpcString, $xmlrpcString, $xmlrpcString, $xmlrpcString, $xmlrpcString, $xmlrpcString, $xmlrpcString, $xmlrpcString, $xmlrpcString)), "docstring" => "get search results by location"), "dolphin.getSearchResultsKeyword" => array("function" => "BxDolXMLRPCSearch::getSearchResultsKeyword", "signature" => array(array($xmlrpcArray, $xmlrpcString, $xmlrpcString, $xmlrpcString, $xmlrpcString, $xmlrpcString, $xmlrpcString, $xmlrpcString, $xmlrpcString)), "docstring" => "get search results by keyword"), "dolphin.getSearchResultsNearMe" => array("function" => "BxDolXMLRPCSearch::getSearchResultsNearMe", "signature" => array(array($xmlrpcArray, $xmlrpcString, $xmlrpcString, $xmlrpcString, $xmlrpcString, $xmlrpcString, $xmlrpcString, $xmlrpcString, $xmlrpcString, $xmlrpcString)), "docstring" => "get search results near specified location"), "dolphin.getFriends" => array("function" => "BxDolXMLRPCFriends::getFriends", "signature" => array(array($xmlrpcArray, $xmlrpcString, $xmlrpcString, $xmlrpcString, $xmlrpcString)), "docstring" => "get user's friends"), "dolphin.getFriendRequests" => array("function" => "BxDolXMLRPCFriends::getFriendRequests", "signature" => array(array($xmlrpcArray, $xmlrpcString, $xmlrpcString, $xmlrpcString)), "docstring" => "get friend requests"), "dolphin.declineFriendRequest" => array("function" => "BxDolXMLRPCFriends::declineFriendRequest", "signature" => array(array($xmlrpcString, $xmlrpcString, $xmlrpcString, $xmlrpcString)), "docstring" => "decline friend request"), "dolphin.acceptFriendRequest" => array("function" => "BxDolXMLRPCFriends::acceptFriendRequest", "signature" => array(array($xmlrpcString, $xmlrpcString, $xmlrpcString, $xmlrpcString)), "docstring" => "accept friend request"), "dolphin.removeFriend" => array("function" => "BxDolXMLRPCFriends::removeFriend", "signature" => array(array($xmlrpcString, $xmlrpcString, $xmlrpcString, $xmlrpcString)), "docstring" => "remove friend"), "dolphin.addFriend" => array("function" => "BxDolXMLRPCFriends::addFriend", "signature" => array(array($xmlrpcString, $xmlrpcString, $xmlrpcString, $xmlrpcString, $xmlrpcString)), "docstring" => "add friend"), "dolphin.removeImage" => array("function" => "BxDolXMLRPCImages::removeImage", "signature" => array(array($xmlrpcString, $xmlrpcString, $xmlrpcString, $xmlrpcString)), "docstring" => "remove user image by id"), "dolphin.makeThumbnail" => array("function" => "BxDolXMLRPCImages::makeThumbnail", "signature" => array(array($xmlrpcString, $xmlrpcString, $xmlrpcString, $xmlrpcString)), "docstring" => "make primary image by image id"), "dolphin.getImageAlbums" => array("function" => "BxDolXMLRPCImages::getImageAlbums", "signature" => array(array($xmlrpcArray, $xmlrpcString, $xmlrpcString, $xmlrpcString)), "docstring" => "get profile's images albums"), "dolphin.uploadImage" => array("function" => "BxDolXMLRPCImages::uploadImage", "signature" => array(array($xmlrpcString, $xmlrpcString, $xmlrpcString, $xmlrpcString, $xmlrpcBase64, $xmlrpcString, $xmlrpcString, $xmlrpcString, $xmlrpcString)), "docstring" => "upload new image"), "dolphin.getImagesInAlbum" => array("function" => "BxDolXMLRPCImages::getImagesInAlbum", "signature" => array(array($xmlrpcArray, $xmlrpcString, $xmlrpcString, $xmlrpcString, $xmlrpcString)), "docstring" => "get profile's images in specified album"), "dolphin.removeAudio" => array("function" => "BxDolXMLRPCMediaAudio::removeAudio5", "signature" => array(array($xmlrpcString, $xmlrpcString, $xmlrpcString, $xmlrpcString)), "docstring" => "remove user sound by id (v.5)"), "dolphin.getAudioAlbums" => array("function" => "BxDolXMLRPCMediaAudio::getAudioAlbums", "signature" => array(array($xmlrpcArray, $xmlrpcString, $xmlrpcString, $xmlrpcString)), "docstring" => "get profile's sound albums"), "dolphin.getAudioInAlbum" => array("function" => "BxDolXMLRPCMediaAudio::getAudioInAlbum", "signature" => array(array($xmlrpcArray, $xmlrpcString, $xmlrpcString, $xmlrpcString, $xmlrpcString)), "docstring" => "get profile's sounds in specified album"), "dolphin.removeVideo" => array("function" => "BxDolXMLRPCMediaVideo::removeVideo5", "signature" => array(array($xmlrpcString, $xmlrpcString, $xmlrpcString, $xmlrpcString)), "docstring" => "remove user video by id (v.5)"), "dolphin.getVideoAlbums" => array("function" => "BxDolXMLRPCMediaVideo::getVideoAlbums", "signature" => array(array($xmlrpcArray, $xmlrpcString, $xmlrpcString, $xmlrpcString)), "docstring" => "get profile's video albums"), "dolphin.uploadVideo" => array("function" => "BxDolXMLRPCMediaVideo::uploadVideo5", "signature" => array(array($xmlrpcString, $xmlrpcString, $xmlrpcString, $xmlrpcString, $xmlrpcBase64, $xmlrpcString, $xmlrpcString, $xmlrpcString, $xmlrpcString, $xmlrpcString)), "docstring" => "upload new video (v.5)"), "dolphin.getVideoInAlbum" => array("function" => "BxDolXMLRPCMediaVideo::getVideoInAlbum", "signature" => array(array($xmlrpcArray, $xmlrpcString, $xmlrpcString, $xmlrpcString, $xmlrpcString)), "docstring" => "get profile's video in specified album")), 0);
$s->functions_parameters_type = 'phpvals';
$GLOBALS['xmlrpc_internalencoding'] = 'UTF-8';
$s->service();
Example #13
0
<?php

if (isset($GLOBALS['HTTP_RAW_POST_DATA'])) {
    if (defined('XMLRPCDBG')) {
        logfile(array($GLOBALS['HTTP_RAW_POST_DATA']), 'xmlrpcdbglog');
    }
}
include_once FLGR_COMMON . '/rfunctions.php';
$xmlrpc_server = new xmlrpc_server($manifesto_xmlrpc, false);
//dbg($xmlrpc_server, 'server object');
$xmlrpc_server->setdebug(3);
//$xmlrpc_server->compress_response = true;
$xmlrpc_server->compress_response = false;
//$xmlrpc_server->allow_system_funcs = false;
$xmlrpc_server->debug = false;
// out-of-band information: let the client manipulate the server operations.
// we do this to help the testsuite script: do not reproduce in production!
if (isset($_GET['RESPONSE_ENCODING'])) {
    $xmlrpc_server->response_charset_encoding = $_GET['RESPONSE_ENCODING'];
}
$xmlrpc_server->service();
// that should do all we need!
exit;
Example #14
0
        $meta_tags = array_unique($meta_tags);
        foreach ($meta_tags as $key => $value) {
            $structArray[] = new xmlrpcval(array('tag_id' => new xmlrpcval($key, 'string'), 'name' => new xmlrpcval($value, 'string'), 'count' => new xmlrpcval('1', 'string'), 'slug' => new xmlrpcval('1', 'string'), 'html_url' => new xmlrpcval('1', 'string'), 'rss_url' => new xmlrpcval('1', 'string')), 'struct');
        }
        return new xmlrpcresp(new xmlrpcval($structArray, 'array'));
        // Return type is struct[] (array of struct)
    } else {
        return new xmlrpcresp(0, $xmlrpcerruser + 1, 'Login Failed');
    }
}
//
//METHODS DECLARATION
//
$o = new xmlrpc_server_methods_container();
$a = array('blogger.getUsersBlogs' => array('function' => 'getUsersBlogs', 'docstring' => $getUsersBlogs_doc, 'signature' => $getUsersBlogs_sig), 'metaWeblog.newPost' => array('function' => 'newPost', 'signature' => $newPost_sig, 'docstring' => $newPost_doc), 'metaWeblog.editPost' => array('function' => 'editPost', 'signature' => $editPost_sig, 'docstring' => $editPost_doc), 'metaWeblog.getPost' => array('function' => 'getPost', 'signature' => $getPost_sig, 'docstring' => $getPost_doc), 'metaWeblog.getRecentPosts' => array('function' => 'getRecentPosts', 'signature' => $getRecentPosts_sig, 'docstring' => $getRecentPosts_doc), 'metaWeblog.getCategories' => array('function' => 'getCategories', 'signature' => $getCategories_sig, 'docstring' => $getCategories_doc), 'metaWeblog.newMediaObject' => array('function' => 'newMediaObject', 'signature' => $newMediaObject_sig, 'docstring' => $newMediaObject_doc), 'blogger.deletePost' => array('function' => 'deletePost', 'docstring' => 'Deletes a post.', 'signature' => array(array($xmlrpcBoolean, $xmlrpcString, $xmlrpcString, $xmlrpcString, $xmlrpcString, $xmlrpcBoolean))), 'wp.getPage' => array('function' => 'getPage', 'signature' => $getPage_sig, 'docstring' => $getPage_doc), 'wp.getPages' => array('function' => 'getPages', 'signature' => $getPages_sig, 'docstring' => $getPages_doc), 'wp.newPage' => array('function' => 'newPage', 'signature' => $newPage_sig, 'docstring' => $newPage_doc), 'wp.deletePage' => array('function' => 'deletePage', 'signature' => $deletePage_sig, 'docstring' => $deletePage_doc), 'wp.editPage' => array('function' => 'editPage', 'signature' => $editPage_sig, 'docstring' => $editPage_doc), 'wp.getPageList' => array('function' => 'getPageList', 'signature' => $getPageList_sig, 'docstring' => $getPageList_doc), 'wp.getAuthors' => array('function' => 'getAuthors', 'signature' => $getAuthors_sig, 'docstring' => $getAuthors_doc), 'wp.getCategories' => array('function' => 'getCategories', 'signature' => $getCategories_sig, 'docstring' => $getCategories_doc), 'wp.getTags' => array('function' => 'getTags', 'signature' => $getTags_sig, 'docstring' => $getTags_doc), 'wp.newCategory' => array('function' => 'newCategory', 'signature' => $newCategory_sig, 'docstring' => $newCategory_doc), 'wp.deleteCategory' => array('function' => 'deleteCategory', 'signature' => $deleteCategory_sig, 'docstring' => $deleteCategory_doc), 'wp.uploadFile' => array('function' => 'newMediaObject', 'signature' => $newMediaObject_sig, 'docstring' => $newMediaObject_doc), 'mt.getCategoryList' => array('function' => 'getCategoryList', 'signature' => $getCategoryList_sig, 'docstring' => $getCategoryList_doc), 'mt.setPostCategories' => array('function' => 'setPostCategories', 'signature' => $setPostCategories_sig, 'docstring' => $setPostCategories_doc), 'mt.getPostCategories' => array('function' => 'getPostCategories', 'signature' => $getPostCategories_sig, 'docstring' => $getPostCategories_doc));
$s = new xmlrpc_server($a, false);
$s->setdebug(1);
$s->service();
// that should do all we need!
/*
 *********************************************
 ********** XML FUNCTIONS  *******************
 *********************************************
 */
//19/08/2009 13.36.16 unused!
function checkXmlElement($xml, $element)
{
    // DOMElement->getElementsByTagName() -- Gets elements by tagname
    // nodeValue : The value of this node, depending on its type.
    // Load XML File. You can use loadXML if you wish to load XML data from a string
    $objDOM = new DOMDocument();
Example #15
0
<?php

require_once "xmlrpc.inc";
require_once "xmlrpcs.inc";
require_once "OpenemrBillingServer.class.php";
require_once dirname(__FILE__) . "/../../includes/config.php";
$auth = false;
if ($_SERVER['PHP_AUTH_USER'] == $GLOBALS['oer_config']['freeb']['username'] && $_SERVER['PHP_AUTH_PW'] == $GLOBALS['oer_config']['freeb']['password']) {
    $auth = true;
}
session_start();
$oerbill = new OpenemrBillingServer($GLOBALS['xmlrpcerruser']);
$s = new xmlrpc_server(false, false);
if (!$auth) {
    header('WWW-Authenticate: Basic realm="Unauthorized Access Prohibited"');
    header("HTTP/1.0 401 Unauthorized");
    return new xmlrpcresp(0, &$oerbill->xmlrpcerruser, $GLOBALS['xmlrpcerruser']);
}
$s->registerMethods(&$oerbill);
$s->service();
Example #16
0
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details:
 *
 *         http://www.gnu.org/copyleft/gpl.html
 *
 * @category  Moodle
 * @package   webservice
 * @copyright Copyright (c) 1999 onwards Martin Dougiamas     http://dougiamas.com
 * @license   http://www.gnu.org/copyleft/gpl.html     GNU GPL License
 */
/**
 * Main script - XML-RPC server
 *
 * @author Jerome Mouneyrac <*****@*****.**>
 * @version 1.0
 * @package webservices
 */
/*
 * Zend XML-RPC server
 */
require_once dirname(__FILE__) . '/../../config.php';
require_once 'lib.php';
if (empty($CFG->enablewebservices)) {
    die;
}
$server = new xmlrpc_server();
$server->run();
include BASEDIR . 'modules/Forums/nukebb.php';
// Initialise tapatalk
include MOBIDIR . 'include/xmlrpc.inc';
include MOBIDIR . 'include/xmlrpcs.inc';
require MOBIDIR . 'error_code.php';
require MOBIDIR . 'config/config.php';
$mobiquo_config = get_mobiquo_config();
if (empty($mobiquo_config['is_open'])) {
    header("{$_SERVER['SERVER_PROTOCOL']} 503 Service Unavailable");
    exit;
}
require MOBIDIR . 'mobiquo_common.php';
require MOBIDIR . 'server_define.php';
$phpEx = $mobiquo_config['php_extension'];
$xmlrpc_internalencoding = 'UTF-8';
$xmlrpcName = 'DragonflyCMS/' . CPG_NUKE . ' (PHP ' . PHP_MAJOR_VERSION . '; ' . PHP_SAPI . '; ' . PHP_OS . ') XML-RPC Tapatalk/3';
$xmlrpcVersion = 'v' . $mobiquo_config['sys_version'];
header('Mobiquo_is_login:'******'true' : 'false'));
// Get requested function and load file
$request_method_name = get_method_name();
if ($request_method_name && isset($server_param[$request_method_name])) {
    require MOBIDIR . 'function/' . $request_method_name . '.php';
}
$rpcServer = new xmlrpc_server($server_param, false);
$rpcServer->setDebug(2);
$rpcServer->allow_system_funcs = false;
$rpcServer->compress_response = 'false';
$rpcServer->response_charset_encoding = 'UTF-8';
$response = $rpcServer->service();
ini_restore('log_errors');
exit;
 /**
  * Takes the xmlrpc object and generates the response to be set back
  * @param {xmlrpc_server} $server XML-RPC Server instance
  * @param {xmlrpcresp} $r XML-RPC Response object to relay to client
  * @return {string} Response to be sent to the client
  */
 protected function generateErrorResponse(xmlrpc_server $server, xmlrpcresp $r)
 {
     $this->response->addHeader('Content-Type', $r->content_type);
     $this->response->addHeader('Vary', 'Accept-Charset');
     $payload = $server->xml_header();
     if (empty($r->payload)) {
         $r->serialize();
     }
     $payload = $payload . $r->payload;
     return $payload;
 }
Example #19
0
    $sAuthHash = strtolower(md5($sXml . $sSecretKey));
    /* check authentication */
    if (strcmp($sAuthHash, $_GET['authHash']) != 0) {
        /* authentication failed - generate fault code and string */
        $aOutput = array('faultCode' => '-1', 'faultString' => 'authentication failed');
        $pResp = new xmlrpcresp(php_xmlrpc_encode($aOutput));
        echo $pResp->serialize();
    } else {
        /* authentication okay */
        /* set common signature for the methods */
        $aSignature = array(array($xmlrpcStruct, $xmlrpcStruct));
        $pMyGameClass = new TheGame();
        /* methods to be registered - $pMyGameClass is an instance of class TheGame */
        $aRegister = array('game.login' => array('function' => array($pMyGameClass, 'Login'), 'signature' => $aSignature), 'game.registerAndLogin' => array('function' => array($pMyGameClass, 'Register'), 'signature' => $aSignature), 'game.getUserStats' => array('function' => array($pMyGameClass, 'GetStats'), 'signature' => $aSignature), 'bookItem' => array('function' => array($pMyGameClass, 'BookItem'), 'signature' => $aSignature), 'blockedNotify' => array('function' => array($pMyGameClass, 'BlockedNotify'), 'signature' => $aSignature), 'getUserPaymentLanguage' => array('function' => array($pMyGameClass, 'GetUserPaymentLanguage'), 'signature' => $aSignature), 'getUserExchangeRate' => array('function' => array($pMyGameClass, 'GetUserExchangeRate'), 'signature' => $aSignature), 'currencySwap' => array('function' => array($pMyGameClass, 'CurrencySwap'), 'signature' => $aSignature));
        /* create server, set encoding and invoke */
        $pServer = new xmlrpc_server($aRegister, false);
        $pServer->response_charset_encoding = 'UTF-8';
        $pServer->service();
    }
}
/* example game class */
class TheGame
{
    function Login($pXml)
    {
        /* do your stuff here and return something like: */
        $aParams = php_xmlrpc_decode($pXml);
        $aParams = $aParams[0];
        $bpUserID = $aParams['bpUserID'];
        $login_id = $aParams['userID'];
        db("select * from user_accounts where login_id={$login_id} and bp_user_id={$bpUserID}");
    function testBrokenRequests()
    {
        $s = new xmlrpc_server();
        // omitting the 'params' tag: not tolerated by the lib anymore
        $f = '<?xml version="1.0"?>
<methodCall>
<methodName>system.methodHelp</methodName>
<param>
<value><string>system.methodHelp</string></value>
</param>
</methodCall>';
        $r = $s->parserequest($f);
        $this->assertEquals(15, $r->faultCode());
        // omitting a 'param' tag
        $f = '<?xml version="1.0"?>
<methodCall>
<methodName>system.methodHelp</methodName>
<params>
<value><string>system.methodHelp</string></value>
</params>
</methodCall>';
        $r = $s->parserequest($f);
        $this->assertEquals(15, $r->faultCode());
        // omitting a 'value' tag
        $f = '<?xml version="1.0"?>
<methodCall>
<methodName>system.methodHelp</methodName>
<params>
<param><string>system.methodHelp</string></param>
</params>
</methodCall>';
        $r = $s->parserequest($f);
        $this->assertEquals(15, $r->faultCode());
    }
Example #21
0
require_once JPATH_BASE . DS . 'includes' . DS . 'framework.php';
// We want to echo the errors so that the xmlrpc client has a chance to capture them in the payload
JError::setErrorHandling(E_ERROR, 'die');
JError::setErrorHandling(E_WARNING, 'echo');
JError::setErrorHandling(E_NOTICE, 'echo');
// create the mainframe object
$mainframe =& JFactory::getApplication('xmlrpc');
// Ensure that this application is enabled
if (!$mainframe->getCfg('xmlrpc_server')) {
    JError::raiseError(403, 'XML-RPC Server not enabled.');
}
// Includes the required class file for the XML-RPC Server
jimport('phpxmlrpc.xmlrpc');
jimport('phpxmlrpc.xmlrpcs');
// load all available remote calls
JPluginHelper::importPlugin('xmlrpc');
$allCalls = $mainframe->triggerEvent('onGetWebServices');
$methodsArray = array();
foreach ($allCalls as $calls) {
    $methodsArray = array_merge($methodsArray, $calls);
}
$xmlrpcServer = new xmlrpc_server($methodsArray, false);
// allow casting to be defined by that actual values passed
$xmlrpcServer->functions_parameters_type = 'phpvals';
// define UTF-8 as the internal encoding for the XML-RPC server
$xmlrpcServer->xml_header($mainframe->getEncoding());
$xmlrpc_internalencoding = $mainframe->getEncoding();
// debug level
$xmlrpcServer->setDebug(0);
// start the service
$xmlrpcServer->service();
    global $xmlrpcName, $xmlrpcVersion, $SERVER_SOFTWARE;
    $ret = array("toolkitDocsUrl" => "http://phpxmlrpc.sourceforge.net/", "toolkitName" => $xmlrpcName, "toolkitVersion" => $xmlrpcVersion, "toolkitOperatingSystem" => isset($SERVER_SOFTWARE) ? $SERVER_SOFTWARE : $_SERVER['SERVER_SOFTWARE']);
    return new xmlrpcresp(php_xmlrpc_encode($ret));
}
$o = new xmlrpc_server_methods_container();
$a = array("examples.getStateName" => array("function" => "findstate", "signature" => $findstate_sig, "docstring" => $findstate_doc), "examples.sortByAge" => array("function" => "agesorter", "signature" => $agesorter_sig, "docstring" => $agesorter_doc), "examples.addtwo" => array("function" => "addtwo", "signature" => $addtwo_sig, "docstring" => $addtwo_doc), "examples.addtwodouble" => array("function" => "addtwodouble", "signature" => $addtwodouble_sig, "docstring" => $addtwodouble_doc), "examples.stringecho" => array("function" => "stringecho", "signature" => $stringecho_sig, "docstring" => $stringecho_doc), "examples.echo" => array("function" => "echoback", "signature" => $echoback_sig, "docstring" => $echoback_doc), "examples.decode64" => array("function" => "echosixtyfour", "signature" => $echosixtyfour_sig, "docstring" => $echosixtyfour_doc), "examples.invertBooleans" => array("function" => "bitflipper", "signature" => $bitflipper_sig, "docstring" => $bitflipper_doc), "examples.generatePHPWarning" => array("function" => array($o, "phpwarninggenerator")), "examples.raiseException" => array("function" => array($o, "exceptiongenerator")), "examples.getallheaders" => array("function" => 'getallheaders_xmlrpc', "signature" => $getallheaders_sig, "docstring" => $getallheaders_doc), "examples.setcookies" => array("function" => 'setcookies', "signature" => $setcookies_sig, "docstring" => $setcookies_doc), "examples.getcookies" => array("function" => 'getcookies', "signature" => $getcookies_sig, "docstring" => $getcookies_doc), "mail.send" => array("function" => "mail_send", "signature" => $mail_send_sig, "docstring" => $mail_send_doc), "validator1.arrayOfStructsTest" => array("function" => "v1_arrayOfStructs", "signature" => $v1_arrayOfStructs_sig, "docstring" => $v1_arrayOfStructs_doc), "validator1.easyStructTest" => array("function" => "v1_easyStruct", "signature" => $v1_easyStruct_sig, "docstring" => $v1_easyStruct_doc), "validator1.echoStructTest" => array("function" => "v1_echoStruct", "signature" => $v1_echoStruct_sig, "docstring" => $v1_echoStruct_doc), "validator1.manyTypesTest" => array("function" => "v1_manyTypes", "signature" => $v1_manyTypes_sig, "docstring" => $v1_manyTypes_doc), "validator1.moderateSizeArrayCheck" => array("function" => "v1_moderateSizeArrayCheck", "signature" => $v1_moderateSizeArrayCheck_sig, "docstring" => $v1_moderateSizeArrayCheck_doc), "validator1.simpleStructReturnTest" => array("function" => "v1_simpleStructReturn", "signature" => $v1_simpleStructReturn_sig, "docstring" => $v1_simpleStructReturn_doc), "validator1.nestedStructTest" => array("function" => "v1_nestedStruct", "signature" => $v1_nestedStruct_sig, "docstring" => $v1_nestedStruct_doc), "validator1.countTheEntities" => array("function" => "v1_countTheEntities", "signature" => $v1_countTheEntities_sig, "docstring" => $v1_countTheEntities_doc), "interopEchoTests.echoString" => array("function" => "i_echoString", "signature" => $i_echoString_sig, "docstring" => $i_echoString_doc), "interopEchoTests.echoStringArray" => array("function" => "i_echoStringArray", "signature" => $i_echoStringArray_sig, "docstring" => $i_echoStringArray_doc), "interopEchoTests.echoInteger" => array("function" => "i_echoInteger", "signature" => $i_echoInteger_sig, "docstring" => $i_echoInteger_doc), "interopEchoTests.echoIntegerArray" => array("function" => "i_echoIntegerArray", "signature" => $i_echoIntegerArray_sig, "docstring" => $i_echoIntegerArray_doc), "interopEchoTests.echoFloat" => array("function" => "i_echoFloat", "signature" => $i_echoFloat_sig, "docstring" => $i_echoFloat_doc), "interopEchoTests.echoFloatArray" => array("function" => "i_echoFloatArray", "signature" => $i_echoFloatArray_sig, "docstring" => $i_echoFloatArray_doc), "interopEchoTests.echoStruct" => array("function" => "i_echoStruct", "signature" => $i_echoStruct_sig, "docstring" => $i_echoStruct_doc), "interopEchoTests.echoStructArray" => array("function" => "i_echoStructArray", "signature" => $i_echoStructArray_sig, "docstring" => $i_echoStructArray_doc), "interopEchoTests.echoValue" => array("function" => "i_echoValue", "signature" => $i_echoValue_sig, "docstring" => $i_echoValue_doc), "interopEchoTests.echoBase64" => array("function" => "i_echoBase64", "signature" => $i_echoBase64_sig, "docstring" => $i_echoBase64_doc), "interopEchoTests.echoDate" => array("function" => "i_echoDate", "signature" => $i_echoDate_sig, "docstring" => $i_echoDate_doc), "interopEchoTests.whichToolkit" => array("function" => "i_whichToolkit", "signature" => $i_whichToolkit_sig, "docstring" => $i_whichToolkit_doc));
if ($findstate2_sig) {
    $a['examples.php.getStateName'] = $findstate2_sig;
}
if ($findstate3_sig) {
    $a['examples.php2.getStateName'] = $findstate3_sig;
}
if ($findstate4_sig) {
    $a['examples.php3.getStateName'] = $findstate4_sig;
}
if ($findstate5_sig) {
    $a['examples.php4.getStateName'] = $findstate5_sig;
}
$s = new xmlrpc_server($a, false);
$s->setdebug(3);
$s->compress_response = true;
// out-of-band information: let the client manipulate the server operations.
// we do this to help the testsuite script: do not reproduce in production!
if (isset($_GET['RESPONSE_ENCODING'])) {
    $s->response_charset_encoding = $_GET['RESPONSE_ENCODING'];
}
if (isset($_GET['EXCEPTION_HANDLING'])) {
    $s->exception_handling = $_GET['EXCEPTION_HANDLING'];
}
$s->service();
// that should do all we need!
Example #23
0
    $PermMasked = mysql_result($results, 0);
    if ($PermMasked != $Permission) {
        $permNames = array_flip($groupPowers);
        return array('error' => 'Agent does not have group power to ' . $Permission . '(' . $permNames[$Permission] . ')', 'PermMasked' => $PermMasked, 'params' => var_export($params, TRUE), 'permBitMaskSql' => $sql, 'Permission' => $Permission);
    }
    /*
    return array('error' => 'Reached end'
    		   , 'reqAgentMembership' => var_export($reqAgentMembership, TRUE)
    		   , 'GroupID' => $GroupID
    		   , 'Permission' => $Permission
    		   , 'PermMasked' => $PermMasked
    		   );
    */
    return TRUE;
}
$s = new xmlrpc_server(array("test" => array("function" => "test"), "groups.createGroup" => array("function" => "createGroup", "signature" => $common_sig), "groups.updateGroup" => array("function" => "updateGroup", "signature" => $common_sig), "groups.getGroup" => array("function" => "getGroup", "signature" => $common_sig), "groups.findGroups" => array("function" => "findGroups", "signature" => $common_sig), "groups.getGroupRoles" => array("function" => "getGroupRoles", "signature" => $common_sig), "groups.addRoleToGroup" => array("function" => "addRoleToGroup", "signature" => $common_sig), "groups.removeRoleFromGroup" => array("function" => "removeRoleFromGroup", "signature" => $common_sig), "groups.updateGroupRole" => array("function" => "updateGroupRole", "signature" => $common_sig), "groups.getGroupRoleMembers" => array("function" => "getGroupRoleMembers", "signature" => $common_sig), "groups.setAgentGroupSelectedRole" => array("function" => "setAgentGroupSelectedRole", "signature" => $common_sig), "groups.addAgentToGroupRole" => array("function" => "addAgentToGroupRole", "signature" => $common_sig), "groups.removeAgentFromGroupRole" => array("function" => "removeAgentFromGroupRole", "signature" => $common_sig), "groups.getGroupMembers" => array("function" => "getGroupMembers", "signature" => $common_sig), "groups.addAgentToGroup" => array("function" => "addAgentToGroup", "signature" => $common_sig), "groups.removeAgentFromGroup" => array("function" => "removeAgentFromGroup", "signature" => $common_sig), "groups.setAgentGroupInfo" => array("function" => "setAgentGroupInfo", "signature" => $common_sig), "groups.addAgentToGroupInvite" => array("function" => "addAgentToGroupInvite", "signature" => $common_sig), "groups.getAgentToGroupInvite" => array("function" => "getAgentToGroupInvite", "signature" => $common_sig), "groups.removeAgentToGroupInvite" => array("function" => "removeAgentToGroupInvite", "signature" => $common_sig), "groups.setAgentActiveGroup" => array("function" => "setAgentActiveGroup", "signature" => $common_sig), "groups.getAgentGroupMembership" => array("function" => "getAgentGroupMembership", "signature" => $common_sig), "groups.getAgentGroupMemberships" => array("function" => "getAgentGroupMemberships", "signature" => $common_sig), "groups.getAgentActiveMembership" => array("function" => "getAgentActiveMembership", "signature" => $common_sig), "groups.getAgentRoles" => array("function" => "getAgentRoles", "signature" => $common_sig), "groups.getGroupNotices" => array("function" => "getGroupNotices", "signature" => $common_sig), "groups.getGroupNotice" => array("function" => "getGroupNotice", "signature" => $common_sig), "groups.addGroupNotice" => array("function" => "addGroupNotice", "signature" => $common_sig)), false);
$s->functions_parameters_type = 'phpvals';
if (isset($debugXMLRPC) && $debugXMLRPC > 0 && isset($debugXMLRPCFile) && $debugXMLRPCFile != "") {
    $s->setDebug($debugXMLRPC);
}
$s->service();
if (isset($debugXMLRPC) && $debugXMLRPC > 0 && isset($debugXMLRPCFile) && $debugXMLRPCFile != "") {
    $f = fopen($debugXMLRPCFile, "a");
    fwrite($f, "\n----- " . date("Y-m-d H:i:s") . " -----\n");
    $debugInfo = $s->serializeDebug();
    $debugInfo = split("\n", $debugInfo);
    unset($debugInfo[0]);
    unset($debugInfo[count($debugInfo) - 1]);
    $debugInfo = join("\n", $debugInfo);
    fwrite($f, base64_decode($debugInfo));
    fclose($f);
        mysql_query("INSERT INTO " . $mosConfig_dbprefix . "radiotv_channel (id) VALUES (" . $tiny_data['id'] . ");");
    }
    mysql_query("UPDATE " . $mosConfig_dbprefix . "radiotv_channel SET " . "name='" . addcslashes($tiny_data['name'], "'") . "'," . "description='" . addcslashes($tiny_data['description'], "'") . "'," . "changed=1 " . "WHERE id=" . $tiny_data['id'] . ";");
    return new xmlrpcresp(new xmlrpcval($new, "int"));
}
function reset_channel()
{
    global $mosConfig_dbprefix;
    mysql_query("UPDATE " . $mosConfig_dbprefix . "radiotv_channel SET changed=0;");
    return new xmlrpcresp(new xmlrpcval(1, "int"));
}
function delete_channel()
{
    global $mosConfig_dbprefix;
    $result = mysql_query("SELECT count(*) FROM " . $mosConfig_dbprefix . "radiotv_channel WHERE changed=0;");
    $row = mysql_fetch_row($result);
    $delete = $row[0];
    if ($delete) {
        mysql_query("DELETE FROM " . $mosConfig_dbprefix . "radiotv_channel WHERE changed=0;");
    }
    return new xmlrpcresp(new xmlrpcval($delete, "int"));
}
function reset_channel_program()
{
    global $mosConfig_dbprefix;
    mysql_query("DELETE FROM " . $mosConfig_dbprefix . "radiotv_channel_program_rel WHERE 1=1;");
    return new xmlrpcresp(new xmlrpcval(1, "int"));
}
$server = new xmlrpc_server(array("get_table" => array("function" => "get_table", "signature" => array(array($xmlrpcInt, $xmlrpcString, $xmlrpcStruct))), "set_table" => array("function" => "set_table", "signature" => array(array($xmlrpcInt, $xmlrpcString, $xmlrpcStruct))), "reset_table" => array("function" => "reset_table", "signature" => array(array($xmlrpcInt, $xmlrpcString))), "delete_table" => array("function" => "delete_table", "signature" => array(array($xmlrpcInt, $xmlrpcString, $xmlrpcString))), "delete_items" => array("function" => "delete_items", "signature" => array(array($xmlrpcInt, $xmlrpcString, $xmlrpcArray, $xmlrpcString))), "get_channel" => array("function" => "get_channel", "signature" => array(array($xmlrpcArray))), "set_channel" => array("function" => "set_channel", "signature" => array(array($xmlrpcInt, $xmlrpcStruct))), "reset_channel" => array("function" => "reset_channel", "signature" => array(array($xmlrpcInt))), "delete_channel" => array("function" => "delete_channel", "signature" => array(array($xmlrpcInt))), "reset_channel_program" => array("function" => "reset_channel_program", "signature" => array(array($xmlrpcInt)))), false);
$server->functions_parameters_type = 'phpvals';
$server->service();
Example #25
0
 function service()
 {
     global $ErrorManager;
     $ErrorManager->pushErrorHandler(new WikiMethodCb($this, '_errorHandler'));
     xmlrpc_server::service();
     $ErrorManager->popErrorHandler();
 }