diff options
author | gnhb <gnoahb@gmail.com> | 2010-06-03 23:01:34 +0700 |
---|---|---|
committer | gnhb <gnoahb@gmail.com> | 2010-06-03 23:01:34 +0700 |
commit | 4749cccb32c4709c032ce5631ea11cbd157c6548 (patch) | |
tree | b5946c7a168e09d494ed29e5237608a07e1a6f8f | |
parent | 1a5f6ddf191db009ae5f798f9e63108216ed3330 (diff) | |
parent | b72eb6c8cc0aa927ee79d4c389429eef1a648433 (diff) | |
download | pfsense-4749cccb32c4709c032ce5631ea11cbd157c6548.zip pfsense-4749cccb32c4709c032ce5631ea11cbd157c6548.tar.gz |
Merge branch 'master' of http://gitweb.pfsense.org/pfsense/mainline into mlppp
76 files changed, 448 insertions, 342 deletions
diff --git a/etc/inc/captiveportal.inc b/etc/inc/captiveportal.inc index 885040b..ce2a834 100644 --- a/etc/inc/captiveportal.inc +++ b/etc/inc/captiveportal.inc @@ -34,7 +34,7 @@ added rules which may have been created by other per-user code (index.php, etc). These changes are (c) 2004 Keycom PLC. - pfSense_BUILDER_BINARIES: /sbin/ifconfig /sbin/ipfw /sbin/sysctl /sbin/kldunload + pfSense_BUILDER_BINARIES: /sbin/ipfw /sbin/sysctl /sbin/kldunload pfSense_BUILDER_BINARIES: /usr/local/sbin/lighttpd /usr/local/bin/minicron /sbin/pfctl pfSense_BUILDER_BINARIES: /bin/hostname /bin/cp pfSense_MODULE: captiveportal @@ -58,7 +58,7 @@ function captiveportal_configure() { $ifaces = get_configured_interface_list(); foreach ($ifaces as $kiface => $kiface2) { $tmpif = get_real_interface($kiface); - mwexec("/sbin/ifconfig {$tmpif} -ipfwfilter"); + pfSense_interface_flags($tmpif, -IFF_IPFW_FILTER); } $cpinterfaces = explode(",", $config['captiveportal']['interface']); $firsttime = 0; @@ -77,14 +77,14 @@ function captiveportal_configure() { if (!empty($carpif)) { $carpsif = explode(" ", $carpif); foreach ($carpsif as $cpcarp) { - mwexec("/sbin/ifconfig {$cpcarp} ipfwfilter"); + pfSense_interface_flags($cpcarp, IFF_IPFW_FILTER); $carpip = find_interface_ip($cpcarp); if (is_ipaddr($carpip)) $cpips[] = $carpip; } } $cpips[] = $cpipm; - mwexec("/sbin/ifconfig {$tmpif} ipfwfilter"); + pfSense_interface_flags($tmpif, IFF_IPFW_FILTER); } } } @@ -108,7 +108,7 @@ function captiveportal_configure() { unlink_if_exists("{$g['vardb_path']}/captiveportal_mac.db"); unlink_if_exists("{$g['vardb_path']}/captiveportal_ip.db"); unlink_if_exists("{$g['vardb_path']}/captiveportal_radius.db"); - mwexec("/sbin/ipfw -q table all flush"); + mwexec("/sbin/ipfw -q table all flush", true); /* setup new database in case someone tries to access the status -> captive portal page */ touch("{$g['vardb_path']}/captiveportal.db"); @@ -391,12 +391,12 @@ EOD; foreach ($listifs as $listrealif => $listif) { if (!empty($listrealif)) { if (does_interface_exist($listrealif)) { - mwexec("/sbin/ifconfig {$listrealif} -ipfwfilter"); + pfSense_interface_flags($listrealif, -IFF_IPFW_FILTER); $carpif = link_ip_to_carp_interface(find_interface_ip($listrealif)); if (!empty($carpif)) { $carpsif = explode(" ", $carpif); foreach ($carpsif as $cpcarp) - mwexec("/sbin/ifconfig {$cpcarp} -ipfwfilter"); + pfSense_interface_flags($cpcarp, -IFF_IPFW_FILTER); } } } diff --git a/etc/inc/config.lib.inc b/etc/inc/config.lib.inc index 435949f..707dee8 100644 --- a/etc/inc/config.lib.inc +++ b/etc/inc/config.lib.inc @@ -359,7 +359,7 @@ function convert_config() { global $config, $g; $now = date("H:i:s"); log_error("Start Configuration upgrade at $now, set execution timeout to 15 minutes"); - ini_set("max_execution_time", "900"); + //ini_set("max_execution_time", "900"); /* special case upgrades */ /* fix every minute crontab bogons entry */ @@ -932,7 +932,7 @@ EODD; if (strcasecmp(chop(fgets($fp)), "y") == 0) { if($config['interfaces']['lan']['if']) - mwexec("/sbin/ifconfig delete " . $config['interfaces']['lan']['if']); + mwexec("/sbin/ifconfig " . $config['interfaces']['lan']['if'] . " delete"); } if(isset($config['interfaces']['lan'])) unset($config['interfaces']['lan']); @@ -950,7 +950,7 @@ EODD; unset($config['nat']); } else { if(isset($config['interfaces']['lan']['if'])) - mwexec("/sbin/ifconfig delete " . $config['interfaces']['lan']['if']); + mwexec("/sbin/ifconfig " . $config['interfaces']['lan']['if'] . " delete"); if(isset($config['interfaces']['lan'])) unset($config['interfaces']['lan']); if(isset($config['dhcpd']['lan'])) diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc index d959b1e..e3f5f0c 100644 --- a/etc/inc/interfaces.inc +++ b/etc/inc/interfaces.inc @@ -51,7 +51,7 @@ function interfaces_bring_up($interface) { log_error( "Backtrace: " . debug_backtrace() ); return; } - mwexec("/sbin/ifconfig " . escapeshellarg($interface) . " up"); + pfSense_interface_flags($interface, IFF_UP); } /* @@ -87,7 +87,7 @@ function does_interface_exist($interface) { function interfaces_loopback_configure() { if($g['booting']) echo "Configuring loopback interface..."; - mwexec("/sbin/ifconfig lo0 127.0.0.1"); + pfSense_interface_setaddress("lo0", "127.0.0.1"); interfaces_bring_up("lo0"); exec("/sbin/route add 127.0.0.2 127.0.0.1"); if($g['booting']) @@ -122,7 +122,7 @@ function interface_vlan_configure(&$vlan) { $vlanif = empty($vlan['vlanif']) ? "{$if}_vlan{$vlan['tag']}" : $vlan['vlanif']; $tag = $vlan['tag']; - if(empty($if)) { + if (empty($if)) { log_error("interface_vlan_confgure called with if undefined."); return; } @@ -130,37 +130,23 @@ function interface_vlan_configure(&$vlan) { /* make sure the parent interface is up */ interfaces_bring_up($if); /* Since we are going to add vlan(4) try to enable all that hardware supports. */ - mwexec("/sbin/ifconfig {$if} vlanhwtag"); - mwexec("/sbin/ifconfig {$if} vlanmtu"); - mwexec("/sbin/ifconfig {$if} vlanhwfilter"); + pfSense_interface_capabilities($if, IFCAP_VLAN_HWTAGGING|IFCAP_VLAN_MTU|IFCAP_VLAN_HWFILTER); if (!empty($vlanif) && does_interface_exist($vlanif)) { interface_bring_down($vlanif); } else { - $tmpvlanif = exec("/sbin/ifconfig vlan create"); - mwexec("/sbin/ifconfig {$tmpvlanif} name {$vlanif}"); - mwexec("/usr/sbin/ngctl name {$tmpvlanif}: {$vlanif}"); + $tmpvlanif = pfSense_interface_create("vlan"); + pfSense_interface_rename($tmpvlanif, $vlanif); + pfSense_ngctl_name("{$tmpvlanif}:", $vlanif); } - - mwexec("/sbin/ifconfig {$vlanif} vlan " . - escapeshellarg($tag) . " vlandev " . - escapeshellarg($if)); + + pfSense_vlan_create($vlanif, $if, $tag); interfaces_bring_up($vlanif); /* invalidate interface cache */ get_interface_arr(true); - /* all vlans need to spoof their parent mac address, too. see - * ticket #1514: http://cvstrac.pfsense.com/tktview?tn=1514,33 - */ - foreach($config['interfaces'] as $interfaces) { - if($interfaces['if'] == $if && $interfaces['spoofmac']) { - mwexec("/sbin/ifconfig " . escapeshellarg($vlanif) . - " link " . escapeshellarg($interfaces['spoofmac'])); - } - } - /* XXX: ermal -- for now leave it here at the moment it does not hurt. */ interfaces_bring_up($if); @@ -333,12 +319,11 @@ function interface_bridge_configure(&$bridge) { $checklist = get_configured_interface_list(); if ($g['booting'] || !empty($bridge['bridgeif'])) { - mwexec("/sbin/ifconfig {$bridge['bridgeif']} destroy"); - mwexec("/sbin/ifconfig {$bridge['bridgeif']} create"); + pfSense_interface_destroy($bridge['bridgeif']); + pfSense_interface_create($bridge['bridgeif']); $bridgeif = $bridge['bridgeif']; - } else { - $bridgeif = exec("/sbin/ifconfig bridge create"); - } + } else + $bridgeif = pfSense_interface_create("bridge"); /* Calculate smaller mtu and enforce it */ $smallermtu = 0; @@ -362,7 +347,7 @@ function interface_bridge_configure(&$bridge) { $realif1 = get_real_interface($member); $realif = escapeshellarg($realif1); /* make sure the parent interface is up */ - mwexec("/sbin/ifconfig {$realif} mtu {$smallermtu}"); + pfSense_interface_mtu($realif, $smallermtu); if(!$realif) log_error("realif not defined in interfaces bridge - up"); interfaces_bring_up($realif1); @@ -486,7 +471,7 @@ function interface_bridge_add_member($bridgeif, $interface) { $mtum = get_interface_mtu($interface); if ($mtu != $mtum) - mwexec("/sbin/ifconfig {$interface} mtu {$mtu}"); + pfSense_interface_mtu($interface, $mtu); interfaces_bring_up($interface); mwexec("/sbin/ifconfig {$bridgeif} addm {$interface}"); @@ -524,11 +509,11 @@ function interface_lagg_configure(&$lagg) { $checklist = get_interface_list(); if ($g['booting'] || !(empty($lagg['laggif']))) { - mwexec("/sbin/ifconfig {$lagg['laggif']} destroy"); - mwexec("/sbin/ifconfig {$lagg['laggif']} create"); + pfSense_interface_destroy($lagg['laggif']); + pfSense_interface_create($lagg['laggif']); $laggif = $lagg['laggif']; } else - $laggif = exec("/sbin/ifconfig lagg create"); + $laggif = pfSense_interface_create("lagg"); /* Calculate smaller mtu and enforce it */ $smallermtu = 0; @@ -548,7 +533,7 @@ function interface_lagg_configure(&$lagg) { if (!array_key_exists($member, $checklist)) continue; /* make sure the parent interface is up */ - mwexec("/sbin/ifconfig {$member} mtu {$smallermtu}"); + pfSense_interface_mtu($member, $smallermtu); interfaces_bring_up($member); mwexec("/sbin/ifconfig {$laggif} laggport {$member}"); } @@ -588,22 +573,21 @@ function interface_gre_configure(&$gre) { interfaces_bring_up($realif); if ($g['booting'] || !(empty($gre['greif']))) { - mwexec("/sbin/ifconfig {$gre['greif']} destroy"); - mwexec("/sbin/ifconfig {$gre['greif']} create"); + pfSense_interface_destroy($gre['greif']); + pfSense_interface_create($gre['greif']); $greif = $gre['greif']; - } else { - $greif = exec("/sbin/ifconfig gre create"); - } + } else + $greif = pfSense_interface_create("gre"); /* Do not change the order here for more see gre(4) NOTES section. */ mwexec("/sbin/ifconfig {$greif} tunnel {$realifip} {$gre['remote-addr']}"); mwexec("/sbin/ifconfig {$greif} {$gre['tunnel-local-addr']} {$gre['tunnel-remote-addr']} netmask " . gen_subnet_mask($gre['tunnel-remote-net'])); if (isset($gre['link0']) && $gre['link0']) - mwexec("/sbin/ifconfig {$greif} link0"); + pfSense_interface_flags($greif, IFF_LINK0); if (isset($gre['link1']) && $gre['link1']) - mwexec("/sbin/ifconfig {$greif} link1"); + pfSense_interface_flags($greif, IFF_LINK1); if (isset($gre['link2']) && $gre['link2']) - mwexec("/sbin/ifconfig {$greif} link2"); + pfSense_interface_flags($greif, IFF_LINK2); if($greif) interfaces_bring_up($greif); @@ -647,19 +631,19 @@ function interface_gif_configure(&$gif) { log_error("could not bring realif up -- variable not defined -- interface_gif_configure()"); if ($g['booting'] || !(empty($gif['gifif']))) { - mwexec("/sbin/ifconfig {$gif['gifif']} destroy"); - mwexec("/sbin/ifconfig {$gif['gifif']} create"); + pfSense_interface_destroy($gif['gifif']); + pfSense_interface_create($gif['gifif']); $gifif = $gif['gifif']; } else - $gifif = exec("/sbin/ifconfig gif create"); + $gifif = pfSense_interface_create("gif"); /* Do not change the order here for more see gif(4) NOTES section. */ mwexec("/sbin/ifconfig {$gifif} tunnel {$realifip} {$gif['remote-addr']}"); mwexec("/sbin/ifconfig {$gifif} {$gif['tunnel-local-addr']} {$gif['tunnel-remote-addr']} netmask " . gen_subnet_mask($gif['tunnel-remote-net'])); if (isset($gif['link0']) && $gif['link0']) - mwexec("/sbin/ifconfig {$gifif} link0"); + pfSense_interface_flags($gifif, IFF_LINK0); if (isset($gif['link1']) && $gif['link1']) - mwexec("/sbin/ifconfig {$gifif} link1"); + pfSense_interface_flags($gifif, IFF_LINK1); if($gifif) interfaces_bring_up($gifif); else @@ -690,6 +674,11 @@ function interfaces_configure() { $delayed_list = array(); $bridge_list = array(); + /* This is needed to speedup interfaces on bootup. */ + $reload = false; + if ($g['booting']) + $reload = true; + foreach($iflist as $if => $ifname) { $realif = $config['interfaces'][$if]['if']; if(is_array($config['interfaces'][$if]['pppoe']) && isset($config['interfaces'][$if]['pppoe']['pppoe-reset-type'])) @@ -707,7 +696,7 @@ function interfaces_configure() { echo "Configuring {$ifname} interface..."; if($g['debug']) log_error("Configuring {$ifname}"); - interface_configure($if, true); + interface_configure($if, $reload); if ($g['booting']) echo "done.\n"; } @@ -728,7 +717,7 @@ function interfaces_configure() { if ($g['debug']) log_error("Configuring {$ifname}"); - interface_configure($if, true); + interface_configure($if, $reload); if ($g['booting']) echo "done.\n"; @@ -743,7 +732,7 @@ function interfaces_configure() { if($g['debug']) log_error("Configuring {$ifname}"); - interface_configure($if, true); + interface_configure($if, $reload); if ($g['booting']) echo "done.\n"; @@ -780,7 +769,7 @@ function interfaces_configure() { function interface_reconfigure($interface = "wan") { interface_bring_down($interface); - interface_configure($interface); + interface_configure($interface, true); } function interface_vip_bring_down(&$vip) { @@ -791,17 +780,17 @@ function interface_vip_bring_down(&$vip) { case "ipalias": $vipif = get_real_interface($vip['interface']); if(does_interface_exist($vipif)) - mwexec("/sbin/ifconfig {$vipif} delete {$vip['subnet']}"); + pfSense_interface_deladdress($vipif, $vip['subnet']); break; case "carp": $vipif = "vip" . $vip['vhid']; if(does_interface_exist($vipif)) - mwexec("/sbin/ifconfig {$vipif} destroy"); + pfSense_interface_destroy($vipif); break; case "carpdev-dhcp": $vipif = "vip" . $vip['vhid']; if(does_interface_exist($vipif)) - mwexec("/sbin/ifconfig {$vipif} destroy"); + pfSense_interface_destroy($vipif); break; } } @@ -838,14 +827,14 @@ function interface_bring_down($interface = "wan", $destroy = false) { unlink_if_exists("{$g['varetc_path']}/dhclient_{$interface}.conf"); if(does_interface_exist("$realif")) { mwexec("/sbin/ifconfig " . escapeshellarg($realif) . " delete", true); - mwexec("/sbin/ifconfig " . escapeshellarg($realif) . " down"); + pfSense_interface_flags($realif, -IFF_UP); mwexec("/usr/sbin/arp -d -i {$realif} -a"); } break; default: if(does_interface_exist("$realif")) { mwexec("/sbin/ifconfig " . escapeshellarg($realif) . " delete", true); - mwexec("/sbin/ifconfig " . escapeshellarg($realif) . " down"); + pfSense_interface_flags($realif, -IFF_UP); mwexec("/usr/sbin/arp -d -i {$realif} -a"); } break; @@ -865,7 +854,7 @@ function interface_bring_down($interface = "wan", $destroy = false) { if ($destroy == true) { if (preg_match("/^tun|^ovpn|^gif|^gre|^lagg|^bridge|vlan/i", $realif)) - mwexec("/sbin/ifconfig {$realif} destroy"); + pfSense_interface_destroy($realif); } return; @@ -1503,11 +1492,11 @@ function interface_carp_configure(&$vip) { /* create the carp interface and setup */ if (does_interface_exist($vipif)) { - interface_bring_down($vipif); + pfSense_interface_flags($vipif, -IFF_UP); } else { - $carpif = exec("/sbin/ifconfig carp create"); - mwexec("/sbin/ifconfig {$carpif} name {$vipif}"); - mwexec("/usr/sbin/ngctl name {$carpif}: {$vipif}"); + $carpif = pfSense_interface_create("carp"); + pfSense_interface_rename($carpif, $vipif); + pfSense_ngctl_name("{$carpif}:", $vipif); } /* invalidate interface cache */ @@ -1553,7 +1542,7 @@ function interface_carpdev_configure(&$vip) { } else { $carpdevif = exec("/sbin/ifconfig carp create"); mwexec("/sbin/ifconfig {$carpdevif} name {$vipif}"); - mwexec("/usr/sbin/ngctl name {$carpdevif}: {$vipif}"); + pfSense_ngctl_name("{$carpdevif}:", $vipif); } mwexec("/sbin/ifconfig {$vipif} carpdev {$realif} vhid {$vip['vhid']} advskew {$vip['advskew']} {$password}"); @@ -1641,7 +1630,7 @@ function interface_wireless_clone($realif, $wlcfg) { if($needs_clone == true) { /* remove previous instance if it exists */ if(does_interface_exist($realif)) - mwexec("/sbin/ifconfig {$realif} destroy"); + pfSense_interface_destroy($realif); log_error("Cloning new wireless interface {$realif}"); // Create the new wlan interface. FreeBSD returns the new interface name. @@ -1653,7 +1642,7 @@ function interface_wireless_clone($realif, $wlcfg) { } $newif = trim($out[0]); // Rename the interface to {$parentnic}_wlan{$number}#: EX: ath0_wlan0 - mwexec("/sbin/ifconfig {$newif} name {$realif} 2>&1", false); + pfSense_interface_rename($newif, $realif); // FIXME: not sure what ngctl is for. Doesn't work. // mwexec("/usr/sbin/ngctl name {$newif}: {$realif}", false); } @@ -2088,6 +2077,18 @@ function interface_configure($interface = "wan", $reloadall = false) { if ($wancfg['spoofmac']) { mwexec("/sbin/ifconfig " . escapeshellarg($realif) . " link " . escapeshellarg($wancfg['spoofmac'])); + + /* + * All vlans need to spoof their parent mac address, too. see + * ticket #1514: http://cvstrac.pfsense.com/tktview?tn=1514,33 + */ + if (is_array($config['vlans']['vlan'])) { + foreach ($config['vlans']['vlan'] as $vlan) { + if ($vlan['if'] == $realif) + mwexec("/sbin/ifconfig " . escapeshellarg($vlan['vlanif']) . + " link " . escapeshellarg($wancfg['spoofmac'])); + } + } } else { $mac = get_interface_mac(get_real_interface($wancfg['if'])); if($mac == "ff:ff:ff:ff:ff:ff") { @@ -2114,7 +2115,7 @@ function interface_configure($interface = "wan", $reloadall = false) { mwexec($cmd); } if (!empty($wancfg['mtu'])) - mwexec("/sbin/ifconfig " . escapeshellarg($realif) . " mtu {$wancfg['mtu']}"); + pfSense_interface_mtu($realif, $wancfg['mtu']); /* invalidate interface/ip/sn cache */ get_interface_arr(true); @@ -2140,10 +2141,7 @@ function interface_configure($interface = "wan", $reloadall = false) { break; default: if ($wancfg['ipaddr'] <> "" && $wancfg['subnet'] <> "") { - if($wancfg['ipaddr'] && $wancfg['subnet']) - mwexec("/sbin/ifconfig " . escapeshellarg($realif) . - " " . escapeshellarg($wancfg['ipaddr'] . "/" . - $wancfg['subnet'])); + pfSense_interface_setaddress($realif, "{$wancfg['ipaddr']}/{$wancfg['subnet']}"); } else if (substr($realif, 0, 3) == "gre") { if (is_array($config['gres']['gre'])) { foreach ($config['gres']['gre'] as $gre) @@ -2219,8 +2217,6 @@ function interface_configure($interface = "wan", $reloadall = false) { } } - unmute_kernel_msgs(); - return 0; } diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc index 15d5282..97aa3e6 100644 --- a/etc/inc/pfsense-utils.inc +++ b/etc/inc/pfsense-utils.inc @@ -188,13 +188,15 @@ function enable_hardware_offloading($interface) { if($int <> "") $interface = $int; $int_family = preg_split("/[0-9]+/", $interface); - $options = strtolower(`/sbin/ifconfig -m {$interface} | grep capabilities`); + $options = pfSense_get_interface_addresses($interface); + if (!is_array($options)) + return; $supported_ints = array('fxp'); if (in_array($int_family, $supported_ints)) { if(isset($config['system']['do_not_use_nic_microcode'])) continue; if(does_interface_exist($interface)) - mwexec("/sbin/ifconfig {$interface} link0"); + pfSense_interface_flags($interface, IFF_LINK0); } /* skip vlans for checksumming and polling */ @@ -202,26 +204,24 @@ function enable_hardware_offloading($interface) { return; if($config['system']['disablechecksumoffloading']) { - if(stristr($options, "txcsum") == true) - mwexec("/sbin/ifconfig {$interface} -txcsum 2>/dev/null"); - if(stristr($options, "rxcsum") == true) - mwexec("/sbin/ifconfig {$interface} -rxcsum 2>/dev/null"); + if (isset($options['encaps']['txcsum'])) + pfSense_interface_capabilities($interface, -IFCAP_TXCSUM); + if (isset($options['encaps']['rxcsum'])) + pfSense_interface_capabilities($interface, -IFCAP_RXCSUM); } else { - if(stristr($options, "txcsum") == true) - mwexec("/sbin/ifconfig {$interface} txcsum 2>/dev/null"); - if(stristr($options, "rxcsum") == true) - mwexec("/sbin/ifconfig {$interface} rxcsum 2>/dev/null"); + if (isset($options['caps']['txcsum'])) + pfSense_interface_capabilities($interface, IFCAP_TXCSUM); + if (isset($options['caps']['rxcsum'])) + pfSense_interface_capabilities($interface, IFCAP_RXCSUM); } /* if the NIC supports polling *AND* it is enabled in the GUI */ - if(interface_supports_polling($interface)) { - $polling = isset($config['system']['polling']); - if($polling) { - mwexec("/sbin/ifconfig {$interface} polling 2>/dev/null"); - } else { - mwexec("/sbin/ifconfig {$interface} -polling 2>/dev/null"); - } - } + $polling = isset($config['system']['polling']); + if($polling && isset($options['caps']['polling'])) + pfSense_interface_capabilities($interface, IFCAP_POLLING); + else + pfSense_interface_capabilities($interface, -IFCAP_POLLING); + return; } @@ -236,29 +236,10 @@ function enable_hardware_offloading($interface) { * ******/ function interface_supports_polling($iface) { - $pattern = '/([a-z].*)[0-9]/'; - preg_match($pattern, $iface, $iface2); - $interface=$iface2[1]; - $supported_ints = array("bge", - "dc", - "em", - "fwe", - "fwip", - "fxp", - "ixgb", - "nfe", - "vge", - "re", - "rl", - "sf", - "sis", - "ste", - "stge", - "vge", - "vr", - "xl"); - if(in_array($interface, $supported_ints)) + $opts = pfSense_get_interface_addresses($iface); + if (is_array($opts) && isset($opts['caps']['polling'])) return true; + return false; } diff --git a/etc/inc/system.inc b/etc/inc/system.inc index 6281a14..75e3f6d 100644 --- a/etc/inc/system.inc +++ b/etc/inc/system.inc @@ -263,15 +263,29 @@ function system_routing_configure() { $interfacegw = ""; /* tack on all the hard defined gateways as well */ if (is_array($config['gateways']['gateway_item'])) { + mwexec("/bin/rm {$g['tmp_path']}/*_defaultgw"); + $foundgw = false; foreach ($config['gateways']['gateway_item'] as $gateway) { if (isset($gateway['defaultgw'])) { if ($gateway['gateway'] == "dynamic") $gateway['gateway'] = get_interface_gateway($gateway['interface']); $gatewayip = $gateway['gateway']; $interfacegw = $gateway['interface']; + if (!empty($interfacegw)) { + $defaultif = get_real_interface($gateway['interface']); + if ($defaultif) + @file_put_contents("{$g['tmp_path']}/{$defaultif}_defaultgw", $gatewayip); + } + $foundgw = true; break; } } + if ($foundgw == false) { + $defaultif = get_real_interface("wan"); + $interfacegw = "wan"; + $gatewayip = get_interface_gateway("wan"); + @touch("{$g['tmp_path']}/{$defaultif}_defaultgw"); + } } $dont_add_route = false; /* if OLSRD is enabled, allow WAN to house DHCP. */ @@ -1418,4 +1432,4 @@ function system_get_dmesg_boot() { return file_get_contents("{$g['varlog_path']}/dmesg.boot"); } -?>
\ No newline at end of file +?> diff --git a/etc/inc/upgrade_config.inc b/etc/inc/upgrade_config.inc index ce0a16b..d732fed 100644 --- a/etc/inc/upgrade_config.inc +++ b/etc/inc/upgrade_config.inc @@ -1539,6 +1539,11 @@ function upgrade_051_to_052() { $csc['wins_server1'] = $csc['dhcp_wins']; unset($csc['dhcp_wins']); + if (!empty($csc['disable'])) + $csc['disable'] = true; + else + unset($csc['disable']); + $config['openvpn']['openvpn-csc'][] = $csc; } @@ -1669,7 +1674,7 @@ function upgrade_054_to_055() { global $g; /* RRD files changed for quality, traffic and packets graphs */ - ini_set("max_execution_time", "1800"); + //ini_set("max_execution_time", "1800"); /* convert traffic RRD file */ global $parsedcfg, $listtags; $listtags = array("ds", "v", "rra", "row"); @@ -171,7 +171,9 @@ if [ ! -h /tmp/tmp ]; then fi # Make sure our /tmp is 777 + Sticky -rm -rf /tmp/* +if [ ! "$PLATFORM" = "cdrom" ] ; then + rm -rf /tmp/* +fi chmod 1777 /tmp if [ ! "$PLATFORM" = "cdrom" ] ; then diff --git a/etc/rc.bootup b/etc/rc.bootup index 0492389..2f977f3 100755 --- a/etc/rc.bootup +++ b/etc/rc.bootup @@ -163,7 +163,6 @@ $wan_if = get_real_interface(); * and ask the user to reassign interfaces. This will * avoid a reboot and thats a good thing. */ -unmute_kernel_msgs(); while(is_interface_mismatch() == true) { echo "\nNetwork interface mismatch -- Running interface assignment option.\n"; set_networking_interfaces_ports(); @@ -201,6 +200,10 @@ system_hosts_generate(); /* configure loopback interface */ interfaces_loopback_configure(); +echo "Starting Secure Shell Services..."; +mwexec_bg("/etc/sshd"); +echo "done.\n"; + /* set up interfaces */ if(!$debugging) mute_kernel_msgs(); @@ -263,10 +266,6 @@ system_routing_configure(); /* enable routing */ system_routing_enable(); -echo "Starting Secure Shell Services..."; -mwexec_bg("/etc/sshd"); -echo "done.\n"; - /* configure console menu */ system_console_configure(); @@ -381,4 +380,4 @@ led_normalize(); conf_mount_ro(); -?>
\ No newline at end of file +?> diff --git a/etc/rc.initial b/etc/rc.initial index 7485e0d..13fcbba 100755 --- a/etc/rc.initial +++ b/etc/rc.initial @@ -62,7 +62,7 @@ echo "10) Filter Logs" echo "11) Restart webConfigurator" echo "12) ${product} Developer Shell" echo "13) Upgrade from console" -SSHD=`netstat -an | grep "*.22" | wc -l` +SSHD=`/usr/bin/sockstat -4l | grep "*.22" | wc -l` if [ "$SSHD" -gt 0 ]; then echo "14) Disable Secure Shell (sshd)"; else @@ -155,7 +155,7 @@ case ${opmode} in fi ;; "") - killall login ; exit + kill $PPID ; exit ;; esac diff --git a/etc/rc.reboot b/etc/rc.reboot index af5d874..ecc47c2 100755 --- a/etc/rc.reboot +++ b/etc/rc.reboot @@ -23,11 +23,4 @@ fi sleep 1 -echo -n "Downing interfaces: " -for INTERFACE in `/sbin/ifconfig -l`; do - echo -n "$INTERFACE " - /sbin/ifconfig $INTERFACE down -done - /sbin/shutdown -r now - diff --git a/sbin/dhclient-script b/sbin/dhclient-script index 5ef88ea..132946d 100755 --- a/sbin/dhclient-script +++ b/sbin/dhclient-script @@ -107,7 +107,7 @@ delete_old_routes() { $LOGGER "Deleting old routes" $ROUTE delete "$old_ip_address" $LOCALHOST >/dev/null 2>&1 # Only allow the default route to be overridden if it's on our own interface - DEFAULTROUTE_IFACE=`route get default | grep interface | awk '{print $2};'` + DEFAULTROUTE_IFACE=`/sbin/route get default | grep interface | awk '{print $2};'` if [ -z "${DEFAULTROUTE_IFACE}" -o "{$interface}" = "${DEFAULTROUTE_IFACE}" ]; then for router in $old_routers; do if [ $if_defaultroute = x -o $if_defaultroute = $interface ]; then @@ -130,23 +130,22 @@ delete_old_routes() { } add_new_routes() { - $LOGGER "Adding new routes" - # $ROUTE add $new_ip_address $LOCALHOST >/dev/null 2>&1 + $LOGGER "Adding new routes to interface: $interface" # Only allow the default route to be overridden if it's on our own interface - DEFAULTROUTE_IFACE=`route get default | grep interface | awk '{print $2};'` - if [ -z "${DEFAULTROUTE_IFACE}" -o "{$interface}" = "${DEFAULTROUTE_IFACE}" ]; then + if [ -f "/tmp/${interface}_defaultgw" ]; then + $ROUTE delete default for router in $new_routers; do if [ "$new_ip_address" = "$router" ]; then - $ROUTE add default -iface $router - #>/dev/null 2>&1 - echo $ROUTE add default -iface $router | $LOGGER - echo $new_routers > /tmp/${interface}_router + $ROUTE add default -iface $interface + echo $ROUTE add default -iface $interface | $LOGGER + echo $router > /tmp/${interface}_router + echo $router > /tmp/${interface}_defaultgw else $ROUTE add default $router echo $ROUTE add default $router | $LOGGER - #>/dev/null 2>&1 - echo $new_routers > /tmp/${interface}_router + echo $router > /tmp/${interface}_router + echo $router > /tmp/${interface}_defaultgw fi # 2nd and subsequent default routers error out, so explicitly # stop processing the list after the first one. @@ -163,13 +162,6 @@ add_new_routes() { echo $new_routers > /tmp/${interface}_router done fi - - # last ditch effort if no route exists. - DEFAULTROUTE=`$NETSTAT -rn | $GREP default` - if [ -z "${DEFAULTROUTE}" ]; then - $ROUTE add default -iface $interface - fi - } add_new_resolv_conf() { @@ -181,7 +173,7 @@ add_new_resolv_conf() { if [ -n "$new_domain_name_servers" ]; then # Remove old entries for nameserver in `cat /var/etc/nameserver_$interface`; do - route delete $nameserver + $ROUTE delete $nameserver done rm -f /var/etc/nameserver_$interface for nameserver in $new_domain_name_servers; do @@ -189,7 +181,7 @@ add_new_resolv_conf() { # so that mulitple wans work correctly with multiple dns # also backup the nameserver for later route removal echo $nameserver >>/var/etc/nameserver_$interface - route add $nameserver -iface $interface + $ROUTE add $nameserver -iface $interface done echo $new_domain_name >/var/etc/defaultdomain.conf fi @@ -219,9 +211,8 @@ if [ -f /etc/dhclient-enter-hooks ]; then fi fi -if [ -x $NETSTAT ]; then - $LOGGER "netstat" - if_defaultroute=`$NETSTAT -rn | $GREP "^default" | $AWK '{print $6}'` +if [ -x $ROUTE ]; then + if_defaultroute=`$ROUTE get default | $GREP interface | $AWK '{print $2}'` else $LOGGER "if_defaultroute" if_defaultroute="x" diff --git a/usr/local/captiveportal/index.php b/usr/local/captiveportal/index.php index 5990ec1..32c8853 100755 --- a/usr/local/captiveportal/index.php +++ b/usr/local/captiveportal/index.php @@ -37,6 +37,8 @@ require_once("auth.inc"); require_once("functions.inc"); require_once("captiveportal.inc"); +$errormsg = "Invalid credentials specified."; + header("Expires: 0"); header("Cache-Control: no-store, no-cache, must-revalidate"); header("Cache-Control: post-check=0, pre-check=0", false); @@ -140,14 +142,14 @@ exit; // YES: user is good for $timecredit minutes. captiveportal_logportalauth($voucher,$clientmac,$clientip,"Voucher login good for $timecredit min."); } else { - portal_reply_page($redirurl, "error", $config['voucher']['msgexpired']); + portal_reply_page($redirurl, "error", $config['voucher']['msgexpired'] ? $config['voucher']['msgexpired']: $errormsg); } } else if (-1 == $timecredit) { // valid but expired captiveportal_logportalauth($voucher,$clientmac,$clientip,"FAILURE","voucher expired"); - portal_reply_page($redirurl, "error", $config['voucher']['msgexpired']); + portal_reply_page($redirurl, "error", $config['voucher']['msgexpired'] ? $config['voucher']['msgexpired']: $errormsg); } else { captiveportal_logportalauth($voucher,$clientmac,$clientip,"FAILURE"); - portal_reply_page($redirurl, "error", $config['voucher']['msgnoaccess']); + portal_reply_page($redirurl, "error", $config['voucher']['msgnoaccess'] ? $config['voucher']['msgnoaccess'] : $errormsg); } } else if ($_POST['accept'] && $radius_enable) { @@ -162,15 +164,15 @@ exit; if ($auth_list['auth_val'] == 1) { captiveportal_logportalauth($_POST['auth_user'],$clientmac,$clientip,"ERROR",$auth_list['error']); - portal_reply_page($redirurl, $type, $auth_list['error']); + portal_reply_page($redirurl, $type, $auth_list['error'] ? $auth_list['error'] : $errormsg); } else if ($auth_list['auth_val'] == 3) { captiveportal_logportalauth($_POST['auth_user'],$clientmac,$clientip,"FAILURE",$auth_list['reply_message']); - portal_reply_page($redirurl, $type, $auth_list['reply_message']); + portal_reply_page($redirurl, $type, $auth_list['reply_message'] ? $auth_list['reply_message'] : $errormsg); } } else { captiveportal_logportalauth($_POST['auth_user'],$clientmac,$clientip,"ERROR"); - portal_reply_page($redirurl, "error", "Invalid username/password specified."); + portal_reply_page($redirurl, "error", $errormsg); } } else if ($_POST['accept'] && $config['captiveportal']['auth_method'] == "local") { @@ -182,7 +184,7 @@ exit; portal_allow($clientip, $clientmac,$_POST['auth_user']); } else { captiveportal_logportalauth($_POST['auth_user'],$clientmac,$clientip,"FAILURE"); - portal_reply_page($redirurl, "error"); + portal_reply_page($redirurl, "error", $errormsg); } } else if ($_POST['accept'] && $clientip) { captiveportal_logportalauth("unauthenticated",$clientmac,$clientip,"ACCEPT"); @@ -294,12 +296,20 @@ function portal_allow($clientip,$clientmac,$username,$password = null, $attribut $mac = captiveportal_passthrumac_findbyname($username); if (!empty($mac)) { if ($_POST['replacemacpassthru']) { - foreach ($a_passthrumacs as $idx => $macent) { + foreach ($config['captiveportal']['passthrumac'] as $idx => $macent) { if ($macent['mac'] == $mac['mac']) { + $macrules = ""; + $ruleno = captiveportal_get_ipfw_passthru_ruleno($mac['mac']); + if ($ruleno) { + captiveportal_free_ipfw_ruleno($ruleno, true); + $macrules .= "delete {$ruleno}\n"; + ++$ruleno; + $macrules .= "delete {$ruleno}\n"; + } unset($config['captiveportal']['passthrumac'][$idx]); $mac['mac'] = $clientmac; $config['captiveportal']['passthrumac'][] = $mac; - $macrules = captiveportal_passthrumac_configure_entry($mac); + $macrules .= captiveportal_passthrumac_configure_entry($mac); file_put_contents("{$g['tmp_path']}/macentry.rules.tmp", $macrules); mwexec("/sbin/ipfw -q {$g['tmp_path']}/macentry.rules.tmp"); $writecfg = true; diff --git a/usr/local/www/fbegin.inc b/usr/local/www/fbegin.inc index 5f02b69..acdd9b8 100755 --- a/usr/local/www/fbegin.inc +++ b/usr/local/www/fbegin.inc @@ -408,9 +408,17 @@ function add_to_menu($url, $name) { <div> <span class="pgtitle"><?=genhtmltitle($pgtitle);?></font></span> +<span style="float:right; margin: 0 0 20px 20px;"> +<?php if(! empty($statusurl)): ?> +<a href="<?php echo $statusurl; ?>" target="_new" title="Status of items on this page."><img src="/themes/<?php echo $g['theme']; ?>/images/status.png" border="0"></a> +<?php endif; ?> +<?php if(! empty($logurl)): ?> +<a href="<?php echo $logurl; ?>" target="_new" title="Log entries for items on this page."><img src="/themes/<?php echo $g['theme']; ?>/images/log.png" border="0"></a> +<?php endif; ?> <?php if(! $g['disablehelpicon']): ?> -<span style="float:right; margin: 0 0 20px 20px;"><a href="<?php echo $helpurl; ?>" target="_new" title="Help for items on this page."><img src="/themes/<?php echo $g['theme']; ?>/images/help.png" border="0"></a></span> +<a href="<?php echo $helpurl; ?>" target="_new" title="Help for items on this page."><img src="/themes/<?php echo $g['theme']; ?>/images/help.png" border="0"></a> <?php endif; ?> +</span> </div> <br /> diff --git a/usr/local/www/firewall_rules.php b/usr/local/www/firewall_rules.php index 0edba70..b9888e6 100755 --- a/usr/local/www/firewall_rules.php +++ b/usr/local/www/firewall_rules.php @@ -42,6 +42,9 @@ ##|-PRIV $pgtitle = array("Firewall", "Rules"); +$statusurl = "status_filter_reload.php"; +$logurl = "diag_logs_filter.php"; + require("guiconfig.inc"); require_once("functions.inc"); require_once("filter.inc"); diff --git a/usr/local/www/firewall_rules_edit.php b/usr/local/www/firewall_rules_edit.php index 2baaef0..342b689 100755 --- a/usr/local/www/firewall_rules_edit.php +++ b/usr/local/www/firewall_rules_edit.php @@ -549,6 +549,9 @@ read_layer7_config(); $l7clist =& get_l7_unique_list(); $pgtitle = array("Firewall","Rules","Edit"); +$statusurl = "status_filter_reload.php"; +$logurl = "diag_logs_filter.php"; + $closehead = false; $page_filename = "firewall_rules_edit.php"; diff --git a/usr/local/www/firewall_shaper.php b/usr/local/www/firewall_shaper.php index 6b6824f..6618389 100755 --- a/usr/local/www/firewall_shaper.php +++ b/usr/local/www/firewall_shaper.php @@ -52,6 +52,7 @@ if($_GET['reset'] <> "") { } $pgtitle = array("Firewall","Traffic Shaper"); +$statusurl = "status_queues.php"; $shaperIFlist = get_configured_interface_with_descr(); read_altq_config(); diff --git a/usr/local/www/firewall_shaper_layer7.php b/usr/local/www/firewall_shaper_layer7.php index 1fe4ead..3e2dc22 100755 --- a/usr/local/www/firewall_shaper_layer7.php +++ b/usr/local/www/firewall_shaper_layer7.php @@ -57,6 +57,7 @@ $show_proto_form = false; //More variables $pgtitle = array("Firewall","Traffic Shaper", "Layer7"); +$statusurl = "status_queues.php"; $output_form = ""; diff --git a/usr/local/www/firewall_shaper_queues.php b/usr/local/www/firewall_shaper_queues.php index 1072d72..35b6f21 100755 --- a/usr/local/www/firewall_shaper_queues.php +++ b/usr/local/www/firewall_shaper_queues.php @@ -170,6 +170,7 @@ if ($_POST['apply']) { } $pgtitle = "Firewall: Shaper: By Queues View"; +$statusurl = "status_queues.php"; include("head.inc"); ?> diff --git a/usr/local/www/firewall_shaper_vinterface.php b/usr/local/www/firewall_shaper_vinterface.php index 45ec5cc..b6c8c76 100644 --- a/usr/local/www/firewall_shaper_vinterface.php +++ b/usr/local/www/firewall_shaper_vinterface.php @@ -52,6 +52,7 @@ if($_GET['reset'] <> "") { } $pgtitle = array("Firewall","Traffic Shaper", "Limiter"); +$statusurl = "status_queues.php"; read_dummynet_config(); /* diff --git a/usr/local/www/firewall_shaper_wizards.php b/usr/local/www/firewall_shaper_wizards.php index 1557242..acd744c 100755 --- a/usr/local/www/firewall_shaper_wizards.php +++ b/usr/local/www/firewall_shaper_wizards.php @@ -71,6 +71,7 @@ if ($_POST['apply']) { } $pgtitle = array("Firewall", "Traffic Shaper", "Wizards"); +$statusurl = "status_queues.php"; $wizards = array("Single Lan multi Wan" => "traffic_shaper_wizard.xml", "Single Wan multi Lan" => "traffic_shaper_wizard_multi_lan.xml", diff --git a/usr/local/www/index.php b/usr/local/www/index.php index 4125b51..0463750 100755 --- a/usr/local/www/index.php +++ b/usr/local/www/index.php @@ -165,7 +165,7 @@ EOF; if ($fd) { while (!feof($fd)) { $dmesgl = fgets($fd); - if (preg_match("/^hifn.: (.*?),/", $dmesgl, $matches) or preg_match("/^safe.: (.*?),/", $dmesgl, $matches) or preg_match("/^ubsec.: (.*?),/", $dmesgl, $matches) or preg_match("/^padlock.: <(.*?)>,/", $dmesgl, $matches) or preg_match("/^glxsb.: (.*?),/", $dmesgl, $matches)) { + if (preg_match("/^hifn.: (.*?),/", $dmesgl, $matches) or preg_match("/.*(VIA Padlock)/", $dmesgl, $matches) or preg_match("/^safe.: (.*?),/", $dmesgl, $matches) or preg_match("/^ubsec.: (.*?),/", $dmesgl, $matches) or preg_match("/^padlock.: <(.*?)>,/", $dmesgl, $matches) or preg_match("/^glxsb.: (.*?),/", $dmesgl, $matches)) { $hwcrypto = $matches[1]; break; } diff --git a/usr/local/www/installer.php b/usr/local/www/installer.php index 534ff63..f988d02 100644 --- a/usr/local/www/installer.php +++ b/usr/local/www/installer.php @@ -29,6 +29,25 @@ require("guiconfig.inc"); +if($g['platform'] == "pfSense" or $g['platform'] == "nanobsd") { + Header("Location: /index.php"); + exit; +} + +// Main switch dispatcher +switch ($_REQUEST['state']) { + case "quickeasyinstall": + quickeasyinstall_gui(); + break; + case "update_installer_status": + update_installer_status(); + exit; + case "quickeasyinstall": + begin_quick_easy_install(); + default: + installer_main(); +} + function write_out_pc_sysinstaller_config($disk) { $fd = fopen("/PCBSD/pc-sysinstall/examples/pfSense-install.cfg", "w"); if(!$fd) { @@ -73,6 +92,10 @@ EOF; function start_installation() { $fd = fopen("/tmp/installer.sh", "w"); + if(!$fd) { + die("Could not open /tmp/installer.sh for writing"); + exit; + } fwrite($fd, "/PCBSD/pc-sysinstall/pc-sysinstall -c /PCBSD/pc-sysinstall/examples/pfSense-install.cfg && touch /tmp/install_complete"); fclose($fd); exec("chmod a+rx /tmp/installer.sh"); @@ -115,166 +138,139 @@ function begin_quick_easy_install() { start_installation(); } -if($_REQUEST['state'] == "update_installer_status") { - update_installer_status(); - exit; -} - -if($_REQUEST['step1_post']) { - -} - -if($_REQUEST['step2_post']) { - -} +function body_html() { + $pfSversion = str_replace("\n", "", file_get_contents("/etc/version")); + if(strstr($pfSversion, "1.2")) + $one_two = true; + $pgtitle = "pfSense: Installer"; + include("head.inc"); + echo <<<EOF + <body link="#0000CC" vlink="#0000CC" alink="#0000CC"> + <script src="/javascript/scriptaculous/prototype.js" type="text/javascript"></script> + <script type="text/javascript"> + function getinstallerprogress() { + url = 'installer.php'; + pars = 'state=update_installer_status'; + callajax(url, pars, installcallback); + } + function callajax(url, pars, activitycallback) { + var myAjax = new Ajax.Request( + url, + { + method: 'post', + parameters: pars, + onComplete: activitycallback + }); + } + function installcallback(transport) { + this.document.forms[0].installeroutput.value=transport.responseText; + setTimeout('getinstallerprogress()', 1000); + } + </script> +EOF; + include("fbegin.inc"); -if($_REQUEST['step3_post']) { - -} + if($one_two) + echo "<p class=\"pgtitle\">{$pgtitle}</font></p>"; -if($_REQUEST['step4_post']) { - + if ($savemsg) print_info_box($savemsg); } -$pfSversion = str_replace("\n", "", file_get_contents("/etc/version")); -if(strstr($pfSversion, "1.2")) - $one_two = true; - -$pgtitle = "pfSense: Installer"; -include("head.inc"); - -?> -<body link="#0000CC" vlink="#0000CC" alink="#0000CC"> -<script src="/javascript/scriptaculous/prototype.js" type="text/javascript"></script> - <script type="text/javascript"> - function getinstallerprogress() { - url = 'installer.php'; - pars = 'state=update_installer_status'; - callajax(url, pars, installcallback); - } - function callajax(url, pars, activitycallback) { - var myAjax = new Ajax.Request( - url, - { - method: 'post', - parameters: pars, - onComplete: activitycallback - }); - } - function installcallback(transport) { - this.document.forms[0].installeroutput.value=transport.responseText; - setTimeout('getinstallerprogress()', 1000); - } -</script> -<?php include("fbegin.inc"); ?> - -<?php if($one_two): ?> -<p class="pgtitle"><?=$pgtitle?></font></p> -<?php endif; ?> - -<?php if ($savemsg) print_info_box($savemsg); ?> - -<?php -if($_REQUEST['state'] == "quickeasyinstall") { - quickeasyinstall_gui(); -} else { - installer_main(); +function end_html() { + echo "</form>"; + include("fend.inc"); + echo "</body>"; + echo "</html>"; } function template() { -echo <<<EOF -<div id="mainlevel"> - <table width="100%" border="0" cellpadding="0" cellspacing="0"> - <tr> - <td> - <div id="mainarea"> - <table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0"> - <tr> - <td class="tabcont" > - <form action="installer.php" method="post"> - <div id="pfsensetemplate"> - - - </div> - </td> - </tr> - </table> - </div> - </td> - </tr> - </table> -</div> + body_html(); + echo <<<EOF + <div id="mainlevel"> + <table width="100%" border="0" cellpadding="0" cellspacing="0"> + <tr> + <td> + <div id="mainarea"> + <table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0"> + <tr> + <td class="tabcont" > + <form action="installer.php" method="post"> + <div id="pfsensetemplate"> + + + </div> + </td> + </tr> + </table> + </div> + </td> + </tr> + </table> + </div> EOF; - + end_html(); } function quickeasyinstall_gui() { + body_html(); echo <<<EOF -<div id="mainlevel"> - <table width="100%" border="0" cellpadding="0" cellspacing="0"> - <tr> - <td> - <div id="mainarea"> - <table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0"> - <tr> - <td class="tabcont" > - <form action="installer.php" method="post" state="step1_post"> - <div id="pfsenseinstaller"> - Starting Installer... Please wait...<p/> - {{ Insert progressbar here }}<p/> - <textarea name='installeroutput' id='installeroutput' rows="20" cols="80"> - </textarea> - </div> - </td> - </tr> - </table> - </div> - </td> - </tr> - </table> -</div> -<script type="text/javascript">setTimeout('getinstallerprogress()', 250);</script> + <div id="mainlevel"> + <table width="100%" border="0" cellpadding="0" cellspacing="0"> + <tr> + <td> + <div id="mainarea"> + <table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0"> + <tr> + <td class="tabcont" > + <form action="installer.php" method="post" state="step1_post"> + <div id="pfsenseinstaller"> + Starting Installer... Please wait...<p/> + {{ Insert progressbar here }}<p/> + <textarea name='installeroutput' id='installeroutput' rows="20" cols="80"> + </textarea> + </div> + </td> + </tr> + </table> + </div> + </td> + </tr> + </table> + </div> + <script type="text/javascript">setTimeout('getinstallerprogress()', 250);</script> EOF; - + end_html(); } - function installer_main() { -echo <<<EOF -<div id="mainlevel"> - <table width="100%" border="0" cellpadding="0" cellspacing="0"> - <tr> - <td> - <div id="mainarea"> - <table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0"> - <tr> - <td class="tabcont" > - <form action="installer.php" method="post" state="step1_post"> - <div id="pfsenseinstaller"> - <a href='installer.php?state=quickeasyinstall'>Quick/Easy installation</a> - </p> - </div> - </td> - </tr> - </table> - </div> - </td> - </tr> - </table> -</div> + body_html(); + $disk = installer_find_first_disk(); + if(!$disk) + echo "WARNING: Could not find any suitable disks for installation."; + echo <<<EOF + <div id="mainlevel"> + <table width="100%" border="0" cellpadding="0" cellspacing="0"> + <tr> + <td> + <div id="mainarea"> + <table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0"> + <tr> + <td class="tabcont" > + <form action="installer.php" method="post" state="step1_post"> + <div id="pfsenseinstaller"> + <a onclick="return confirm('Are you sure you want to install pfSense to $disk?')"> href='installer.php?state=quickeasyinstall'>Quick/Easy installation</a> + </p> + </div> + </td> + </tr> + </table> + </div> + </td> + </tr> + </table> + </div> EOF; - + end_html(); } -?> - -</form> -<?php include("fend.inc"); ?> -</body> -</html> - -<?php - if($_REQUEST['state'] == "quickeasyinstall") { - begin_quick_easy_install(); - } -?> +?>
\ No newline at end of file diff --git a/usr/local/www/interfaces.php b/usr/local/www/interfaces.php index d215871..d01008c 100755 --- a/usr/local/www/interfaces.php +++ b/usr/local/www/interfaces.php @@ -869,6 +869,8 @@ function check_wireless_mode() { } $pgtitle = array("Interfaces", $pconfig['descr']); +$statusurl = "status_interfaces.php"; + $closehead = false; include("head.inc"); $types = array("none" => "None", "static" => "Static", "dhcp" => "DHCP", "ppp" => "PPP", "pppoe" => "PPPoE", "pptp" => "PPTP" /* , "carpdev-dhcp" => "CarpDev"*/); diff --git a/usr/local/www/interfaces_assign.php b/usr/local/www/interfaces_assign.php index 36aa469..a3f2ce9 100755 --- a/usr/local/www/interfaces_assign.php +++ b/usr/local/www/interfaces_assign.php @@ -41,6 +41,8 @@ ##|-PRIV $pgtitle = array("Interfaces", "Assign network ports"); +$statusurl = "status_interfaces.php"; + require("guiconfig.inc"); require("functions.inc"); require("filter.inc"); diff --git a/usr/local/www/load_balancer_monitor.php b/usr/local/www/load_balancer_monitor.php index ebb6406..2f0f372 100755 --- a/usr/local/www/load_balancer_monitor.php +++ b/usr/local/www/load_balancer_monitor.php @@ -86,6 +86,10 @@ if ($_GET['act'] == "del") { } $pgtitle = array("Services", "Load Balancer","Monitor"); +#$statusurl = "status_slbd_vs.php"; +$statusurl = "status_slbd_pool.php"; +$logurl = "diag_logs_relayd.php"; + include("head.inc"); ?> diff --git a/usr/local/www/load_balancer_monitor_edit.php b/usr/local/www/load_balancer_monitor_edit.php index 320a54f..c3b269f 100755 --- a/usr/local/www/load_balancer_monitor_edit.php +++ b/usr/local/www/load_balancer_monitor_edit.php @@ -188,6 +188,10 @@ if ($_POST) { } $pgtitle = array("Services", "Load Balancer","Monitor","Edit"); +#$statusurl = "status_slbd_vs.php"; +$statusurl = "status_slbd_pool.php"; +$logurl = "diag_logs_relayd.php"; + include("head.inc"); $types = array("icmp" => "ICMP", "tcp" => "TCP", "http" => "HTTP", "https" => "HTTPS", "send" => "Send/Expect"); diff --git a/usr/local/www/load_balancer_pool.php b/usr/local/www/load_balancer_pool.php index c320683..4742ab1 100755 --- a/usr/local/www/load_balancer_pool.php +++ b/usr/local/www/load_balancer_pool.php @@ -95,6 +95,10 @@ for ($i = 0; isset($config['load_balancer']['lbpool'][$i]); $i++) { } $pgtitle = array("Services", "Load Balancer","Pool"); +#$statusurl = "status_slbd_vs.php"; +$statusurl = "status_slbd_pool.php"; +$logurl = "diag_logs_relayd.php"; + include("head.inc"); ?> diff --git a/usr/local/www/load_balancer_pool_edit.php b/usr/local/www/load_balancer_pool_edit.php index a81faa3..5936d35 100755 --- a/usr/local/www/load_balancer_pool_edit.php +++ b/usr/local/www/load_balancer_pool_edit.php @@ -138,6 +138,10 @@ if ($_POST) { } $pgtitle = array("Services", "Load Balancer","Pool","Edit"); +#$statusurl = "status_slbd_vs.php"; +$statusurl = "status_slbd_pool.php"; +$logurl = "diag_logs_relayd.php"; + include("head.inc"); ?> diff --git a/usr/local/www/load_balancer_relay_action.php b/usr/local/www/load_balancer_relay_action.php index 8926f65..36b4b8f 100755 --- a/usr/local/www/load_balancer_relay_action.php +++ b/usr/local/www/load_balancer_relay_action.php @@ -102,6 +102,10 @@ if ($_GET['act'] == "del") { */ $pgtitle = array("Services", "Load Balancer","Relay Action"); +#$statusurl = "status_slbd_vs.php"; +$statusurl = "status_slbd_pool.php"; +$logurl = "diag_logs_relayd.php"; + include("head.inc"); ?> diff --git a/usr/local/www/load_balancer_relay_action_edit.php b/usr/local/www/load_balancer_relay_action_edit.php index 218c49d..dc47e45 100755 --- a/usr/local/www/load_balancer_relay_action_edit.php +++ b/usr/local/www/load_balancer_relay_action_edit.php @@ -176,6 +176,10 @@ if ($_POST) { } $pgtitle = array("Services", "Load Balancer","Relay Action","Edit"); +#$statusurl = "status_slbd_vs.php"; +$statusurl = "status_slbd_pool.php"; +$logurl = "diag_logs_relayd.php"; + include("head.inc"); $types = array("http" => "HTTP", "tcp" => "TCP", "dns" => "DNS"); ?> diff --git a/usr/local/www/load_balancer_relay_protocol.php b/usr/local/www/load_balancer_relay_protocol.php index 767e962..f854041 100755 --- a/usr/local/www/load_balancer_relay_protocol.php +++ b/usr/local/www/load_balancer_relay_protocol.php @@ -98,6 +98,10 @@ if ($_GET['act'] == "del") { */ $pgtitle = array("Services", "Load Balancer","Relay Protocol"); +#$statusurl = "status_slbd_vs.php"; +$statusurl = "status_slbd_pool.php"; +$logurl = "diag_logs_relayd.php"; + include("head.inc"); ?> diff --git a/usr/local/www/load_balancer_relay_protocol_edit.php b/usr/local/www/load_balancer_relay_protocol_edit.php index eac04c1..4575aeb 100755 --- a/usr/local/www/load_balancer_relay_protocol_edit.php +++ b/usr/local/www/load_balancer_relay_protocol_edit.php @@ -132,6 +132,10 @@ if ($_POST) { } $pgtitle = array("Services", "Load Balancer","Relay Protocol","Edit"); +#$statusurl = "status_slbd_vs.php"; +$statusurl = "status_slbd_pool.php"; +$logurl = "diag_logs_relayd.php"; + include("head.inc"); $types = array("http" => "HTTP", "tcp" => "TCP", "dns" => "DNS"); diff --git a/usr/local/www/load_balancer_virtual_server.php b/usr/local/www/load_balancer_virtual_server.php index 772cbf8..9114dc9 100755 --- a/usr/local/www/load_balancer_virtual_server.php +++ b/usr/local/www/load_balancer_virtual_server.php @@ -94,6 +94,10 @@ for ($i = 0; isset($config['load_balancer']['virtual_server'][$i]); $i++) { } $pgtitle = array("Services","Load Balancer","Virtual Servers"); +$statusurl = "status_slbd_vs.php"; +#$statusurl = "status_slbd_pool.php"; +$logurl = "diag_logs_relayd.php"; + include("head.inc"); ?> diff --git a/usr/local/www/load_balancer_virtual_server_edit.php b/usr/local/www/load_balancer_virtual_server_edit.php index 6eb49bd..dda2c71 100755 --- a/usr/local/www/load_balancer_virtual_server_edit.php +++ b/usr/local/www/load_balancer_virtual_server_edit.php @@ -129,6 +129,10 @@ if ($_POST) { } $pgtitle = array("Services", "Load Balancer","Virtual Server","Edit"); +$statusurl = "status_slbd_vs.php"; +#$statusurl = "status_slbd_pool.php"; +$logurl = "diag_logs_relayd.php"; + include("head.inc"); ?> diff --git a/usr/local/www/services_captiveportal.php b/usr/local/www/services_captiveportal.php index 331708a..5206535 100755 --- a/usr/local/www/services_captiveportal.php +++ b/usr/local/www/services_captiveportal.php @@ -39,6 +39,9 @@ ##|-PRIV $pgtitle = array("Services","Captive portal"); +$statusurl = "status_captiveportal.php"; +$logurl = "diag_logs_auth.php"; + require("guiconfig.inc"); require("functions.inc"); require("filter.inc"); @@ -288,7 +291,6 @@ function enable_change(enable_change) { $tab_array[] = array("Allowed IP addresses", false, "services_captiveportal_ip.php"); $tab_array[] = array("Vouchers", false, "services_captiveportal_vouchers.php"); $tab_array[] = array("File Manager", false, "services_captiveportal_filemanager.php"); - $tab_array[] = array("Auth Logs", false, "diag_logs_auth.php"); display_top_tabs($tab_array); ?> </td></tr> <tr> diff --git a/usr/local/www/services_captiveportal_filemanager.php b/usr/local/www/services_captiveportal_filemanager.php index 2c8d815..efef6b7 100755 --- a/usr/local/www/services_captiveportal_filemanager.php +++ b/usr/local/www/services_captiveportal_filemanager.php @@ -50,6 +50,9 @@ function cpelements_sort() { } $pgtitle = array("Services","Captive portal"); +$statusurl = "status_captiveportal.php"; +$logurl = "diag_logs_auth.php"; + require("guiconfig.inc"); require("functions.inc"); @@ -137,7 +140,6 @@ include("head.inc"); $tab_array[] = array("Allowed IP addresses", false, "services_captiveportal_ip.php"); $tab_array[] = array("Vouchers", false, "services_captiveportal_vouchers.php"); $tab_array[] = array("File Manager", true, "services_captiveportal_filemanager.php"); - $tab_array[] = array("Auth Logs", false, "diag_logs_auth.php"); display_top_tabs($tab_array); ?> </td></tr> <tr> diff --git a/usr/local/www/services_captiveportal_ip.php b/usr/local/www/services_captiveportal_ip.php index 61e05e5..29acb1c 100755 --- a/usr/local/www/services_captiveportal_ip.php +++ b/usr/local/www/services_captiveportal_ip.php @@ -40,6 +40,9 @@ ##|-PRIV $pgtitle = array("Services","Captive portal"); +$statusurl = "status_captiveportal.php"; +$logurl = "diag_logs_auth.php"; + require("guiconfig.inc"); require("functions.inc"); require("filter.inc"); @@ -85,7 +88,6 @@ include("head.inc"); $tab_array[] = array("Allowed IP addresses", true, "services_captiveportal_ip.php"); $tab_array[] = array("Vouchers", false, "services_captiveportal_vouchers.php"); $tab_array[] = array("File Manager", false, "services_captiveportal_filemanager.php"); - $tab_array[] = array("Auth Logs", false, "diag_logs_auth.php"); display_top_tabs($tab_array); ?> </td></tr> diff --git a/usr/local/www/services_captiveportal_ip_edit.php b/usr/local/www/services_captiveportal_ip_edit.php index 57e8476..419327d 100755 --- a/usr/local/www/services_captiveportal_ip_edit.php +++ b/usr/local/www/services_captiveportal_ip_edit.php @@ -50,6 +50,9 @@ function allowedips_sort() { } $pgtitle = array("Services","Captive portal","Edit allowed IP address"); +$statusurl = "status_captiveportal.php"; +$logurl = "diag_logs_auth.php"; + require("guiconfig.inc"); require("functions.inc"); require("filter.inc"); diff --git a/usr/local/www/services_captiveportal_mac.php b/usr/local/www/services_captiveportal_mac.php index 3e459f4..8e64fd8 100755 --- a/usr/local/www/services_captiveportal_mac.php +++ b/usr/local/www/services_captiveportal_mac.php @@ -39,6 +39,9 @@ ##|-PRIV $pgtitle = array("Services","Captive portal"); +$statusurl = "status_captiveportal.php"; +$logurl = "diag_logs_auth.php"; + require("guiconfig.inc"); require("functions.inc"); require("filter.inc"); @@ -83,6 +86,7 @@ if ($_POST) { if ($found == true) { $ruleno = captiveportal_get_ipfw_passthru_ruleno($_POST['delmac']); if ($ruleno) { + captiveportal_free_ipfw_ruleno($ruleno, true); mwexec("/sbin/ipfw delete {$ruleno}; /sbin/ipfw delete " . ++$ruleno); } unset($a_passthrumacs[$idx]); @@ -125,7 +129,6 @@ include("head.inc"); $tab_array[] = array("Allowed IP addresses", false, "services_captiveportal_ip.php"); $tab_array[] = array("Vouchers", false, "services_captiveportal_vouchers.php"); $tab_array[] = array("File Manager", false, "services_captiveportal_filemanager.php"); - $tab_array[] = array("Auth Logs", false, "diag_logs_auth.php"); display_top_tabs($tab_array); ?> </td></tr> diff --git a/usr/local/www/services_captiveportal_mac_edit.php b/usr/local/www/services_captiveportal_mac_edit.php index bc397b7..b55e750 100755 --- a/usr/local/www/services_captiveportal_mac_edit.php +++ b/usr/local/www/services_captiveportal_mac_edit.php @@ -49,6 +49,9 @@ function passthrumacs_sort() { } $pgtitle = array("Services","Captive portal","Edit pass-through MAC address"); +$statusurl = "status_captiveportal.php"; +$logurl = "diag_logs_auth.php"; + require("guiconfig.inc"); require("functions.inc"); require("filter.inc"); diff --git a/usr/local/www/services_captiveportal_vouchers.php b/usr/local/www/services_captiveportal_vouchers.php index de305b7..f6c4577 100644 --- a/usr/local/www/services_captiveportal_vouchers.php +++ b/usr/local/www/services_captiveportal_vouchers.php @@ -37,6 +37,9 @@ ##|-PRIV $pgtitle = array("Services", "Captive portal", "Vouchers"); +$statusurl = "status_captiveportal_vouchers.php"; +$logurl = "diag_logs_auth.php"; + require("guiconfig.inc"); require("functions.inc"); require("filter.inc"); @@ -244,7 +247,6 @@ function enable_change(enable_change) { $tab_array[] = array("Allowed IP addresses", false, "services_captiveportal_ip.php"); $tab_array[] = array("Vouchers", true, "services_captiveportal_vouchers.php"); $tab_array[] = array("File Manager", false, "services_captiveportal_filemanager.php"); - $tab_array[] = array("Auth Logs", false, "diag_logs_auth.php"); display_top_tabs($tab_array); ?> </ul> diff --git a/usr/local/www/services_captiveportal_vouchers_edit.php b/usr/local/www/services_captiveportal_vouchers_edit.php index ee95927..cacbb61 100644 --- a/usr/local/www/services_captiveportal_vouchers_edit.php +++ b/usr/local/www/services_captiveportal_vouchers_edit.php @@ -36,6 +36,9 @@ ##|-PRIV $pgtitle = array("Services", "Captive portal", "Edit Voucher Rolls"); +$statusurl = "status_captiveportal_vouchers.php"; +$logurl = "diag_logs_auth.php"; + require("guiconfig.inc"); require("functions.inc"); require("filter.inc"); diff --git a/usr/local/www/services_dhcp.php b/usr/local/www/services_dhcp.php index 0bbb3bc..d4259ed 100755 --- a/usr/local/www/services_dhcp.php +++ b/usr/local/www/services_dhcp.php @@ -373,6 +373,9 @@ if ($_GET['act'] == "del") { } $pgtitle = array("Services","DHCP server"); +$statusurl = "diag_dhcp_leases.php"; +$logurl = "diag_logs_dhcp.php"; + include("head.inc"); ?> diff --git a/usr/local/www/services_dhcp_edit.php b/usr/local/www/services_dhcp_edit.php index 86fefe3..e7bc745 100755 --- a/usr/local/www/services_dhcp_edit.php +++ b/usr/local/www/services_dhcp_edit.php @@ -177,6 +177,9 @@ if ($_POST) { } $pgtitle = array("Services","DHCP","Edit static mapping"); +$statusurl = "diag_dhcp_leases.php"; +$logurl = "diag_logs_dhcp.php"; + include("head.inc"); ?> diff --git a/usr/local/www/system_gateway_groups.php b/usr/local/www/system_gateway_groups.php index d79627f..43dfea7 100755 --- a/usr/local/www/system_gateway_groups.php +++ b/usr/local/www/system_gateway_groups.php @@ -86,6 +86,8 @@ if ($_GET['act'] == "del") { } $pgtitle = array(gettext("System"),gettext("Gateway Groups")); +$statusurl = "status_gateway_groups.php"; + include("head.inc"); ?> diff --git a/usr/local/www/system_gateway_groups_edit.php b/usr/local/www/system_gateway_groups_edit.php index d5076c1..1a504c5 100755 --- a/usr/local/www/system_gateway_groups_edit.php +++ b/usr/local/www/system_gateway_groups_edit.php @@ -141,6 +141,8 @@ if ($_POST) { } $pgtitle = array(gettext("System"),gettext("Gateways"),gettext("Edit gateway")); +$statusurl = "status_gateway_groups.php"; + include("head.inc"); ?> diff --git a/usr/local/www/system_gateways.php b/usr/local/www/system_gateways.php index 6f38012..82004a7 100755 --- a/usr/local/www/system_gateways.php +++ b/usr/local/www/system_gateways.php @@ -118,6 +118,8 @@ if ($_GET['act'] == "del") { $pgtitle = array(gettext("System"),gettext("Gateways")); +$statusurl = "status_gateways.php"; + include("head.inc"); ?> diff --git a/usr/local/www/system_gateways_edit.php b/usr/local/www/system_gateways_edit.php index 5c14f17..69cc405 100755 --- a/usr/local/www/system_gateways_edit.php +++ b/usr/local/www/system_gateways_edit.php @@ -76,7 +76,7 @@ if (isset($id) && $a_gateways[$id]) { $pconfig['down'] = $a_gateway_item[$id]['down']; if (isset($a_gateways[$id]['dynamic'])) $pconfig['dynamic'] = true; - if($a_gateways[$id]['monitor'] <> "") { + if(($a_gateways[$id]['monitor'] <> "") && ($a_gateways[$id]['attribute'] != "system") && ($a_gateways[$id]['gateway'] != "dynamic")) { $pconfig['monitor'] = $a_gateways[$id]['monitor']; } else { $pconfig['monitor'] == ""; @@ -279,6 +279,8 @@ if ($_POST) { $pgtitle = array(gettext("System"),gettext("Gateways"),gettext("Edit gateway")); +$statusurl = "status_gateways.php"; + include("head.inc"); ?> @@ -346,7 +348,7 @@ function show_advanced_gateway() { <tr> <td width="22%" valign="top" class="vncellreq"><?=gettext("Gateway"); ?></td> <td width="78%" class="vtable"> - <input name="gateway" type="text" class="formfld host" id="gateway" size="40" value="<?php echo $pconfig['gateway']; ?>" <?php if ($pconfig['dynamic'] == true && $pconfig['attribute'] == "system") echo "disabled"; ?>> + <input name="gateway" type="text" class="formfld host" id="gateway" size="40" value="<?php if ($pconfig['dynamic']) echo "dynamic"; else echo $pconfig['gateway']; ?>" <?php if ($pconfig['dynamic'] && $pconfig['attribute'] == "system") echo "disabled"; ?>> <br> <span class="vexpl"><?=gettext("Gateway IP address"); ?></span></td> </tr> <tr> @@ -361,7 +363,7 @@ function show_advanced_gateway() { <td width="22%" valign="top" class="vncell"><?=gettext("Monitor IP"); ?></td> <td width="78%" class="vtable"> <?php - if(is_numeric($pconfig['attribute']) && ($pconfig['gateway'] == dynamic) && ($pconfig['monitor'] == "")) { + if(($pconfig['attribute'] == "system") && ($pconfig['gateway'] == "dynamic") && ($pconfig['monitor'] == "")) { $monitor = ""; } else { $monitor = htmlspecialchars($pconfig['monitor']); diff --git a/usr/local/www/system_routes.php b/usr/local/www/system_routes.php index df80023..032a5c2 100755 --- a/usr/local/www/system_routes.php +++ b/usr/local/www/system_routes.php @@ -99,6 +99,8 @@ if ($_GET['act'] == "del") { } $pgtitle = array(gettext("System"),gettext("Static Routes")); +$statusurl = "diag_routes.php"; + include("head.inc"); ?> diff --git a/usr/local/www/themes/_corporate/images/log.png b/usr/local/www/themes/_corporate/images/log.png Binary files differnew file mode 100644 index 0000000..ba0b397 --- /dev/null +++ b/usr/local/www/themes/_corporate/images/log.png diff --git a/usr/local/www/themes/_corporate/images/status.png b/usr/local/www/themes/_corporate/images/status.png Binary files differnew file mode 100644 index 0000000..2578518 --- /dev/null +++ b/usr/local/www/themes/_corporate/images/status.png diff --git a/usr/local/www/themes/code-red/images/help.png b/usr/local/www/themes/code-red/images/help.png Binary files differnew file mode 100644 index 0000000..3c71cab --- /dev/null +++ b/usr/local/www/themes/code-red/images/help.png diff --git a/usr/local/www/themes/code-red/images/log.png b/usr/local/www/themes/code-red/images/log.png Binary files differnew file mode 100644 index 0000000..ba0b397 --- /dev/null +++ b/usr/local/www/themes/code-red/images/log.png diff --git a/usr/local/www/themes/code-red/images/status.png b/usr/local/www/themes/code-red/images/status.png Binary files differnew file mode 100644 index 0000000..2578518 --- /dev/null +++ b/usr/local/www/themes/code-red/images/status.png diff --git a/usr/local/www/themes/metallic/images/log.png b/usr/local/www/themes/metallic/images/log.png Binary files differnew file mode 100644 index 0000000..ba0b397 --- /dev/null +++ b/usr/local/www/themes/metallic/images/log.png diff --git a/usr/local/www/themes/metallic/images/status.png b/usr/local/www/themes/metallic/images/status.png Binary files differnew file mode 100644 index 0000000..2578518 --- /dev/null +++ b/usr/local/www/themes/metallic/images/status.png diff --git a/usr/local/www/themes/nervecenter/images/log.png b/usr/local/www/themes/nervecenter/images/log.png Binary files differnew file mode 100644 index 0000000..ba0b397 --- /dev/null +++ b/usr/local/www/themes/nervecenter/images/log.png diff --git a/usr/local/www/themes/nervecenter/images/status.png b/usr/local/www/themes/nervecenter/images/status.png Binary files differnew file mode 100644 index 0000000..2578518 --- /dev/null +++ b/usr/local/www/themes/nervecenter/images/status.png diff --git a/usr/local/www/themes/pfsense-dropdown/images/log.png b/usr/local/www/themes/pfsense-dropdown/images/log.png Binary files differnew file mode 100644 index 0000000..ba0b397 --- /dev/null +++ b/usr/local/www/themes/pfsense-dropdown/images/log.png diff --git a/usr/local/www/themes/pfsense-dropdown/images/status.png b/usr/local/www/themes/pfsense-dropdown/images/status.png Binary files differnew file mode 100644 index 0000000..2578518 --- /dev/null +++ b/usr/local/www/themes/pfsense-dropdown/images/status.png diff --git a/usr/local/www/themes/pfsense/images/log.png b/usr/local/www/themes/pfsense/images/log.png Binary files differnew file mode 100644 index 0000000..ba0b397 --- /dev/null +++ b/usr/local/www/themes/pfsense/images/log.png diff --git a/usr/local/www/themes/pfsense/images/status.png b/usr/local/www/themes/pfsense/images/status.png Binary files differnew file mode 100644 index 0000000..2578518 --- /dev/null +++ b/usr/local/www/themes/pfsense/images/status.png diff --git a/usr/local/www/themes/pfsense_ng/images/log.png b/usr/local/www/themes/pfsense_ng/images/log.png Binary files differnew file mode 100644 index 0000000..ba0b397 --- /dev/null +++ b/usr/local/www/themes/pfsense_ng/images/log.png diff --git a/usr/local/www/themes/pfsense_ng/images/status.png b/usr/local/www/themes/pfsense_ng/images/status.png Binary files differnew file mode 100644 index 0000000..2578518 --- /dev/null +++ b/usr/local/www/themes/pfsense_ng/images/status.png diff --git a/usr/local/www/themes/the_wall/images/log.png b/usr/local/www/themes/the_wall/images/log.png Binary files differnew file mode 100644 index 0000000..ba0b397 --- /dev/null +++ b/usr/local/www/themes/the_wall/images/log.png diff --git a/usr/local/www/themes/the_wall/images/status.png b/usr/local/www/themes/the_wall/images/status.png Binary files differnew file mode 100644 index 0000000..2578518 --- /dev/null +++ b/usr/local/www/themes/the_wall/images/status.png diff --git a/usr/local/www/vpn_ipsec.php b/usr/local/www/vpn_ipsec.php index 7d6e0db..0fdecc8 100755 --- a/usr/local/www/vpn_ipsec.php +++ b/usr/local/www/vpn_ipsec.php @@ -124,6 +124,9 @@ if ($_GET['act'] == "delph2") } $pgtitle = array("VPN","IPsec"); +$statusurl = "diag_ipsec.php"; +$logurl = "diag_logs_ipsec.php"; + include("head.inc"); ?> @@ -145,7 +148,6 @@ include("head.inc"); $tab_array[0] = array("Tunnels", true, "vpn_ipsec.php"); $tab_array[1] = array("Mobile clients", false, "vpn_ipsec_mobile.php"); $tab_array[2] = array("Pre-shared keys", false, "vpn_ipsec_keys.php"); - $tab_array[3] = array("Logs", false, "diag_logs_ipsec.php"); display_top_tabs($tab_array); ?> </td> diff --git a/usr/local/www/vpn_ipsec_keys.php b/usr/local/www/vpn_ipsec_keys.php index 2a232f3..c446e05 100644 --- a/usr/local/www/vpn_ipsec_keys.php +++ b/usr/local/www/vpn_ipsec_keys.php @@ -69,6 +69,9 @@ if ($_GET['act'] == "del") { } $pgtitle = "VPN: IPsec: Keys"; +$statusurl = "diag_ipsec.php"; +$logurl = "diag_logs_ipsec.php"; + include("head.inc"); ?> @@ -90,7 +93,6 @@ if (is_subsystem_dirty('ipsec')) $tab_array[0] = array("Tunnels", false, "vpn_ipsec.php"); $tab_array[1] = array("Mobile clients", false, "vpn_ipsec_mobile.php"); $tab_array[2] = array("Pre-shared keys", true, "vpn_ipsec_keys.php"); - $tab_array[3] = array("Logs", false, "diag_logs_ipsec.php"); display_top_tabs($tab_array); ?> </td></tr> diff --git a/usr/local/www/vpn_ipsec_keys_edit.php b/usr/local/www/vpn_ipsec_keys_edit.php index 20ac6c0..ff1ef9a 100644 --- a/usr/local/www/vpn_ipsec_keys_edit.php +++ b/usr/local/www/vpn_ipsec_keys_edit.php @@ -112,6 +112,9 @@ if ($_POST) { } $pgtitle = "VPN: IPsec: Edit pre-shared key"; +$statusurl = "diag_ipsec.php"; +$logurl = "diag_logs_ipsec.php"; + include("head.inc"); ?> diff --git a/usr/local/www/vpn_ipsec_mobile.php b/usr/local/www/vpn_ipsec_mobile.php index 4bf8d61..379cf15 100755 --- a/usr/local/www/vpn_ipsec_mobile.php +++ b/usr/local/www/vpn_ipsec_mobile.php @@ -211,6 +211,9 @@ if ($_POST['submit']) { } $pgtitle = array("VPN","IPsec","Mobile"); +$statusurl = "diag_ipsec.php"; +$logurl = "diag_logs_ipsec.php"; + include("head.inc"); ?> @@ -308,7 +311,6 @@ function login_banner_change() { $tab_array[0] = array("Tunnels", false, "vpn_ipsec.php"); $tab_array[1] = array("Mobile clients", true, "vpn_ipsec_mobile.php"); $tab_array[2] = array("Pre-shared keys", false, "vpn_ipsec_keys.php"); - $tab_array[3] = array("Logs", false, "diag_logs_ipsec.php"); display_top_tabs($tab_array); ?> </td> diff --git a/usr/local/www/vpn_ipsec_phase1.php b/usr/local/www/vpn_ipsec_phase1.php index be3414c..71ea6d8 100644 --- a/usr/local/www/vpn_ipsec_phase1.php +++ b/usr/local/www/vpn_ipsec_phase1.php @@ -333,6 +333,9 @@ if ($pconfig['mobile']) $pgtitle = array("VPN","IPsec","Edit Phase 1", "Mobile Client"); else $pgtitle = array("VPN","IPsec","Edit Phase 1"); +$statusurl = "diag_ipsec.php"; +$logurl = "diag_logs_ipsec.php"; + include("head.inc"); @@ -457,7 +460,6 @@ function dpdchkbox_change() { $tab_array[0] = array("Tunnels", true, "vpn_ipsec.php"); $tab_array[1] = array("Mobile clients", false, "vpn_ipsec_mobile.php"); $tab_array[2] = array("Pre-shared keys", false, "vpn_ipsec_keys.php"); - $tab_array[3] = array("Logs", false, "diag_logs_ipsec.php"); display_top_tabs($tab_array); ?> </td> diff --git a/usr/local/www/vpn_ipsec_phase2.php b/usr/local/www/vpn_ipsec_phase2.php index 5be729c..e00535e 100644 --- a/usr/local/www/vpn_ipsec_phase2.php +++ b/usr/local/www/vpn_ipsec_phase2.php @@ -199,6 +199,9 @@ if ($pconfig['mobile']) $pgtitle = array("VPN","IPsec","Edit Phase 2", "Mobile Client"); else $pgtitle = array("VPN","IPsec","Edit Phase 2"); +$statusurl = "diag_ipsec.php"; +$logurl = "diag_logs_ipsec.php"; + include("head.inc"); @@ -314,7 +317,6 @@ function change_protocol() { $tab_array[0] = array("Tunnels", true, "vpn_ipsec.php"); $tab_array[1] = array("Mobile clients", false, "vpn_ipsec_mobile.php"); $tab_array[2] = array("Pre-shared keys", false, "vpn_ipsec_keys.php"); - $tab_array[3] = array("Logs", false, "diag_logs_ipsec.php"); display_top_tabs($tab_array); ?> </td> diff --git a/usr/local/www/vpn_openvpn_client.php b/usr/local/www/vpn_openvpn_client.php index 70f5cd1..a52a739 100644 --- a/usr/local/www/vpn_openvpn_client.php +++ b/usr/local/www/vpn_openvpn_client.php @@ -38,6 +38,8 @@ require("guiconfig.inc"); require_once("openvpn.inc"); $pgtitle = array("OpenVPN", "Client"); +$statusurl = "status_openvpn.php"; +$logurl = "diag_logs_openvpn.php"; if (!is_array($config['openvpn']['openvpn-client'])) $config['openvpn']['openvpn-client'] = array(); @@ -344,7 +346,6 @@ function autotls_change() { $tab_array[] = array(gettext("Client"), true, "vpn_openvpn_client.php"); $tab_array[] = array(gettext("Client Specific Overrides"), false, "vpn_openvpn_csc.php"); $tab_array[] = array(gettext("Wizards"), false, "wizard.php?xml=openvpn_wizard.xml"); - $tab_array[] = array(gettext("Logs"), false, "diag_logs_openvpn.php"); add_package_tabs("OpenVPN", $tab_array); display_top_tabs($tab_array); ?> diff --git a/usr/local/www/vpn_openvpn_csc.php b/usr/local/www/vpn_openvpn_csc.php index b70404f..5a71121 100644 --- a/usr/local/www/vpn_openvpn_csc.php +++ b/usr/local/www/vpn_openvpn_csc.php @@ -38,6 +38,8 @@ require("guiconfig.inc"); require_once("openvpn.inc"); $pgtitle = array("OpenVPN", "Client Specific Override"); +$statusurl = "status_openvpn.php"; +$logurl = "diag_logs_openvpn.php"; if (!is_array($config['openvpn']['openvpn-csc'])) $config['openvpn']['openvpn-csc'] = array(); @@ -69,7 +71,7 @@ if($_GET['act']=="edit"){ if (isset($id) && $a_csc[$id]) { $pconfig['custom_options'] = $a_csc[$id]['custom_options']; - $pconfig['disable'] = $a_csc[$id]['disable']; + $pconfig['disable'] = isset($a_csc[$id]['disable']); $pconfig['common_name'] = $a_csc[$id]['common_name']; $pconfig['block'] = $a_csc[$id]['block']; $pconfig['description'] = $a_csc[$id]['description']; @@ -168,7 +170,8 @@ if ($_POST) { $csc = array(); $csc['custom_options'] = $pconfig['custom_options']; - $csc['disable'] = $pconfig['disable']; + if ($_POST['disable'] == "yes") + $csc['disable'] = true; $csc['common_name'] = $pconfig['common_name']; $csc['block'] = $pconfig['block']; $csc['description'] = $pconfig['description']; @@ -291,7 +294,6 @@ function netbios_change() { $tab_array[] = array(gettext("Client"), false, "vpn_openvpn_client.php"); $tab_array[] = array(gettext("Client Specific Overrides"), true, "vpn_openvpn_csc.php"); $tab_array[] = array(gettext("Wizards"), false, "wizard.php?xml=openvpn_wizard.xml"); - $tab_array[] = array(gettext("Logs"), false, "diag_logs_openvpn.php"); add_package_tabs("OpenVPN", $tab_array); display_top_tabs($tab_array); ?> @@ -314,7 +316,7 @@ function netbios_change() { <table border="0" cellpadding="0" cellspacing="0"> <tr> <td> - <?php set_checked($pconfig['disable'],$chk); ?> + <?php set_checked(isset($pconfig['disable']),$chk); ?> <input name="disable" type="checkbox" value="yes" <?=$chk;?>/> </td> <td> @@ -676,7 +678,7 @@ function netbios_change() { $i = 0; foreach($a_csc as $csc): $disabled = "NO"; - if ($csc['disable']) + if (isset($csc['disable'])) $disabled = "YES"; ?> <tr> diff --git a/usr/local/www/vpn_openvpn_server.php b/usr/local/www/vpn_openvpn_server.php index f221b6b..b213c6f 100644 --- a/usr/local/www/vpn_openvpn_server.php +++ b/usr/local/www/vpn_openvpn_server.php @@ -38,6 +38,8 @@ require("guiconfig.inc"); require_once("openvpn.inc"); $pgtitle = array("OpenVPN", "Server"); +$statusurl = "status_openvpn.php"; +$logurl = "diag_logs_openvpn.php"; if (!is_array($config['openvpn']['openvpn-server'])) $config['openvpn']['openvpn-server'] = array(); @@ -514,7 +516,6 @@ function netbios_change() { $tab_array[] = array(gettext("Client"), false, "vpn_openvpn_client.php"); $tab_array[] = array(gettext("Client Specific Overrides"), false, "vpn_openvpn_csc.php"); $tab_array[] = array(gettext("Wizards"), false, "wizard.php?xml=openvpn_wizard.xml"); - $tab_array[] = array(gettext("Logs"), false, "diag_logs_openvpn.php"); add_package_tabs("OpenVPN", $tab_array); display_top_tabs($tab_array); ?> diff --git a/usr/local/www/wizard.php b/usr/local/www/wizard.php index 08d2716..8c2ae36 100755 --- a/usr/local/www/wizard.php +++ b/usr/local/www/wizard.php @@ -201,7 +201,7 @@ function enablechange() { $enablefields = explode(',', $field['enablefields']); foreach($enablefields as $enablefield) { $enablefield = strtolower($enablefield); - print "\t\t" . 'document.iform.' . $enablefield . '.disabled = 1;' . "\n"; + print "\t\t" . 'document.iform.' . $enablefield . '.disabled = 0;' . "\n"; } } if(isset($field['checkenablefields'])) { @@ -216,7 +216,7 @@ function enablechange() { $enablefields = explode(',', $field['enablefields']); foreach($enablefields as $enablefield) { $enablefield = strtolower($enablefield); - print "\t\t" . 'document.iform.' . $enablefield . '.disabled = 0;' . "\n"; + print "\t\t" . 'document.iform.' . $enablefield . '.disabled = 1;' . "\n"; } } if(isset($field['checkenablefields'])) { @@ -248,7 +248,7 @@ function disablechange() { $checkenablefields = explode(',', $field['checkdisablefields']); foreach($checkenablefields as $checkenablefield) { $checkenablefield = strtolower($checkenablefield); - print "\t\t" . 'document.iform.' . $checkenablefield . '.checked = 0;' . "\n"; + print "\t\t" . 'document.iform.' . $checkenablefield . '.checked = 1;' . "\n"; } } print "\t" . '} else {' . "\n"; @@ -263,7 +263,7 @@ function disablechange() { $checkenablefields = explode(',', $field['checkdisablefields']); foreach($checkenablefields as $checkenablefield) { $checkenablefield = strtolower($checkenablefield); - print "\t\t" . 'document.iform.' . $checkenablefield . '.checked = 1;' . "\n"; + print "\t\t" . 'document.iform.' . $checkenablefield . '.checked = 0;' . "\n"; } } print "\t" . '}' . "\n"; @@ -365,7 +365,10 @@ function showchange() { $arraynum = "[" . $field['arraynum'] . "]"; foreach ($field_split as $f) $field_conv .= "['" . $f . "']"; - $toeval = "if (isset(\$config" . $field_conv . $arraynum . ")) { \$value = \$config" . $field_conv . $arraynum . "; if (empty(\$value)) \$value = true; }"; + if($field['type'] == "checkbox") + $toeval = "if (isset(\$config" . $field_conv . $arraynum . ")) { \$value = \$config" . $field_conv . $arraynum . "; if (empty(\$value)) \$value = true; }"; + else + $toeval = "if (isset(\$config" . $field_conv . $arraynum . ")) \$value = \$config" . $field_conv . $arraynum . ";"; eval($toeval); } |