function report_bug($raw_params) { /* give us access to XML listtags */ global $listtags; $listtags = array('bug'); /* where do we stuff the bug reports? */ $path_to_bugfile = '../bugreports/reports.xml'; /* get our params */ $params = array_shift(xmlrpc_params_to_php($raw_params)); $bugfile = parse_xml_config_raw($path_to_bugfile, 'bugfile'); if ($params['desc']) { if ($params['name']) { $toput['name'] = $params['name']; } if ($params['email']) { $toput['email'] = $params['email']; } $toput['desc'] = $params['desc']; $toput['config'] = base64_encode($params['config']); $toput['rules'] = base64_encode($params['rules']); $toput['time'] = time(); $bugfile['bugs']['bug'][] = $toput; $xmlout = dump_xml_config_raw($bugfile, 'bugfile'); $fout = fopen($path_to_bugfile, "w"); fwrite($fout, $xmlout); fclose($fout); return new XML_RPC_Response(XML_RPC_encode(true)); } else { return new XML_RPC_Response(XML_RPC_encode(false)); } return new XML_RPC_Response(XML_RPC_encode(false)); }
function get_notices_xmlrpc($raw_params) { global $g, $xmlrpc_g; $params = xmlrpc_params_to_php($raw_params); if (!xmlrpc_auth($params)) { xmlrpc_authfail(); return $xmlrpc_g['return']['authfail']; } if (!function_exists("get_notices")) { require "notices.inc"; } if (!$params) { $toreturn = get_notices(); } else { $toreturn = get_notices($params); } $response = new XML_RPC_Response(XML_RPC_encode($toreturn)); return $response; }
function interfaces_carp_configure_xmlrpc($raw_params) { global $xmlrpc_g; $params = xmlrpc_params_to_php($raw_params); if (!xmlrpc_auth($params)) { return $xmlrpc_g['return']['authfail']; } interfaces_carp_configure(); interfaces_carp_bring_up_final(); return $xmlrpc_g['return']['true']; }