diff options
-rw-r--r-- | etc/inc/captiveportal.inc | 12 | ||||
-rw-r--r-- | etc/inc/filter.inc | 18 | ||||
-rw-r--r-- | etc/inc/interfaces.inc | 18 | ||||
-rw-r--r-- | etc/inc/priv.defs.inc | 24 | ||||
-rw-r--r-- | etc/inc/system.inc | 3 | ||||
-rw-r--r-- | etc/inc/unbound.inc | 70 | ||||
-rw-r--r-- | etc/inc/vpn.inc | 4 | ||||
-rw-r--r-- | etc/inc/xmlparse.inc | 2 | ||||
-rwxr-xr-x[-rw-r--r--] | etc/rc.carpbackup | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | etc/rc.carpmaster | 0 | ||||
-rwxr-xr-x | etc/rc.restart_webgui | 2 | ||||
-rw-r--r-- | usr/local/share/locale/ja/LC_MESSAGES/pfSense.po | 2 | ||||
-rw-r--r-- | usr/local/share/locale/pt_BR.ISO8859-1/LC_MESSAGES/pfSense.po | 2 | ||||
-rw-r--r-- | usr/local/www/firewall_shaper_vinterface.php | 2 | ||||
-rw-r--r-- | usr/local/www/index.php | 2 | ||||
-rw-r--r-- | usr/local/www/interfaces_assign.php | 2 | ||||
-rw-r--r-- | usr/local/www/pkg_mgr.php | 2 | ||||
-rw-r--r-- | usr/local/www/services_captiveportal.php | 2 | ||||
-rw-r--r-- | usr/local/www/services_unbound.php | 51 | ||||
-rw-r--r-- | usr/local/www/widgets/javascript/thermal_sensors.js | 33 | ||||
-rw-r--r-- | usr/local/www/wizard.php | 2 |
21 files changed, 133 insertions, 120 deletions
diff --git a/etc/inc/captiveportal.inc b/etc/inc/captiveportal.inc index c45e984..1383e86 100644 --- a/etc/inc/captiveportal.inc +++ b/etc/inc/captiveportal.inc @@ -367,7 +367,7 @@ EOD; /* Release allocated pipes for this zone */ captiveportal_free_dnrules(); - mwexec("/usr/local/sbin/ipfw zone {$cpzoneid} destory", true); + mwexec("/sbin/ipfw zone {$cpzoneid} destroy", true); if (empty($config['captiveportal'])) mwexec("/sbin/sysctl net.link.ether.ipfw=0"); @@ -464,7 +464,7 @@ function captiveportal_init_rules($reinit = false) { return; captiveportal_load_modules(); - mwexec("/usr/local/sbin/ipfw zone {$cpzoneid} create", true); + mwexec("/sbin/ipfw zone {$cpzoneid} create", true); $cpips = array(); $ifaces = get_configured_interface_list(); @@ -481,7 +481,7 @@ function captiveportal_init_rules($reinit = false) { if (!empty($carpif)) { $carpsif = explode(" ", $carpif); foreach ($carpsif as $cpcarp) { - mwexec("/usr/local/sbin/ipfw zone {$cpzoneid} madd {$cpcarp}", true); + mwexec("/sbin/ipfw zone {$cpzoneid} madd {$cpcarp}", true); $carpip = find_interface_ip($cpcarp); if (is_ipaddr($carpip)) $cpips[] = $carpip; @@ -489,7 +489,7 @@ function captiveportal_init_rules($reinit = false) { } $cpips[] = $cpipm; } - mwexec("/usr/local/sbin/ipfw zone {$cpzoneid} madd {$tmpif}", true); + mwexec("/sbin/ipfw zone {$cpzoneid} madd {$tmpif}", true); } } if (count($cpips) > 0) { @@ -1478,7 +1478,7 @@ function captiveportal_get_dn_passthru_ruleno($value) { if (file_exists("{$g['vardb_path']}/captiveportaldn.rules")) { $rules = unserialize(file_get_contents("{$g['vardb_path']}/captiveportaldn.rules")); unset($output); - $_gb = exec("/sbin/ipfw -x {$cpzone} show | /usr/bin/grep {$value} | /usr/bin/grep -v grep | /usr/bin/cut -d \" \" -f 5 | /usr/bin/head -n 1", $output); + $_gb = exec("/sbin/ipfw -x {$cpzoneid} show | /usr/bin/grep " . escapeshellarg($value) . " | /usr/bin/grep -v grep | /usr/bin/awk '{print $5}' | /usr/bin/head -n 1", $output); $ruleno = intval($output[0]); if (!$rules[$ruleno]) $ruleno = NULL; @@ -1566,7 +1566,7 @@ function captiveportal_get_ipfw_passthru_ruleno($value) { if (file_exists("{$g['vardb_path']}/captiveportal_{$cpzone}.rules")) { $rules = unserialize(file_get_contents("{$g['vardb_path']}/captiveportal_{$cpzone}.rules")); unset($output); - $_gb = exec("/sbin/ipfw -x {$cpzone} show | /usr/bin/grep {$value} | /usr/bin/grep -v grep | /usr/bin/cut -d \" \" -f 5 | /usr/bin/head -n 1", $output); + $_gb = exec("/sbin/ipfw -x {$cpzoneid} show | /usr/bin/grep " . escapeshellarg($value) . " | /usr/bin/grep -v grep | /usr/bin/awk '{print $1}' | /usr/bin/head -n 1", $output); $ruleno = intval($output[0]); if (!$rules[$ruleno]) $ruleno = NULL; diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc index bcbf6a4..6a63998 100644 --- a/etc/inc/filter.inc +++ b/etc/inc/filter.inc @@ -323,23 +323,29 @@ function filter_configure_sync($delete_states_if_needed = true) { * then output the contents of the error to the caller */ if($rules_loading <> 0) { + $saved_line_error = $rules_error[0]; $line_error = explode(":", $rules_error[0]); $line_number = $line_error[1]; $line_split = file("{$g['tmp_path']}/rules.debug"); if(is_array($line_split)) $line_error = sprintf(gettext('The line in question reads [%1$d]: %2$s'), $line_number, $line_split[$line_number-1]); unset($line_split); - if ($line_error and $line_number) { - file_notice("filter_load", sprintf(gettext('There were error(s) loading the rules: %1$s - %2$s'), $rules_error[0], $line_error), "Filter Reload", ""); - update_filter_reload_status(sprintf(gettext('There were error(s) loading the rules: %1$s - %2$s'), $rules_error[0], $line_error)); - unlock($filterlck); - return; - } + /* Brutal ugly hack but required -- PF is stuck, unwedge */ if (strstr("$rules_error[0]", "busy")) { exec("/sbin/pfctl -d; /sbin/pfctl -e; /sbin/pfctl -f {$g['tmp_path']}/rules.debug"); $error_msg = gettext("PF was wedged/busy and has been reset."); file_notice("pf_busy", $error_msg, "pf_busy", ""); + } else { + $_grbg = exec("/sbin/pfctl -o basic -f {$g['tmp_path']}/rules.debug.old 2>&1"); + } + unset($rules_loading, $rules_error); + + if ($line_error and $line_number) { + file_notice("filter_load", sprintf(gettext('There were error(s) loading the rules: %1$s - %2$s'), $saved_line_error, $line_error), "Filter Reload", ""); + update_filter_reload_status(sprintf(gettext('There were error(s) loading the rules: %1$s - %2$s'), $saved_line_error, $line_error)); + unlock($filterlck); + return; } } diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc index a82884e..6453947 100644 --- a/etc/inc/interfaces.inc +++ b/etc/inc/interfaces.inc @@ -1916,22 +1916,16 @@ function interfaces_carp_setup() { /* suck in configuration items */ if ($config['hasync']) { $pfsyncenabled = $config['hasync']['pfsyncenabled']; - $balancing = $config['hasync']['balancing']; $pfsyncinterface = $config['hasync']['pfsyncinterface']; $pfsyncpeerip = $config['hasync']['pfsyncpeerip']; } else { unset($pfsyncinterface); - unset($balancing); unset($pfsyncenabled); } - if ($balancing) { - mwexec("/sbin/sysctl net.inet.carp.arpbalance=1", true); - mwexec("/sbin/sysctl net.inet.carp.preempt=0", true); - } else - mwexec("/sbin/sysctl net.inet.carp.preempt=1", true); + mwexec("/sbin/sysctl net.inet.carp.preempt=1", true); + mwexec("/sbin/sysctl net.inet.carp.log=1", true); - mwexec("sbin/sysctl net.inet.carp.log=1", true); if (!empty($pfsyncinterface)) $carp_sync_int = get_real_interface($pfsyncinterface); else @@ -2180,12 +2174,12 @@ function interface_carp_configure(&$vip) { if (!empty($vip['advbase'])) $advbase = "advbase " . escapeshellarg($vip['advbase']); + mwexec("/sbin/ifconfig {$realif} vhid " . escapeshellarg($vip['vhid']) . " advskew " . escapeshellarg($vip['advskew']) . " {$advbase} {$password}"); + if (is_ipaddrv4($vip['subnet'])) - mwexec("/sbin/ifconfig {$realif} " . escapeshellarg($vip['subnet']) . "/" . escapeshellarg($vip['subnet_bits']) . " alias"); + mwexec("/sbin/ifconfig {$realif} " . escapeshellarg($vip['subnet']) . "/" . escapeshellarg($vip['subnet_bits']) . " alias vhid " . escapeshellarg($vip['vhid'])); else if (is_ipaddrv6($vip['subnet'])) - mwexec("/sbin/ifconfig {$realif} inet6 " . escapeshellarg($vip['subnet']) . " prefixlen " . escapeshellarg($vip['subnet_bits'])); - - mwexec("/sbin/ifconfig {$realif} vhid " . escapeshellarg($vip['vhid']) . " advskew " . escapeshellarg($vip['advskew']) . " {$advbase} {$password}"); + mwexec("/sbin/ifconfig {$realif} inet6 " . escapeshellarg($vip['subnet']) . " prefixlen " . escapeshellarg($vip['subnet_bits']) . " vhid " . escapeshellarg($vip['vhid'])); return $realif; } diff --git a/etc/inc/priv.defs.inc b/etc/inc/priv.defs.inc index 24aa120..682de57 100644 --- a/etc/inc/priv.defs.inc +++ b/etc/inc/priv.defs.inc @@ -872,6 +872,30 @@ $priv_list['page-services-dnsforwarder-edithost']['descr'] = gettext("Allow acce $priv_list['page-services-dnsforwarder-edithost']['match'] = array(); $priv_list['page-services-dnsforwarder-edithost']['match'][] = "services_dnsmasq_edit.php*"; +$priv_list['page-services-dnsresolver'] = array(); +$priv_list['page-services-dnsresolver']['name'] = gettext("WebCfg - Services: DNS Resolver page"); +$priv_list['page-services-dnsresolver']['descr'] = gettext("Allow access to the 'Services: DNS Resolver' page."); +$priv_list['page-services-dnsresolver']['match'] = array(); +$priv_list['page-services-dnsresolver']['match'][] = "services_unbound.php*"; + +$priv_list['page-services-dnsresolver-advanced'] = array(); +$priv_list['page-services-dnsresolver-advanced']['name'] = gettext("WebCfg - Services: DNS Resolver: Advanced page"); +$priv_list['page-services-dnsresolver-advanced']['descr'] = gettext("Allow access to the 'Services: DNS Resolver: Advanced' page."); +$priv_list['page-services-dnsresolver-advanced']['match'] = array(); +$priv_list['page-services-dnsresolver-advanced']['match'][] = "services_unbound_advanced.php*"; + +$priv_list['page-services-dnsresolver-acls'] = array(); +$priv_list['page-services-dnsresolver-acls']['name'] = gettext("WebCfg - Services: DNS Resolver: Access Lists page"); +$priv_list['page-services-dnsresolver-acls']['descr'] = gettext("Allow access to the 'Services: DNS Resolver: Access Lists' page."); +$priv_list['page-services-dnsresolver-acls']['match'] = array(); +$priv_list['page-services-dnsresolver-acls']['match'][] = "services_unbound_acls.php*"; + +$priv_list['page-services-dnsresolver-editacls'] = array(); +$priv_list['page-services-dnsresolver-editacls']['name'] = gettext("WebCfg - Services: DNS Resolver: Access Lists: Edit page"); +$priv_list['page-services-dnsresolver-editacls']['descr'] = gettext("Allow access to the 'Services: DNS Resolver: Access Lists: Edit' page."); +$priv_list['page-services-dnsresolver-editacls']['match'] = array(); +$priv_list['page-services-dnsresolver-editacls']['match'][] = "services_unbound_acls_edit.php*"; + $priv_list['page-services-dynamicdnsclients'] = array(); $priv_list['page-services-dynamicdnsclients']['name'] = gettext("WebCfg - Services: Dynamic DNS clients page"); $priv_list['page-services-dynamicdnsclients']['descr'] = gettext("Allow access to the 'Services: Dynamic DNS clients' page."); diff --git a/etc/inc/system.inc b/etc/inc/system.inc index 37f7d34..59ffd94 100644 --- a/etc/inc/system.inc +++ b/etc/inc/system.inc @@ -1631,7 +1631,8 @@ function system_ntp_configure($start_ntpd=true) { if (!is_ipaddr($interface)) { $interface = get_real_interface($interface); } - $ntpcfg .= "interface listen {$interface}\n"; + if (!empty($interface)) + $ntpcfg .= "interface listen {$interface}\n"; } } diff --git a/etc/inc/unbound.inc b/etc/inc/unbound.inc index 3f3a369..68f60bb 100644 --- a/etc/inc/unbound.inc +++ b/etc/inc/unbound.inc @@ -4,7 +4,7 @@ part of the pfSense project (https://www.pfsense.org) originally part of m0n0wall (http://m0n0.ch/wall) - Copyright (C) 2014 Warren Baker <warren@decoy.co.za> + Copyright (C) 2014 Warren Baker <warren@decoy.co.za> All rights reserved. Redistribution and use in source and binary forms, with or without @@ -106,9 +106,9 @@ function unbound_generate_config() { $optimization = unbound_optimization(); // Setup DNSSEC support - if (isset($config['unbound']['dnssec_status'])) { + if (isset($config['unbound']['dnssec'])) { $module_config = "validator iterator"; - $anchor_file = "auto-trust-anchor-file: {$g['unbound_chroot_path']}/root-trust-anchor"; + $anchor_file = "auto-trust-anchor-file: {$g['unbound_chroot_path']}/root.key"; } else $module_config = "iterator"; @@ -152,6 +152,7 @@ EOF; } // Server configuration variables + $port = (is_port($config['unbound']['port'])) ? $config['unbound']['port'] : "53"; $hide_id = ($config['unbound']['hide_id'] == "on") ? "yes" : "no"; $hide_version = ($config['unbound']['hide_version'] == "on") ? "yes" : "no"; $harden_glue = ($config['unbound']['harden_glue'] == "on") ? "yes" : "no"; @@ -171,6 +172,36 @@ EOF; $unwanted_reply_threshold = (!empty($config['unbound']['unwanted_reply_threshold'])) ? $config['unbound']['unwanted_reply_threshold'] : "0"; $verbosity = isset($config['unbound']['loglevel']) ? $config['unbound']['loglevel'] : 1; + // Set up forwarding if it configured + if (isset($config['unbound']['forwarding'])) { + $dnsservers = array(); + if (isset($config['system']['dnsallowoverride'])) { + $ns = array_unique(get_nameservers()); + foreach($ns as $nameserver) { + if ($nameserver) + $dnsservers[] = $nameserver; + } + } else { + $ns = array_unique(get_dns_servers()); + foreach($ns as $nameserver) { + if ($nameserver) + $dnsservers[] = $nameserver; + } + } + + if (!empty($dnsservers)) { + $forward_conf .=<<<EOD +# Forwarding +forward-zone: + name: "." + +EOD; + foreach($dnsservers as $dnsserver) + $forward_conf .= "\tforward-addr: $dnsserver\n"; + } + } else + $forward_conf = ""; + $unboundconf = <<<EOD ########################## # Unbound Configuration @@ -185,7 +216,7 @@ username: "unbound" directory: "{$g['unbound_chroot_path']}" pidfile: "/var/run/unbound.pid" use-syslog: yes -port: 53 +port: {$port} verbosity: {$verbosity} harden-referral-path: no do-ip4: yes @@ -233,6 +264,7 @@ include: {$g['unbound_chroot_path']}/host_entries.conf # Domain overrides include: {$g['unbound_chroot_path']}/domainoverrides.conf +{$forward_conf} {$custom_options} @@ -315,10 +347,8 @@ function sync_unbound_service() { unbound_generate_config(); do_as_unbound_user("start"); require_once("service-utils.inc"); - if (is_service_running("unbound")) { - do_as_unbound_user("forward"); + if (is_service_running("unbound")) do_as_unbound_user("restore_cache"); - } } @@ -505,32 +535,6 @@ function unbound_control($action) { $cache_dumpfile = "/var/tmp/unbound_cache"; switch ($action) { - case "forward": - if ($config['unbound']['forwarding_mode'] == "on") { - // Get configured DNS servers and add them as forwarders - if (!isset($config['system']['dnsallowoverride'])) { - $ns = array_unique(get_nameservers()); - foreach($ns as $nameserver) { - if($nameserver) - $dns_servers .= " $nameserver"; - } - } else { - $ns = array_unique(get_dns_servers()); - foreach($ns as $nameserver) { - if($nameserver) - $dns_servers .= " $nameserver"; - } - } - - if(is_service_running("unbound")) { - unbound_ctl_exec("forward $dns_servers"); - } else { - unbound_control("start"); - sleep(1); - unbound_control("forward"); - } - } - break; case "start": // Start Unbound if ($config['unbound']['enable'] == "on") { diff --git a/etc/inc/vpn.inc b/etc/inc/vpn.inc index 0d875c4..ea0e974 100644 --- a/etc/inc/vpn.inc +++ b/etc/inc/vpn.inc @@ -279,6 +279,7 @@ charon { auth { default = -1 ike = 1 + ike_name = yes } } @@ -799,7 +800,7 @@ EOD; $ipsecconf .=<<<EOD -conn con{$ph2ent['ikeid']}{$ph2ent['ikeid']} +conn con{$ph2ent['ikeid']}-{$ph2ent['ikeid']} aggressive = {$aggressive} fragmentation = yes keyexchange = {$keyexchange} @@ -845,6 +846,7 @@ EOD; } else { mwexec("/usr/local/sbin/ipsec start", false); } + vpn_ipsec_configure_loglevels(); if ($natfilterrules == true) filter_configure(); /* start filterdns, if necessary */ diff --git a/etc/inc/xmlparse.inc b/etc/inc/xmlparse.inc index 5eba494..3b32719 100644 --- a/etc/inc/xmlparse.inc +++ b/etc/inc/xmlparse.inc @@ -64,7 +64,7 @@ function listtags() { function listtags_pkg() { $ret = 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'); - return $ret; + return array_flip($ret); } function startElement($parser, $name, $attrs) { diff --git a/etc/rc.carpbackup b/etc/rc.carpbackup index 439c214..439c214 100644..100755 --- a/etc/rc.carpbackup +++ b/etc/rc.carpbackup diff --git a/etc/rc.carpmaster b/etc/rc.carpmaster index d22b267..d22b267 100644..100755 --- a/etc/rc.carpmaster +++ b/etc/rc.carpmaster diff --git a/etc/rc.restart_webgui b/etc/rc.restart_webgui index 05eab12..eef8c01 100755 --- a/etc/rc.restart_webgui +++ b/etc/rc.restart_webgui @@ -6,7 +6,7 @@ require("config.inc"); require("functions.inc"); require("shaper.inc"); require("captiveportal.inc"); -require("rrd.inc"); +require_once("rrd.inc"); echo "Restarting webConfigurator..."; diff --git a/usr/local/share/locale/ja/LC_MESSAGES/pfSense.po b/usr/local/share/locale/ja/LC_MESSAGES/pfSense.po index de8af4b..21d02f3 100644 --- a/usr/local/share/locale/ja/LC_MESSAGES/pfSense.po +++ b/usr/local/share/locale/ja/LC_MESSAGES/pfSense.po @@ -1,5 +1,5 @@ # Language translation for pfSense project. -# Copyright (C) 2011 BSD Perimeter +# Copyright (C) 2011-2014 Electric Sheep Fencing LLC # This file is distributed under the same license as the pfSense package. # Kiyo Takami and Isaac (.ike) Levy, 2013. # diff --git a/usr/local/share/locale/pt_BR.ISO8859-1/LC_MESSAGES/pfSense.po b/usr/local/share/locale/pt_BR.ISO8859-1/LC_MESSAGES/pfSense.po index bfad148..f3c8b02 100644 --- a/usr/local/share/locale/pt_BR.ISO8859-1/LC_MESSAGES/pfSense.po +++ b/usr/local/share/locale/pt_BR.ISO8859-1/LC_MESSAGES/pfSense.po @@ -1,5 +1,5 @@ # Language translation for pfSense project. -# Copyright (C) 2011 BSD Perimeter +# Copyright (C) 2011-2014 Electric Sheep Fencing LLC # This file is distributed under the same license as the pfSense package. # Vinicius Coque <vcoque@gmail.com>, 2011. # Luiz Gustavo <luizgustavo@luizgustavo.pro>, 2014 Powered by: TrustUX Network (www.trustux.com) diff --git a/usr/local/www/firewall_shaper_vinterface.php b/usr/local/www/firewall_shaper_vinterface.php index e53deef..5384cde 100644 --- a/usr/local/www/firewall_shaper_vinterface.php +++ b/usr/local/www/firewall_shaper_vinterface.php @@ -336,7 +336,7 @@ $output_form .= "<input type=\"button\" class=\"formbtn\" name=\"delete\""; if ($queue) $output_form .= " value=\"" . gettext("Delete this queue") ."\" />"; else - $output_form .= " value=\"" . gettext("Delete virtual interface") ."\" />"; + $output_form .= " value=\"" . gettext("Delete Limiter") ."\" />"; $output_form .= "</a>"; $output_form .= "</td></tr>"; $output_form .= "</table>"; diff --git a/usr/local/www/index.php b/usr/local/www/index.php index 9bb6e5e..b473828 100644 --- a/usr/local/www/index.php +++ b/usr/local/www/index.php @@ -766,7 +766,7 @@ pfSense_handle_custom_code("/usr/local/pkg/dashboard/pre_dashboard"); $jsincludefiles[] = $filename; } foreach($jsincludefiles as $jsincludename) { - if(!stristr($jsincludename, ".js")) + if(!preg_match('/\.js$/', $jsincludename)) continue; echo "<script src='{$directory}{$jsincludename}' type='text/javascript'></script>\n"; } diff --git a/usr/local/www/interfaces_assign.php b/usr/local/www/interfaces_assign.php index 3fd531a..6e82f64 100644 --- a/usr/local/www/interfaces_assign.php +++ b/usr/local/www/interfaces_assign.php @@ -50,7 +50,7 @@ require("shaper.inc"); require("ipsec.inc"); require("vpn.inc"); require("captiveportal.inc"); -require("rrd.inc"); +require_once("rrd.inc"); /* In this file, "port" refers to the physical port name, diff --git a/usr/local/www/pkg_mgr.php b/usr/local/www/pkg_mgr.php index 9bc2dae..96c26fe 100644 --- a/usr/local/www/pkg_mgr.php +++ b/usr/local/www/pkg_mgr.php @@ -75,7 +75,7 @@ function domTT_title($title_msg) { $pkg_cache_file_time=($g['min_pkg_cache_file_time'] ? $g['min_pkg_cache_file_time'] : 120); if (!file_exists("{$g['tmp_path']}/pkg_info.cache") || (time() - filemtime("{$g['tmp_path']}/pkg_info.cache")) > $pkg_cache_file_time) { - $pkg_info = get_pkg_info('all', array("noembedded", "name", "category", "website", "version", "status", "descr", "maintainer", "required_version", "maximum_version", "pkginfolink", "supportedbybsdperimeter","config_file")); + $pkg_info = get_pkg_info('all', array("noembedded", "name", "category", "website", "version", "status", "descr", "maintainer", "required_version", "maximum_version", "pkginfolink", "config_file")); //create cache file after get_pkg_info if($pkg_info) { $fout = fopen("{$g['tmp_path']}/pkg_info.cache", "w"); diff --git a/usr/local/www/services_captiveportal.php b/usr/local/www/services_captiveportal.php index a8243bc..4cd2127 100644 --- a/usr/local/www/services_captiveportal.php +++ b/usr/local/www/services_captiveportal.php @@ -399,7 +399,7 @@ if ($_POST) { if (!empty($toremove)) { foreach ($toremove as $removeif) { $removeif = get_real_interface($removeif); - mwexec("/usr/local/sbin/ipfw zone {$cpzone} mdel {$removeif}"); + mwexec("/sbin/ipfw zone {$cpzoneid} mdel {$removeif}"); } } captiveportal_configure_zone($newcp); diff --git a/usr/local/www/services_unbound.php b/usr/local/www/services_unbound.php index 333272a..bd1c00b 100644 --- a/usr/local/www/services_unbound.php +++ b/usr/local/www/services_unbound.php @@ -3,14 +3,11 @@ /* services_unbound.php part of the pfSense project (https://www.pfsense.org) - Copyright (C) 2011 Warren Baker (warren@pfsense.org) + Copyright (C) 2014 Warren Baker (warren@pfsense.org) All rights reserved. - Copyright (C) 2003-2004 Bob Zoller <bob@kludgebox.com> and Manuel Kasper <mk@neon1.net>. - All rights reserved. - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: + modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. @@ -45,14 +42,13 @@ require_once("guiconfig.inc"); require_once("unbound.inc"); $pconfig['enable'] = isset($config['unbound']['enable']); +$pconfig['port'] = $config['unbound']['port']; $pconfig['active_interface'] = $config['unbound']['active_interface']; $pconfig['outgoing_interface'] = $config['unbound']['outgoing_interface']; $pconfig['dnssec'] = isset($config['unbound']['dnssec']); $pconfig['forwarding'] = isset($config['unbound']['forwarding']); $pconfig['regdhcp'] = isset($config['unbound']['regdhcp']); $pconfig['regdhcpstatic'] = isset($config['unbound']['regdhcpstatic']); -$pconfig['dhcpfirst'] = isset($config['unbound']['dhcpfirst']); -$pconfig['port'] = isset($config['unbound']['port']); if(!is_array($config['unbound'])) $config['unbound'] = array(); @@ -68,6 +64,7 @@ $a_domainOverrides = &$config['unbound']['domainoverrides']; if ($_POST) { + $pconfig = $_POST; unset($input_errors); if ($_POST['enable'] == "yes" && isset($config['dnsmasq']['enable'])) @@ -76,6 +73,9 @@ if ($_POST) { if (empty($_POST['active_interface'])) $input_errors[] = "A single network interface needs to be selected for the DNS Resolver to bind to."; + if (empty($_POST['outgoing_interface'])) + $input_errors[] = "A single outgoing network interface needs to be selected for the DNS Resolver to use for outgoing DNS requests."; + if ($_POST['port']) if (is_port($_POST['port'])) $a_unboundcfg['port'] = $_POST['port']; @@ -89,7 +89,6 @@ if ($_POST) { $a_unboundcfg['forwarding'] = ($_POST['forwarding']) ? true : false; $a_unboundcfg['regdhcp'] = ($_POST['regdhcp']) ? true : false; $a_unboundcfg['regdhcpstatic'] = ($_POST['regdhcpstatic']) ? true : false; - $a_unboundcfg['dhcpfirst'] = ($_POST['dhcpfirst']) ? true : false; if (is_array($_POST['active_interface'])) $a_unboundcfg['active_interface'] = implode(",", $_POST['active_interface']); else @@ -140,8 +139,8 @@ function show_advanced_dns() { <td class="tabnavtbl"> <?php $tab_array = array(); - $tab_array[] = array(gettext("General settings"), true, "services_unbound.php"); - $tab_array[] = array(gettext("Advanced settings"), false, "services_unbound_advanced.php"); + $tab_array[] = array(gettext("General settings"), true, "services_unbound.php"); + $tab_array[] = array(gettext("Advanced settings"), false, "services_unbound_advanced.php"); $tab_array[] = array(gettext("Access Lists"), false, "/services_unbound_acls.php"); display_top_tabs($tab_array, true); ?> @@ -164,6 +163,16 @@ function show_advanced_dns() { </td> </tr> <tr> + <td width="22%" valign="top" class="vncellreq"><?=gettext("Listen Port");?></td> + <td width="78%" class="vtable"> + <p> + <input name="port" type="text" id="port" size="6" <?php if ($pconfig['port']) echo "value=\"{$pconfig['port']}\"";?>> + <br /><br /> + <?=gettext("The port used for responding to DNS queries. It should normally be left blank unless another service needs to bind to TCP/UDP port 53.");?> + </p> + </td> + </tr> + <tr> <td width="22%" valign="top" class="vncellreq"><?=gettext("Network Interfaces"); ?></td> <td width="78%" class="vtable"> <?php @@ -214,7 +223,7 @@ function show_advanced_dns() { <tr> <td width="22%" valign="top" class="vncellreq"><?=gettext("DNSSEC");?></td> <td width="78%" class="vtable"><p> - <input name="dnssec" type="checkbox" id="dnssec" value="yes" <?php if ($pconfig['dnssec'] === true) echo "checked";?>/> + <input name="dnssec" type="checkbox" id="dnssec" value="yes" <?php echo (isset($pconfig['dnssec']) ? "checked" : "");?>/> <strong><?=gettext("Enable DNSSEC Support");?><br /> </strong></p> </td> @@ -222,7 +231,7 @@ function show_advanced_dns() { <tr> <td width="22%" valign="top" class="vncellreq"><?=gettext("DNS Query Forwarding");?></td> <td width="78%" class="vtable"><p> - <input name="forwarding" type="checkbox" id="forwarding" value="yes" <?php if ($pconfig['forwarding'] == "yes") echo "checked";?>> + <input name="forwarding" type="checkbox" id="forwarding" value="yes" <?php echo (isset($pconfig['forwarding']) ? "checked" : "");?>/> <strong><?=gettext("Enable Forwarding Mode");?></strong><br /></p> </td> </tr> @@ -250,21 +259,11 @@ function show_advanced_dns() { </td> </tr> <tr> - <td width="22%" valign="top" class="vncellreq"><?=gettext("Prefer DHCP");?></td> + <td width="22%" valign="top" class="vncellreq"><?=gettext("TXT Comment Support");?></td> <td width="78%" class="vtable"><p> - <input name="dhcpfirst" type="checkbox" id="dhcpfirst" value="yes" <?php if ($pconfig['dhcpfirst'] === true) echo "checked";?>> - <strong><?=gettext("Resolve DHCP mappings first");?><br /> - </strong><?php printf(gettext("If this option is set, then DHCP mappings will ". - "be resolved before the manual list of names below. This only ". - "affects the name given for a reverse lookup (PTR)."));?></p> - </td> - </tr> - <tr> - <td width="22%" valign="top" class="vncellreq"><?=gettext("Listen Port");?></td> - <td width="78%" class="vtable"><p> - <input name="port" type="text" id="port" size="6" <?php if ($pconfig['port']) echo "value=\"{$pconfig['port']}\"";?>> - <br /><br /> - <?=gettext("The port used for responding to DNS queries. It should normally be left blank unless another service needs to bind to TCP/UDP port 53.");?></p> + <input name="txtsupport" type="checkbox" id="txtsupport" value="yes" <?php echo (isset($pconfig['txtsupport']) ? "checked" : "");?>/> + <strong><?=gettext("If this option is set, then any descriptions associated with Host entries and DHCP Static mappings will create a corresponding TXT record.");?><br /> + </strong></p> </td> </tr> <tr> diff --git a/usr/local/www/widgets/javascript/thermal_sensors.js b/usr/local/www/widgets/javascript/thermal_sensors.js index 17f07d0..edc9990 100644 --- a/usr/local/www/widgets/javascript/thermal_sensors.js +++ b/usr/local/www/widgets/javascript/thermal_sensors.js @@ -278,33 +278,16 @@ function pulsateThermalSensorsItems(itemsToPulsate) { } function getSensorFriendlyName(sensorFullName){ + var rzone = /^hw\.acpi\.thermal\.tz([0-9]+)\.temperature$/; + var rcore = /^dev\.cpu\.([0-9]+)\.temperature$/; - var friendlyName = ""; - - switch (sensorFullName) { - case "hw.acpi.thermal.tz0.temperature": - friendlyName = "Zone 0"; - break; - case "hw.acpi.thermal.tz1.temperature": - friendlyName = "Zone 1"; - break; - case "dev.cpu.0.temperature": - friendlyName = "Core 0"; - break; - case "dev.cpu.1.temperature": - friendlyName = "Core 1"; - break; - case "dev.cpu.2.temperature": - friendlyName = "Core 2"; - break; - case "dev.cpu.3.temperature": - friendlyName = "Core 3"; - break; - default: - friendlyName = sensorFullName; - } + if (rzone.test(sensorFullName)) + return "Zone " + rzone.exec(sensorFullName)[1]; + + if (rcore.test(sensorFullName)) + return "Core " + rcore.exec(sensorFullName)[1]; - return friendlyName; + return sensorFullName; } function getThermalSensorValue(stringValue){ diff --git a/usr/local/www/wizard.php b/usr/local/www/wizard.php index 586404a..017d03f 100644 --- a/usr/local/www/wizard.php +++ b/usr/local/www/wizard.php @@ -41,7 +41,7 @@ require("guiconfig.inc"); require("functions.inc"); require_once("filter.inc"); require("shaper.inc"); -require("rrd.inc"); +require_once("rrd.inc"); function gentitle_pkg($pgname) { global $config; |