$ssifs = array(); foreach ($interfaces as $iface => $ifacename) { $tmp["name"] = $ifacename; $tmp["value"] = $iface; $ssifs[] = $tmp; } if ($include_localhost) { $tmp["name"] = "Localhost"; $tmp["value"] = "lo0"; $ssifs[] = $tmp; } return $ssifs; } global $listtags; $listtags = array_flip(array('build_port_path', 'onetoone', 'queue', 'rule', 'servernat', 'alias', 'additional_files_needed', 'tab', 'menu', 'rowhelperfield', 'service', 'step', 'package', 'columnitem', 'option', 'item', 'field', 'package', 'file')); $pkg = parse_xml_config_raw('/usr/local/pkg/miniupnpd.xml', 'packagegui', false); if ($config['installedpackages'] && !is_array($config['installedpackages'][xml_safe_fieldname($pkg['name'])]['config'])) { $config['installedpackages'][xml_safe_fieldname($pkg['name'])]['config'] = array(); } if ($config['installedpackages'] && count($config['installedpackages'][xml_safe_fieldname($pkg['name'])]['config']) > 0 && $config['installedpackages'][xml_safe_fieldname($pkg['name'])]['config'][0] == "") { array_shift($config['installedpackages'][xml_safe_fieldname($pkg['name'])]['config']); } $a_pkg =& $config['installedpackages'][xml_safe_fieldname($pkg['name'])]['config']; global $config; if ($_POST) { $firstfield = ''; $rows = 0; $input_errors = array(); $reqfields = array(); $reqfieldsn = array(); foreach ($pkg['fields']['field'] as $field) {
if (!$stepid) $stepid = "0"; $xml = htmlspecialchars($_GET['xml']); if($_POST['xml']) $xml = htmlspecialchars($_POST['xml']); if(empty($xml)) { $xml = "not_defined"; print_info_box_np(sprintf(gettext("ERROR: Could not open %s."), $xml)); die; } else { if (file_exists("/usr/local/www/wizards/{$xml}")) { global $listtags ; $listtags = array_flip(array('build_port_path', 'depends_on_package', 'onetoone', 'queue', 'rule', 'servernat', 'alias', 'additional_files_needed', 'tab', 'template', 'menu', 'rowhelperfield', 'service', 'step', 'package', 'columnitem', 'option', 'item', 'field', 'package', 'file')); $pkg = parse_xml_config_raw('/usr/local/www/wizards/' . $xml, 'opnsensewizard', false); } else { print_info_box_np(sprintf(gettext("ERROR: Could not open %s."), $xml)); die; } } if (!is_array($pkg)) { print_info_box_np(sprintf(gettext("ERROR: Could not parse /usr/local/www/wizards/%s file."), $xml)); die; } $title = preg_replace("/pfSense/i", $g['product_name'], $pkg['step'][$stepid]['title']); $description = preg_replace("/pfSense/i", $g['product_name'], $pkg['step'][$stepid]['description']); $totalsteps = $pkg['totalsteps'];
$xml = htmlspecialchars($_POST['xml']); } /* * XXX If we don't want hardcoding we could * probe /usr/local/wizard for viable files. */ switch ($xml) { case 'openvpn': break; default: $xml = 'setup'; break; } global $g, $listtags; $listtags = array_flip(array('additional_files_needed', 'alias', 'build_port_path', 'columnitem', 'depends_on_package', 'field', 'file', 'item', 'menu', 'onetoone', 'option', 'package', 'package', 'queue', 'rowhelperfield', 'rule', 'servernat', 'service', 'step', 'tab', 'template')); $pkg = parse_xml_config_raw("/usr/local/wizard/{$xml}.xml", 'opnsensewizard', false); if (!is_array($pkg)) { print_info_box(sprintf(gettext("ERROR: Could not parse %s wizard file."), $xml)); die; } $description = preg_replace("/pfSense/i", $g['product_name'], $pkg['step'][$stepid]['description']); $title = preg_replace("/pfSense/i", $g['product_name'], $pkg['step'][$stepid]['title']); $totalsteps = $pkg['totalsteps']; if ($pkg['includefile']) { require_once $pkg['includefile']; } if ($pkg['step'][$stepid]['stepsubmitbeforesave']) { eval($pkg['step'][$stepid]['stepsubmitbeforesave']); } if ($_POST && !$input_errors) { foreach ($pkg['step'][$stepid]['fields']['field'] as $field) {
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)); }
$title_msg = preg_replace("/'/", "\\'", $title_msg); return "onmouseout=\"this.style.color = ''; domTT_mouseout(this, event);\" onmouseover=\"domTT_activate(this, event, 'content', '{$title_msg}', 'trail', true, 'delay', 0, 'fade', 'both', 'fadeMax', 93, 'delay',300,'styleClass', 'niceTitle');\""; } } $xml = htmlspecialchars($_GET['xml']); if ($_POST['xml']) { $xml = htmlspecialchars($_POST['xml']); } $xml_fullpath = realpath('/usr/local/pkg/' . $xml); if ($xml == "" || $xml_fullpath === false || substr($xml_fullpath, 0, strlen('/usr/local/pkg/')) != '/usr/local/pkg/') { print_info_box_np(gettext("ERROR: No valid package defined.")); die; } else { global $listtags; $listtags = array_flip(array('build_port_path', 'depends_on_package', 'onetoone', 'queue', 'rule', 'servernat', 'alias', 'additional_files_needed', 'tab', 'template', 'menu', 'rowhelperfield', 'service', 'step', 'package', 'columnitem', 'option', 'item', 'field', 'package', 'file')); $pkg = parse_xml_config_raw($xml_fullpath, "packagegui", false); } if ($pkg['include_file'] != "") { require_once $pkg['include_file']; } if (!isset($pkg['adddeleteeditpagefields'])) { $only_edit = true; } else { $only_edit = false; } $package_name = $pkg['menu'][0]['name']; $section = $pkg['menu'][0]['section']; $config_path = $pkg['configpath']; $name = $pkg['name']; $title = $pkg['title']; $pgtitle = $title;