summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Lucas <rafalucas.unicamp@gmail.com>2010-06-24 11:02:28 -0300
committerRafael Lucas <rafalucas.unicamp@gmail.com>2010-06-24 11:02:28 -0300
commit69237206a0460a68a65986bbbe39f30ae958db09 (patch)
treef2bec7cf0897b0efa2d89a63c4071d964d178608
parentfcf4c7a4f03e2b969ec6d2cbe18c5a1df26a87e8 (diff)
parenta11ee3cf4f32afad9b4996bc1be544efdf24d258 (diff)
downloadpfsense-69237206a0460a68a65986bbbe39f30ae958db09.zip
pfsense-69237206a0460a68a65986bbbe39f30ae958db09.tar.gz
Merge branch 'master' of git@rcs.pfsense.org:pfsense/pfsense-gettext
-rw-r--r--etc/inc/auth.inc2
-rw-r--r--etc/inc/captiveportal.inc278
-rw-r--r--etc/inc/filter.inc4
-rw-r--r--etc/inc/globals.inc2
-rw-r--r--etc/inc/gwlb.inc17
-rw-r--r--etc/inc/interfaces.inc6
-rw-r--r--etc/inc/pfsense-utils.inc2
-rw-r--r--etc/inc/pkg-utils.inc7
-rw-r--r--etc/inc/system.inc12
-rw-r--r--etc/inc/upgrade_config.inc14
-rw-r--r--etc/inc/util.inc4
-rw-r--r--etc/pfSense.obsoletedfiles1
-rwxr-xr-xetc/rc.linkup.sh5
-rwxr-xr-xetc/rc.restart_webgui4
-rwxr-xr-xetc/sshd14
-rwxr-xr-xusr/local/www/diag_arp.php20
-rwxr-xr-xusr/local/www/diag_authentication.php8
-rwxr-xr-xusr/local/www/diag_backup.php42
-rwxr-xr-xusr/local/www/diag_confbak.php45
-rwxr-xr-xusr/local/www/diag_defaults.php29
-rw-r--r--usr/local/www/diag_dns.php32
-rwxr-xr-xusr/local/www/diag_dump_states.php14
-rw-r--r--usr/local/www/diag_ipsec.php26
-rwxr-xr-xusr/local/www/diag_ipsec_sad.php28
-rw-r--r--usr/local/www/diag_logs_filter_summary.php30
-rwxr-xr-xusr/local/www/diag_logs_ipsec.php22
-rw-r--r--usr/local/www/diag_logs_ntpd.php22
-rw-r--r--usr/local/www/diag_logs_openvpn.php22
-rwxr-xr-xusr/local/www/diag_logs_ppp.php22
-rwxr-xr-xusr/local/www/diag_logs_relayd.php22
-rwxr-xr-xusr/local/www/firewall_aliases.php8
-rwxr-xr-xusr/local/www/firewall_nat.php50
-rwxr-xr-xusr/local/www/index.php2
-rw-r--r--usr/local/www/interfaces_ppps.php2
-rwxr-xr-xusr/local/www/status_gateways.php2
-rw-r--r--usr/local/www/system_advanced_admin.php2
-rwxr-xr-xusr/local/www/system_firmware_auto.php16
-rwxr-xr-xusr/local/www/system_firmware_check.php11
-rw-r--r--usr/local/www/system_usermanager.php12
39 files changed, 478 insertions, 383 deletions
diff --git a/etc/inc/auth.inc b/etc/inc/auth.inc
index f9b9d21..3a72db9 100644
--- a/etc/inc/auth.inc
+++ b/etc/inc/auth.inc
@@ -409,7 +409,7 @@ function local_user_set_groups($user, $new_groups = NULL ) {
/* determine which memberships to remove */
foreach ($cur_groups as $groupname) {
if (in_array($groupname,$new_groups))
- continue;
+ continue;
$group = & $config['system']['group'][$groupindex[$groupname]];
$index = array_search($user['uid'], $group['member']);
array_splice($group['member'], $index, 1);
diff --git a/etc/inc/captiveportal.inc b/etc/inc/captiveportal.inc
index 1b34717..1e96b41 100644
--- a/etc/inc/captiveportal.inc
+++ b/etc/inc/captiveportal.inc
@@ -52,49 +52,7 @@ function captiveportal_configure() {
$captiveportallck = lock('captiveportal');
- $cpactive = false;
if (isset($config['captiveportal']['enable'])) {
- $cpips = array();
- $ifaces = get_configured_interface_list();
- foreach ($ifaces as $kiface => $kiface2) {
- $tmpif = get_real_interface($kiface);
- pfSense_interface_flags($tmpif, -IFF_IPFW_FILTER);
- }
- $cpinterfaces = explode(",", $config['captiveportal']['interface']);
- $firsttime = 0;
- foreach ($cpinterfaces as $cpifgrp) {
- if (!isset($ifaces[$cpifgrp]))
- continue;
- $tmpif = get_real_interface($cpifgrp);
- if (!empty($tmpif)) {
- if ($firsttime > 0)
- $cpinterface .= " or ";
- $cpinterface .= "via {$tmpif}";
- $firsttime = 1;
- $cpipm = get_interface_ip($cpifgrp);
- if (is_ipaddr($cpipm)) {
- $carpif = link_ip_to_carp_interface($cpipm);
- if (!empty($carpif)) {
- $carpsif = explode(" ", $carpif);
- foreach ($carpsif as $cpcarp) {
- pfSense_interface_flags($cpcarp, IFF_IPFW_FILTER);
- $carpip = find_interface_ip($cpcarp);
- if (is_ipaddr($carpip))
- $cpips[] = $carpip;
- }
- }
- $cpips[] = $cpipm;
- pfSense_interface_flags($tmpif, IFF_IPFW_FILTER);
- }
- }
- }
- if (count($cpips) > 0) {
- $cpactive = true;
- $cpinterface = "{ {$cpinterface} } ";
- }
- }
-
- if ($cpactive == true) {
if ($g['booting'])
echo "Starting captive portal... ";
@@ -108,7 +66,6 @@ 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", true);
/* setup new database in case someone tries to access the status -> captive portal page */
touch("{$g['vardb_path']}/captiveportal.db");
@@ -116,22 +73,8 @@ function captiveportal_configure() {
/* kill any running minicron */
killbypid("{$g['varrun_path']}/minicron.pid");
- /* make sure ipfw is loaded */
- if (!is_module_loaded("ipfw.ko"))
- filter_load_ipfw();
- /* Always load dummynet now that even allowed ip and mac passthrough use it. */
- if (!is_module_loaded("dummynet.ko"))
- mwexec("/sbin/kldload dummynet");
-
- /* generate ipfw rules */
- captiveportal_init_ipfw_ruleno();
- $cprules = captiveportal_rules_generate($cpinterface, $cpips);
- $cprules .= "\n";
- /* generate passthru mac database */
- $cprules .= captiveportal_passthrumac_configure(true);
- $cprules .= "\n";
- /* allowed ipfw rules to make allowed ip work */
- $cprules .= captiveportal_allowedip_configure();
+ /* init ipfw rules */
+ captiveportal_init_rules(true);
/* stop accounting on all clients */
captiveportal_radius_stop_all(true);
@@ -277,60 +220,8 @@ EOD;
/* write elements */
captiveportal_write_elements();
- /* load rules */
- mwexec("/sbin/ipfw -q flush");
-
- /* ipfw cannot accept rules directly on stdin,
- so we have to write them to a temporary file first */
- $fd = @fopen("{$g['tmp_path']}/ipfw.cp.rules", "w");
- if (!$fd) {
- printf("Cannot open ipfw.cp.rules in captiveportal_configure()\n");
- return 1;
- }
-
- fwrite($fd, $cprules);
- fclose($fd);
-
- mwexec("/sbin/ipfw -q {$g['tmp_path']}/ipfw.cp.rules");
-
- @unlink("{$g['tmp_path']}/ipfw.cp.rules");
-
- /* filter on layer2 as well so we can check MAC addresses */
- mwexec("/sbin/sysctl net.link.ether.ipfw=1");
-
- chdir($g['captiveportal_path']);
-
- if ($config['captiveportal']['maxproc'])
- $maxproc = $config['captiveportal']['maxproc'];
- else
- $maxproc = 16;
-
- $use_fastcgi = true;
-
- if(isset($config['captiveportal']['httpslogin'])) {
- $cert = base64_decode($config['captiveportal']['certificate']);
- if (isset($config['captiveportal']['cacertificate']))
- $cacert = base64_decode($config['captiveportal']['cacertificate']);
- else
- $cacert = "";
- $key = base64_decode($config['captiveportal']['private-key']);
- /* generate lighttpd configuration */
- system_generate_lighty_config("{$g['varetc_path']}/lighty-CaptivePortal-SSL.conf",
- $cert, $key, $cacert, "lighty-CaptivePortal-ssl.pid", "8001", "/usr/local/captiveportal/",
- "cert-portal.pem", "ca-portal.pem", "1", $maxproc, $use_fastcgi, true);
- }
-
- /* generate lighttpd configuration */
- system_generate_lighty_config("{$g['varetc_path']}/lighty-CaptivePortal.conf",
- "", "", "", "lighty-CaptivePortal.pid", "8000", "/usr/local/captiveportal/",
- "cert-portal.pem", "ca-portal.pem", "1", $maxproc, $use_fastcgi, true);
-
- /* attempt to start lighttpd */
- $res = mwexec("/usr/local/sbin/lighttpd -f {$g['varetc_path']}/lighty-CaptivePortal.conf");
-
- /* fire up https instance */
- if(isset($config['captiveportal']['httpslogin']))
- $res = mwexec("/usr/local/sbin/lighttpd -f {$g['varetc_path']}/lighty-CaptivePortal-SSL.conf");
+ /* start up the webserving daemon */
+ captiveportal_init_webgui();
/* start pruning process (interval defaults to 60 seconds) */
mwexec("/usr/local/bin/minicron $croninterval {$g['varrun_path']}/minicron.pid " .
@@ -408,9 +299,104 @@ EOD;
return 0;
}
-function captiveportal_rules_generate($cpif, &$cpiparray) {
+function captiveportal_init_webgui() {
+ global $g, $config;
+
+ if (!isset($config['captiveportal']['enable']))
+ return;
+
+ if ($config['captiveportal']['maxproc'])
+ $maxproc = $config['captiveportal']['maxproc'];
+ else
+ $maxproc = 16;
+
+ $use_fastcgi = true;
+
+ if (isset($config['captiveportal']['httpslogin'])) {
+ $cert = base64_decode($config['captiveportal']['certificate']);
+ if (isset($config['captiveportal']['cacertificate']))
+ $cacert = base64_decode($config['captiveportal']['cacertificate']);
+ else
+ $cacert = "";
+ $key = base64_decode($config['captiveportal']['private-key']);
+ /* generate lighttpd configuration */
+ system_generate_lighty_config("{$g['varetc_path']}/lighty-CaptivePortal-SSL.conf",
+ $cert, $key, $cacert, "lighty-CaptivePortal-ssl.pid", "8001", "/usr/local/captiveportal/",
+ "cert-portal.pem", "ca-portal.pem", "1", $maxproc, $use_fastcgi, true);
+ }
+
+ /* generate lighttpd configuration */
+ system_generate_lighty_config("{$g['varetc_path']}/lighty-CaptivePortal.conf",
+ "", "", "", "lighty-CaptivePortal.pid", "8000", "/usr/local/captiveportal/",
+ "cert-portal.pem", "ca-portal.pem", "1", $maxproc, $use_fastcgi, true);
+
+ /* attempt to start lighttpd */
+ $res = mwexec("/usr/local/sbin/lighttpd -f {$g['varetc_path']}/lighty-CaptivePortal.conf");
+
+ /* fire up https instance */
+ if (isset($config['captiveportal']['httpslogin']))
+ $res = mwexec("/usr/local/sbin/lighttpd -f {$g['varetc_path']}/lighty-CaptivePortal-SSL.conf");
+}
+
+function captiveportal_init_rules($reinit = false) {
global $config, $g;
+ if (!isset($config['captiveportal']['enable']))
+ return;
+
+ $cpips = array();
+ $ifaces = get_configured_interface_list();
+ foreach ($ifaces as $kiface => $kiface2) {
+ $tmpif = get_real_interface($kiface);
+ pfSense_interface_flags($tmpif, -IFF_IPFW_FILTER);
+ }
+ $cpinterfaces = explode(",", $config['captiveportal']['interface']);
+ $firsttime = 0;
+ foreach ($cpinterfaces as $cpifgrp) {
+ if (!isset($ifaces[$cpifgrp]))
+ continue;
+ $tmpif = get_real_interface($cpifgrp);
+ if (!empty($tmpif)) {
+ if ($firsttime > 0)
+ $cpinterface .= " or ";
+ $cpinterface .= "via {$tmpif}";
+ $firsttime = 1;
+ $cpipm = get_interface_ip($cpifgrp);
+ if (is_ipaddr($cpipm)) {
+ $carpif = link_ip_to_carp_interface($cpipm);
+ if (!empty($carpif)) {
+ $carpsif = explode(" ", $carpif);
+ foreach ($carpsif as $cpcarp) {
+ pfSense_interface_flags($cpcarp, IFF_IPFW_FILTER);
+ $carpip = find_interface_ip($cpcarp);
+ if (is_ipaddr($carpip))
+ $cpips[] = $carpip;
+ }
+ }
+ $cpips[] = $cpipm;
+ pfSense_interface_flags($tmpif, IFF_IPFW_FILTER);
+ }
+ }
+ }
+ if (count($cpips) > 0) {
+ $cpactive = true;
+ $cpinterface = "{ {$cpinterface} } ";
+ } else
+ return false;
+
+ if ($reinit == false)
+ $captiveportallck = lock('captiveportal');
+
+ /* init dummynet/ipfw rules number database */
+ captiveportal_init_ipfw_ruleno();
+
+ /* make sure ipfw is loaded */
+ if (!is_module_loaded("ipfw.ko"))
+ filter_load_ipfw();
+ /* Always load dummynet now that even allowed ip and mac passthrough use it. */
+ if (!is_module_loaded("dummynet.ko"))
+ mwexec("/sbin/kldload dummynet");
+
$cprules = "add 65291 set 1 allow pfsync from any to any\n";
$cprules .= "add 65292 set 1 allow carp from any to any\n";
@@ -436,7 +422,7 @@ EOD;
$rulenum = 65310;
$ips = "255.255.255.255 ";
- foreach ($cpiparray as $cpip)
+ foreach ($cpips as $cpip)
$ips .= "or {$cpip} ";
$ips = "{ {$ips} }";
//# allow access to our DHCP server (which needs to be able to ping clients as well)
@@ -522,7 +508,40 @@ add 65534 set 1 pass all from any to any layer2
EOD;
- return $cprules;
+ /* generate passthru mac database */
+ $cprules .= captiveportal_passthrumac_configure(true);
+ $cprules .= "\n";
+ /* allowed ipfw rules to make allowed ip work */
+ $cprules .= captiveportal_allowedip_configure();
+
+ /* load rules */
+ if ($reinit == true)
+ $cprules = "table all flush\nflush\n{$cprules}";
+ else {
+ $tmprules = "table 3 flush\n";
+ $tmprules .= "table 4 flush\n";
+ $tmprules .= "table 5 flush\n";
+ $tmprules .= "table 6 flush\n";
+ $tmprules .= "table 7 flush\n";
+ $tmprules .= "table 8 flush\n";
+ $tmprules .= "table 9 flush\n";
+ $tmprules .= "table 10 flush\n";
+ $tmprules .= "flush\n";
+ $cprules = "{$tmprules}\n{$cprules}";
+ }
+
+ file_put_contents("{$g['tmp_path']}/ipfw.cp.rules", $cprules);
+ mwexec("/sbin/ipfw -q {$g['tmp_path']}/ipfw.cp.rules", true);
+ @unlink("{$g['tmp_path']}/ipfw.cp.rules");
+
+ if ($reinit == false)
+ unlock($captiveportallck);
+
+
+ /* filter on layer2 as well so we can check MAC addresses */
+ mwexec("/sbin/sysctl net.link.ether.ipfw=1");
+
+ return $cprules;
}
/* remove clients that have been around for longer than the specified amount of time */
@@ -1071,20 +1090,19 @@ function captiveportal_write_db($cpdb) {
}
function captiveportal_write_elements() {
- global $g, $config;
-
- /* delete any existing elements */
- if (is_dir($g['captiveportal_element_path'])) {
- $dh = opendir($g['captiveportal_element_path']);
- while (($file = readdir($dh)) !== false) {
- if ($file != "." && $file != "..")
- unlink($g['captiveportal_element_path'] . "/" . $file);
- }
- closedir($dh);
- } else {
- @mkdir($g['captiveportal_element_path']);
- }
+ global $g, $config;
+ /* delete any existing elements */
+ if (is_dir($g['captiveportal_element_path'])) {
+ $dh = opendir($g['captiveportal_element_path']);
+ while (($file = readdir($dh)) !== false) {
+ if ($file != "." && $file != "..")
+ unlink($g['captiveportal_element_path'] . "/" . $file);
+ }
+ closedir($dh);
+ } else
+ @mkdir($g['captiveportal_element_path']);
+
if (is_array($config['captiveportal']['element'])) {
conf_mount_rw();
foreach ($config['captiveportal']['element'] as $data) {
@@ -1103,7 +1121,7 @@ function captiveportal_write_elements() {
conf_mount_ro();
}
- return 0;
+ return 0;
}
function captiveportal_init_ipfw_ruleno($rulenos_start = 2000, $rulenos_range_max = 49899) {
diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc
index 7ef9f32..c3a8cd2 100644
--- a/etc/inc/filter.inc
+++ b/etc/inc/filter.inc
@@ -145,9 +145,9 @@ function filter_delete_states_for_down_gateways() {
$a_gateways = return_gateways_status();
foreach ($a_gateways as $gateway) {
- if ($gateway['status'] == "down") {
+ if (stristr($status['status'], "down")) {
$int_ip = get_interface_ip($gateway['interface']);
- if(is_ipaddr($int_ip))
+ if (is_ipaddr($int_ip))
mwexec("/sbin/pfctl -b {$int_ip}");
}
}
diff --git a/etc/inc/globals.inc b/etc/inc/globals.inc
index 6e2b1f6..dae4ea7 100644
--- a/etc/inc/globals.inc
+++ b/etc/inc/globals.inc
@@ -124,7 +124,7 @@ if(file_exists("/etc/platform")) {
$arch = trim(`uname -m`);
$g['platform'] = trim(file_get_contents("/etc/platform"));
if($g['platform'] == "nanobsd") {
- $g['update_url']="http://snapshots.pfsense.org/FreeBSD_RELENG_8_0/{$arch}/pfSense_HEAD/.updaters/";
+ $g['update_url']="http://snapshots.pfsense.org/FreeBSD_RELENG_8_1/{$arch}/pfSense_HEAD/.updaters/";
$g['update_manifest']="http://updates.pfSense.com/nanobsd/manifest";
$g['firmware_update_text']="pfSense-*.img.gz";
diff --git a/etc/inc/gwlb.inc b/etc/inc/gwlb.inc
index 268d94c..94ddd17 100644
--- a/etc/inc/gwlb.inc
+++ b/etc/inc/gwlb.inc
@@ -49,9 +49,6 @@ function setup_gateways_monitor() {
$a_settings['losslow'] = "10";
$a_settings['losshigh'] = "20";
- /* kill apinger process */
- if(is_process_running("apinger"))
- mwexec("/usr/bin/killall apinger", true);
$fd = fopen("{$g['varetc_path']}/apinger.conf", "w");
$apingerconfig = <<<EOD
@@ -160,6 +157,9 @@ EOD;
$gateway['monitor'] = $gateway['gateway'];
}
+ if (!is_ipaddr($gateway['monitor']))
+ continue;
+
$apingercfg .= "target \"{$gateway['monitor']}\" {\n";
$apingercfg .= " description \"{$gateway['name']}\"\n";
$gwifip = find_interface_ip($gateway['interface']);
@@ -235,7 +235,9 @@ EOD;
fwrite($fd, $apingerconfig);
fclose($fd);
- if(!is_process_running("apinger")) {
+ if (is_process_running("apinger")) {
+ sigkillbypid("{$g['varrun_path']}/apinger.pid", "HUP");
+ } else {
if (is_dir("{$g['tmp_path']}"))
chmod("{$g['tmp_path']}", 01777);
if (is_dir("{$g['vardb_path']}/rrd"))
@@ -243,6 +245,7 @@ EOD;
/* start a new apinger process */
mwexec_bg("/usr/local/sbin/apinger -c {$g['varetc_path']}/apinger.conf");
}
+
return 0;
}
@@ -465,8 +468,10 @@ function dhclient_update_gateway_groups_defaultroute($interface = "wan") {
function lookup_gateway_ip_by_name($name) {
$gateways_arr = return_gateways_array();
- if (!empty($gateways_arr[$name]))
- return $gateways_arr[$name]['gateway'];
+ foreach ($gateways_arr as $gw) {
+ if ($gw['name'] == $name)
+ return $gw['gateway'];
+ }
return false;
}
diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc
index e28ec51..004f2b3 100644
--- a/etc/inc/interfaces.inc
+++ b/etc/inc/interfaces.inc
@@ -760,7 +760,7 @@ function interfaces_configure() {
services_dnsmasq_configure();
/* reload captive portal */
- captiveportal_configure();
+ captiveportal_init_rules();
/* set the reload filter dity flag */
filter_configure();
@@ -2355,7 +2355,7 @@ function interface_configure($interface = "wan", $reloadall = false) {
if ($reloadall == true) {
/* reconfigure static routes (kernel may have deleted them) */
- system_routing_configure();
+ system_routing_configure($interface);
/* reload ipsec tunnels */
vpn_ipsec_configure();
@@ -2370,7 +2370,7 @@ function interface_configure($interface = "wan", $reloadall = false) {
services_dnsmasq_configure();
/* reload captive portal */
- captiveportal_configure();
+ captiveportal_init_rules();
/* set the reload filter dity flag */
filter_configure();
diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc
index 17c7e67..e3eef07 100644
--- a/etc/inc/pfsense-utils.inc
+++ b/etc/inc/pfsense-utils.inc
@@ -1810,7 +1810,7 @@ function pfs_version_compare($cur_time, $cur_text, $remote) {
if ($v === FALSE) {
// If that fails, try to compare by string
// Before anything else, simply test if the strings are equal
- if ($cur_text == $remote)
+ if (($cur_text == $remote) || ($cur_time == $remote))
return 0;
list($cur_num, $cur_str) = explode('-', $cur_text);
list($rem_num, $rem_str) = explode('-', $remote);
diff --git a/etc/inc/pkg-utils.inc b/etc/inc/pkg-utils.inc
index 6c241c2..6015f72 100644
--- a/etc/inc/pkg-utils.inc
+++ b/etc/inc/pkg-utils.inc
@@ -172,8 +172,10 @@ function resync_all_package_configs($show_message = false) {
global $config, $restart_sync, $pkg_interface;
$i = 0;
log_error("Resyncing configuration for all packages.");
- if(!$config['installedpackages']['package']) return;
- if($show_message == true) print "Syncing packages:";
+ if(!$config['installedpackages']['package'])
+ return;
+ if($show_message == true)
+ echo "Syncing packages:";
foreach($config['installedpackages']['package'] as $package) {
if (empty($package['name']))
continue;
@@ -189,6 +191,7 @@ function resync_all_package_configs($show_message = false) {
$i++;
}
if($show_message == true) print ".\n";
+ @unlink("/conf/needs_package_sync");
}
/*
diff --git a/etc/inc/system.inc b/etc/inc/system.inc
index 86916cf..ac8fa37 100644
--- a/etc/inc/system.inc
+++ b/etc/inc/system.inc
@@ -260,7 +260,7 @@ function system_hostname_configure() {
return $status;
}
-function system_routing_configure() {
+function system_routing_configure($interface = "") {
global $config, $g;
if(isset($config['system']['developerspew'])) {
$mt = microtime();
@@ -276,7 +276,7 @@ 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");
+ mwexec("/bin/rm {$g['tmp_path']}/*_defaultgw", true);
$foundgw = false;
foreach ($config['gateways']['gateway_item'] as $gateway) {
if (isset($gateway['defaultgw'])) {
@@ -322,8 +322,10 @@ function system_routing_configure() {
$route_arr[$items[0]] = array($items[0], $items[1], $items[5]);
}
- if ($dont_add_route == false) {
- if (($interfacegw <> "bgpd") && (is_ipaddr($gatewayip))) {
+ if ($dont_add_route == false ) {
+ if (!empty($interface) && $inteface != $interafegw)
+ ;
+ else if (($interfacegw <> "bgpd") && (is_ipaddr($gatewayip))) {
$action = "add";
if(isset($route_arr['default'])) {
$action = "change";
@@ -345,6 +347,8 @@ function system_routing_configure() {
$gateways_arr = return_gateways_array();
foreach ($config['staticroutes']['route'] as $rtent) {
+ if (!empty($interface) && $interface != $rtent['interface'])
+ continue;
$gatewayip = "";
if (isset($gateways_arr[$rtent['gateway']])) {
$gatewayip = $gateways_arr[$rtent['gateway']]['gateway'];
diff --git a/etc/inc/upgrade_config.inc b/etc/inc/upgrade_config.inc
index 50b6ad0..104d5ac 100644
--- a/etc/inc/upgrade_config.inc
+++ b/etc/inc/upgrade_config.inc
@@ -1619,6 +1619,9 @@ function upgrade_053_to_054() {
$lbpool_srv_arr = array();
$gateway_group_arr = array();
$gateways = return_gateways_array();
+ if (is_array($config['gateways']['gateway_item']))
+ $config['gateways']['gateway_item'] = array();
+ $a_gateways =& $config['gateways']['gateway_item'];
foreach($lbpool_arr as $lbpool) {
if($lbpool['type'] == "gateway") {
$gateway_group['name'] = $lbpool['name'];
@@ -1630,13 +1633,14 @@ function upgrade_053_to_054() {
$split = split("\|", $member);
$interface = $split[0];
$monitor = $split[1];
- if(is_ipaddr($monitor)) {
- $config['interfaces'][$interface]['monitorip'] = "$monitor";
- }
/* on static upgraded configuration we automatically prepend GW_ */
$static_name = "GW_" . strtoupper($interface);
- if(is_array($gateways[$static_name])) {
+ if(is_ipaddr($monitor)) {
$interface = $static_name;
+ if(is_array($gateways[$static_name]) && isset($gateways[$static_name]['attribute']))
+ $a_gateways[$gateways[$static_name]['attribute']]['monitor'] = $monitor;
+ else
+ $config['interfaces'][$interface]['monitorip'] = $monitor;
}
/* on failover increment tier. Else always assign 1 */
if($lbpool['behaviour'] == "failover") {
@@ -2064,4 +2068,4 @@ function upgrade_063_to_064() {
}
}
-?> \ No newline at end of file
+?>
diff --git a/etc/inc/util.inc b/etc/inc/util.inc
index 32846aa..9d5872e 100644
--- a/etc/inc/util.inc
+++ b/etc/inc/util.inc
@@ -50,9 +50,9 @@ function isvalidpid($pid) {
}
function is_process_running($process) {
- $running = (shell_exec("/bin/pgrep -x {$process}") != '');
+ $running = shell_exec("/bin/pgrep -x {$process}");
- return $running;
+ return !empty($running);
}
function isvalidproc($proc) {
diff --git a/etc/pfSense.obsoletedfiles b/etc/pfSense.obsoletedfiles
index 3efbb16..04b9a77 100644
--- a/etc/pfSense.obsoletedfiles
+++ b/etc/pfSense.obsoletedfiles
@@ -1,4 +1,5 @@
/etc/rc.parse-isc-dhcpd
+/etc/rc.linkup.sh
/etc/phpshellsessions/cvssync
/etc/inc/regdomain.inc
/etc/inc/sysctl.inc
diff --git a/etc/rc.linkup.sh b/etc/rc.linkup.sh
deleted file mode 100755
index 3ab0e3f..0000000
--- a/etc/rc.linkup.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/sh
-
-LINKUP=`cat /tmp/rc.linkup`
-/usr/local/bin/php /etc/rc.linkup $LINKUP
-rm /tmp/rc.linkup
diff --git a/etc/rc.restart_webgui b/etc/rc.restart_webgui
index fd0d8b9..463f934 100755
--- a/etc/rc.restart_webgui
+++ b/etc/rc.restart_webgui
@@ -14,10 +14,10 @@ echo "Restarting webConfigurator...";
system_webgui_start();
-captiveportal_configure();
+captiveportal_init_webgui();
enable_rrd_graphing();
echo " done.\n\n";
-?> \ No newline at end of file
+?>
diff --git a/etc/sshd b/etc/sshd
index 285cf65..1b54355 100755
--- a/etc/sshd
+++ b/etc/sshd
@@ -64,7 +64,7 @@
foreach($files_to_check as $f2c) {
if(file_exists("/etc/ssh/{$f2c}"))
if(file_size("/etc/ssh/{$f2c}")==0) {
- mwexec("rm /etc/ssh/ssh_host*");
+ mwexec("rm /etc/ssh/ssh_host*", true);
}
}
@@ -135,10 +135,18 @@
exit;
}
- if (!file_exists("$sshConfigDir/ssh_host_key")) {
+ // Check for all needed key files. If any are missing, the keys need to be regenerated.
+ $files_to_check = array('ssh_host_dsa_key','ssh_host_dsa_key.pub','ssh_host_key','ssh_host_key.pub','ssh_host_rsa_key','ssh_host_rsa_key.pub');
+ $generate_keys = false;
+ foreach ($files_to_check as $f2c) {
+ if (!file_exists("/etc/ssh/{$f2c}")) {
+ $generate_keys = true;
+ }
+ }
+ if ($generate_keys) {
/* remove previous keys and regen later */
file_notice("SSH", "{$g['product_name']} has started creating your SSH keys. SSH Startup will be delayed. Please note that reloading the filter rules and changes will be delayed until this operation is completed.", "SSH KeyGen", "");
- mwexec("rm /etc/ssh/ssh_host_*");
+ mwexec("rm /etc/ssh/ssh_host_*", true);
mark_subsystem_dirty('sshdkeys');
echo " Generating Keys:\n";
system("/usr/bin/nice -n20 /usr/bin/ssh-keygen -t rsa1 -N '' -f $sshConfigDir/ssh_host_key");
diff --git a/usr/local/www/diag_arp.php b/usr/local/www/diag_arp.php
index e202bc0..3aff783 100755
--- a/usr/local/www/diag_arp.php
+++ b/usr/local/www/diag_arp.php
@@ -205,15 +205,15 @@ if(count($pools) > 0) {
// Put this in an easy to use form
$dhcpmac = array();
$dhcpip = array();
-
+
foreach ($leases as $value) {
- $dhcpmac[$value['mac']] = $value['hostname'];
- $dhcpip[$value['ip']] = $value['hostname'];
+ $dhcpmac[$value['mac']] = $value['hostname'];
+ $dhcpip[$value['ip']] = $value['hostname'];
}
exec("/usr/sbin/arp -an",$rawdata);
-$i = 0;
+$i = 0;
/* if list */
$ifdescrs = get_configured_interface_with_descr();
@@ -225,7 +225,7 @@ foreach ($ifdescrs as $key =>$interface) {
$data = array();
foreach ($rawdata as $line) {
$elements = explode(' ',$line);
-
+
if ($elements[3] != "(incomplete)") {
$arpent = array();
$arpent['ip'] = trim(str_replace(array('(',')'),'',$elements[1]));
@@ -238,15 +238,15 @@ foreach ($rawdata as $line) {
function getHostName($mac,$ip)
{
global $dhcpmac, $dhcpip;
-
+
if ($dhcpmac[$mac])
return $dhcpmac[$mac];
else if ($dhcpip[$ip])
return $dhcpip[$ip];
else if(gethostbyaddr($ip) <> "" and gethostbyaddr($ip) <> $ip)
return gethostbyaddr($ip);
- else
- return "";
+ else
+ return "";
}
$pgtitle = array(gettext("Diagnostics"),gettext("ARP Table"));
@@ -255,7 +255,7 @@ include("head.inc");
?>
<body link="#000000" vlink="#000000" alink="#000000">
-
+
<?php include("fbegin.inc"); ?>
<div id="loading">
@@ -276,7 +276,7 @@ foreach ($data as &$entry) {
$dns = trim(getHostName($entry['mac'], $entry['ip']));
if(trim($dns))
$entry['dnsresolve'] = "$dns";
- else
+ else
$entry['dnsresolve'] = "Z_ ";
}
diff --git a/usr/local/www/diag_authentication.php b/usr/local/www/diag_authentication.php
index 079e335..91874d4 100755
--- a/usr/local/www/diag_authentication.php
+++ b/usr/local/www/diag_authentication.php
@@ -49,16 +49,16 @@ if ($_POST) {
$authcfg = auth_get_authserver($_POST['authmode']);
if (!$authcfg)
- $input_errors[] = "{$_POST['authmode']}" + gettext("is not a valid authentication server ");
+ $input_errors[] = $_POST['authmode'] . " " . gettext("is not a valid authentication server");
if (empty($_POST['username']) || empty($_POST['password']))
$input_errors[] = gettext("A username and password must be specified.");
if (!$input_errors) {
if (authenticate_user($_POST['username'], $_POST['password'], $authcfg)) {
- $savemsg = gettext("User: ") + {$_POST['username']} + gettext(" authenticated sucessfully.");
+ $savemsg = gettext("User") . ": " . $_POST['username'] . " " . gettext("authenticated sucessfully.");
$groups = getUserGroups($_POST['username'], $authcfg);
- $savemsg .= "<br />" + gettext("This user is member of this groups:") + " <br />";
+ $savemsg .= "<br />" + gettext("This user is member of this groups") + ": <br />";
foreach ($groups as $group)
$savemsg .= "{$group} ";
} else {
@@ -72,7 +72,7 @@ include("head.inc");
?>
<body link="#000000" vlink="#000000" alink="#000000">
-
+
<?php include("fbegin.inc"); ?>
<?php if ($input_errors) print_input_errors($input_errors);?>
<?php if ($savemsg) print_info_box($savemsg);?>
diff --git a/usr/local/www/diag_backup.php b/usr/local/www/diag_backup.php
index 540eb47..6ce7b8d 100755
--- a/usr/local/www/diag_backup.php
+++ b/usr/local/www/diag_backup.php
@@ -60,7 +60,7 @@ function add_base_packages_menu_items() {
$modified_config = false;
foreach($base_packages as $bp) {
$basepkg_path = "/usr/local/pkg/{$bp}";
- $tmpinfo = pathinfo($basepkg_path, PATHINFO_EXTENSION);
+ $tmpinfo = pathinfo($basepkg_path, PATHINFO_EXTENSION);
if($tmpinfo['extension'] == "xml" && file_exists($basepkg_path)) {
$pkg_config = parse_xml_config_pkg($basepkg_path, "packagegui");
if($pkg_config['menu'] != "") {
@@ -80,7 +80,7 @@ function add_base_packages_menu_items() {
}
}
if($modified_config) {
- write_confg("Restored base_package menus after configuration restore.");
+ write_confg(gettext("Restored base_package menus after configuration restore."));
$config = parse_config(true);
}
}
@@ -98,11 +98,11 @@ function check_and_returnif_section_exists($section) {
function spit_out_select_items($area, $showall) {
global $config;
-
- $areas = array("aliases" => gettext("Aliases"),
+
+ $areas = array("aliases" => gettext("Aliases"),
"captiveportal" => gettext("Captive Portal"),
"voucher" => gettext("Captive Portal Vouchers"),
- "dnsmasq" => gettext("DNS Forwarder"),
+ "dnsmasq" => gettext("DNS Forwarder"),
"dhcpd" => gettext("DHCP Server"),
"filter" => gettext("Firewall Rules"),
"interfaces" => gettext("Interfaces"),
@@ -111,7 +111,7 @@ function spit_out_select_items($area, $showall) {
"ovpn" => gettext("OpenVPN"),
"installedpackages" => gettext("Package Manager"),
"pptpd" => gettext("PPTP Server"),
- "cron" => gettext("Scheduled Tasks"),
+ "cron" => gettext("Scheduled Tasks"),
"syslog" => gettext("Syslog"),
"system" => gettext("System"),
"staticroutes" => gettext("Static routes"),
@@ -128,16 +128,16 @@ function spit_out_select_items($area, $showall) {
$select .= " >\n";
$select .= "<option VALUE=\"\">ALL</option>";
- if($showall == true)
+ if($showall == true)
foreach($areas as $area => $areaname)
$select .= "<option value='{$area}'>{$areaname}</option>\n";
- else
+ else
foreach($areas as $area => $areaname)
if(check_and_returnif_section_exists($area) == true)
$select .= "<option value='{$area}'>{$areaname}</option>\n";
$select .= "</select>\n";
-
+
echo $select;
}
@@ -153,13 +153,13 @@ if ($_POST['apply']) {
if ($_POST) {
unset($input_errors);
- if (stristr($_POST['Submit'], "Restore configuration"))
+ if (stristr($_POST['Submit'], gettext("Restore configuration")))
$mode = "restore";
- else if (stristr($_POST['Submit'], "Reinstall"))
+ else if (stristr($_POST['Submit'], gettext("Reinstall")))
$mode = "reinstallpackages";
- else if (stristr($_POST['Submit'], "Download"))
+ else if (stristr($_POST['Submit'], gettext("Download")))
$mode = "download";
- else if (stristr($_POST['Submit'], "Restore version"))
+ else if (stristr($_POST['Submit'], gettext("Restore version")))
$mode = "restore_ver";
if ($_POST["nopackages"] <> "")
@@ -199,7 +199,7 @@ if ($_POST) {
$sfn = "{$g['tmp_path']}/config.xml.nopkg";
file_put_contents($sfn, $data);
exec("sed '/<installedpackages>/,/<\/installedpackages>/d' {$sfn} > {$sfn}-new");
- $data = file_get_contents($sfn . "-new");
+ $data = file_get_contents($sfn . "-new");
} else {
if(!$_POST['backuparea']) {
/* backup entire configuration */
@@ -218,7 +218,7 @@ if ($_POST) {
tagfile_reformat($data, $data, "config.xml");
}
- /*
+ /*
* Backup RRD Data
*/
if(!$_POST['donotbackuprrd']) {
@@ -238,7 +238,7 @@ if ($_POST) {
$data .= "\t</rrddata>\n";
$data .= "</pfsense>\n";
}
-
+
$size = strlen($data);
header("Content-Type: application/octet-stream");
header("Content-Disposition: attachment; filename={$name}");
@@ -272,7 +272,7 @@ if ($_POST) {
/* read the file contents */
$data = file_get_contents($_FILES['conffile']['tmp_name']);
if(!$data) {
- log_error(gettext("Warning, could not read file ") . $_FILES['conffile']['tmp_name']);
+ log_error(gettext("Warning, could not read file") . " " . $_FILES['conffile']['tmp_name']);
return 1;
}
@@ -301,7 +301,7 @@ if ($_POST) {
}
} else {
if(!stristr($data, "<" . $g['xml_rootobj'] . ">")) {
- $input_errors[] = gettext("You have selected to restore the full configuration but we could not locate a ") . $g['xml_rootobj'] . gettext(" tag.");
+ $input_errors[] = gettext("You have selected to restore the full configuration but we could not locate a") . " " . $g['xml_rootobj'] . " " . gettext("tag.");
} else {
/* restore the entire configuration */
file_put_contents($_FILES['conffile']['tmp_name'], $data);
@@ -370,7 +370,7 @@ if ($_POST) {
}
unlink_if_exists("{$g['tmp_path']}/config.cache");
// Reset configuration version to something low
- // in order to force the config upgrade code to
+ // in order to force the config upgrade code to
// run through with all steps that are required.
$config['system']['version'] = "1.0";
// Deal with descriptions longer than 63 characters
@@ -432,7 +432,7 @@ if ($_POST) {
}
$config['diag']['ipv6nat'] = true;
write_config();
- add_base_packages_menu_items();
+ add_base_packages_menu_items();
convert_config();
conf_mount_ro();
$savemsg = gettext("The m0n0wall configuration has been restored and upgraded to pfSense.");
@@ -527,7 +527,7 @@ function backuparea_change(obj) {
<?php if (is_subsystem_dirty('restore')): ?><p>
<form action="reboot.php" method="post">
<input name="Submit" type="hidden" value=" Yes ">
-<?php print_info_box(gettext("The firewall configuration has been changed.<br/>The firewall is now rebooting."));?><br>
+<?php print_info_box(gettext("The firewall configuration has been changed.") . "<br/>" . gettext("The firewall is now rebooting."));?><br>
</form>
<?php endif; ?>
<form action="diag_backup.php" method="post" name="iform" enctype="multipart/form-data">
diff --git a/usr/local/www/diag_confbak.php b/usr/local/www/diag_confbak.php
index 5d0458b..393f771 100755
--- a/usr/local/www/diag_confbak.php
+++ b/usr/local/www/diag_confbak.php
@@ -28,7 +28,7 @@
POSSIBILITY OF SUCH DAMAGE.
*/
-/*
+/*
pfSense_MODULE: config
*/
@@ -45,9 +45,10 @@ if($_GET['newver'] != "") {
conf_mount_rw();
$confvers = unserialize(file_get_contents($g['cf_conf_path'] . '/backup/backup.cache'));
if(config_restore($g['conf_path'] . '/backup/config-' . $_GET['newver'] . '.xml') == 0)
- $savemsg = "Successfully reverted to timestamp " . date("n/j/y H:i:s", $_GET['newver']) . " with description \"" . $confvers[$_GET['newver']]['description'] . "\".";
+
+ $savemsg = sprintf(gettext("Successfully reverted to timestamp %s with description \"%s\"."), date(gettext("n/j/y H:i:s"), $_GET['newver']), $confvers[$_GET['newver']]['description']);
else
- $savemsg = "Unable to revert to the selected configuration.";
+ $savemsg = gettext("Unable to revert to the selected configuration.");
conf_mount_ro();
}
@@ -55,7 +56,7 @@ if($_GET['rmver'] != "") {
conf_mount_rw();
$confvers = unserialize(file_get_contents($g['cf_conf_path'] . '/backup/backup.cache'));
unlink_if_exists($g['conf_path'] . '/backup/config-' . $_GET['rmver'] . '.xml');
- $savemsg = "Deleted backup with timestamp " . date("n/j/y H:i:s", $_GET['rmver']) . " and description \"" . $confvers[$_GET['rmver']]['description'] . "\".";
+ $savemsg = sprintf(gettext("Deleted backup with timestamp %s and description \"%s\"."), date(gettext("n/j/y H:i:s"), $_GET['rmver']),$confvers[$_GET['rmver']]['description']);
conf_mount_ro();
}
@@ -94,7 +95,7 @@ cleanup_backupcache();
$confvers = get_backups();
unset($confvers['versions']);
-$pgtitle = array("Diagnostics","Configuration History");
+$pgtitle = array(gettext("Diagnostics"),gettext("Configuration History"));
include("head.inc");
?>
@@ -107,7 +108,7 @@ include("head.inc");
?>
<? if ($diff) { ?>
<table align="center" valign="middle" width="100%" border="0" cellspacing="0" style="padding-top: 4px; padding-bottom: 4px;">
- <tr><td>Configuration diff from <?php echo date("n/j/y H:i:s", $oldtime); ?> to <?php echo date("n/j/y H:i:s", $newtime); ?></td></tr>
+ <tr><td><?=gettext("Configuration diff from");?> <?php echo date(gettext("n/j/y H:i:s"), $oldtime); ?> <?=gettext("to");?> <?php echo date(gettext("n/j/y H:i:s"), $newtime); ?></td></tr>
<?php foreach ($diff as $line) {
switch (substr($line, 0, 1)) {
case "+":
@@ -135,10 +136,10 @@ include("head.inc");
<td>
<?php
$tab_array = array();
- $tab_array[0] = array("Config History", true, "diag_confbak.php");
- $tab_array[1] = array("Backup/Restore", false, "diag_backup.php");
+ $tab_array[0] = array(gettext("Config History"), true, "diag_confbak.php");
+ $tab_array[1] = array(gettext("Backup/Restore"), false, "diag_backup.php");
display_top_tabs($tab_array);
- ?>
+ ?>
</td>
</tr>
<tr>
@@ -149,25 +150,25 @@ include("head.inc");
<?php if (is_array($confvers)): ?>
<tr>
<td colspan="2" valign="middle" align="center" class="list" nowrap><input type="submit" name="diff" value="Diff"></td>
- <td width="30%" class="listhdrr">Date</td>
- <td width="70%" class="listhdrr">Configuration Change</td>
+ <td width="30%" class="listhdrr"><?=gettext("Date");?></td>
+ <td width="70%" class="listhdrr"><?=gettext("Configuration Change");?></td>
</tr>
<tr valign="top">
<td valign="middle" class="list" nowrap></td>
<td class="list">
<input type="radio" name="newtime" value="current">
</td>
- <td class="listlr"> <?= date("n/j/y H:i:s", $config['revision']['time']) ?></td>
+ <td class="listlr"> <?= date(gettext("n/j/y H:i:s"), $config['revision']['time']) ?></td>
<td class="listr"> <?= $config['revision']['description'] ?></td>
- <td colspan="3" valign="middle" class="list" nowrap><b>Current</b></td>
+ <td colspan="3" valign="middle" class="list" nowrap><b><?=gettext("Current");?></b></td>
</tr>
<?php
$c = 0;
foreach($confvers as $version):
if($version['time'] != 0)
- $date = date("n/j/y H:i:s", $version['time']);
+ $date = date(gettext("n/j/y H:i:s"), $version['time']);
else
- $date = "Unknown";
+ $date = gettext("Unknown");
$desc = $version['description'];
?>
<tr valign="top">
@@ -179,24 +180,24 @@ include("head.inc");
<input type="radio" name="newtime" value="<?php echo $version['time'];?>">
<? } else { ?>
&nbsp;
- <? }
+ <? }
$c++; ?>
</td>
<td class="listlr"> <?= $date ?></td>
<td class="listr"> <?= $desc ?></td>
<td valign="middle" class="list" nowrap>
- <a href="diag_confbak.php?newver=<?=$version['time'];?>" onclick="return confirm('Revert to this configuration?')">
- <img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" alt="Revert to this configuration" title="Revert to this configuration">
+ <a href="diag_confbak.php?newver=<?=$version['time'];?>" onclick="return confirm('<?=gettext("Revert to this configuration?");?>'")>
+ <img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" alt="<?=gettext("Revert to this configuration");?>" title="<?=gettext("Revert to this configuration");?>">
</a>
</td>
<td valign="middle" class="list" nowrap>
- <a href="diag_confbak.php?rmver=<?=$version['time'];?>" onclick="return confirm('Delete this configuration backup?')">
- <img src="/themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0" alt="Remove this backup" title="Remove this backup">
+ <a href="diag_confbak.php?rmver=<?=$version['time'];?>" onclick="return confirm('<?=gettext("Delete this configuration backup?");?>')">
+ <img src="/themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0" alt="<?=gettext("Remove this backup");?>" title="<?=gettext("Remove this backup");?>">
</a>
</td>
<td valign="middle" class="list" nowrap>
<a href="diag_confbak.php?getcfg=<?=$version['time'];?>">
- <img src="/themes/<?= $g['theme']; ?>/images/icons/icon_down.gif" width="17" height="17" border="0" alt="Download this backup" title="Download this backup">
+ <img src="/themes/<?= $g['theme']; ?>/images/icons/icon_down.gif" width="17" height="17" border="0" alt="<?=gettext("Download this backup");?>" title="<?=gettext("Download this backup");?>">
</a>
</td>
</tr>
@@ -208,7 +209,7 @@ include("head.inc");
<?php else: ?>
<tr>
<td>
- <?php print_info_box("No backups found."); ?>
+ <?php print_info_box(gettext("No backups found.")); ?>
</td>
</tr>
<?php endif; ?>
diff --git a/usr/local/www/diag_defaults.php b/usr/local/www/diag_defaults.php
index c462abd..cde9d54 100755
--- a/usr/local/www/diag_defaults.php
+++ b/usr/local/www/diag_defaults.php
@@ -48,14 +48,14 @@ if ($_POST) {
if ($_POST['Submit'] != " No ") {
reset_factory_defaults();
system_reboot();
- $rebootmsg = "The system has been reset to factory defaults and is now rebooting. This may take one minute.";
+ $rebootmsg = gettext("The system has been reset to factory defaults and is now rebooting. This may take one minute.");
} else {
header("Location: index.php");
exit;
}
}
-$pgtitle = array("Diagnostics","Factory defaults");
+$pgtitle = array(gettext("Diagnostics"),gettext("Factory defaults"));
include("head.inc");
?>
@@ -64,21 +64,22 @@ include("head.inc");
<?php include("fbegin.inc"); ?>
<?php if ($rebootmsg): echo print_info_box($rebootmsg); else: ?>
<form action="diag_defaults.php" method="post">
- <p><strong>If you click &quot;Yes&quot;, the firewall will:
-
+ <p><strong> <?=gettext("If you click") . " &quot;" . gettext("Yes") . "&quot;, " . gettext("the firewall will")?>:
+
<ul>
- <li>Reset to factory defaults</li>
- <li>LAN IP address will be reset to 192.168.1.1</li>
- <li>System will be configured as a DHCP server on the default LAN interface</li>
- <li>Reboot after changes are installed</li>
- <li>WAN interface will be set to obtain an address automatically from a DHCP server</li>
- <li>webConfigurator admin username will be reset to 'admin'</li>
- <li>webConfigurator admin password will be reset to '<?=$g['product_name']?>'</li>
+ <li><?=gettext("Reset to factory defaults");?></li>
+ <li><?=gettext("LAN IP address will be reset to 192.168.1.1");?></li>
+ <li><?=gettext("System will be configured as a DHCP server on the default LAN interface");?></li>
+ <li><?=gettext("Reboot after changes are installed");?></li>
+ <li><?=gettext("WAN interface will be set to obtain an address automatically from a DHCP server");?></li>
+ <li><?=gettext("webConfigurator admin username will be reset to 'admin'");?></li>
+ <li><?=gettext("webConfigurator admin password will be reset to");?> '<?=$g['product_name']?>'</li>
+
</ul>
- Are you sure you want to proceed?</strong></p>
+ <?=gettext("Are you sure you want to proceed?");?></strong></p>
<p>
- <input name="Submit" type="submit" class="formbtn" value=" Yes ">
- <input name="Submit" type="submit" class="formbtn" value=" No ">
+ <input name="Submit" type="submit" class="formbtn" value=" <?=gettext("Yes");?> ">
+ <input name="Submit" type="submit" class="formbtn" value=" <?=gettext("No");?> ">
</p>
</form>
<?php endif; ?>
diff --git a/usr/local/www/diag_dns.php b/usr/local/www/diag_dns.php
index abdeea3..a82628d 100644
--- a/usr/local/www/diag_dns.php
+++ b/usr/local/www/diag_dns.php
@@ -49,7 +49,7 @@ if ($_POST) {
$host_esc = escapeshellarg(trim($_POST['host']));
if (!is_hostname($host) && !is_ipaddr($host))
- $input_errors[] = "Host must be a valid hostname or IP address.";
+ $input_errors[] = gettext("Host must be a valid hostname or IP address.");
// Test resolution speed of each DNS server.
if ((is_hostname($host) || is_ipaddr($host))) {
@@ -59,7 +59,7 @@ if ($_POST) {
$dns_server = $pconfig['dns' . $dnscounter];
$query_time = `dig {$host_esc} @{$dns_server} | grep Query | cut -d':' -f2`;
if($query_time == "")
- $query_time = "No response";
+ $query_time = gettext("No response");
$new_qt = array();
$new_qt['dns_server'] = $dns_server;
$new_qt['query_time'] = $query_time;
@@ -68,7 +68,7 @@ if ($_POST) {
}
}
- $type = "unknown";
+ $type = gettext("unknown");
$resolved = "";
$ipaddr = "";
$hostname = "";
@@ -88,7 +88,7 @@ if ($_POST) {
}
if ($host == $resolved) {
- $resolved = "No record found";
+ $resolved = gettext("No record found");
}
}
}
@@ -103,10 +103,10 @@ include("head.inc"); ?>
<form action="diag_dns.php" method="post" name="iform" id="iform">
<table width="100%" border="0" cellpadding="6" cellspacing="0">
<tr>
- <td colspan="2" valign="top" class="listtopic">Resolve DNS hostname or IP</td>
+ <td colspan="2" valign="top" class="listtopic"> <?=gettext("Resolve DNS hostname or IP");?></td>
</tr>
<tr>
- <td width="22%" valign="top" class="vncellreq">Hostname or IP</td>
+ <td width="22%" valign="top" class="vncellreq">gettext("Hostname or IP");?></td>
<td width="78%" class="vtable">
<?=$mandfldhtml;?><input name="host" type="text" class="formfld" id="host" size="20" value="<?=htmlspecialchars($host);?>">
<? if ($resolved && $type) { ?>
@@ -116,15 +116,15 @@ include("head.inc"); ?>
</tr>
<?php if($_POST): ?>
<tr>
- <td width="22%" valign="top" class="vncell">Resolution time per server</td>
+ <td width="22%" valign="top" class="vncell"><?=gettext("Resolution time per server");?></td>
<td width="78%" class="vtable">
<table width="170" border="1" cellpadding="2" style="border-width: 1px 1px 1px 1px; border-collapse: collapse;">
<tr>
<td>
- <b>Server</b>
+ <b><?=gettext("Server");?></b>
</td>
<td>
- <b>Query time</b>
+ <b><?=gettext("Query time");></b>
</td>
</tr>
<?php
@@ -148,14 +148,14 @@ include("head.inc"); ?>
<?php endif; ?>
<?php if (!$input_errors && $ipaddr) { ?>
<tr>
- <td width="22%" valign="top" class="vncell">More Information:</td>
+ <td width="22%" valign="top" class="vncell"><?=gettext("More Information:");?></td>
<td width="78%" class="vtable">
- <a target="_new" href ="/diag_ping.php?host=<?=$host?>&interface=wan&count=3">Ping</a> <br/>
- <a target="_new" href ="/diag_traceroute.php?host=<?=$host?>&ttl=18">Traceroute</a>
+ <a target="_new" href ="/diag_ping.php?host=<?=$host?>&interface=wan&count=3"><?=gettext("Ping");?></a> <br/>
+ <a target="_new" href ="/diag_traceroute.php?host=<?=$host?>&ttl=18"><?=gettext("Traceroute");?></a>
<p/>
- NOTE: The following links are to external services, so their reliability cannot be guaranteed.<br/><br/>
- <a target="_new" href="http://private.dnsstuff.com/tools/whois.ch?ip=<?php echo $ipaddr; ?>">IP WHOIS @ DNS Stuff</a><br />
- <a target="_new" href="http://private.dnsstuff.com/tools/ipall.ch?ip=<?php echo $ipaddr; ?>">IP Info @ DNS Stuff</a>
+ <?=gettext("NOTE: The following links are to external services, so their reliability cannot be guaranteed.");?><br/><br/>
+ <a target="_new" href="http://private.dnsstuff.com/tools/whois.ch?ip=<?php echo $ipaddr; ?>"><?=gettext("IP WHOIS @ DNS Stuff");?></a><br />
+ <a target="_new" href="http://private.dnsstuff.com/tools/ipall.ch?ip=<?php echo $ipaddr; ?>"><?=gettext("IP Info @ DNS Stuff");?></a>
</td>
</tr>
<?php } ?>
@@ -163,7 +163,7 @@ include("head.inc"); ?>
<td width="22%" valign="top">&nbsp;</td>
<td width="78%">
<br/>&nbsp;
- <input name="Submit" type="submit" class="formbtn" value="DNS Lookup">
+ <input name="Submit" type="submit" class="formbtn" value="<?=gettext("DNS Lookup");?>">
</td>
</tr>
</table>
diff --git a/usr/local/www/diag_dump_states.php b/usr/local/www/diag_dump_states.php
index c3818f6..f0b9ba5 100755
--- a/usr/local/www/diag_dump_states.php
+++ b/usr/local/www/diag_dump_states.php
@@ -50,7 +50,7 @@ if($_GET['action']) {
$retval = mwexec("/sbin/pfctl -k '{$srcip}' -k '{$dstip}'");
echo htmlentities("|{$srcip}|{$dstip}|{$retval}|");
} else {
- echo "invalid input";
+ echo gettext("invalid input");
}
exit;
}
@@ -132,7 +132,7 @@ include("head.inc");
<form action="<?=$_SERVER['SCRIPT_NAME'];?>" method="get">
<table class="tabcont" width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
- <td>Current state count: <?=$current_statecount?></td>
+ <td><?=gettext("Current state count");?>: <?=$current_statecount?></td>
<td style="font-weight:bold;" align="right">
<?=gettext("Filter expression:");?>
<input type="text" name="filter" class="formfld search" value="<?=$_GET['filter'];?>" size="30" />
@@ -172,26 +172,26 @@ if(count($states) > 0) {
$parts = split(":", $ends[count($ends) - 1]);
$dstip = trim($parts[0]);
- echo "<tr valign='top' name='r:{$srcip}:{$dstip}'>
+ echo "<tr valign='top' name='r:{$srcip}:{$dstip}'>"
<td class='listlr'>{$proto}</td>
<td class='listr'>{$info}</td>
<td class='listr'>{$state}</td>
<td class='list'>
<img src='/themes/{$g['theme']}/images/icons/icon_x.gif' height='17' width='17' border='0'
- onclick=\"removeState('{$srcip}', '{$dstip}');\" style='cursor:pointer;'
+ onclick="removeState('{$srcip}', '{$dstip}');" style='cursor:pointer;'
name='i:{$srcip}:{$dstip}'
title='" . gettext("Remove all state entries from") . " {$srcip} " . gettext("to") . " {$dstip}' alt='' />
</td>
- </tr>";
+ </tr>;
$row++;
}
}
else {
- echo "<tr>
+ echo "<tr>"
<td class='list' colspan='4' align='center' valign='top'>
" . gettext("No states were found.") . "
</td>
- </tr>";
+ </tr>;
}
?>
</table>
diff --git a/usr/local/www/diag_ipsec.php b/usr/local/www/diag_ipsec.php
index a77d261..99b9864 100644
--- a/usr/local/www/diag_ipsec.php
+++ b/usr/local/www/diag_ipsec.php
@@ -45,7 +45,7 @@
global $g;
-$pgtitle = array("Status","IPsec");
+$pgtitle = array(gettext("Status"),gettext("IPsec"));
require("guiconfig.inc");
include("head.inc");
@@ -69,10 +69,10 @@ $sad = ipsec_dump_sad();
<td>
<?php
$tab_array = array();
- $tab_array[0] = array("Overview", true, "diag_ipsec.php");
- $tab_array[1] = array("SAD", false, "diag_ipsec_sad.php");
- $tab_array[2] = array("SPD", false, "diag_ipsec_spd.php");
- $tab_array[3] = array("Logs", false, "diag_logs_ipsec.php");
+ $tab_array[0] = array(gettext("Overview"), true, "diag_ipsec.php");
+ $tab_array[1] = array(gettext("SAD"), false, "diag_ipsec_sad.php");
+ $tab_array[2] = array(gettext("SPD"), false, "diag_ipsec_spd.php");
+ $tab_array[3] = array(gettext("Logs"), false, "diag_logs_ipsec.php");
display_top_tabs($tab_array);
?>
</td>
@@ -82,12 +82,12 @@ $sad = ipsec_dump_sad();
<div id="mainarea">
<table width="100%" border="0" cellpadding="6" cellspacing="0" class="tabcont sortable">
<tr>
- <td nowrap class="listhdrr">Local IP</td>
- <td nowrap class="listhdrr">Remote IP</a></td>
- <td nowrap class="listhdrr">Local Network</td>
- <td nowrap class="listhdrr">Remote Network</a></td>
- <td nowrap class="listhdrr">Description</a></td>
- <td nowrap class="listhdrr">Status</td>
+ <td nowrap class="listhdrr"><?=gettext("Local IP");?></td>
+ <td nowrap class="listhdrr"><?=gettext("Remote IP");?></a></td>
+ <td nowrap class="listhdrr"><?=gettext("Local Network");?></td>
+ <td nowrap class="listhdrr"><?=gettext("Remote Network");?></a></td>
+ <td nowrap class="listhdrr"><?=gettext("Description");?></a></td>
+ <td nowrap class="listhdrr"><?=gettext("Status");?></td>
</tr>
<?php
foreach ($a_phase2 as $ph2ent) {
@@ -132,9 +132,9 @@ $sad = ipsec_dump_sad();
<span class="vexpl">
<span class="red">
- <strong>Note:<br /></strong>
+ <strong><?=gettext("Note");?>:<br /></strong>
</span>
- You can configure your IPsec
+ <?=gettext("You can configure your IPsec");?>
<a href="vpn_ipsec.php">here</a>.
</span>
diff --git a/usr/local/www/diag_ipsec_sad.php b/usr/local/www/diag_ipsec_sad.php
index 75ec782..3af1e69 100755
--- a/usr/local/www/diag_ipsec_sad.php
+++ b/usr/local/www/diag_ipsec_sad.php
@@ -46,7 +46,7 @@
require("guiconfig.inc");
require("ipsec.inc");
-$pgtitle = array("Status","IPsec","SAD");
+$pgtitle = array(gettext("Status"),gettext("IPsec"),gettext("SAD"));
include("head.inc");
$sad = ipsec_dump_sad();
@@ -70,10 +70,10 @@ if ($_GET['act'] == "del") {
<td>
<?php
$tab_array = array();
- $tab_array[0] = array("Overview", false, "diag_ipsec.php");
- $tab_array[1] = array("SAD", true, "diag_ipsec_sad.php");
- $tab_array[2] = array("SPD", false, "diag_ipsec_spd.php");
- $tab_array[3] = array("Logs", false, "diag_logs_ipsec.php");
+ $tab_array[0] = array(gettext("Overview"), false, "diag_ipsec.php");
+ $tab_array[1] = array(gettext("SAD"), true, "diag_ipsec_sad.php");
+ $tab_array[2] = array(gettext("SPD"), false, "diag_ipsec_spd.php");
+ $tab_array[3] = array(gettext("Logs"), false, "diag_logs_ipsec.php");
display_top_tabs($tab_array);
?>
</td>
@@ -84,12 +84,12 @@ if ($_GET['act'] == "del") {
<table class="tabcont sortable" width="100%" border="0" cellpadding="6" cellspacing="0">
<?php if (count($sad)): ?>
<tr>
- <td nowrap class="listhdrr">Source</td>
- <td nowrap class="listhdrr">Destination</a></td>
- <td nowrap class="listhdrr">Protocol</td>
- <td nowrap class="listhdrr">SPI</td>
- <td nowrap class="listhdrr">Enc. alg.</td>
- <td nowrap class="listhdr">Auth. alg.</td>
+ <td nowrap class="listhdrr"><?=gettext("Source");?></td>
+ <td nowrap class="listhdrr"><?=gettext("Destination");?></a></td>
+ <td nowrap class="listhdrr"><?=gettext("Protocol");?></td>
+ <td nowrap class="listhdrr"><?=gettext("SPI");?></td>
+ <td nowrap class="listhdrr"><?=gettext("Enc. alg.");?></td>
+ <td nowrap class="listhdr"><?=gettext("Auth. alg.");?></td>
<td nowrap class="list"></td>
</tr>
<?php foreach ($sad as $sa): ?>
@@ -116,7 +116,7 @@ if ($_GET['act'] == "del") {
<?php else: ?>
<tr>
<td>
- <p><strong>No IPsec security associations.</strong></p>
+ <p><strong><?=gettext("No IPsec security associations.");?></strong></p>
</td>
</tr>
<?php endif; ?>
@@ -129,8 +129,8 @@ if ($_GET['act'] == "del") {
<p/>
<span class="vexpl">
-<span class="red"><strong>Note:<br></strong></span>
-You can configure your IPsec <a href="vpn_ipsec.php">here</a>.
+<span class="red"><strong><?=gettext("Note");?>:<br></strong></span>
+<?=gettext("You can configure your IPsec");?> <a href="vpn_ipsec.php">here</a>.
</span>
<?php include("fend.inc"); ?>
diff --git a/usr/local/www/diag_logs_filter_summary.php b/usr/local/www/diag_logs_filter_summary.php
index ba5751a..1171b89 100644
--- a/usr/local/www/diag_logs_filter_summary.php
+++ b/usr/local/www/diag_logs_filter_summary.php
@@ -121,7 +121,7 @@ function pie_block($summary, $stat, $num) {
print " [\n";
for ($i=0; $i < $num; $i++) {
if ($k[$i]) {
- print " { ".gettext("data").": d{$stat}{$i}, ".gettext("label").": \"{$k[$i]}\"}";
+ print " { data: d{$stat}{$i}, label: \"{$k[$i]}\"}";
if (!(($i == ($numentries - 1)) && ($leftover <= 0)))
print ",\n";
else
@@ -129,11 +129,11 @@ function pie_block($summary, $stat, $num) {
}
}
if ($leftover > 0)
- print " { ".gettext("data").": d{$stat}{$i}, ".gettext("label").": \"Other\"}\n";
+ print " { data: d{$stat}{$i}, label: \"Other\"}\n";
print " ],\n";
print " {\n";
- print " ".gettext("pies").": {show: true, autoScale: true},\n";
- print " ".gettext("legend").": {show: true, labelFormatter: lblfmt}\n";
+ print " pies: {show: true, autoScale: true},\n";
+ print " legend: {show: true, labelFormatter: lblfmt}\n";
print " });\n";
print "});\n";
@@ -181,17 +181,17 @@ include("head.inc"); ?>
<tr><td>
<?php
$tab_array = array();
- $tab_array[] = array(gettext("System"), false, gettext("diag_logs.php"));
- $tab_array[] = array(gettext("Firewall"), true, gettext("diag_logs_filter.php"));
- $tab_array[] = array(gettext("DHCP"), false, gettext("diag_logs_dhcp.php"));
- $tab_array[] = array(gettext("Portal Auth"), false, gettext("diag_logs_auth.php"));
- $tab_array[] = array(gettext("IPsec"), false, gettext("diag_logs_ipsec.php"));
- $tab_array[] = array(gettext("PPP"), false, gettext("diag_logs_ppp.php"));
- $tab_array[] = array(gettext("VPN"), false, gettext("diag_logs_vpn.php"));
- $tab_array[] = array(gettext("Load Balancer"), false, gettext("diag_logs_relayd.php"));
- $tab_array[] = array(gettext("OpenVPN"), false, gettext("diag_logs_openvpn.php"));
- $tab_array[] = array(gettext("OpenNTPD"), false, gettext("diag_logs_ntpd.php"));
- $tab_array[] = array(gettext("Settings"), false, gettext("diag_logs_settings.php"));
+ $tab_array[] = array(gettext("System"), false, "diag_logs.php");
+ $tab_array[] = array(gettext("Firewall"), true, "diag_logs_filter.php");
+ $tab_array[] = array(gettext("DHCP"), false, "diag_logs_dhcp.php");
+ $tab_array[] = array(gettext("Portal Auth"), false, "diag_logs_auth.php");
+ $tab_array[] = array(gettext("IPsec"), false, "diag_logs_ipsec.php");
+ $tab_array[] = array(gettext("PPP"), false, "diag_logs_ppp.php");
+ $tab_array[] = array(gettext("VPN"), false, "diag_logs_vpn.php");
+ $tab_array[] = array(gettext("Load Balancer"), false, "diag_logs_relayd.php");
+ $tab_array[] = array(gettext("OpenVPN"), false, "diag_logs_openvpn.php");
+ $tab_array[] = array(gettext("OpenNTPD"), false, "diag_logs_ntpd.php");
+ $tab_array[] = array(gettext("Settings"), false, "diag_logs_settings.php");
display_top_tabs($tab_array);
?>
</td></tr>
diff --git a/usr/local/www/diag_logs_ipsec.php b/usr/local/www/diag_logs_ipsec.php
index bb1cc80..9de5494 100755
--- a/usr/local/www/diag_logs_ipsec.php
+++ b/usr/local/www/diag_logs_ipsec.php
@@ -84,17 +84,17 @@ include("head.inc");
<td>
<?php
$tab_array = array();
- $tab_array[] = array(gettext("System"), false, gettext("diag_logs.php"));
- $tab_array[] = array(gettext("Firewall"), false, gettext("diag_logs_filter.php"));
- $tab_array[] = array(gettext("DHCP"), false, gettext("diag_logs_dhcp.php"));
- $tab_array[] = array(gettext("Portal Auth"), false, gettext("diag_logs_auth.php"));
- $tab_array[] = array(gettext("IPsec"), true, gettext("diag_logs_ipsec.php"));
- $tab_array[] = array(gettext("PPP"), false, gettext("diag_logs_ppp.php"));
- $tab_array[] = array(gettext("VPN"), false, gettext("diag_logs_vpn.php"));
- $tab_array[] = array(gettext("Load Balancer"), false, gettext("diag_logs_relayd.php"));
- $tab_array[] = array(gettext("OpenVPN"), false, gettext("diag_logs_openvpn.php"));
- $tab_array[] = array(gettext("OpenNTPD"), false, gettext("diag_logs_ntpd.php"));
- $tab_array[] = array(gettext("Settings"), false, gettext("diag_logs_settings.php"));
+ $tab_array[] = array(gettext("System"), false, "diag_logs.php");
+ $tab_array[] = array(gettext("Firewall"), false, "diag_logs_filter.php");
+ $tab_array[] = array(gettext("DHCP"), false, "diag_logs_dhcp.php");
+ $tab_array[] = array(gettext("Portal Auth"), false, "diag_logs_auth.php");
+ $tab_array[] = array(gettext("IPsec"), true, "diag_logs_ipsec.php");
+ $tab_array[] = array(gettext("PPP"), false, "diag_logs_ppp.php");
+ $tab_array[] = array(gettext("VPN"), false, "diag_logs_vpn.php");
+ $tab_array[] = array(gettext("Load Balancer"), false, "diag_logs_relayd.php");
+ $tab_array[] = array(gettext("OpenVPN"), false, "diag_logs_openvpn.php");
+ $tab_array[] = array(gettext("OpenNTPD"), false, "diag_logs_ntpd.php");
+ $tab_array[] = array(gettext("Settings"), false, "diag_logs_settings.php");
display_top_tabs($tab_array);
?>
</td>
diff --git a/usr/local/www/diag_logs_ntpd.php b/usr/local/www/diag_logs_ntpd.php
index a07c54e..588c0e2 100644
--- a/usr/local/www/diag_logs_ntpd.php
+++ b/usr/local/www/diag_logs_ntpd.php
@@ -62,17 +62,17 @@ include("head.inc");
<tr><td>
<?php
$tab_array = array();
- $tab_array[] = array(gettext("System"), false, gettext("diag_logs.php"));
- $tab_array[] = array(gettext("Firewall"), false, gettext("diag_logs_filter.php"));
- $tab_array[] = array(gettext("DHCP"), false, gettext("diag_logs_dhcp.php"));
- $tab_array[] = array(gettext("Portal Auth"), false, gettext("diag_logs_auth.php"));
- $tab_array[] = array(gettext("IPsec"), false, gettext("diag_logs_ipsec.php"));
- $tab_array[] = array(gettext("PPP"), false, gettext("diag_logs_ppp.php"));
- $tab_array[] = array(gettext("VPN"), false, gettext("diag_logs_vpn.php"));
- $tab_array[] = array(gettext("Load Balancer"), false, gettext("diag_logs_relayd.php"));
- $tab_array[] = array(gettext("OpenVPN"), false, gettext("diag_logs_openvpn.php"));
- $tab_array[] = array(gettext("OpenNTPD"), true, gettext("diag_logs_ntpd.php"));
- $tab_array[] = array(gettext("Settings"), false, gettext("diag_logs_settings.php"));
+ $tab_array[] = array(gettext("System"), false, "diag_logs.php");
+ $tab_array[] = array(gettext("Firewall"), false, "diag_logs_filter.php");
+ $tab_array[] = array(gettext("DHCP"), false, "diag_logs_dhcp.php");
+ $tab_array[] = array(gettext("Portal Auth"), false, "diag_logs_auth.php");
+ $tab_array[] = array(gettext("IPsec"), false, "diag_logs_ipsec.php");
+ $tab_array[] = array(gettext("PPP"), false, "diag_logs_ppp.php");
+ $tab_array[] = array(gettext("VPN"), false, "diag_logs_vpn.php");
+ $tab_array[] = array(gettext("Load Balancer"), false, "diag_logs_relayd.php");
+ $tab_array[] = array(gettext("OpenVPN"), false, "diag_logs_openvpn.php");
+ $tab_array[] = array(gettext("OpenNTPD"), true, "diag_logs_ntpd.php");
+ $tab_array[] = array(gettext("Settings"), false, "diag_logs_settings.php");
display_top_tabs($tab_array);
?>
</td></tr>
diff --git a/usr/local/www/diag_logs_openvpn.php b/usr/local/www/diag_logs_openvpn.php
index 18c48df..f052ad9 100644
--- a/usr/local/www/diag_logs_openvpn.php
+++ b/usr/local/www/diag_logs_openvpn.php
@@ -66,17 +66,17 @@ include("head.inc");
<td>
<?php
$tab_array = array();
- $tab_array[] = array(gettext("System"), false, gettext("diag_logs.php"));
- $tab_array[] = array(gettext("Firewall"), false, gettext("diag_logs_filter.php"));
- $tab_array[] = array(gettext("DHCP"), false, gettext("diag_logs_dhcp.php"));
- $tab_array[] = array(gettext("Portal Auth"), false, gettext("diag_logs_auth.php"));
- $tab_array[] = array(gettext("IPsec"), false, gettext("diag_logs_ipsec.php"));
- $tab_array[] = array(gettext("PPP"), false, gettext("diag_logs_ppp.php"));
- $tab_array[] = array(gettext("VPN"), false, gettext("diag_logs_vpn.php"));
- $tab_array[] = array(gettext("Load Balancer"), false, gettext("diag_logs_relayd.php"));
- $tab_array[] = array(gettext("OpenVPN"), true, gettext("diag_logs_openvpn.php"));
- $tab_array[] = array(gettext("OpenNTPD"), false, gettext("diag_logs_ntpd.php"));
- $tab_array[] = array(gettext("Settings"), false, gettext("diag_logs_settings.php"));
+ $tab_array[] = array(gettext("System"), false, "diag_logs.php");
+ $tab_array[] = array(gettext("Firewall"), false, "diag_logs_filter.php");
+ $tab_array[] = array(gettext("DHCP"), false, "diag_logs_dhcp.php");
+ $tab_array[] = array(gettext("Portal Auth"), false, "diag_logs_auth.php");
+ $tab_array[] = array(gettext("IPsec"), false, "diag_logs_ipsec.php");
+ $tab_array[] = array(gettext("PPP"), false, "diag_logs_ppp.php");
+ $tab_array[] = array(gettext("VPN"), false, "diag_logs_vpn.php");
+ $tab_array[] = array(gettext("Load Balancer"), false, "diag_logs_relayd.php");
+ $tab_array[] = array(gettext("OpenVPN"), true, "diag_logs_openvpn.php");
+ $tab_array[] = array(gettext("OpenNTPD"), false, "diag_logs_ntpd.php");
+ $tab_array[] = array(gettext("Settings"), false, "diag_logs_settings.php");
display_top_tabs($tab_array);
?>
</td>
diff --git a/usr/local/www/diag_logs_ppp.php b/usr/local/www/diag_logs_ppp.php
index e38d096..52eb40b 100755
--- a/usr/local/www/diag_logs_ppp.php
+++ b/usr/local/www/diag_logs_ppp.php
@@ -67,17 +67,17 @@ include("head.inc");
<td>
<?php
$tab_array = array();
- $tab_array[] = array(gettext("System"), false, gettext("diag_logs.php"));
- $tab_array[] = array(gettext("Firewall"), false, gettext("diag_logs_filter.php"));
- $tab_array[] = array(gettext("DHCP"), false, gettext("diag_logs_dhcp.php"));
- $tab_array[] = array(gettext("Portal Auth"), false, gettext("diag_logs_auth.php"));
- $tab_array[] = array(gettext("IPsec"), false, gettext("diag_logs_ipsec.php"));
- $tab_array[] = array(gettext("PPP"), true, gettext("diag_logs_ppp.php"));
- $tab_array[] = array(gettext("VPN"), false, gettext("diag_logs_vpn.php"));
- $tab_array[] = array(gettext("Load Balancer"), false, gettext("diag_logs_relayd.php"));
- $tab_array[] = array(gettext("OpenVPN"), false, gettext("diag_logs_openvpn.php"));
- $tab_array[] = array(gettext("OpenNTPD"), false, gettext("diag_logs_ntpd.php"));
- $tab_array[] = array(gettext("Settings"), false, gettext("diag_logs_settings.php"));
+ $tab_array[] = array(gettext("System"), false, "diag_logs.php");
+ $tab_array[] = array(gettext("Firewall"), false, "diag_logs_filter.php");
+ $tab_array[] = array(gettext("DHCP"), false, "diag_logs_dhcp.php");
+ $tab_array[] = array(gettext("Portal Auth"), false, "diag_logs_auth.php");
+ $tab_array[] = array(gettext("IPsec"), false, "diag_logs_ipsec.php");
+ $tab_array[] = array(gettext("PPP"), true, "diag_logs_ppp.php");
+ $tab_array[] = array(gettext("VPN"), false, "diag_logs_vpn.php");
+ $tab_array[] = array(gettext("Load Balancer"), false, "diag_logs_relayd.php");
+ $tab_array[] = array(gettext("OpenVPN"), false, "diag_logs_openvpn.php");
+ $tab_array[] = array(gettext("OpenNTPD"), false, "diag_logs_ntpd.php");
+ $tab_array[] = array(gettext("Settings"), false, "diag_logs_settings.php");
display_top_tabs($tab_array);
?>
</td>
diff --git a/usr/local/www/diag_logs_relayd.php b/usr/local/www/diag_logs_relayd.php
index a2c8ab5..8ce35b8 100755
--- a/usr/local/www/diag_logs_relayd.php
+++ b/usr/local/www/diag_logs_relayd.php
@@ -63,17 +63,17 @@ include("head.inc");
<tr><td>
<?php
$tab_array = array();
- $tab_array[] = array(gettext("System"), false, gettext("diag_logs.php"));
- $tab_array[] = array(gettext("Firewall"), false, gettext("diag_logs_filter.php"));
- $tab_array[] = array(gettext("DHCP"), false, gettext("diag_logs_dhcp.php"));
- $tab_array[] = array(gettext("Portal Auth"), false, gettext("diag_logs_auth.php"));
- $tab_array[] = array(gettext("PPP"), false, gettext("diag_logs_ppp.php"));
- $tab_array[] = array(gettext("IPsec"), false, gettext("diag_logs_ipsec.php"));
- $tab_array[] = array(gettext("VPN"), false, gettext("diag_logs_vpn.php"));
- $tab_array[] = array(gettext("Load Balancer"), true, gettext("diag_logs_relayd.php"));
- $tab_array[] = array(gettext("OpenVPN"), false, gettext("diag_logs_openvpn.php"));
- $tab_array[] = array(gettext("OpenNTPD"), false, gettext("diag_logs_ntpd.php"));
- $tab_array[] = array(gettext("Settings"), false, gettext("diag_logs_settings.php"));
+ $tab_array[] = array(gettext("System"), false, "diag_logs.php");
+ $tab_array[] = array(gettext("Firewall"), false, "diag_logs_filter.php");
+ $tab_array[] = array(gettext("DHCP"), false, "diag_logs_dhcp.php");
+ $tab_array[] = array(gettext("Portal Auth"), false, "diag_logs_auth.php");
+ $tab_array[] = array(gettext("PPP"), false, "diag_logs_ppp.php");
+ $tab_array[] = array(gettext("IPsec"), false, "diag_logs_ipsec.php");
+ $tab_array[] = array(gettext("VPN"), false, "diag_logs_vpn.php");
+ $tab_array[] = array(gettext("Load Balancer"), true, "diag_logs_relayd.php");
+ $tab_array[] = array(gettext("OpenVPN"), false, "diag_logs_openvpn.php");
+ $tab_array[] = array(gettext("OpenNTPD"), false, "diag_logs_ntpd.php");
+ $tab_array[] = array(gettext("Settings"), false, "diag_logs_settings.php");
display_top_tabs($tab_array);
?>
</td></tr>
diff --git a/usr/local/www/firewall_aliases.php b/usr/local/www/firewall_aliases.php
index bc210a1..28bb7e7 100755
--- a/usr/local/www/firewall_aliases.php
+++ b/usr/local/www/firewall_aliases.php
@@ -147,7 +147,7 @@ if ($_GET['act'] == "del") {
}
}
if($is_alias_referenced == true) {
- $savemsg = "Cannot delete rule. Currently in use by {$referenced_by}";
+ $savemsg = gettext("Cannot delete rule. Currently in use by {$referenced_by}");
} else {
unset($a_aliases[$_GET['id']]);
write_config();
@@ -169,7 +169,7 @@ include("head.inc");
<form action="firewall_aliases.php" method="post">
<?php if ($savemsg) print_info_box($savemsg); ?>
<?php if (is_subsystem_dirty('aliases')): ?><p>
-<?php print_info_box_np("The alias list has been changed.<br>You must apply the changes in order for them to take effect.");?>
+<?php print_info_box_np gettext("The alias list has been changed.<br>You must apply the changes in order for them to take effect.");?>
<?php endif; ?>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
@@ -230,7 +230,7 @@ include("head.inc");
<a href="firewall_aliases_edit.php"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" title="add a new alias"></a></td>
</td>
<td valign="middle">
- <a href="firewall_aliases_import.php"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_import_alias.gif" width="17" height="17" border="0" title="<?=gettext("Bulk import aliases from list");?>" alt="" /></a>
+ <a href="firewall_aliases_import.php"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_import_alias.gif" width="17" height="17" border="0" title="<?=gettext("Bulk import aliases from list");"?>" alt="" /></a>
</td>
</tr>
</table>
@@ -238,7 +238,7 @@ include("head.inc");
</tr>
<tr>
<td class="tabcont" colspan="3">
- <p><span class="vexpl"><span class="red"><strong>Note:<br></strong></span>Aliases act as placeholders for real hosts, networks or ports. They can be used to minimize the number of changes that have to be made if a host, network or port changes. You can enter the name of an alias instead of the host, network or port in all fields that have a red background. The alias will be resolved according to the list above. If an alias cannot be resolved (e.g. because you deleted it), the corresponding element (e.g. filter/NAT/shaper rule) will be considered invalid and skipped.</span></p>
+ <p><span class="vexpl"><span class="red"><strong>Note:<br></strong></span>gettext("Aliases act as placeholders for real hosts, networks or ports.") gettext("They can be used to minimize the number of changes that have to be made if a host, network or port changes.") gettext("You can enter the name of an alias instead of the host, network or port in all fields that have a red background.") gettext("The alias will be resolved according to the list above.") gettext("If an alias cannot be resolved (e.g. because you deleted it), the corresponding element (e.g. filter/NAT/shaper rule) will be considered invalid and skipped.")</span></p>
</td>
</tr>
</table>
diff --git a/usr/local/www/firewall_nat.php b/usr/local/www/firewall_nat.php
index 0c9229b..ccc524b 100755
--- a/usr/local/www/firewall_nat.php
+++ b/usr/local/www/firewall_nat.php
@@ -82,6 +82,19 @@ if ($_POST) {
}
}
+if ($_GET['act'] == "del") {
+ if ($a_nat[$_GET['id']]) {
+ if (isset($a_nat[$_GET['id']]['associated-rule-id'])) {
+ delete_id($a_nat[$_GET['id']]['associated-rule-id'], $config['filter']['rule']);
+ }
+ unset($a_nat[$_GET['id']]);
+ write_config();
+ mark_subsystem_dirty('nat');
+ header("Location: firewall_nat.php");
+ exit;
+ }
+}
+
if (isset($_POST['del_x'])) {
/* delete selected rules */
if (is_array($_POST['rule']) && count($_POST['rule'])) {
@@ -145,7 +158,7 @@ if (isset($_POST['del_x'])) {
}
}
-$pgtitle = array("Firewall","NAT","Port Forward");
+$pgtitle = array(gettext("Firewall","NAT","Port Forward"));
include("head.inc");
echo "<script type=\"text/javascript\" language=\"javascript\" src=\"/javascript/domTT/domLib.js\"></script>";
@@ -161,18 +174,18 @@ echo "<script type=\"text/javascript\" language=\"javascript\" src=\"/javascript
<?php if (is_subsystem_dirty('natconf')): ?><p>
<?php
if($savemsg)
- print_info_box_np("{$savemsg}<br>The NAT configuration has been changed.<br>You must apply the changes in order for them to take effect.");
+ print_info_box_np("{$savemsg}<br>gettext("The NAT configuration has been changed.")<br>gettext ("You must apply the changes in order for them to take effect.");
else
- print_info_box_np("The NAT configuration has been changed.<br>You must apply the changes in order for them to take effect.");
+ print_info_box_np(gettext("The NAT configuration has been changed.<br>You must apply the changes in order for them to take effect."));
?>
<?php endif; ?>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr><td>
<?php
$tab_array = array();
- $tab_array[] = array("Port Forward", true, "firewall_nat.php");
+ $tab_array[] = array(gettext("Port Forward"), true, "firewall_nat.php");
$tab_array[] = array("1:1", false, "firewall_nat_1to1.php");
- $tab_array[] = array("Outbound", false, "firewall_nat_out.php");
+ $tab_array[] = array(gettext("Outbound"), false, "firewall_nat_out.php");
display_top_tabs($tab_array);
?>
</td></tr>
@@ -195,7 +208,13 @@ echo "<script type=\"text/javascript\" language=\"javascript\" src=\"/javascript
<td width="5%" class="list">
<table border="0" cellspacing="0" cellpadding="1">
<tr>
- <td width="17"></td>
+ <td width="17">
+ <?php if (count($a_nat) == 0): ?>
+ <img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x_d.gif" width="17" height="17" title=gettext("delete selected rules") border="0">
+ <?php else: ?>
+ <input name="del" type="image" src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" title="delete selected rules" onclick="return confirm('Do you really want to delete the selected rules?')">
+ <?php endif; ?>
+ </td>
<td><a href="firewall_nat_edit.php"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0"></a></td>
</tr>
</table>
@@ -293,11 +312,12 @@ echo "<script type=\"text/javascript\" language=\"javascript\" src=\"/javascript
<td valign="middle" class="list" nowrap>
<table border="0" cellspacing="0" cellpadding="1">
<tr>
+ <td><input onmouseover="fr_insline(<?=$nnats;?>, true)" onmouseout="fr_insline(<?=$nnats;?>, false)" name="move_<?=$i;?>" src="/themes/<?= $g['theme']; ?>/images/icons/icon_left.gif" title=gettext("move selected rules before this rule") height="17" type="image" width="17" border="0"></td>
<td><a href="firewall_nat_edit.php?id=<?=$i;?>"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0" title="edit rule"></a></td>
</tr>
<tr>
- <td><input onmouseover="fr_insline(<?=$nnats;?>, true)" onmouseout="fr_insline(<?=$nnats;?>, false)" name="move_<?=$i;?>" src="/themes/<?= $g['theme']; ?>/images/icons/icon_left.gif" title="move selected rules before this rule" height="17" type="image" width="17" border="0"></td>
- <td><a href="firewall_nat_edit.php?dup=<?=$i;?>"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" title="add a new nat based on this one" width="17" height="17" border="0"></a></td>
+ <td align="center" valign="middle"><a href="firewall_nat.php?act=del&id=<?=$i;?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0" title=gettext("delete rule") onclick="return confirm(gettext('Do you really want to delete this rule?'))"></a></td>
+ <td><a href="firewall_nat_edit.php?dup=<?=$i;?>"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" title=gettext("add a new nat based on this one") width="17" height="17" border="0"></a></td>
</tr>
</table>
</tr>
@@ -310,11 +330,17 @@ echo "<script type=\"text/javascript\" language=\"javascript\" src=\"/javascript
<td class="list" valign="middle" nowrap>
<table border="0" cellspacing="0" cellpadding="1">
<tr>
- <td><?php if ($nnats == 0): ?><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_left_d.gif" width="17" height="17" title="move selected mappings to end" border="0"><?php else: ?><input name="move_<?=$i;?>" type="image" src="/themes/<?= $g['theme']; ?>/images/icons/icon_left.gif" width="17" height="17" title="move selected mappings to end" border="0"><?php endif; ?></td>
- <td><a href="firewall_nat_edit.php"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0"></a></td>
+ <td><?php if ($nnats == 0): ?><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_left_d.gif" width="17" height="17" title="move selected rules to end" border="0"><?php else: ?><input name="move_<?=$i;?>" type="image" src="/themes/<?= $g['theme']; ?>/images/icons/icon_left.gif" width="17" height="17" title=gettext("move selected rules to end") border="0"><?php endif; ?></td>
</tr>
<tr>
- <td><?php if ($nnats == 0): ?><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_x_d.gif" width="17" height="17" title="delete selected rules" border="0"><?php else: ?><input name="del" type="image" src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" title="delete selected mappings" onclick="return confirm('Do you really want to delete the selected mappings?')"><?php endif; ?></td>
+ <td width="17">
+ <?php if (count($a_nat) == 0): ?>
+ <img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x_d.gif" width="17" height="17" title=gettext("delete selected rules") border="0">
+ <?php else: ?>
+ <input name="del" type="image" src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" title="delete selected rules" onclick="return confirm(gettext('Do you really want to delete the selected rules?'))">
+ <?php endif; ?>
+ </td>
+ <td><a href="firewall_nat_edit.php"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0"></a></td>
</tr>
</table>
</td>
@@ -326,7 +352,7 @@ echo "<script type=\"text/javascript\" language=\"javascript\" src=\"/javascript
</tr>
<tr>
<td width="14"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_chain.png" width="11" height="11"></td>
- <td colspan="3">linked rule</td>
+ <td colspan="3">gettext("linked rule")</td>
</tr>
</table>
</div>
diff --git a/usr/local/www/index.php b/usr/local/www/index.php
index 68755f9..ec3122e 100755
--- a/usr/local/www/index.php
+++ b/usr/local/www/index.php
@@ -109,7 +109,7 @@ if (!is_array($config['widgets'])) {
if(file_exists('/conf/needs_package_sync')) {
if($config['installedpackages'] <> '') {
conf_mount_rw();
- unlink('/conf/needs_package_sync');
+ @unlink('/conf/needs_package_sync');
conf_mount_ro();
if($g['platform'] == "pfSense" || $g['platform'] == "nanobsd") {
header('Location: pkg_mgr_install.php?mode=reinstallall');
diff --git a/usr/local/www/interfaces_ppps.php b/usr/local/www/interfaces_ppps.php
index 5a6c306..e6d4880 100644
--- a/usr/local/www/interfaces_ppps.php
+++ b/usr/local/www/interfaces_ppps.php
@@ -88,7 +88,7 @@ include("head.inc");
$tab_array[2] = array("Wireless", false, "interfaces_wireless.php");
$tab_array[3] = array("VLANs", false, "interfaces_vlan.php");
$tab_array[4] = array("QinQs", false, "interfaces_qinq.php");
- $tab_array[5] = array("PPPs", false, "interfaces_ppps.php");
+ $tab_array[5] = array("PPPs", true, "interfaces_ppps.php");
$tab_array[6] = array("GRE", false, "interfaces_gre.php");
$tab_array[7] = array("GIF", false, "interfaces_gif.php");
$tab_array[8] = array("Bridges", false, "interfaces_bridge.php");
diff --git a/usr/local/www/status_gateways.php b/usr/local/www/status_gateways.php
index 4d85a42..6d6c43d 100755
--- a/usr/local/www/status_gateways.php
+++ b/usr/local/www/status_gateways.php
@@ -79,7 +79,7 @@ include("head.inc");
?>
<tr>
<td class="listlr">
- <?=strtoupper($gateway['name']);?>
+ <?=$gateway['name'];?>
</td>
<td class="listr" align="center" >
<?php echo lookup_gateway_ip_by_name($gateway['name']);?>
diff --git a/usr/local/www/system_advanced_admin.php b/usr/local/www/system_advanced_admin.php
index 6f7a077..ca4cee3 100644
--- a/usr/local/www/system_advanced_admin.php
+++ b/usr/local/www/system_advanced_admin.php
@@ -412,7 +412,7 @@ function prot_change() {
<?php
if ($restart_sshd) {
- mwexec("/usr/bin/killall sshd");
+ killbyname(sshd);
log_error(gettext("secure shell configuration has changed. Stopping sshd."));
if ($config['system']['enablesshd']) {
diff --git a/usr/local/www/system_firmware_auto.php b/usr/local/www/system_firmware_auto.php
index d5b7cd5..48d727c 100755
--- a/usr/local/www/system_firmware_auto.php
+++ b/usr/local/www/system_firmware_auto.php
@@ -124,7 +124,12 @@ include("head.inc");
<?php
update_status(gettext("Downloading current version information") . "...");
-download_file_with_progress_bar("{$updater_url}/version", "/tmp/{$g['product_name']}_version");
+$nanosize = "";
+if ($g['platform'] == "nanobsd") {
+ $nanosize = "-nanobsd-" . strtolower(trim(file_get_contents("/etc/nanosize.txt")));
+}
+
+download_file_with_progress_bar("{$updater_url}/version{$nanosize}", "/tmp/{$g['product_name']}_version");
$latest_version = str_replace("\n", "", @file_get_contents("/tmp/{$g['product_name']}_version"));
if(!$latest_version) {
update_output_window(gettext("Unable to check for updates."));
@@ -143,8 +148,13 @@ if(!$latest_version) {
if (pfs_version_compare($current_installed_buildtime, $current_installed_version, $latest_version) == -1) {
update_status(gettext("Downloading updates") . "...");
conf_mount_rw();
- $status = download_file_with_progress_bar("{$updater_url}/latest.tgz", "{$g['upload_path']}/latest.tgz", "read_body_firmware");
- $status = download_file_with_progress_bar("{$updater_url}/latest.tgz.sha256", "{$g['upload_path']}/latest.tgz.sha256");
+ if ($g['platform'] == "nanobsd") {
+ $update_filename = "latest{$nanosize}.img.gz";
+ } else {
+ $update_filename = "latest.tgz";
+ }
+ $status = download_file_with_progress_bar("{$updater_url}/{$update_filename}", "{$g['upload_path']}/latest.tgz", "read_body_firmware");
+ $status = download_file_with_progress_bar("{$updater_url}/{$update_filename}.sha256", "{$g['upload_path']}/latest.tgz.sha256");
conf_mount_ro();
update_output_window("{$g['product_name']} " . gettext("download complete."));
} else {
diff --git a/usr/local/www/system_firmware_check.php b/usr/local/www/system_firmware_check.php
index 9eabe26..c676950 100755
--- a/usr/local/www/system_firmware_check.php
+++ b/usr/local/www/system_firmware_check.php
@@ -120,7 +120,13 @@ else
$updater_url = $g['update_url'];
$needs_system_upgrade = false;
$static_text .= gettext("Downloading new version information...");
-download_file_with_progress_bar("{$updater_url}/version", "/tmp/{$g['product_name']}_version");
+
+$nanosize = "";
+if ($g['platform'] == "nanobsd") {
+ $nanosize = "-nanobsd-" . strtolower(trim(file_get_contents("/etc/nanosize.txt")));
+}
+
+download_file_with_progress_bar("{$updater_url}/version{$nanosize}", "/tmp/{$g['product_name']}_version");
$remote_version = trim(@file_get_contents("/tmp/{$g['product_name']}_version"));
$static_text .= gettext("done") . "\\n";
if (!$remote_version) {
@@ -155,6 +161,9 @@ if ($needs_system_upgrade == false) {
echo "\n<script>$('invokeupgrade').style.visibility = 'visible';</script>";
$txt = gettext("A new version is now available") . "\\n\\n";
$txt .= gettext("Current version") .": ". $current_installed_version . "\\n";
+if ($g['platform'] == "nanobsd") {
+ $txt .= " " . gettext("NanoBSD Size") . " : " . trim(file_get_contents("/etc/nanosize.txt")) . "\\n";
+}
$txt .= " " . gettext("Built On") .": ". $current_installed_buildtime . "\\n";
$txt .= " " . gettext("New version") .": ". $remote_version . "\\n\\n";
$txt .= " " . gettext("Update source") .": ". $updater_url . "\\n";
diff --git a/usr/local/www/system_usermanager.php b/usr/local/www/system_usermanager.php
index c3da004..058046a 100644
--- a/usr/local/www/system_usermanager.php
+++ b/usr/local/www/system_usermanager.php
@@ -174,7 +174,6 @@ if (isAllowedPage("system_usermanager")) {
}
if ($_POST) {
- conf_mount_rw();
unset($input_errors);
$pconfig = $_POST;
@@ -253,6 +252,7 @@ if (isAllowedPage("system_usermanager")) {
}
if (!$input_errors) {
+ conf_mount_rw();
$userent = array();
if (isset($id) && $a_user[$id])
$userent = $a_user[$id];
@@ -303,6 +303,16 @@ if (isAllowedPage("system_usermanager")) {
$userent['cert'][] = $cert;
}
$userent['uid'] = $config['system']['nextuid']++;
+ /* Add the user to All Users group. */
+ if (!is_array($config['system']['group']['member']))
+ $config['system']['group']['member'] = array();
+ foreach ($config['system']['group'] as $gidx => $group) {
+ if ($group['name'] == "all") {
+ $config['system']['group'][$gidx]['member'][] = $userent['uid'];
+ break;
+ }
+ }
+
$a_user[] = $userent;
}
OpenPOWER on IntegriCloud