configured == true) { $commands = apitest_call( array ( 'method' => 'system.api.list' ) ); $commands = $commands->result; } /* See if we are executing a method - This is a quick demo, obviously use functions as they are much easier!*/ if (isset($_REQUEST['method'])) { $command_details = $commands[$_REQUEST['method']]; $auth_req = $command_details['require_auth'] == 1 ? true : false; $params = array(); $params['method'] = $_REQUEST['method']; if ($auth_req) $params['auth_token'] = $_REQUEST['auth_token']; foreach ($command_details['parameters'] as $k => $v) { $params[$k] = $_REQUEST[$k]; } $result = apitest_call($params, $_REQUEST['post_data']); if ($result->status == 0) system_message("
".print_r($result->result, true)."