Backups Created:
/home/japatmex/public_html/wp-content/edit-wolf.php
Savvy
W
olf -
MANAGER
Edit File: dhrufusionapi.class.php
<?php /** * @author Dhru.com * @APi kit version 1.0 Oct 30, 2011 * @Copyleft GPL 2001-2011, Dhru.com **/ if (!extension_loaded('curl')) { trigger_error('cURL extension not installed', E_USER_ERROR); } class DhruFusion { var $xmlData; var $xmlResult; var $debug; var $action; function __construct() { $this->xmlData = new DOMDocument(); } function getResult() { return $this->xmlResult; } function action($action, $apiKey, $userName, $url, $arr = array()) { if (strpos($url, ".php") === false){ $url = $url . '/api/index.php'; } if (is_string($action)) { if (is_array($arr)) { if (count($arr)) { $request = $this->xmlData->createElement("PARAMETERS"); $this->xmlData->appendChild($request); foreach ($arr as $key => $val) { $key = strtoupper($key); $request->appendChild($this->xmlData->createElement($key, $val)); } } $posted = array('username' => $userName, 'apiaccesskey' => $apiKey, 'action' => $action, 'requestformat' => 'JSON', 'parameters' => $this->xmlData->saveHTML()); $crul = curl_init(); curl_setopt($crul, CURLOPT_HEADER, false); curl_setopt($crul, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']); //curl_setopt($crul, CURLOPT_FOLLOWLOCATION, true); curl_setopt($crul, CURLOPT_RETURNTRANSFER, true); curl_setopt($crul, CURLOPT_URL, $url); curl_setopt($crul, CURLOPT_POST, true); curl_setopt($crul, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($crul, CURLOPT_POSTFIELDS, $posted); $response = curl_exec($crul); curl_close($crul); return (json_decode($response, true)); } return false; } } } if(!function_exists("XMLtoARRAY")) { function XMLtoARRAY($rawxml) { $xml_parser = xml_parser_create(); xml_parse_into_struct($xml_parser, $rawxml, $vals, $index); xml_parser_free($xml_parser); $params = array(); $level = array(); $alreadyused = array(); $x = 0; foreach ($vals as $xml_elem) { if ($xml_elem['type'] == 'open') { if (in_array($xml_elem['tag'], $alreadyused)) { ++$x; $xml_elem['tag'] = $xml_elem['tag'] . $x; } $level[$xml_elem['level']] = $xml_elem['tag']; $alreadyused[] = $xml_elem['tag']; } if ($xml_elem['type'] == 'complete') { $start_level = 1; $php_stmt = '$params'; while ($start_level < $xml_elem['level']) { $php_stmt .= '[$level[' . $start_level . ']]'; ++$start_level; } $php_stmt .= '[$xml_elem[\'tag\']] = $xml_elem[\'value\'];'; eval($php_stmt); continue; } } return $params; } } ?>