summaryrefslogtreecommitdiffstats
path: root/usr/local
diff options
context:
space:
mode:
authorColin Smith <colin@pfsense.org>2005-04-20 14:10:51 +0000
committerColin Smith <colin@pfsense.org>2005-04-20 14:10:51 +0000
commit6fe6b9163a3f21863158df21f2e40e474af07ef4 (patch)
tree6482f6943c84b8ac0a1c022efd049da9555723e7 /usr/local
parent207abd8486d88f88e60d6cd41db8e1d432d3cbcf (diff)
downloadpfsense-6fe6b9163a3f21863158df21f2e40e474af07ef4.zip
pfsense-6fe6b9163a3f21863158df21f2e40e474af07ef4.tar.gz
Include XMLRPC helper functions and remove unnecessary code.
Diffstat (limited to 'usr/local')
-rwxr-xr-xusr/local/www/xmlrpc.php50
1 files changed, 1 insertions, 49 deletions
diff --git a/usr/local/www/xmlrpc.php b/usr/local/www/xmlrpc.php
index 41093cc..709b0f2 100755
--- a/usr/local/www/xmlrpc.php
+++ b/usr/local/www/xmlrpc.php
@@ -36,59 +36,11 @@
*/
require_once("xmlrpc_server.inc");
+require_once("xmlrpc.inc");
require_once("xmlparse_pkg.inc");
require_once("config.inc");
require_once("functions.inc");
-// Helper functions.
-/*
- * xmlrpc_auth: Handle basic crypt() authentication of the XMLRPC request. This function assumes that
- * $params[0] contains the local system's plaintext password and removes the password from
- * the array before returning it.
- */
-function xmlrpc_auth(&$params) {
- global $config;
- if (crypt($params[0], $config['system']['password']) != $config['system']['password'])
- return false; // Password didn't match.
- array_shift($params); // Shift the password parameter off of the array.
- return true; // Password matched.
-}
-
-/*
- * xmlrpc_params_to_php: Convert params array passed from XMLRPC server into a PHP array and return it.
- *
- * XXX: This function does not currently handle XML_RPC_Value objects of type "struct".
- */
-function xmlrpc_params_to_php($params) {
- $array = array();
- for($i = 0; $i < $params->getNumParams(); $i++) {
- $value = $params->getParam($i);
- if($value->kindOf() == "scalar") {
- $array[] = $value->scalarval();
- } elseif($value->kindOf() == "array") {
- $array[] = xmlrpc_array_to_php($value);
- }
- }
- return $array;
-}
-
-/*
- * xmlrpc_array_to_php: Convert an XMLRPC array into a PHP array and return it.
- */
-function xmlrpc_array_to_php($array) {
- $return = array();
- $array_length = $array->arraysize();
- for($i = 0; $i < $array->arraysize(); $i++) {
- $value = $array->arraymem($i);
- if($value->kindOf() == "scalar") {
- $return[] = $value->scalarval();
- } elseif($value->kindOf() == "array") {
- $return[] = xmlrpc_array_to_php($value);
- }
- }
- return $return;
-}
-
// Exposed functions.
$backup_config_section_doc = 'XMLRPC wrapper for backup_config_section. This method must be called with two parameters: a string containing the local system\'s password followed by a string containing the section to be backed up.';
OpenPOWER on IntegriCloud