function new_Intraface_Contact_XMLRPC_Client($c) { XML_RPC2_Backend::setBackend('php'); $credentials = array('private_key' => $GLOBALS['elevforeningen_intraface_private_key'], 'session_id' => session_id()); $debug = false; return $contact_client = new IntrafacePublic_Contact_XMLRPC_Client($credentials, $debug); }
/** * Factory method to select, create and return a XML_RPC2_Client backend * * To create a new XML_RPC2_Client, a URI must be provided (e.g. http://xmlrpc.example.com/1.0/). * * Optionally, some options may be set. * * @param string URI for the XML-RPC server * @param array (optional) associative array of options (see constructor) */ public static function create($uri, $options = array()) { if (isset($options['backend'])) { XML_RPC2_Backend::setBackend($options['backend']); } $backend = XML_RPC2_Backend::getClientClassname(); return new $backend($uri, $options); }
/** * Factory method to select a backend and return a new XML_RPC2_Server based on the backend * * @param mixed $callTarget either a class name or an object instance. * @param array associative array of options * @return object a server class instance */ public static function create($callTarget, $options = array()) { if (isset($options['backend'])) { XML_RPC2_Backend::setBackend($options['backend']); } if (isset($options['prefix'])) { $prefix = $options['prefix']; } else { $prefix = ''; } $backend = XML_RPC2_Backend::getServerClassname(); // Find callHandler class if (!isset($options['callHandler'])) { if (is_object($callTarget)) { // Delegate calls to instance methods require_once 'XML/RPC2/Server/CallHandler/Instance.php'; $callHandler = new XML_RPC2_Server_CallHandler_Instance($callTarget, $prefix); } else { // Delegate calls to static class methods require_once 'XML/RPC2/Server/CallHandler/Class.php'; $callHandler = new XML_RPC2_Server_CallHandler_Class($callTarget, $prefix); } } else { $callHandler = $options['callHandler']; } return new $backend($callHandler, $options); }
/** * Wrapper for get_notices() * * @param string $username * @param string $password * @param string $category * * @return bool */ public function get_notices($username, $password, $category = 'all') { $this->auth($username, $password); global $g; if (!function_exists("get_notices")) { require_once "notices.inc"; } if (!$params) { $toreturn = get_notices(); } else { $toreturn = get_notices($params); } return $toreturn; } } $xmlrpclockkey = lock('xmlrpc', LOCK_EX); XML_RPC2_Backend::setBackend('php'); $HTTP_RAW_POST_DATA = file_get_contents('php://input'); $options = array('prefix' => 'pfsense.', 'encoding' => 'utf-8', 'autoDocument' => false); $server = XML_RPC2_Server::create(new pfsense_xmlrpc_server(), $options); $server->handleCall(); unlock($xmlrpclockkey);
/** * Factory method to select, create and return a XML_RPC2_Client backend * * To create a new XML_RPC2_Client, a URI must be provided (e.g. http://xmlrpc.example.com/1.0/). * * Optionally, some options may be set. * * @param string URI for the XML-RPC server * @param array (optional) associative array of options (see constructor) */ public static function create($uri, $options = array()) { if (isset($this)) { // Method called non-statically forward to remote call() as RPC $this->__call('create', func_get_args()); } if (isset($options['backend'])) { XML_RPC2_Backend::setBackend($options['backend']); } $backend = XML_RPC2_Backend::getClientClassname(); return new $backend($uri, $options); }
function new_IntrafacePublic_Newsletter_XMLRPC_Client() { $credentials = array("private_key" => INTRAFACE_PRIVATE_KEY, "session_id" => uniqid()); XML_RPC2_Backend::setBackend("php"); return new IntrafacePublic_Newsletter_XMLRPC_Client($credentials); }