diff options
author | Rafael Lucas <rafalucas.unicamp@gmail.com> | 2010-07-27 14:56:40 -0300 |
---|---|---|
committer | Rafael Lucas <rafalucas.unicamp@gmail.com> | 2010-07-27 14:56:40 -0300 |
commit | f96cc03432419b8974c5ad2652a0cfa817dc3de0 (patch) | |
tree | 278a4a4419aa4bf40ee2cfd7c328d43414e91175 | |
parent | 891fba69e7a8a084c52c2353ac1a37e9ebd1d660 (diff) | |
parent | ada15acdddb88c1358ceddb00ed589a956c3be60 (diff) | |
download | pfsense-f96cc03432419b8974c5ad2652a0cfa817dc3de0.zip pfsense-f96cc03432419b8974c5ad2652a0cfa817dc3de0.tar.gz |
Merge branch 'master' of git@rcs.pfsense.org:pfsense/pfsense-gettext
49 files changed, 824 insertions, 676 deletions
diff --git a/etc/inc/captiveportal.inc b/etc/inc/captiveportal.inc index 1e96b41..0d3853b 100644 --- a/etc/inc/captiveportal.inc +++ b/etc/inc/captiveportal.inc @@ -425,45 +425,14 @@ EOD; 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) - $cprules .= "add {$rulenum} set 1 pass udp from any 68 to {$ips} 67 in \n"; + $cprules .= "add {$rulenum} set 1 pass ip from any to {$ips} in\n"; $rulenum++; - $cprules .= "add {$rulenum} set 1 pass udp from any 68 to {$ips} 67 in \n"; - $rulenum++; - $cprules .= "add {$rulenum} set 1 pass udp from {$ips} 67 to any 68 out \n"; + $cprules .= "add {$rulenum} set 1 pass ip from {$ips} to any out\n"; $rulenum++; $cprules .= "add {$rulenum} set 1 pass icmp from {$ips} to any out icmptype 0\n"; $rulenum++; $cprules .= "add {$rulenum} set 1 pass icmp from any to {$ips} in icmptype 8 \n"; $rulenum++; - //# allow access to our DNS forwarder - $cprules .= "add {$rulenum} set 1 pass udp from any to {$ips} 53 in \n"; - $rulenum++; - $cprules .= "add {$rulenum} set 1 pass udp from {$ips} 53 to any out \n"; - $rulenum++; - # allow access to our web server - $cprules .= "add {$rulenum} set 1 pass tcp from any to {$ips} 8000 in \n"; - $rulenum++; - $cprules .= "add {$rulenum} set 1 pass tcp from {$ips} 8000 to any out \n"; - - if (isset($config['captiveportal']['httpslogin'])) { - $rulenum++; - $cprules .= "add {$rulenum} set 1 pass tcp from any to {$ips} 8001 in \n"; - $rulenum++; - $cprules .= "add {$rulenum} set 1 pass tcp from {$ips} 8001 to any out \n"; - } - if (!empty($config['system']['webgui']['port'])) - $port = $config['system']['webgui']['port']; - else if ($config['system']['webgui']['proto'] == "http") - $port = 80; - else - $port = 443; - $rulenum++; - $cprules .= "add {$rulenum} set 1 pass tcp from any to {$ips} {$port} in \n"; - $rulenum++; - $cprules .= "add {$rulenum} set 1 pass tcp from {$ips} {$port} to any out \n"; - $rulenum++; - /* Allowed ips */ $cprules .= "add {$rulenum} allow ip from table(3) to any in\n"; $rulenum++; @@ -917,14 +886,17 @@ function captiveportal_allowedip_configure_entry($ipent) { $bw_up = $ruleno + 20000; $rules .= "pipe {$bw_up} config bw {$ipent['bw_up']}Kbit/s queue 100\n"; } + $subnet = ""; + if (!empty($ipent['sn'])) + $subnet = "/{$ipent['sn']}"; foreach ($tablein as $table) - $rules .= "table {$table} add {$ipent['ip']} {$bw_up}\n"; + $rules .= "table {$table} add {$ipent['ip']}{$subnet} {$bw_up}\n"; if ($enBwdown) { $bw_down = $ruleno + 20001; $rules .= "pipe {$bw_down} config bw {$ipent['bw_down']}Kbit/s queue 100\n"; } foreach ($tableout as $table) - $rules .= "table {$table} add {$ipent['ip']} {$bw_down}\n"; + $rules .= "table {$table} add {$ipent['ip']}{$subnet} {$bw_down}\n"; return $rules; } diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc index af4619d..c480381 100644 --- a/etc/inc/filter.inc +++ b/etc/inc/filter.inc @@ -1396,18 +1396,10 @@ function filter_nat_rules_generate() { else sigkillbypid("/var/run/inetd.pid", "HUP"); - if($pptpdcfg['mode'] && $pptpdcfg['mode'] != "off") { - if($pptpdcfg['mode'] == "server") - $pptpdtarget = "127.0.0.1"; - else if($pptpdcfg['mode'] == "redir") - $pptpdtarget = $pptpdcfg['redir']; - if($pptpdcfg['mode'] == "redir" && is_array($FilterIflist['wan'])) { - /* - * NB: ermal -- the rdr rule below is commented out now that we have a solution - * for PPTP passthrough. This unbreaks other GRE traffic passing - * through pfSense. - * After some more testing this will be removed compeletely. - */ + $pptpdcfg = $config['pptpd']; + if($pptpdcfg['mode'] && $pptpdcfg['mode'] == "redir") { + $pptpdtarget = $pptpdcfg['redir']; + if(is_ipaddr($pptpdtarget) && is_array($FilterIflist['wan'])) { $natrules .= <<<EOD # PPTP diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc index dc4cbdf..73e5554 100644 --- a/etc/inc/interfaces.inc +++ b/etc/inc/interfaces.inc @@ -819,10 +819,11 @@ function interface_bring_down($interface = "wan", $destroy = false) { if (is_array($config['ppps']['ppp']) && count($config['ppps']['ppp'])) { foreach ($config['ppps']['ppp'] as $pppid => $ppp) { if ($realif == $ppp['if']) { - if (!isset($ppp['ondemand'])) { - killbypid("{$g['varrun_path']}/{$ifcfg['ipaddr']}_{$interface}.pid"); - sleep(2); - unlink_if_exists("{$g['varetc_path']}/mpd_{$interface}.conf"); + killbypid("{$g['varrun_path']}/{$ifcfg['ipaddr']}_{$interface}.pid"); + sleep(2); + unlink_if_exists("{$g['varetc_path']}/mpd_{$interface}.conf"); + if (isset($ppp['ondemand']) && !$destroy) { + interface_configure("wan"); } break; } @@ -2227,7 +2228,7 @@ function interface_configure($interface = "wan", $reloadall = false) { if (!$g['booting']) { /* remove all IPv4 addresses */ while (mwexec("/sbin/ifconfig " . escapeshellarg($realif) . " -alias", true) == 0); - interface_bring_down($interface); + interface_bring_down($interface, true); } /* wireless configuration? */ @@ -2764,7 +2765,7 @@ function find_carp_interface($ip) { foreach ($config['virtualip']['vip'] as $vip) { if ($vip['mode'] == "carp" || $vip['mode'] == "carpdev") { $carp_ip = get_interface_ip($vip['interface']); - $if = `ifconfig | grep '$ip' -B1 | head -n1 | cut -d: -f1`; + $if = `ifconfig | grep '$ip ' -B1 | head -n1 | cut -d: -f1`; if ($if) return $if; } @@ -3209,4 +3210,4 @@ function setup_pppoe_reset_file($pppif, $iface="") { unlink_if_exists($cron_file); } -?> +?>
\ No newline at end of file diff --git a/etc/inc/rrd.inc b/etc/inc/rrd.inc index 98766e3..356037e 100644 --- a/etc/inc/rrd.inc +++ b/etc/inc/rrd.inc @@ -1,7 +1,7 @@ <?php /* $Id$ */ /* - Copyright (C) 2008 Seth Mos + Copyright (C) 2010 Seth Mos <seth.mos@dds.nl> All rights reserved. Redistribution and use in source and binary forms, with or without @@ -174,6 +174,7 @@ function enable_rrd_graphing() { $proc = "-processor.rrd"; $mem = "-memory.rrd"; $cellular = "-cellular.rrd"; + $vpnusers = "-vpnusers.rrd"; $rrdtool = "/usr/bin/nice -n20 /usr/local/bin/rrdtool"; $netstat = "/usr/bin/netstat"; @@ -197,6 +198,7 @@ function enable_rrd_graphing() { $rrdprocinterval = 60; $rrdmeminterval = 60; $rrdcellularinterval = 60; + $rrdvpninterval = 60; $trafficvalid = $rrdtrafficinterval * 2; $wirelessvalid = $rrdwirelessinterval * 2; @@ -209,6 +211,7 @@ function enable_rrd_graphing() { $procvalid = $rrdlbpoolinterval * 2; $memvalid = $rrdmeminterval * 2; $cellularvalid = $rrdcellularinterval * 2; + $vpnvalid = $rrdvpninterval * 2; /* Asume GigE for now */ $downstream = 125000000; @@ -250,8 +253,17 @@ function enable_rrd_graphing() { $i = 0; $ifdescrs = get_configured_interface_with_descr(); + /* IPsec counters */ $ifdescrs['ipsec'] = "IPsec"; + /* OpenVPN server counters */ + if(is_array($config['openvpn']['openvpn-server'])) { + foreach($config['openvpn']['openvpn-server'] as $server) { + $serverid = "ovpns" . $server['vpnid']; + $ifdescrs[$serverid] = "{$server['description']}"; + } + } + /* process all real and pseudo interfaces */ foreach ($ifdescrs as $ifname => $ifdescr) { $temp = get_real_interface($ifname); if($temp <> "") { @@ -336,190 +348,264 @@ function enable_rrd_graphing() { $rrdupdatesh .= "`$ifconfig {$realif} list sta| $awk 'gsub(\"M\", \"\") {getline 2;print substr(\$5, 0, length(\$5)-2) \":\" $4 \":\" $3}'`\n"; } - /* QUEUES, set up the queues databases */ - if ($altq_list_queues[$ifname]) { - $altq =& $altq_list_queues[$ifname]; - /* NOTE: Is it worth as its own function?! */ - switch ($altq->GetBwscale()) { - case "Gb": - $factor = 1024 * 1024 * 1024; - break; - case "Mb": - $factor = 1024 * 1024; - break; - case "Kb": - $factor = 1024; - break; - case "b": - default: - $factor = 1; - break; - } - $qbandwidth = $altq->GetBandwidth() * $factor; - if ($qbandwidth <=0) - $qbandwidth = 100 * 1000 * 1000; /* 100Mbit */ - $qlist =& $altq->get_queue_list($notused); - if (!file_exists("$rrddbpath$ifname$queues")) { - $rrdcreate = "$rrdtool create $rrddbpath$ifname$queues --step $rrdqueuesinterval "; - /* loop list of shaper queues */ - $q = 0; - foreach ($qlist as $qname => $q) { - $rrdcreate .= "DS:$qname:COUNTER:$queuesvalid:0:$qbandwidth "; - } + /* OpenVPN, set up the rrd file */ + if(stristr($ifname, "ovpns")) { + if (!file_exists("$rrddbpath$ifname$vpnusers")) { + $rrdcreate = "$rrdtool create $rrddbpath$ifname$vpnusers --step $rrdvpninterval "; + $rrdcreate .= "DS:users:GAUGE:$vpnvalid:0:10000 "; + $rrdcreate .= "RRA:AVERAGE:0.5:1:1000 "; + $rrdcreate .= "RRA:AVERAGE:0.5:5:1000 "; + $rrdcreate .= "RRA:AVERAGE:0.5:60:1000 "; + $rrdcreate .= "RRA:AVERAGE:0.5:720:3000 "; + + create_new_rrd($rrdcreate); + } - $rrdcreate .= "RRA:AVERAGE:0.5:1:1000 "; - $rrdcreate .= "RRA:AVERAGE:0.5:5:1000 "; - $rrdcreate .= "RRA:AVERAGE:0.5:60:1000 "; - $rrdcreate .= "RRA:AVERAGE:0.5:720:3000 "; + /* enter UNKNOWN values in the RRD so it knows we rebooted. */ + if($g['booting']) { + mwexec("$rrdtool update $rrddbpath$ifname$vpnusers N:U"); + } - create_new_rrd($rrdcreate); + if(is_array($config['openvpn']['openvpn-server'])) { + foreach($config['openvpn']['openvpn-server'] as $server) { + if("ovpns{$server['vpnid']}" == $ifname) { + $port = $server['local_port']; + } } + } + $rrdupdatesh .= "\n"; + $rrdupdatesh .= "# polling vpn users for interface $ifname $realif port $port\n"; + $rrdupdatesh .= "list_current_users() {\n"; + $rrdupdatesh .= " sleep 0.2\n"; + $rrdupdatesh .= " echo \"status 2\"\n"; + $rrdupdatesh .= " sleep 0.2\n"; + $rrdupdatesh .= " echo \"quit\"\n"; + $rrdupdatesh .= "}\n"; + $rrdupdatesh .= "$rrdtool update $rrddbpath$ifname$vpnusers N:\\\n"; + $rrdupdatesh .= "`list_current_users | nc localhost {$port} | awk -F\",\" '/^CLIENT_LIST/ {print \$2}' | wc -l | awk '{print $1}'`\n"; + } - if (!file_exists("$rrddbpath$ifname$queuesdrop")) { - $rrdcreate = "$rrdtool create $rrddbpath$ifname$queuesdrop --step $rrdqueuesdropinterval "; - /* loop list of shaper queues */ - $q = 0; - foreach ($qlist as $qname => $q) { - $rrdcreate .= "DS:$qname:COUNTER:$queuesdropvalid:0:$qbandwidth "; - } + /* QUEUES, set up the queues databases */ + if ($altq_list_queues[$ifname]) { + $altq =& $altq_list_queues[$ifname]; + /* NOTE: Is it worth as its own function?! */ + switch ($altq->GetBwscale()) { + case "Gb": + $factor = 1024 * 1024 * 1024; + break; + case "Mb": + $factor = 1024 * 1024; + break; + case "Kb": + $factor = 1024; + break; + case "b": + default: + $factor = 1; + break; + } + $qbandwidth = $altq->GetBandwidth() * $factor; + if ($qbandwidth <=0) { + $qbandwidth = 100 * 1000 * 1000; /* 100Mbit */ + } + $qlist =& $altq->get_queue_list($notused); + if (!file_exists("$rrddbpath$ifname$queues")) { + $rrdcreate = "$rrdtool create $rrddbpath$ifname$queues --step $rrdqueuesinterval "; + /* loop list of shaper queues */ + $q = 0; + foreach ($qlist as $qname => $q) { + $rrdcreate .= "DS:$qname:COUNTER:$queuesvalid:0:$qbandwidth "; + } - $rrdcreate .= "RRA:AVERAGE:0.5:1:1000 "; - $rrdcreate .= "RRA:AVERAGE:0.5:5:1000 "; - $rrdcreate .= "RRA:AVERAGE:0.5:60:1000 "; - $rrdcreate .= "RRA:AVERAGE:0.5:720:3000 "; + $rrdcreate .= "RRA:AVERAGE:0.5:1:1000 "; + $rrdcreate .= "RRA:AVERAGE:0.5:5:1000 "; + $rrdcreate .= "RRA:AVERAGE:0.5:60:1000 "; + $rrdcreate .= "RRA:AVERAGE:0.5:720:3000 "; + + create_new_rrd($rrdcreate); + } - create_new_rrd($rrdcreate); + if (!file_exists("$rrddbpath$ifname$queuesdrop")) { + $rrdcreate = "$rrdtool create $rrddbpath$ifname$queuesdrop --step $rrdqueuesdropinterval "; + /* loop list of shaper queues */ + $q = 0; + foreach ($qlist as $qname => $q) { + $rrdcreate .= "DS:$qname:COUNTER:$queuesdropvalid:0:$qbandwidth "; } - if($g['booting']) { - $rrdqcommand = "-t "; - $rrducommand = "N"; - $q = 0; - foreach ($qlist as $qname => $q) { - if($q == 0) { - $rrdqcommand .= "{$qname}"; - } else { - $rrdqcommand .= ":{$qname}"; - } - $q++; - $rrducommand .= ":U"; + $rrdcreate .= "RRA:AVERAGE:0.5:1:1000 "; + $rrdcreate .= "RRA:AVERAGE:0.5:5:1000 "; + $rrdcreate .= "RRA:AVERAGE:0.5:60:1000 "; + $rrdcreate .= "RRA:AVERAGE:0.5:720:3000 "; + + create_new_rrd($rrdcreate); + } + + if($g['booting']) { + $rrdqcommand = "-t "; + $rrducommand = "N"; + $q = 0; + foreach ($qlist as $qname => $q) { + if($q == 0) { + $rrdqcommand .= "{$qname}"; + } else { + $rrdqcommand .= ":{$qname}"; } - mwexec("$rrdtool update $rrddbpath$ifname$queues $rrdqcommand $rrducommand"); - mwexec("$rrdtool update $rrddbpath$ifname$queuesdrop $rrdqcommand $rrducommand"); + $q++; + $rrducommand .= ":U"; } - - /* awk function to gather shaper data */ - /* yes, it's special */ - $rrdupdatesh .= "` pfctl -vsq -i {$realif} | awk 'BEGIN {printf \"$rrdtool update $rrddbpath$ifname$queues \" } "; - $rrdupdatesh .= "{ "; - $rrdupdatesh .= "if ((\$1 == \"queue\") && ( \$2 ~ /^q/ )) { "; - $rrdupdatesh .= "dsname = dsname \":\" \$2 ; "; - $rrdupdatesh .= "q=1; "; - $rrdupdatesh .= "} "; - $rrdupdatesh .= "else if ((\$4 == \"bytes:\") && ( q == 1 ) ) { "; - $rrdupdatesh .= "dsdata = dsdata \":\" \$5 ; "; - $rrdupdatesh .= "q=0; "; - $rrdupdatesh .= "} "; - $rrdupdatesh .= "} END { "; - $rrdupdatesh .= "dsname = substr(dsname,2); "; - $rrdupdatesh .= "dsdata = substr(dsdata,2); "; - $rrdupdatesh .= "printf \"-t \" dsname \" N:\" dsdata }' "; - $rrdupdatesh .= "dsname=\"\" dsdata=\"\"`\n\n"; - - $rrdupdatesh .= "` pfctl -vsq -i {$realif} | awk 'BEGIN {printf \"$rrdtool update $rrddbpath$ifname$queuesdrop \" } "; - $rrdupdatesh .= "{ "; - $rrdupdatesh .= "if ((\$1 == \"queue\") && ( \$2 ~ /^q/ )) { "; - $rrdupdatesh .= "dsname = dsname \":\" \$2 ; "; - $rrdupdatesh .= "q=1; "; - $rrdupdatesh .= "} "; - $rrdupdatesh .= "else if ((\$4 == \"bytes:\") && ( q == 1 ) ) { "; - $rrdupdatesh .= "dsdata = dsdata \":\" \$8 ; "; - $rrdupdatesh .= "q=0; "; - $rrdupdatesh .= "} "; - $rrdupdatesh .= "} END { "; - $rrdupdatesh .= "dsname = substr(dsname,2); "; - $rrdupdatesh .= "dsdata = substr(dsdata,2); "; - $rrdupdatesh .= "printf \"-t \" dsname \" N:\" dsdata }' "; - $rrdupdatesh .= "dsname=\"\" dsdata=\"\"`\n\n"; + mwexec("$rrdtool update $rrddbpath$ifname$queues $rrdqcommand $rrducommand"); + mwexec("$rrdtool update $rrddbpath$ifname$queuesdrop $rrdqcommand $rrducommand"); } + + /* awk function to gather shaper data */ + /* yes, it's special */ + $rrdupdatesh .= "` pfctl -vsq -i {$realif} | awk 'BEGIN {printf \"$rrdtool update $rrddbpath$ifname$queues \" } "; + $rrdupdatesh .= "{ "; + $rrdupdatesh .= "if ((\$1 == \"queue\") && ( \$2 ~ /^q/ )) { "; + $rrdupdatesh .= " dsname = dsname \":\" \$2 ; "; + $rrdupdatesh .= " q=1; "; + $rrdupdatesh .= "} "; + $rrdupdatesh .= " else if ((\$4 == \"bytes:\") && ( q == 1 ) ) { "; + $rrdupdatesh .= " dsdata = dsdata \":\" \$5 ; "; + $rrdupdatesh .= " q=0; "; + $rrdupdatesh .= "} "; + $rrdupdatesh .= "} END { "; + $rrdupdatesh .= " dsname = substr(dsname,2); "; + $rrdupdatesh .= " dsdata = substr(dsdata,2); "; + $rrdupdatesh .= " printf \"-t \" dsname \" N:\" dsdata }' "; + $rrdupdatesh .= " dsname=\"\" dsdata=\"\"`\n\n"; + + $rrdupdatesh .= "` pfctl -vsq -i {$realif} | awk 'BEGIN {printf \"$rrdtool update $rrddbpath$ifname$queuesdrop \" } "; + $rrdupdatesh .= "{ "; + $rrdupdatesh .= "if ((\$1 == \"queue\") && ( \$2 ~ /^q/ )) { "; + $rrdupdatesh .= " dsname = dsname \":\" \$2 ; "; + $rrdupdatesh .= " q=1; "; + $rrdupdatesh .= "} "; + $rrdupdatesh .= " else if ((\$4 == \"bytes:\") && ( q == 1 ) ) { "; + $rrdupdatesh .= " dsdata = dsdata \":\" \$8 ; "; + $rrdupdatesh .= " q=0; "; + $rrdupdatesh .= "} "; + $rrdupdatesh .= "} END { "; + $rrdupdatesh .= " dsname = substr(dsname,2); "; + $rrdupdatesh .= " dsdata = substr(dsdata,2); "; + $rrdupdatesh .= " printf \"-t \" dsname \" N:\" dsdata }' "; + $rrdupdatesh .= " dsname=\"\" dsdata=\"\"`\n\n"; + } } $i++; /* System only statistics */ $ifname = "system"; - /* STATES, create pf states database */ - if(! file_exists("$rrddbpath$ifname$states")) { - $rrdcreate = "$rrdtool create $rrddbpath$ifname$states --step $rrdstatesinterval "; - $rrdcreate .= "DS:pfrate:GAUGE:$statesvalid:0:10000000 "; - $rrdcreate .= "DS:pfstates:GAUGE:$statesvalid:0:10000000 "; - $rrdcreate .= "DS:pfnat:GAUGE:$statesvalid:0:10000000 "; - $rrdcreate .= "DS:srcip:GAUGE:$statesvalid:0:10000000 "; - $rrdcreate .= "DS:dstip:GAUGE:$statesvalid:0:10000000 "; - $rrdcreate .= "RRA:AVERAGE:0.5:1:1000 "; - $rrdcreate .= "RRA:AVERAGE:0.5:5:1000 "; - $rrdcreate .= "RRA:AVERAGE:0.5:60:1000 "; - $rrdcreate .= "RRA:AVERAGE:0.5:720:3000 "; + /* STATES, create pf states database */ + if(! file_exists("$rrddbpath$ifname$states")) { + $rrdcreate = "$rrdtool create $rrddbpath$ifname$states --step $rrdstatesinterval "; + $rrdcreate .= "DS:pfrate:GAUGE:$statesvalid:0:10000000 "; + $rrdcreate .= "DS:pfstates:GAUGE:$statesvalid:0:10000000 "; + $rrdcreate .= "DS:pfnat:GAUGE:$statesvalid:0:10000000 "; + $rrdcreate .= "DS:srcip:GAUGE:$statesvalid:0:10000000 "; + $rrdcreate .= "DS:dstip:GAUGE:$statesvalid:0:10000000 "; + $rrdcreate .= "RRA:AVERAGE:0.5:1:1000 "; + $rrdcreate .= "RRA:AVERAGE:0.5:5:1000 "; + $rrdcreate .= "RRA:AVERAGE:0.5:60:1000 "; + $rrdcreate .= "RRA:AVERAGE:0.5:720:3000 "; + + create_new_rrd($rrdcreate); + } - create_new_rrd($rrdcreate); - } + /* enter UNKNOWN values in the RRD so it knows we rebooted. */ + if($g['booting']) { + mwexec("$rrdtool update $rrddbpath$ifname$states N:U:U:U:U:U"); + } - /* enter UNKNOWN values in the RRD so it knows we rebooted. */ - if($g['booting']) { - mwexec("$rrdtool update $rrddbpath$ifname$states N:U:U:U:U:U"); - } + /* the pf states gathering function. */ + $rrdupdatesh .= "\n"; + $rrdupdatesh .= "pfctl_si_out=\"` $pfctl -si > /tmp/pfctl_si_out `\"\n"; + $rrdupdatesh .= "pfctl_ss_out=\"` $pfctl -ss > /tmp/pfctl_ss_out`\"\n"; + $rrdupdatesh .= "pfrate=\"` cat /tmp/pfctl_si_out | egrep \"inserts|removals\" | awk '{ pfrate = \$3 + pfrate } {print pfrate}'|tail -1 `\"\n"; + $rrdupdatesh .= "pfstates=\"` cat /tmp/pfctl_ss_out | egrep -v \"<\\-.*?<\\-|\\->.*?\\->\" | wc -l|sed 's/ //g'`\"\n"; + $rrdupdatesh .= "pfnat=\"` cat /tmp/pfctl_ss_out | egrep '<\\-.*?<\\-|\\->.*?\\->' | wc -l|sed 's/ //g' `\"\n"; + $rrdupdatesh .= "srcip=\"` cat /tmp/pfctl_ss_out | egrep -v '<\\-.*?<\\-|\\->.*?\\->' | grep '\\->' | awk '{print \$3}' | awk -F: '{print \$1}' | sort -u|wc -l|sed 's/ //g' `\"\n"; + $rrdupdatesh .= "dstip=\"` cat /tmp/pfctl_ss_out | egrep -v '<\\-.*?<\\-|\\->.*?\\->' | grep '<\\-' | awk '{print \$3}' | awk -F: '{print \$1}' | sort -u|wc -l|sed 's/ //g' `\"\n"; + $rrdupdatesh .= "$rrdtool update $rrddbpath$ifname$states N:\$pfrate:\$pfstates:\$pfnat:\$srcip:\$dstip\n\n"; + + /* End pf states statistics */ + + /* CPU, create CPU statistics database */ + if(! file_exists("$rrddbpath$ifname$proc")) { + $rrdcreate = "$rrdtool create $rrddbpath$ifname$proc --step $rrdprocinterval "; + $rrdcreate .= "DS:user:GAUGE:$procvalid:0:10000000 "; + $rrdcreate .= "DS:nice:GAUGE:$procvalid:0:10000000 "; + $rrdcreate .= "DS:system:GAUGE:$procvalid:0:10000000 "; + $rrdcreate .= "DS:interrupt:GAUGE:$procvalid:0:10000000 "; + $rrdcreate .= "DS:processes:GAUGE:$procvalid:0:10000000 "; + $rrdcreate .= "RRA:AVERAGE:0.5:1:1000 "; + $rrdcreate .= "RRA:AVERAGE:0.5:5:1000 "; + $rrdcreate .= "RRA:AVERAGE:0.5:60:1000 "; + $rrdcreate .= "RRA:AVERAGE:0.5:720:3000 "; + + create_new_rrd($rrdcreate); + } - /* the pf states gathering function. */ - $rrdupdatesh .= "\n"; - $rrdupdatesh .= "pfctl_si_out=\"` $pfctl -si > /tmp/pfctl_si_out `\"\n"; - $rrdupdatesh .= "pfctl_ss_out=\"` $pfctl -ss > /tmp/pfctl_ss_out`\"\n"; - $rrdupdatesh .= "pfrate=\"` cat /tmp/pfctl_si_out | egrep \"inserts|removals\" | awk '{ pfrate = \$3 + pfrate } {print pfrate}'|tail -1 `\"\n"; - $rrdupdatesh .= "pfstates=\"` cat /tmp/pfctl_ss_out | egrep -v \"<\\-.*?<\\-|\\->.*?\\->\" | wc -l|sed 's/ //g'`\"\n"; - $rrdupdatesh .= "pfnat=\"` cat /tmp/pfctl_ss_out | egrep '<\\-.*?<\\-|\\->.*?\\->' | wc -l|sed 's/ //g' `\"\n"; - $rrdupdatesh .= "srcip=\"` cat /tmp/pfctl_ss_out | egrep -v '<\\-.*?<\\-|\\->.*?\\->' | grep '\\->' | awk '{print \$3}' | awk -F: '{print \$1}' | sort -u|wc -l|sed 's/ //g' `\"\n"; - $rrdupdatesh .= "dstip=\"` cat /tmp/pfctl_ss_out | egrep -v '<\\-.*?<\\-|\\->.*?\\->' | grep '<\\-' | awk '{print \$3}' | awk -F: '{print \$1}' | sort -u|wc -l|sed 's/ //g' `\"\n"; - $rrdupdatesh .= "$rrdtool update $rrddbpath$ifname$states N:\$pfrate:\$pfstates:\$pfnat:\$srcip:\$dstip\n\n"; - - /* End pf states statistics */ - - /* CPU, create CPU statistics database */ - if(! file_exists("$rrddbpath$ifname$proc")) { - $rrdcreate = "$rrdtool create $rrddbpath$ifname$proc --step $rrdprocinterval "; - $rrdcreate .= "DS:user:GAUGE:$procvalid:0:10000000 "; - $rrdcreate .= "DS:nice:GAUGE:$procvalid:0:10000000 "; - $rrdcreate .= "DS:system:GAUGE:$procvalid:0:10000000 "; - $rrdcreate .= "DS:interrupt:GAUGE:$procvalid:0:10000000 "; - $rrdcreate .= "DS:processes:GAUGE:$procvalid:0:10000000 "; - $rrdcreate .= "RRA:AVERAGE:0.5:1:1000 "; - $rrdcreate .= "RRA:AVERAGE:0.5:5:1000 "; - $rrdcreate .= "RRA:AVERAGE:0.5:60:1000 "; - $rrdcreate .= "RRA:AVERAGE:0.5:720:3000 "; + /* enter UNKNOWN values in the RRD so it knows we rebooted. */ + if($g['booting']) { + mwexec("$rrdtool update $rrddbpath$ifname$proc N:U:U:U:U:U"); + } - create_new_rrd($rrdcreate); - } + /* the CPU stats gathering function. */ + $rrdupdatesh .= "`$top -d 2 -s 1 0 | $awk '{gsub(/%/, \"\")} BEGIN { \\\n"; + $rrdupdatesh .= "printf \"$rrdtool update $rrddbpath$ifname$proc \" } \\\n"; + $rrdupdatesh .= "{ if ( \$2 == \"processes:\" ) { processes = \$1; } \\\n"; + $rrdupdatesh .= "else if ( \$1 == \"CPU:\" ) { user = \$2; nice = \$4; sys = \$6; interrupt = \$8; } \\\n"; + $rrdupdatesh .= "} END { printf \"N:\"user\":\"nice\":\"sys\":\"interrupt\":\"processes }'`\n\n"; + + /* End CPU statistics */ + + /* Memory, create Memory statistics database */ + if(! file_exists("$rrddbpath$ifname$mem")) { + $rrdcreate = "$rrdtool create $rrddbpath$ifname$mem --step $rrdmeminterval "; + $rrdcreate .= "DS:active:GAUGE:$memvalid:0:10000000 "; + $rrdcreate .= "DS:inactive:GAUGE:$memvalid:0:10000000 "; + $rrdcreate .= "DS:free:GAUGE:$memvalid:0:10000000 "; + $rrdcreate .= "DS:cache:GAUGE:$memvalid:0:10000000 "; + $rrdcreate .= "DS:wire:GAUGE:$memvalid:0:10000000 "; + $rrdcreate .= "RRA:MIN:0.5:1:1000 "; + $rrdcreate .= "RRA:MIN:0.5:5:1000 "; + $rrdcreate .= "RRA:MIN:0.5:60:1000 "; + $rrdcreate .= "RRA:MIN:0.5:720:3000 "; + $rrdcreate .= "RRA:AVERAGE:0.5:1:1000 "; + $rrdcreate .= "RRA:AVERAGE:0.5:5:1000 "; + $rrdcreate .= "RRA:AVERAGE:0.5:60:1000 "; + $rrdcreate .= "RRA:AVERAGE:0.5:720:3000 "; + $rrdcreate .= "RRA:MAX:0.5:1:1000 "; + $rrdcreate .= "RRA:MAX:0.5:5:1000 "; + $rrdcreate .= "RRA:MAX:0.5:60:1000 "; + $rrdcreate .= "RRA:MAX:0.5:720:3000"; + + create_new_rrd($rrdcreate); + } - /* enter UNKNOWN values in the RRD so it knows we rebooted. */ - if($g['booting']) { - mwexec("$rrdtool update $rrddbpath$ifname$proc N:U:U:U:U:U"); - } + /* enter UNKNOWN values in the RRD so it knows we rebooted. */ + if($g['booting']) { + mwexec("$rrdtool update $rrddbpath$ifname$mem N:U:U:U:U:U"); + } - /* the CPU stats gathering function. */ - $rrdupdatesh .= "`$top -d 2 -s 1 0 | $awk '{gsub(/%/, \"\")} BEGIN { \\\n"; - $rrdupdatesh .= "printf \"$rrdtool update $rrddbpath$ifname$proc \" } \\\n"; - $rrdupdatesh .= "{ if ( \$2 == \"processes:\" ) { processes = \$1; } \\\n"; - $rrdupdatesh .= "else if ( \$1 == \"CPU:\" ) { user = \$2; nice = \$4; sys = \$6; interrupt = \$8; } \\\n"; - $rrdupdatesh .= "} END { printf \"N:\"user\":\"nice\":\"sys\":\"interrupt\":\"processes }'`\n\n"; - - /* End CPU statistics */ - - /* Memory, create Memory statistics database */ - if(! file_exists("$rrddbpath$ifname$mem")) { - $rrdcreate = "$rrdtool create $rrddbpath$ifname$mem --step $rrdmeminterval "; - $rrdcreate .= "DS:active:GAUGE:$memvalid:0:10000000 "; - $rrdcreate .= "DS:inactive:GAUGE:$memvalid:0:10000000 "; - $rrdcreate .= "DS:free:GAUGE:$memvalid:0:10000000 "; - $rrdcreate .= "DS:cache:GAUGE:$memvalid:0:10000000 "; - $rrdcreate .= "DS:wire:GAUGE:$memvalid:0:10000000 "; + /* the Memory stats gathering function. */ + $rrdupdatesh .= "`$sysctl -n vm.stats.vm.v_page_count vm.stats.vm.v_active_count vm.stats.vm.v_inactive_count vm.stats.vm.v_free_count vm.stats.vm.v_cache_count vm.stats.vm.v_wire_count | "; + $rrdupdatesh .= " $awk '{getline active;getline inactive;getline free;getline cache;getline wire;printf \"$rrdtool update $rrddbpath$ifname$mem N:\""; + $rrdupdatesh .= "((active/$0) * 100)\":\"((inactive/$0) * 100)\":\"((free/$0) * 100)\":\"((cache/$0) * 100)\":\"(wire/$0 * 100)}'`\n\n"; + + /* End Memory statistics */ + + /* SPAMD, set up the spamd rrd file */ + if (isset($config['installedpackages']['spamdsettings']) && + isset ($config['installedpackages']['spamdsettings']['config'][0]['enablerrd'])) { + /* set up the spamd rrd file */ + if (!file_exists("$rrddbpath$ifname$spamd")) { + $rrdcreate = "$rrdtool create $rrddbpath$ifname$spamd --step $rrdspamdinterval "; + $rrdcreate .= "DS:conn:GAUGE:$spamdvalid:0:10000 "; + $rrdcreate .= "DS:time:GAUGE:$spamdvalid:0:86400 "; $rrdcreate .= "RRA:MIN:0.5:1:1000 "; $rrdcreate .= "RRA:MIN:0.5:5:1000 "; $rrdcreate .= "RRA:MIN:0.5:60:1000 "; @@ -531,56 +617,21 @@ function enable_rrd_graphing() { $rrdcreate .= "RRA:MAX:0.5:1:1000 "; $rrdcreate .= "RRA:MAX:0.5:5:1000 "; $rrdcreate .= "RRA:MAX:0.5:60:1000 "; - $rrdcreate .= "RRA:MAX:0.5:720:3000"; + $rrdcreate .= "RRA:MAX:0.5:720:3000 "; create_new_rrd($rrdcreate); } - /* enter UNKNOWN values in the RRD so it knows we rebooted. */ - if($g['booting']) { - mwexec("$rrdtool update $rrddbpath$ifname$mem N:U:U:U:U:U"); - } - - /* the Memory stats gathering function. */ - $rrdupdatesh .= "`$sysctl -n vm.stats.vm.v_page_count vm.stats.vm.v_active_count vm.stats.vm.v_inactive_count vm.stats.vm.v_free_count vm.stats.vm.v_cache_count vm.stats.vm.v_wire_count | "; - $rrdupdatesh .= " $awk '{getline active;getline inactive;getline free;getline cache;getline wire;printf \"$rrdtool update $rrddbpath$ifname$mem N:\""; - $rrdupdatesh .= "((active/$0) * 100)\":\"((inactive/$0) * 100)\":\"((free/$0) * 100)\":\"((cache/$0) * 100)\":\"(wire/$0 * 100)}'`\n\n"; - - /* End Memory statistics */ - - /* SPAMD, set up the spamd rrd file */ - if (isset($config['installedpackages']['spamdsettings']) && - isset ($config['installedpackages']['spamdsettings']['config'][0]['enablerrd'])) { - /* set up the spamd rrd file */ - if (!file_exists("$rrddbpath$ifname$spamd")) { - $rrdcreate = "$rrdtool create $rrddbpath$ifname$spamd --step $rrdspamdinterval "; - $rrdcreate .= "DS:conn:GAUGE:$spamdvalid:0:10000 "; - $rrdcreate .= "DS:time:GAUGE:$spamdvalid:0:86400 "; - $rrdcreate .= "RRA:MIN:0.5:1:1000 "; - $rrdcreate .= "RRA:MIN:0.5:5:1000 "; - $rrdcreate .= "RRA:MIN:0.5:60:1000 "; - $rrdcreate .= "RRA:MIN:0.5:720:3000 "; - $rrdcreate .= "RRA:AVERAGE:0.5:1:1000 "; - $rrdcreate .= "RRA:AVERAGE:0.5:5:1000 "; - $rrdcreate .= "RRA:AVERAGE:0.5:60:1000 "; - $rrdcreate .= "RRA:AVERAGE:0.5:720:3000 "; - $rrdcreate .= "RRA:MAX:0.5:1:1000 "; - $rrdcreate .= "RRA:MAX:0.5:5:1000 "; - $rrdcreate .= "RRA:MAX:0.5:60:1000 "; - $rrdcreate .= "RRA:MAX:0.5:720:3000 "; - - create_new_rrd($rrdcreate); - } - - $rrdupdatesh .= "\n"; - $rrdupdatesh .= "# polling spamd for connections and tarpitness \n"; - $rrdupdatesh .= "$rrdtool update $rrddbpath$ifname$spamd \\\n"; - $rrdupdatesh .= "`$php -q $spamd_gather`\n"; + $rrdupdatesh .= "\n"; + $rrdupdatesh .= "# polling spamd for connections and tarpitness \n"; + $rrdupdatesh .= "$rrdtool update $rrddbpath$ifname$spamd \\\n"; + $rrdupdatesh .= "`$php -q $spamd_gather`\n"; - } + } /* End System statistics */ /* 3G WIRELESS, set up the rrd file */ + /* XXX: Are multiple 3G interfaces not possible? smos@ */ if(isset($config['ppps']['ppp'])) { $ifname = "ppp"; if (!file_exists("$rrddbpath$ifname$cellular")) { diff --git a/etc/inc/services.inc b/etc/inc/services.inc index 8d591ad..5efd274 100644 --- a/etc/inc/services.inc +++ b/etc/inc/services.inc @@ -884,7 +884,7 @@ EOD; fclose($fd); /* invoke nsupdate */ - $cmd = "/usr/sbin/nsupdate -k {$g['varetc_path']}/K{$i}{$keyname}+157+00000.key"; + $cmd = "/usr/bin/nsupdate -k {$g['varetc_path']}/K{$i}{$keyname}+157+00000.key"; if (isset($dnsupdate['usetcp'])) $cmd .= " -v"; $cmd .= " {$g['varetc_path']}/nsupdatecmds{$i}"; diff --git a/etc/inc/shaper.inc b/etc/inc/shaper.inc index 4961a85..a9b9815 100644 --- a/etc/inc/shaper.inc +++ b/etc/inc/shaper.inc @@ -333,11 +333,9 @@ class altq_root_queue { function ReadConfig(&$conf) { if (isset($conf['tbrconfig'])) $this->SetTbrConfig($conf['tbrconfig']); - if ($conf['bandwidth'] <> "") { - $this->SetBandwidth($conf['bandwidth']); - if ($conf['bandwidthtype'] <> "") - $this->SetBwscale($conf['bandwidthtype']); - } + $this->SetBandwidth($conf['bandwidth']); + if ($conf['bandwidthtype'] <> "") + $this->SetBwscale($conf['bandwidthtype']); if (isset($conf['scheduler'])) { if ($this->GetScheduler() != $conf['scheduler']) { foreach ($this->queues as $q) { @@ -517,10 +515,11 @@ class altq_root_queue { $rules = " altq on " . get_real_interface($this->GetInterface()); if ($this->GetScheduler()) $rules .= " ".strtolower($this->GetScheduler()); - if ($this->GetBandwidth()) + if ($this->GetBandwidth()) { $rules .= " bandwidth ".trim($this->GetBandwidth()); - if ($this->GetBwscale()) - $rules .= $this->GetBwscale(); + if ($this->GetBwscale()) + $rules .= $this->GetBwscale(); + } if ($this->GetTbrConfig()) $rules .= " tbrsize ".$this->GetTbrConfig(); if (count($this->queues)) { @@ -593,19 +592,19 @@ class altq_root_queue { * to the user like the traffic wizard does. */ function build_form() { - $form = "<tr><td valign=\"top\" class=\"vncellreq\"><br>"; + $form = "<tr><td valign=\"center\" class=\"vncellreq\"><br>"; $form .= "Enable/Disable"; - $form .= "</td><td class=\"vncellreq\">"; + $form .= "<br/></td><td class=\"vncellreq\">"; $form .= " <input type=\"checkbox\" id=\"enabled\" name=\"enabled\" value=\"on\""; if ($this->GetEnabled() == "on") $form .= " CHECKED"; $form .= " ><span class=\"vexpl\"> Enable/disable discipline and its children</span>"; $form .= "</td></tr>"; - $form .= "<tr><td valign=\"top\" class=\"vncellreq\"><br><span class=\"vexpl\">Name</span></td>"; + $form .= "<tr><td valign=\"center\" class=\"vncellreq\"><br><span class=\"vexpl\">Name</span></td>"; $form .= "<td class=\"vncellreq\">"; $form .= "<strong>".$this->GetQname()."</strong>"; $form .= "</td></tr>"; - $form .= "<tr><td valign=\"top\" class=\"vncellreq\">Scheduler Type "; + $form .= "<tr><td valign=\"center\" class=\"vncellreq\">Scheduler Type "; $form .= "</td>"; $form .= "<td class=\"vncellreq\">"; $form .= "<select id=\"scheduler\" name=\"scheduler\" class=\"formselect\">"; @@ -631,7 +630,7 @@ class altq_root_queue { $form .= " Beware you can lose information."; $form .= "</span>"; $form .= "</td></tr>"; - $form .= "<tr><td valign=\"top\" class=\"vncellreq\">Bandwidth"; + $form .= "<tr><td valign=\"center\" class=\"vncellreq\">Bandwidth"; $form .= "</td><td class=\"vncellreq\">"; $form .= "<input type=\"text\" id=\"bandwidth\" name=\"bandwidth\" value=\""; $form .= $this->GetBandwidth() . "\">"; @@ -654,15 +653,15 @@ class altq_root_queue { $form .= ">Bit/s</option>"; $form .= "</select>"; $form .= "</td></tr>"; - $form .= "<tr><td valign=\"top\" class=\"vncellreq\">Queue Limit</td>"; + $form .= "<tr><td valign=\"center\" class=\"vncellreq\">Queue Limit</td>"; $form .= "<td class=\"vncellreq\">"; $form .= "<input type=\"text\" id=\"qlimit\" name=\"qlimit\" value=\""; $form .= $this->GetQlimit(); $form .= "\">"; $form .= "</td></tr>"; - $form .= "<tr><td valign=\"top\" class=\"vncellreq\">TBR Size</td>"; + $form .= "<tr><td valign=\"center\" class=\"vncellreq\">TBR Size</td>"; $form .= "<td class=\"vncellreq\">"; - $form .= "<input type=\"text\" id=\"tbrconfig\" name=\"tbrconfig\" value=\""; + $form .= "<br /><input type=\"text\" id=\"tbrconfig\" name=\"tbrconfig\" value=\""; $form .= $this->GetTbrConfig(); $form .= "\">"; $form .= "<br> <span class=\"vexpl\">"; @@ -956,11 +955,9 @@ class priq_queue { $this->SetQname($q['name']); if (isset($q['interface'])) $this->SetInterface($q['interface']); - if ($q['bandwidth'] <> "") { - $this->SetBandwidth($q['bandwidth']); - if ($q['bandwidthtype'] <> "") - $this->SetBwscale($q['bandwidthtype']); - } + $this->SetBandwidth($q['bandwidth']); + if ($q['bandwidthtype'] <> "") + $this->SetBwscale($q['bandwidthtype']); if (!empty($q['qlimit'])) $this->SetQlimit($q['qlimit']); else @@ -1075,38 +1072,38 @@ class priq_queue { * need to update it. */ function build_form() { - $form = "<tr><td valign=\"top\" class=\"vncellreq\"><br>"; + $form = "<tr><td valign=\"center\" class=\"vncellreq\"><br>"; $form .= "Enable/Disable"; - $form .= "</td><td class=\"vncellreq\">"; + $form .= "<br/></td><td class=\"vncellreq\">"; $form .= " <input type=\"checkbox\" id=\"enabled\" name=\"enabled\" value=\"on\""; if ($this->GetEnabled() == "on") $form .= " CHECKED"; $form .= " ><span class=\"vexpl\"> Enable/Disable queue and its children</span>"; $form .= "</td></tr>"; $form .= "<tr>"; - $form .= "<td width=\"22%\" valign=\"top\" class=\"vncellreq\">"; + $form .= "<td width=\"22%\" valign=\"center\" class=\"vncellreq\">"; $form .= "Queue Name</td><td width=\"78%\" class=\"vtable\">"; $form .= "<input name=\"name\" type=\"text\" id=\"name\" class=\"formfld unknown\" size=\"15\" maxlength=\"15\" value=\""; $form .= htmlspecialchars($this->GetQname()); $form .= "\">"; - $form .= "<br> <span class=\"vexpl\">Enter the name of the queue here. Do not use spaces and limit the size to 15 characters."; - $form .= "</span></td>"; + $form .= "<br /> <span class=\"vexpl\">Enter the name of the queue here. Do not use spaces and limit the size to 15 characters."; + $form .= "</span><br /></td>"; $form .= "</tr><tr>"; - $form .= "<td width=\"22%\" valign=\"top\" class=\"vncellreq\">Priority</td>"; + $form .= "<td width=\"22%\" valign=\"center\" class=\"vncellreq\">Priority</td>"; $form .= "<td width=\"78%\" class=\"vtable\"> <input name=\"priority\" type=\"text\" id=\"priority\" size=\"5\" value=\""; $form .= htmlspecialchars($this->GetQpriority()); $form .= "\">"; $form .= "<br> <span class=\"vexpl\">For hfsc, the range is 0 to 7. The default is 1. Hfsc queues with a higher priority are preferred in the case of overload.</span></td>"; $form .= "</tr>"; - $form .= "</tr>"; - $form .= "<td width=\"22%\" valign=\"top\" class=\"vncellreq\">Queue limit</td>"; - $form .= "<td width=\"78%\" class=\"vtable\"> <input name=\"qlimit\" type=\"text\" id=\"qlimit\" size=\"5\" value=\""; + $form .= "<tr>"; + $form .= "<td width=\"22%\" valign=\"center\" class=\"vncellreq\">Queue limit</td>"; + $form .= "<td width=\"78%\" class=\"vtable\"> <input name=\"qlimit\" type=\"text\" id=\"qlimit\" size=\"8\" value=\""; $form .= htmlspecialchars($this->GetQlimit()); $form .= "\">"; $form .= "<br> <span class=\"vexpl\">Queue limit in packets per second."; $form .= "</span></td>"; $form .= "<tr>"; - $form .= "<td width=\"22%\" valign=\"top\" class=\"vncell\">Scheduler options</td>"; + $form .= "<td width=\"22%\" valign=\"center\" class=\"vncell\">Scheduler options</td>"; $form .= "<td width=\"78%\" class=\"vtable\">"; $tmpvalue = $this->GetDefault(); if (!empty($tmpvalue)) { @@ -1793,7 +1790,7 @@ class hfsc_queue extends priq_queue { function build_form() { $form = parent::build_form(); $form .= "<tr>"; - $form .= "<td valign=\"top\" class=\"vncellreq\">Bandwidth</td>"; + $form .= "<td valign=\"center\" class=\"vncellreq\">Bandwidth</td>"; $form .= "<td class=\"vtable\"> <input name=\"bandwidth\" id=\"bandwidth\" class=\"formfld unknown\" value=\""; $form .= htmlspecialchars($this->GetBandwidth()); $form .= "\">"; @@ -1822,7 +1819,7 @@ class hfsc_queue extends priq_queue { $form .= "<span class=\"vexpl\">Choose the amount of bandwidth for this queue"; $form .= "</span></td></tr>"; $form .= "<tr>"; - $form .= "<td width=\"22%\" valign=\"top\" class=\"vncellreq\">Service Curve (sc)</td>"; + $form .= "<td width=\"22%\" valign=\"center\" class=\"vncellreq\">Service Curve (sc)</td>"; $form .= "<td width=\"78%\" class=\"vtable\">"; $form .= "<table>"; $form .= "<tr><td> </td><td><center>m1</center></td><td><center>d</center></td><td><center><b>m2</b></center></td></tr>"; @@ -2265,8 +2262,9 @@ class cbq_queue extends priq_queue { } function build_form() { - $form = "<tr>"; - $form .= "<td valign=\"top\" class=\"vncellreq\">Bandwidth</td>"; + $form = parent::build_form(); + $form .= "<tr>"; + $form .= "<td valign=\"center\" class=\"vncellreq\">Bandwidth</td>"; $form .= "<td class=\"vtable\"> <input name=\"bandwidth\" id=\"bandwidth\" class=\"formfld unknown\" value=\""; if ($this->GetBandwidth() > 0) $form .= htmlspecialchars($this->GetBandwidth()); @@ -2295,7 +2293,6 @@ class cbq_queue extends priq_queue { $form .= "</select> <br>"; $form .= "<span class=\"vexpl\">Choose the amount of bandwidth for this queue"; $form .= "</span></td></tr>"; - $form .= parent::build_form(); $form .= "<tr><td class=\"vncellreq\">Scheduler specific options</td>"; $form .= "<td class=\"vtable\"><input type=\"checkbox\" id=\"borrow\" name=\"borrow\""; if($this->GetBorrow() == "on") @@ -2528,8 +2525,9 @@ class fairq_queue extends priq_queue { } function build_form() { - $form = "<tr>"; - $form .= "<td valign=\"top\" class=\"vncellreq\">Bandwidth</td>"; + $form = parent::build_form(); + $form .= "<tr>"; + $form .= "<td valign=\"center\" class=\"vncellreq\">Bandwidth</td>"; $form .= "<td class=\"vtable\"> <input name=\"bandwidth\" id=\"bandwidth\" class=\"formfld unknown\" value=\""; if ($this->GetBandwidth() > 0) $form .= htmlspecialchars($this->GetBandwidth()); @@ -2558,7 +2556,6 @@ class fairq_queue extends priq_queue { $form .= "</select> <br>"; $form .= "<span class=\"vexpl\">Choose the amount of bandwidth for this queue"; $form .= "</span></td></tr>"; - $form .= parent::build_form(); $form .= "<tr><td class=\"vncellreq\">Scheduler specific options</td>"; $form .= "<td class=\"vtable\"><table><tr><td>"; $form .= "<input id=\"buckets\" name=\"buckets\" value=\""; @@ -2923,7 +2920,7 @@ class dnpipe_class extends dummynet_class { } function build_form() { - $form = "<tr><td valign=\"top\" class=\"vncellreq\"><br>"; + $form = "<tr><td valign=\"center\" class=\"vncellreq\"><br>"; $form .= "Enable/Disable"; $form .= "</td><td class=\"vncellreq\">"; $form .= " <input type=\"checkbox\" id=\"enabled\" name=\"enabled\" value=\"on\""; @@ -2931,12 +2928,12 @@ class dnpipe_class extends dummynet_class { $form .= " CHECKED"; $form .= " ><span class=\"vexpl\"> Enable/Disable limiter and its children</span>"; $form .= "</td></tr>"; - $form .= "<tr><td valign=\"top\" class=\"vncellreq\"><br><span class=\"vexpl\">Name</span></td>"; + $form .= "<tr><td valign=\"center\" class=\"vncellreq\"><br><span class=\"vexpl\">Name</span></td>"; $form .= "<td class=\"vncellreq\">"; $form .= "<input type=\"text\" id=\"name\" name=\"name\" value=\""; $form .= $this->GetQname()."\">"; $form .= "</td></tr>"; - $form .= "<tr><td valign=\"top\" class=\"vncellreq\">Bandwidth"; + $form .= "<tr><td valign=\"center\" class=\"vncellreq\">Bandwidth"; $form .= "</td><td class=\"vncellreq\">"; $form .= "<input type=\"text\" id=\"bandwidth\" name=\"bandwidth\" value=\""; $form .= $this->GetBandwidth() . "\">"; @@ -2959,7 +2956,7 @@ class dnpipe_class extends dummynet_class { $form .= ">Bit/s</option>"; $form .= "</select>"; $form .= "</td></tr>"; - $form .= "<tr><td valign=\"top\" class=\"vncellreq\">Mask</td>"; + $form .= "<tr><td valign=\"center\" class=\"vncellreq\">Mask</td>"; $form .= "<td class=\"vncellreq\">"; $form .= "<select name=\"mask\" class=\"formselect\">"; $form .= "<option value=\"none\""; @@ -2982,7 +2979,7 @@ class dnpipe_class extends dummynet_class { $form .= "respectively. This makes it possible to easily specify bandwidth \n"; $form .= "limits per host.</span>"; $form .= "</td></tr>"; - $form .= "<tr><td valign=\"top\" class=\"vncellreq\">Description</td>"; + $form .= "<tr><td valign=\"center\" class=\"vncellreq\">Description</td>"; $form .= "<td class=\"vncellreq\">"; $form .= "<input type=\"text\" class=\"formfld unknown\" size=\"50%\" id=\"description\" name=\"description\" value=\""; $form .= $this->GetDescription(); @@ -2999,16 +2996,16 @@ class dnpipe_class extends dummynet_class { $form .= "</div></td></tr>"; $form .= "<tr style=\"display:none\" id=\"sprtable\" name=\"sprtable\">"; - $form .= "<td valign=\"top\" class=\"vncellreq\">Delay</td>"; - $form .= "<td valign=\"top\" class=\"vncellreq\">"; + $form .= "<td valign=\"center\" class=\"vncellreq\">Delay</td>"; + $form .= "<td valign=\"center\" class=\"vncellreq\">"; $form .= "<input name=\"delay\" type=\"text\" id=\"delay\" size=\"5\" value=\""; $form .= $this->GetDelay() . "\">"; $form .= " ms<br> <span class=\"vexpl\">Hint: in most cases, you "; $form .= "should specify 0 here (or leave the field empty)</span>"; $form .= "</td></tr><br/>"; $form .= "<tr style=\"display:none\" id=\"sprtable1\" name=\"sprtable1\">"; - $form .= "<td valign=\"top\" class=\"vncellreq\">Packet loss rate</td>"; - $form .= "<td valign=\"top\" class=\"vncellreq\">"; + $form .= "<td valign=\"center\" class=\"vncellreq\">Packet loss rate</td>"; + $form .= "<td valign=\"center\" class=\"vncellreq\">"; $form .= "<input name=\"plr\" type=\"text\" id=\"plr\" size=\"5\" value=\""; $form .= $this->GetPlr() . "\">"; $form .= " <br> <span class=\"vexpl\">Hint: in most cases, you "; @@ -3016,7 +3013,7 @@ class dnpipe_class extends dummynet_class { $form .= "A value of 0.001 means one packet in 1000 gets dropped</span>"; $form .= "</td></tr>"; $form .= "<tr style=\"display:none\" id=\"sprtable2\" name=\"sprtable2\">"; - $form .= "<td valign=\"top\" class=\"vncellreq\">Queue Size</td>"; + $form .= "<td valign=\"center\" class=\"vncellreq\">Queue Size</td>"; $form .= "<td class=\"vncellreq\">"; $form .= "<input type=\"text\" id=\"qlimit\" name=\"qlimit\" value=\""; $form .= $this->GetQlimit() . "\">"; @@ -3027,7 +3024,7 @@ class dnpipe_class extends dummynet_class { $form .= "are delivered to their destination.</span>"; $form .= "</td></tr>"; $form .= "<tr style=\"display:none\" id=\"sprtable5\" name=\"sprtable5\">"; - $form .= "<td valign=\"top\" class=\"vncellreq\">Bucket Size</td>"; + $form .= "<td valign=\"center\" class=\"vncellreq\">Bucket Size</td>"; $form .= "<td class=\"vncellreq\">"; $form .= "<input type=\"text\" id=\"buckets\" name=\"buckets\" value=\""; $form .= $this->GetBuckets() . "\">"; @@ -3166,7 +3163,7 @@ class dnqueue_class extends dummynet_class { } function build_form() { - $form = "<tr><td valign=\"top\" class=\"vncellreq\"><br>"; + $form = "<tr><td valign=\"center\" class=\"vncellreq\"><br>"; $form .= "Enable/Disable"; $form .= "</td><td class=\"vncellreq\">"; $form .= " <input type=\"checkbox\" id=\"enabled\" name=\"enabled\" value=\"on\""; @@ -3174,12 +3171,12 @@ class dnqueue_class extends dummynet_class { $form .= " CHECKED"; $form .= " ><span class=\"vexpl\"> Enable/Disable queue and its children</span>"; $form .= "</td></tr>"; - $form .= "<tr><td valign=\"top\" class=\"vncellreq\"><br><span class=\"vexpl\">Name</span></td>"; + $form .= "<tr><td valign=\"center\" class=\"vncellreq\"><br><span class=\"vexpl\">Name</span></td>"; $form .= "<td class=\"vncellreq\">"; $form .= "<input type=\"text\" id=\"name\" name=\"name\" value=\""; $form .= $this->GetQname()."\">"; $form .= "</td></tr>"; - $form .= "<tr><td valign=\"top\" class=\"vncellreq\">Mask</td>"; + $form .= "<tr><td valign=\"center\" class=\"vncellreq\">Mask</td>"; $form .= "<td class=\"vncellreq\">"; $form .= "<select name=\"mask\" class=\"formselect\">"; $form .= "<option value=\"none\""; @@ -3202,7 +3199,7 @@ class dnqueue_class extends dummynet_class { $form .= "respectively. This makes it possible to easily specify bandwidth \n"; $form .= "limits per host.</span>"; $form .= "</td></tr>"; - $form .= "<tr><td valign=\"top\" class=\"vncellreq\">Description</td>"; + $form .= "<tr><td valign=\"center\" class=\"vncellreq\">Description</td>"; $form .= "<td class=\"vncellreq\">"; $form .= "<input type=\"text\" id=\"description\" class=\"formfld unknown\" size=\"50%\" name=\"description\" value=\""; $form .= $this->GetDescription(); @@ -3218,16 +3215,16 @@ class dnqueue_class extends dummynet_class { $form .= " value=\"Show advanced options\"></input></a>"; $form .= "</div></td></tr>"; $form .= "<tr style=\"display:none\" id=\"sprtable\" name=\"sprtable\">"; - $form .= "<td valign=\"top\" class=\"vncellreq\">Weight</td>"; - $form .= "<td valign=\"top\" class=\"vncellreq\">"; + $form .= "<td valign=\"center\" class=\"vncellreq\">Weight</td>"; + $form .= "<td valign=\"center\" class=\"vncellreq\">"; $form .= "<input name=\"weight\" type=\"text\" id=\"weight\" size=\"5\" value=\""; $form .= $this->GetWeight() . "\">"; $form .= " ms<br> <span class=\"vexpl\">Hint: For queues under the same parent "; $form .= "this specifies the share that a queue gets(values range from 1 to 100, you can leave it blank otherwise)</span>"; $form .= "</td></tr>"; $form .= "<tr style=\"display:none\" id=\"sprtable1\" name=\"sprtable1\">"; - $form .= "<td valign=\"top\" class=\"vncellreq\">Packet loss rate</td>"; - $form .= "<td valign=\"top\" class=\"vncellreq\">"; + $form .= "<td valign=\"center\" class=\"vncellreq\">Packet loss rate</td>"; + $form .= "<td valign=\"center\" class=\"vncellreq\">"; $form .= "<input name=\"plr\" type=\"text\" id=\"plr\" size=\"5\" value=\""; $form .= $this->GetPlr() . "\">"; $form .= " <br> <span class=\"vexpl\">Hint: in most cases, you "; @@ -3235,7 +3232,7 @@ class dnqueue_class extends dummynet_class { $form .= "A value of 0.001 means one packet in 1000 gets dropped</span>"; $form .= "</td></tr>"; $form .= "<tr style=\"display:none\" id=\"sprtable2\" name=\"sprtable2\">"; - $form .= "<td valign=\"top\" class=\"vncellreq\">Queue Size</td>"; + $form .= "<td valign=\"center\" class=\"vncellreq\">Queue Size</td>"; $form .= "<td class=\"vncellreq\">"; $form .= "<input type=\"text\" id=\"qlimit\" name=\"qlimit\" value=\""; $form .= $this->GetQlimit() . "\">"; @@ -3246,7 +3243,7 @@ class dnqueue_class extends dummynet_class { $form .= "are delivered to their destination.</span>"; $form .= "</td></tr>"; $form .= "<tr style=\"display:none\" id=\"sprtable5\" name=\"sprtable5\">"; - $form .= "<td valign=\"top\" class=\"vncellreq\">Bucket Size</td>"; + $form .= "<td valign=\"center\" class=\"vncellreq\">Bucket Size</td>"; $form .= "<td class=\"vncellreq\">"; $form .= "<input type=\"text\" id=\"buckets\" name=\"buckets\" value=\""; $form .= $this->GetBuckets() . "\">"; @@ -3384,7 +3381,7 @@ class layer7 { } function build_form() { - $form = "<tr><td valign=\"top\" class=\"vncellreq\"><br>"; + $form = "<tr><td valign=\"center\" class=\"vncellreq\"><br>"; $form .= "Enable/Disable"; $form .= "</td><td class=\"vncellreq\">"; $form .= " <input type=\"checkbox\" id=\"enabled\" name=\"enabled\" value=\"on\" "; @@ -3393,12 +3390,12 @@ class layer7 { } $form .= " ><span class=\"vexpl\"> Enable/Disable layer7 Container</span>"; $form .= "</td></tr>"; - $form .= "<tr><td valign=\"top\" class=\"vncellreq\"><br><span class=\"vexpl\">Name</span></td>"; + $form .= "<tr><td valign=\"center\" class=\"vncellreq\"><br><span class=\"vexpl\">Name</span></td>"; $form .= "<td class=\"vncellreq\">"; $form .= "<input type=\"text\" id=\"container\" name=\"container\" value=\""; $form .= $this->GetRName()."\">"; $form .= "</td></tr>"; - $form .= "<tr><td valign=\"top\" class=\"vncellreq\">Description</td>"; + $form .= "<tr><td valign=\"center\" class=\"vncellreq\">Description</td>"; $form .= "<td class=\"vncellreq\">"; $form .= "<input type=\"text\" class=\"formfld unknown\" size=\"50%\" id=\"description\" name=\"description\" value=\""; $form .= $this->GetRDescription(); diff --git a/etc/inc/system.inc b/etc/inc/system.inc index 41f3123..e7fc684 100644 --- a/etc/inc/system.inc +++ b/etc/inc/system.inc @@ -276,10 +276,10 @@ function system_routing_configure($interface = "") { $gatewayip = ""; $interfacegw = ""; + $foundgw = false; /* tack on all the hard defined gateways as well */ if (is_array($config['gateways']['gateway_item'])) { mwexec("/bin/rm {$g['tmp_path']}/*_defaultgw", true); - $foundgw = false; foreach ($config['gateways']['gateway_item'] as $gateway) { if (isset($gateway['defaultgw'])) { if ($gateway['gateway'] == "dynamic") @@ -295,13 +295,13 @@ function system_routing_configure($interface = "") { break; } } - if ($foundgw == false) { - $defaultif = get_real_interface("wan"); - $interfacegw = "wan"; - $gatewayip = get_interface_gateway("wan"); - @touch("{$g['tmp_path']}/{$defaultif}_defaultgw"); - } } + 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. */ if($config['installedpackages']['olsrd']) { @@ -727,7 +727,7 @@ function system_generate_lighty_config($filename, $cert_location = "cert.pem", $ca_location = "ca.pem", $max_procs = 1, - $max_requests = "1", + $max_requests = "2", $fast_cgi_enable = true, $captive_portal = false) { @@ -1451,4 +1451,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 fd4ad12..8f07a71 100644 --- a/etc/inc/upgrade_config.inc +++ b/etc/inc/upgrade_config.inc @@ -1696,8 +1696,8 @@ function upgrade_054_to_055() { } /* the roundtrip times need to be divided by 1000 to get seconds, really */ $databases = array(); - exec("cd $rrddbpath;/usr/bin/find *-quality.rrd", $databases); - echo "done.\n"; + chdir($rrddbpath); + $databases = glob("*-quality.rrd"); rsort($databases); foreach($databases as $database) { $xmldump = "{$database}.old.xml"; diff --git a/etc/inc/vpn.inc b/etc/inc/vpn.inc index 8a2bb85..68e1064 100644 --- a/etc/inc/vpn.inc +++ b/etc/inc/vpn.inc @@ -103,21 +103,21 @@ function vpn_ipsec_configure($ipchg = false) if (!isset($ipseccfg['enable'])) { mwexec("/sbin/ifconfig enc0 down"); + /* send a SIGKILL to be sure */ + sigkillbypid("{$g['varrun_path']}/racoon.pid", "KILL"); + /* kill racoon */ if(is_process_running("racoon")) mwexec("/usr/bin/killall racoon", true); killbypid("{$g['varrun_path']}/dnswatch-ipsec.pid"); - + /* wait for racoon process to die */ sleep(2); - /* send a SIGKILL to be sure */ - sigkillbypid("{$g['varrun_path']}/racoon.pid", "KILL"); - /* flush SPD and SAD */ - mwexec("/usr/local/sbin/setkey -FP"); mwexec("/usr/local/sbin/setkey -F"); - + mwexec("/usr/local/sbin/setkey -FP"); + /* disallow IPSEC, it is off */ // exec("/sbin/sysctl net.inet.ip.ipsec_in_use=0"); @@ -162,7 +162,7 @@ function vpn_ipsec_configure($ipchg = false) $rg = $ph1ent['remote-gateway']; if (!is_ipaddr($rg)) { - $dnswatch_list[] = $rg; + $dnswatch_list[] = "{$rg} = value"; add_hostname_to_watch($rg); $rg = resolve_retry($rg); if (!$rg) @@ -245,6 +245,7 @@ if [ "$DISABLESYSLOGCLOG" -gt "0" ]; then touch /var/log/relayd.log touch /var/log/lighttpd.log touch /var/log/ntpd.log + touch /var/log/apinger.log else ENABLEFIFOLOG=`cat /cf/conf/config.xml | grep usefifolog | wc -l | awk '{ print $1 }'` if [ "$ENABLEFIFOLOG" -gt "0" ]; then @@ -263,6 +264,7 @@ else /usr/sbin/fifolog_create -s 50688 /var/log/relayd.log /usr/sbin/fifolog_create -s 50688 /var/log/lighttpd.log /usr/sbin/fifolog_create -s 50688 /var/log/ntpd.log + /usr/sbin/fifolog_create -s 50688 /var/log/apinger.log else /usr/sbin/clog -i -s 512144 /var/log/system.log /usr/sbin/clog -i -s 512144 /var/log/filter.log @@ -278,7 +280,8 @@ else /usr/sbin/clog -i -s 65535 /var/log/slbd.log /usr/sbin/clog -i -s 65535 /var/log/lighttpd.log /usr/sbin/clog -i -s 65535 /var/log/ntpd.log - /usr/sbin/clog -i -s 65535 /var/log/relayd.log + /usr/sbin/clog -i -s 65535 /var/log/relayd.log + /usr/sbin/clog -i -s 65535 /var/log/apinger.log fi fi # change permissions on newly created fifolog files. diff --git a/etc/rc.linkup b/etc/rc.linkup index 59c604e..682adb1 100755 --- a/etc/rc.linkup +++ b/etc/rc.linkup @@ -52,6 +52,12 @@ function handle_argument_group($iface, $argument2) { interface_bring_down($iface); break; case "start": + log_error("DEVD Ethernet attached event for {$iface}"); + $riface = get_real_interface($iface); + exec("/usr/sbin/arp -d -i {$riface} -a"); + log_error("HOTPLUG: Configuring interface {$iface}"); + interface_configure($iface); + break; case "up": log_error("DEVD Ethernet attached event for {$iface}"); $riface = get_real_interface($iface); diff --git a/etc/rc.newipsecdns b/etc/rc.newipsecdns index 18b3b5b..4bb247c 100755 --- a/etc/rc.newipsecdns +++ b/etc/rc.newipsecdns @@ -5,7 +5,7 @@ part of m0n0wall (http://m0n0.ch/wall) Copyright (C) 2007 Manuel Kasper <mk@neon1.net>. - Copyright (C) 2009 Seth Mos <seth.mos@xs4all.nl>. + Copyright (C) 2009 Seth Mos <seth.mos@dds.nl>. All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/usr/local/www/carp_status.php b/usr/local/www/carp_status.php index 793a9ae..44dee95 100755 --- a/usr/local/www/carp_status.php +++ b/usr/local/www/carp_status.php @@ -107,7 +107,7 @@ include("head.inc"); <p> <table class="tabcont sortable" width="100%" border="0" cellpadding="6" cellspacing="0"> <tr> - <td class="listhdrr"><b><center>Carp Interface</center></b></td> + <td class="listhdrr"><b><center>CARP Interface</center></b></td> <td class="listhdrr"><b><center>Virtual IP</center></b></td> <td class="listhdrr"><b><center>Status</center></b></td> </tr> diff --git a/usr/local/www/diag_logs_relayd.php b/usr/local/www/diag_logs_relayd.php index 8ce35b8..57df0e1 100755 --- a/usr/local/www/diag_logs_relayd.php +++ b/usr/local/www/diag_logs_relayd.php @@ -5,7 +5,7 @@ part of pfSense Copyright (C) 2008 Bill Marquette <bill.marquette@gmail.com>. - Copyright (C) 2008 Seth Mos <seth.mos@xs4all.nl>. + Copyright (C) 2008 Seth Mos <seth.mos@dds.nl>. All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/usr/local/www/diag_nanobsd.php b/usr/local/www/diag_nanobsd.php index 3409a34..9be602d 100755 --- a/usr/local/www/diag_nanobsd.php +++ b/usr/local/www/diag_nanobsd.php @@ -67,10 +67,11 @@ nanobsd_detect_slice_info(); $NANOBSD_SIZE = nanobsd_get_size(); if($_POST['bootslice']) { + $statusmsg = gettext("Setting slice information, please wait..."); echo <<<EOF <div id="loading"> <img src="/themes/metallic/images/misc/loader.gif"> - gettext("Setting slice information, please wait...") + $statusmsg <p/> </div> EOF; @@ -82,10 +83,11 @@ EOF; } if($_POST['destslice']) { + $statusmsg = gettext("Duplicating slice. Please wait, this will take a moment..."); echo <<<EOF <div id="loading"> <img src="/themes/metallic/images/misc/loader.gif"> - gettext("Duplicating slice. Please wait, this will take a moment...") + $statusmsg <p/> </div> EOF; diff --git a/usr/local/www/firewall_shaper.php b/usr/local/www/firewall_shaper.php index 6618389..e456c61 100755 --- a/usr/local/www/firewall_shaper.php +++ b/usr/local/www/firewall_shaper.php @@ -341,9 +341,9 @@ $tree .= "</ul>"; if (!$dontshow || $newqueue) { -$output_form .= "<tr><td width=\"22%\" valign=\"top\" class=\"vncellreq\">"; -$output_form .= "Queue Actions"; -$output_form .= "</td><td valign=\"top\" class=\"vncellreq\" width=\"78%\">"; +$output_form .= "<tr><td width=\"22%\" valign=\"center\" class=\"vncellreq\">"; +$output_form .= "<br />Queue Actions<br />"; +$output_form .= "</td><td valign=\"center\" class=\"vncellreq\" width=\"78%\"><br />"; $output_form .= "<input type=\"submit\" name=\"Submit\" value=\"" . gettext("Save") . "\" class=\"formbtn\" />"; if ($can_add || $addnewaltq) { @@ -368,9 +368,9 @@ if ($can_add || $addnewaltq) { $output_form .= " value=\"Disable shaper on interface\">"; $output_form .= "</a>"; } -$output_form .= "</td></tr>"; +$output_form .= "<br /></td></tr>"; $output_form .= "</div>"; -} +} else $output_form .= "</div>"; diff --git a/usr/local/www/services_captiveportal_ip.php b/usr/local/www/services_captiveportal_ip.php index 505169e..692ff3d 100755 --- a/usr/local/www/services_captiveportal_ip.php +++ b/usr/local/www/services_captiveportal_ip.php @@ -60,10 +60,16 @@ if ($_GET['act'] == "del") { $ipent = $a_allowedips[$_GET['id']]; if (isset($config['captiveportal']['enable'])) { + if (!empty($ipent['sn'])) + $ipent['ip'] .= "/{$ipent['sn']}"; mwexec("/sbin/ipfw table 3 delete " . $ipent['ip']); mwexec("/sbin/ipfw table 4 delete " . $ipent['ip']); mwexec("/sbin/ipfw table 5 delete " . $ipent['ip']); mwexec("/sbin/ipfw table 6 delete " . $ipent['ip']); + mwexec("/sbin/ipfw table 7 delete " . $ipent['ip']); + mwexec("/sbin/ipfw table 8 delete " . $ipent['ip']); + mwexec("/sbin/ipfw table 9 delete " . $ipent['ip']); + mwexec("/sbin/ipfw table 10 delete " . $ipent['ip']); } unset($a_allowedips[$_GET['id']]); diff --git a/usr/local/www/services_captiveportal_ip_edit.php b/usr/local/www/services_captiveportal_ip_edit.php index f630afa..fecaccb 100755 --- a/usr/local/www/services_captiveportal_ip_edit.php +++ b/usr/local/www/services_captiveportal_ip_edit.php @@ -71,6 +71,7 @@ if (isset($_POST['id'])) if (isset($id) && $a_allowedips[$id]) { $pconfig['ip'] = $a_allowedips[$id]['ip']; + $pconfig['sn'] = $a_allowedips[$id]['sn']; $pconfig['dir'] = $a_allowedips[$id]['dir']; $pconfig['bw_up'] = $a_allowedips[$id]['bw_up']; $pconfig['bw_down'] = $a_allowedips[$id]['bw_down']; @@ -109,6 +110,7 @@ if ($_POST) { if (!$input_errors) { $ip = array(); $ip['ip'] = $_POST['ip']; + $ip['sn'] = $_POST['sn']; $ip['dir'] = $_POST['dir']; $ip['descr'] = $_POST['descr']; if ($_POST['bw_up']) @@ -117,9 +119,13 @@ if ($_POST) { $ip['bw_down'] = $_POST['bw_down']; if (isset($id) && $a_allowedips[$id]) { $oldip = $a_allowedips[$id]['ip']; + if (!empty($a_allowedips[$id]['sn'])) + $oldip .= "/{$a_allowedips[$id]['sn']}"; $a_allowedips[$id] = $ip; } else { $oldip = $ip['ip']; + if (!empty($$ip['sn'])) + $oldip .= "/{$$ip['sn']}"; $a_allowedips[] = $ip; } allowedips_sort(); @@ -169,6 +175,11 @@ include("head.inc"); <td width="22%" valign="top" class="vncellreq"><?=gettext("IP address"); ?></td> <td width="78%" class="vtable"> <?=$mandfldhtml;?><input name="ip" type="text" class="formfld unknown" id="ip" size="17" value="<?=htmlspecialchars($pconfig['ip']);?>"> + <select name='sn' class="formselect" id='sn'> + <?php for ($i = 32; $i >= 1; $i--): ?> + <option value="<?=$i;?>" <?php if ($i == $pconfig['sn']) echo "selected"; ?>><?=$i;?></option> + <?php endfor; ?> + </select> <br> <span class="vexpl"><?=gettext("IP address"); ?></span></td> </tr> diff --git a/usr/local/www/services_rfc2136.php b/usr/local/www/services_rfc2136.php index f0eaabb..563ee26 100644 --- a/usr/local/www/services_rfc2136.php +++ b/usr/local/www/services_rfc2136.php @@ -48,7 +48,7 @@ if ($_GET['act'] == "del") { write_config(); - header("Location: services_dyndns.php"); + header("Location: services_rfc2136.php"); exit; } @@ -105,9 +105,9 @@ include("head.inc"); </tr> <tr> <td colspan="3" class="list"><p class="vexpl"><span class="red"><strong> - <?=gettext("Note");?>:<br> + <br> </strong></span> - <?=gettext("Add something meaningful here.");?> + </td> <td class="list"> </td> </tr> diff --git a/usr/local/www/services_rfc2136_edit.php b/usr/local/www/services_rfc2136_edit.php index 57dfdc6..f195786 100644 --- a/usr/local/www/services_rfc2136_edit.php +++ b/usr/local/www/services_rfc2136_edit.php @@ -81,7 +81,7 @@ if ($_POST) { if (!$input_errors) { $rfc2136 = array(); - $rfc2136['enable'] = $_POST['enable'] ? false : true; + $rfc2136['enable'] = $_POST['enable'] ? true : false; $rfc2136['host'] = $_POST['host']; $rfc2136['ttl'] = $_POST['ttl']; $rfc2136['keyname'] = $_POST['keyname']; diff --git a/usr/local/www/services_snmp.php b/usr/local/www/services_snmp.php index 119be42..50f70d3 100755 --- a/usr/local/www/services_snmp.php +++ b/usr/local/www/services_snmp.php @@ -290,7 +290,7 @@ function enable_change(whichone) { <td width="22%" valign="top" class="vncellreq"><?=gettext("Read Community String");?></td> <td width="78%" class="vtable"> <input name="rocommunity" type="text" class="formfld unknown" id="rocommunity" size="40" value="<?=htmlspecialchars($pconfig['rocommunity']);?>"> - <br><?=gettext("In most cases"); ?>, "<?=gettext("public"); ?>" <?=gettext("is used here");?></br> + <br>The community string is like a password, restricting access to querying SNMP to hosts knowing the community string. Use a strong value here to protect from unauthorized information disclosure.</br> </td> </tr> diff --git a/usr/local/www/status_gateway_groups.php b/usr/local/www/status_gateway_groups.php index c282d36..f70f539 100755 --- a/usr/local/www/status_gateway_groups.php +++ b/usr/local/www/status_gateway_groups.php @@ -4,7 +4,7 @@ status_gateway_groups.php part of pfSense (http://pfsense.com) - Copyright (C) 2007 Seth Mos <seth.mos@xs4all.nl>. + Copyright (C) 2010 Seth Mos <seth.mos@dds.nl>. All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/usr/local/www/status_gateways.php b/usr/local/www/status_gateways.php index e2e5484..eac1b2f 100755 --- a/usr/local/www/status_gateways.php +++ b/usr/local/www/status_gateways.php @@ -4,7 +4,7 @@ status_gateways.php part of pfSense (http://www.pfsense.com/) - Copyright (C) 2006 Seth Mos <seth.mos@xs4all.nl>. + Copyright (C) 2010 Seth Mos <seth.mos@dds.nl>. All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/usr/local/www/status_lb_pool.php b/usr/local/www/status_lb_pool.php index 19a7eb2..54f3398 100755 --- a/usr/local/www/status_lb_pool.php +++ b/usr/local/www/status_lb_pool.php @@ -4,7 +4,7 @@ status_lb_pool.php part of pfSense (http://www.pfsense.com/) - Copyright (C) 2006 Seth Mos <seth.mos@xs4all.nl>. + Copyright (C) 2010 Seth Mos <seth.mos@dds.nl>. All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/usr/local/www/status_lb_vs.php b/usr/local/www/status_lb_vs.php index 83e7d44..91e89dd 100755 --- a/usr/local/www/status_lb_vs.php +++ b/usr/local/www/status_lb_vs.php @@ -4,7 +4,7 @@ status_lb_vs.php part of pfSense (http://www.pfsense.com/) - Copyright (C) 2007 Seth Mos <seth.mos@xs4all.nl>. + Copyright (C) 2010 Seth Mos <seth.mos@dds.nl>. All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/usr/local/www/status_rrd_graph.php b/usr/local/www/status_rrd_graph.php index a52cc86..2360b71 100755 --- a/usr/local/www/status_rrd_graph.php +++ b/usr/local/www/status_rrd_graph.php @@ -3,7 +3,7 @@ /* status_rrd_graph.php Part of pfSense - Copyright (C) 2007 Seth Mos <seth.mos@xs4all.nl> + Copyright (C) 2007 Seth Mos <seth.mos@dds.nl> All rights reserved. Redistribution and use in source and binary forms, with or without @@ -49,7 +49,9 @@ if(! isset($config['rrd']['enable'])) { } $rrddbpath = "/var/db/rrd/"; -$databases = glob("{$rrddbpath}*.rrd"); +chdir($rrddbpath); +$databases = glob("*.rrd"); + if ($_GET['cat']) { $curcat = $_GET['cat']; @@ -107,12 +109,22 @@ if ($_GET['option']) { continue 2; } } + case "vpnusers": + foreach($databases as $database) { + if(preg_match("/[-]vpnusers\.rrd/i", $database)) { + /* pick off the 1st database we find that matches the VPN graphs */ + $name = explode("-", $database); + $curoption = "$name[0]"; + continue 2; + } + } default: $curoption = "wan"; break; } } +$now = time(); if($curcat == "custom") { if (is_numeric($_GET['start'])) { if($start < ($now - (3600 * 24 * 365 * 5))) { @@ -155,6 +167,7 @@ $dbheader = array("allgraphs-traffic.rrd", "allgraphs-quality.rrd", "allgraphs-wireless.rrd", "allgraphs-cellular.rrd", + "allgraphs-vpnusers.rrd", "allgraphs-packets.rrd", "system-allgraphs.rrd", "system-throughput.rrd", @@ -163,15 +176,18 @@ $dbheader = array("allgraphs-traffic.rrd", "outbound-traffic.rrd"); foreach($databases as $database) { - if(stristr($database, "wireless")) { + if(stristr($database, "-wireless")) { $wireless = true; } - if(stristr($database, "queues")) { + if(stristr($database, "-queues")) { $queues = true; } - if(stristr($database, "cellular")) { + if(stristr($database, "-cellular")) { $cellular = true; } + if(stristr($database, "-vpnusers")) { + $vpnusers = true; + } } /* append the existing array to the header */ $ui_databases = array_merge($dbheader, $databases); @@ -190,7 +206,7 @@ function get_dates($curperiod, $graph) { $curyear = date('Y', $now); $curmonth = date('m', $now); $curweek = date('W', $now); - $curweekday = date('w', $now); + $curweekday = date('N', $now) - 1; // We want to start on monday $curday = date('d', $now); switch($curperiod) { @@ -206,8 +222,16 @@ function get_dates($curperiod, $graph) { $end = mktime(0, 0, 0, $curmonth, (($curday + $offset) + 1), $curyear); break; case "week": - $start = mktime(0, 0, 0, $curmonth, (($curday + $curweekday) - $offset), $curyear); - $end = mktime(0, 0, 0, $curmonth, (($curday + $curweekday) + 7), $curyear); + switch($offset) { + case 0; + $weekoffset = 0; + break; + default: + $weekoffset = ($offset * 7) - 7; + break; + } + $start = mktime(0, 0, 0, $curmonth, (($curday - $curweekday) + $weekoffset), $curyear); + $end = mktime(0, 0, 0, $curmonth, (($curday - $curweekday) + $weekoffset + 7), $curyear); break; case "month": $start = mktime(0, 0, 0, ($curmonth + $offset), 0, $curyear); @@ -254,9 +278,9 @@ function get_dates($curperiod, $graph) { $tab_array[] = array(gettext("Quality"), $tabactive, "status_rrd_graph.php?cat=quality"); if($queues) { if($curcat == "queues") { $tabactive = True; } else { $tabactive = False; } - $tab_array[] = array(gettext("Queues"), $tabactive, "status_rrd_graph.php?cat=queues"); + $tab_array[] = array(gettext("Queues"), $tabactive, "status_rrd_graph.php?cat=queues"); if($curcat == "queuedrops") { $tabactive = True; } else { $tabactive = False; } - $tab_array[] = array(gettext("QueueDrops"), $tabactive, "status_rrd_graph.php?cat=queuedrops"); + $tab_array[] = array(gettext("QueueDrops"), $tabactive, "status_rrd_graph.php?cat=queuedrops"); } if($wireless) { if($curcat == "wireless") { $tabactive = True; } else { $tabactive = False; } @@ -266,6 +290,10 @@ function get_dates($curperiod, $graph) { if($curcat == "cellular") { $tabactive = True; } else { $tabactive = False; } $tab_array[] = array(gettext("Cellular"), $tabactive, "status_rrd_graph.php?cat=cellular"); } + if($vpnusers) { + if($curcat == "vpnusers") { $tabactive = True; } else { $tabactive = False; } + $tab_array[] = array("VPN", $tabactive, "status_rrd_graph.php?cat=vpnusers"); + } if($curcat == "custom") { $tabactive = True; } else { $tabactive = False; } $tab_array[] = array(gettext("Custom"), $tabactive, "status_rrd_graph.php?cat=custom"); if($curcat == "settings") { $tabactive = True; } else { $tabactive = False; } @@ -330,7 +358,6 @@ function get_dates($curperiod, $graph) { echo " selected"; } echo ">" . htmlspecialchars($prettyprint) . "</option>\n"; - } ?> @@ -360,59 +387,73 @@ function get_dates($curperiod, $graph) { } } ?> - </select> - <?php if($curcat == "custom") { - - - } - foreach($graphs as $graph) { - /* check which databases are valid for our category */ - foreach($ui_databases as $curdatabase) { - if(! preg_match("/($curcat)/i", $curdatabase)) { - continue; - } - $optionc = split("-", $curdatabase); - $search = array("-", ".rrd", $optionc); - $replace = array(" :: ", "", $friendly); - switch($curoption) { - case "outbound": - /* only show interfaces with a gateway */ - $optionc = "$optionc[0]"; - if(!interface_has_gateway($optionc)) { - if(!preg_match("/($optionc)-(quality)/", $curdatabase)) { + ?> + <?=gettext("Start:");?> + <input type="text" name="start" class="formfldunknown" length="32" value="<?php echo $start;?>"> + <?=gettext("End:");?> + <input type="text" name="end" class="formfldunknown" length="32" value="<?php echo $now;?>"> + <input type="submit" name="Submit" value="<?=gettext("Go"); ?>"> + <? + $curdatabase = $curoption; + $graph = "custom-$curdatabase"; + if(in_array($curdatabase, $databases)) { + echo "<tr><td colspan=2 class=\"list\">\n"; + echo "<IMG BORDER='0' name='{$graph}-{$curoption}-{$curdatabase}' "; + echo "id='{$graph}-{$curoption}-{$curdatabase}' ALT=\"$prettydb Graph\" "; + echo "SRC=\"status_rrd_graph_img.php?start={$start}&end={$end}&database={$curdatabase}&style={$curstyle}&graph={$graph}\" />\n"; + echo "<br /><hr><br />\n"; + echo "</td></tr>\n"; + } + } else { + foreach($graphs as $graph) { + /* check which databases are valid for our category */ + foreach($ui_databases as $curdatabase) { + if(! preg_match("/($curcat)/i", $curdatabase)) { + continue; + } + $optionc = split("-", $curdatabase); + $search = array("-", ".rrd", $optionc); + $replace = array(" :: ", "", $friendly); + switch($curoption) { + case "outbound": + /* only show interfaces with a gateway */ + $optionc = "$optionc[0]"; + if(!interface_has_gateway($optionc)) { + if(!preg_match("/($optionc)-(quality)/", $curdatabase)) { + continue 2; + } + } + if(! preg_match("/($optionc)[-.]/i", $curdatabase)) { continue 2; } - } - if(! preg_match("/($optionc)[-.]/i", $curdatabase)) { - continue 2; - } - break; - case "allgraphs": - /* make sure we do not show the placeholder databases in the all view */ - if((stristr($curdatabase, "outbound")) || (stristr($curdatabase, "allgraphs"))) { - continue 2; - } - break; - default: - /* just use the name here */ - if(! preg_match("/($curoption)[-.]/i", $curdatabase)) { - continue 2; - } - } - if(in_array($curdatabase, $databases)) { - $dates = get_dates($curperiod, $graph); - $start = $dates['start']; - $end = $dates['end']; - echo "<tr><td colspan=2 class=\"list\">\n"; - echo "<IMG BORDER='0' name='{$graph}-{$curoption}-{$curdatabase}' "; - echo "id='{$graph}-{$curoption}-{$curdatabase}' ALT=\"$prettydb Graph\" "; - echo "SRC=\"status_rrd_graph_img.php?start={$start}&end={$end}&database={$curdatabase}&style={$curstyle}&graph={$graph}\" />\n"; - echo "<br /><hr><br />\n"; - echo "</td></tr>\n"; + break; + case "allgraphs": + /* make sure we do not show the placeholder databases in the all view */ + if((stristr($curdatabase, "outbound")) || (stristr($curdatabase, "allgraphs"))) { + continue 2; + } + break; + default: + /* just use the name here */ + if(! preg_match("/($curoption)[-.]/i", $curdatabase)) { + continue 2; + } + } + if(in_array($curdatabase, $databases)) { + $dates = get_dates($curperiod, $graph); + $start = $dates['start']; + $end = $dates['end']; + echo "<tr><td colspan=2 class=\"list\">\n"; + echo "<IMG BORDER='0' name='{$graph}-{$curoption}-{$curdatabase}' "; + echo "id='{$graph}-{$curoption}-{$curdatabase}' ALT=\"$prettydb Graph\" "; + echo "SRC=\"status_rrd_graph_img.php?start={$start}&end={$end}&database={$curdatabase}&style={$curstyle}&graph={$graph}\" />\n"; + echo "<br /><hr><br />\n"; + echo "</td></tr>\n"; + } } } } diff --git a/usr/local/www/status_rrd_graph_img.php b/usr/local/www/status_rrd_graph_img.php index cd93550..bc974b1 100644 --- a/usr/local/www/status_rrd_graph_img.php +++ b/usr/local/www/status_rrd_graph_img.php @@ -3,7 +3,7 @@ /* status_rrd_graph_img.php Part of pfSense - Copyright (C) 2009 Seth Mos <seth.mos@xs4all.nl> + Copyright (C) 2009 Seth Mos <seth.mos@dds.nl> All rights reserved. Redistribution and use in source and binary forms, with or without @@ -28,7 +28,7 @@ POSSIBILITY OF SUCH DAMAGE. */ /* - pfSense_BUILDER_BINARIES: /usr/bin/find /bin/rm /usr/local/bin/rrdtool + pfSense_BUILDER_BINARIES: /bin/rm /usr/local/bin/rrdtool pfSense_MODULE: system */ @@ -40,7 +40,7 @@ require_once("rrd.inc"); $pgtitle = array(gettext("System"),gettext("RRD Graphs"),gettext("Image viewer")); if ($_GET['database']) { - $curdatabase = $_GET['database']; + $curdatabase = basename($_GET['database']); } else { $curdatabase = "wan-traffic.rrd"; } @@ -146,8 +146,9 @@ $havg = timeDiff($average, $defOptions); $hperiod = timeDiff($seconds, $defOptions); $data = true; -/* XXX: (billm) do we have an exec() type function that does this type of thing? */ -exec("cd $rrddbpath;/usr/bin/find -name *.rrd", $databases); +$rrddbpath = "/var/db/rrd/"; +chdir($rrddbpath); +$databases = glob("*.rrd"); rsort($databases); /* compare bytes/sec counters, divide bps by 8 */ @@ -205,6 +206,7 @@ if(file_exists($rrdcolors)) { $colorwireless = array('333333','a83c3c','999999'); $colorspamdtime = array('DDDDFF', 'AAAAFF', 'DDDDFF', '000066'); $colorspamdconn = array('00AA00BB', 'FFFFFFFF', '00660088', 'FFFFFF88', '006600'); + $colorvpnusers = array('990000'); } switch ($curstyle) { @@ -570,6 +572,25 @@ elseif((strstr($curdatabase, "-wireless.rrd")) && (file_exists("$rrddbpath$curda $graphcmd .= "COMMENT:\"\\n\" "; $graphcmd .= "COMMENT:\"\t\t\t\t\t\t\t\t\t\t\t\t\t`date +\"%b %d %H\:%M\:%S %Y\"`\" "; } +elseif((strstr($curdatabase, "-vpnusers.rrd")) && (file_exists("$rrddbpath$curdatabase"))) { + /* define graphcmd for vpn users stats */ + $graphcmd = "$rrdtool graph $rrdtmppath$curdatabase-$curgraph.png "; + $graphcmd .= "--start $start --end $end "; + $graphcmd .= "--vertical-label \"users\" "; + $graphcmd .= "--color SHADEA#eeeeee --color SHADEB#eeeeee "; + $graphcmd .= "--title \"`hostname` - {$prettydb} - {$hperiod} - {$havg} average\" "; + $graphcmd .= "--height 200 --width 620 "; + $graphcmd .= "DEF:\"$curif-users=$rrddbpath$curdatabase:users:AVERAGE\" "; + $graphcmd .= "LINE2:\"$curif-users#{$colorvpnusers[0]}:$curif-users\" "; + $graphcmd .= "COMMENT:\"\\n\" "; + $graphcmd .= "COMMENT:\"\t\t\t maximum\t\t average\t current\\n\" "; + $graphcmd .= "COMMENT:\"Users Online\t\" "; + $graphcmd .= "GPRINT:\"$curif-users:MAX:%7.2lf \" "; + $graphcmd .= "GPRINT:\"$curif-users:AVERAGE:%7.2lf \" "; + $graphcmd .= "GPRINT:\"$curif-users:LAST:%7.2lf \" "; + $graphcmd .= "COMMENT:\"\\n\" "; + $graphcmd .= "COMMENT:\"\t\t\t\t\t\t\t\t\t\t\t\t\t`date +\"%b %d %H\:%M\:%S %Y\"`\" "; +} elseif((strstr($curdatabase, "-states.rrd")) && (file_exists("$rrddbpath$curdatabase"))) { /* define graphcmd for states stats */ $graphcmd = "$rrdtool graph $rrdtmppath$curdatabase-$curgraph.png "; diff --git a/usr/local/www/status_rrd_graph_settings.php b/usr/local/www/status_rrd_graph_settings.php index 7de6788..a12e22a 100755 --- a/usr/local/www/status_rrd_graph_settings.php +++ b/usr/local/www/status_rrd_graph_settings.php @@ -3,7 +3,7 @@ /* status_rrd_graph.php Part of pfSense - Copyright (C) 2007 Seth Mos <seth.mos@xs4all.nl> + Copyright (C) 2007 Seth Mos <seth.mos@dds.nl> All rights reserved. Redistribution and use in source and binary forms, with or without @@ -77,9 +77,11 @@ if ($_POST) { } } + + $rrddbpath = "/var/db/rrd/"; -/* XXX: (billm) do we have an exec() type function that does this type of thing? */ -exec("cd $rrddbpath;/usr/bin/find -name *.rrd", $databases); +chdir($rrddbpath); +$databases = glob("*.rrd"); foreach($databases as $database) { if(stristr($database, "wireless")) { @@ -91,6 +93,9 @@ foreach($databases as $database) { if(stristr($database, "cellular")) { $cellular = true; } + if(stristr($database, "-vpnusers")) { + $vpnusers = true; + } } $pgtitle = array(gettext("Status"),gettext("RRD Graphs")); @@ -132,6 +137,39 @@ include("head.inc"); if($curcat == "settings") { $tabactive = True; } else { $tabactive = False; } $tab_array[] = array(gettext("Settings"), $tabactive, "status_rrd_graph_settings.php"); display_top_tabs($tab_array); + $tab_array = array(); + if($curcat == "system") { $tabactive = True; } else { $tabactive = False; } + $tab_array[] = array(gettext("System"), $tabactive, "status_rrd_graph.php?cat=system"); + if($curcat == "traffic") { $tabactive = True; } else { $tabactive = False; } + $tab_array[] = array(gettext("Traffic"), $tabactive, "status_rrd_graph.php?cat=traffic"); + if($curcat == "packets") { $tabactive = True; } else { $tabactive = False; } + $tab_array[] = array(gettext("Packets"), $tabactive, "status_rrd_graph.php?cat=packets"); + if($curcat == "quality") { $tabactive = True; } else { $tabactive = False; } + $tab_array[] = array(gettext("Quality"), $tabactive, "status_rrd_graph.php?cat=quality"); + if($queues) { + if($curcat == "queues") { $tabactive = True; } else { $tabactive = False; } + $tab_array[] = array(gettext("Queues"), $tabactive, "status_rrd_graph.php?cat=queues"); + if($curcat == "queuedrops") { $tabactive = True; } else { $tabactive = False; } + $tab_array[] = array(gettext("QueueDrops"), $tabactive, "status_rrd_graph.php?cat=queuedrops"); + } + if($wireless) { + if($curcat == "wireless") { $tabactive = True; } else { $tabactive = False; } + $tab_array[] = array(gettext("Wireless"), $tabactive, "status_rrd_graph.php?cat=wireless"); + } + if($cellular) { + if($curcat == "cellular") { $tabactive = True; } else { $tabactive = False; } + $tab_array[] = array(gettext("Cellular"), $tabactive, "status_rrd_graph.php?cat=cellular"); + } + if($vpnusers) { + if($curcat == "vpnusers") { $tabactive = True; } else { $tabactive = False; } + $tab_array[] = array(gettext("VPN"), $tabactive, "status_rrd_graph.php?cat=vpnusers"); + } + if($curcat == "custom") { $tabactive = True; } else { $tabactive = False; } + $tab_array[] = array(gettext("Custom"), $tabactive, "status_rrd_graph.php?cat=custom"); + if($curcat == "settings") { $tabactive = True; } else { $tabactive = False; } + $tab_array[] = array(gettext("Settings"), $tabactive, "status_rrd_graph_settings.php"); + + display_top_tabs($tab_array); ?> </td> </tr> @@ -184,7 +222,7 @@ include("head.inc"); </tr> <tr> <td width="22%" height="53" valign="top"> </td> - <td width="78%"><strong><span class="red"><?=gettext("Note:");?></span></strong><br> + <td width="78%"><strong><span class="red"><?=gettext("Note");?>:</span></strong><br> <?=gettext("Graphs will not be allowed to be recreated within a 1 minute interval, please " . "take this into account after changing the style.");?> </td> diff --git a/usr/local/www/status_upnp.php b/usr/local/www/status_upnp.php index d2e0a88..7197a2c 100644 --- a/usr/local/www/status_upnp.php +++ b/usr/local/www/status_upnp.php @@ -4,7 +4,7 @@ status_upnp.php part of pfSense (http://www.pfsense.com/) - Copyright (C) 2006 Seth Mos <seth.mos@xs4all.nl>. + Copyright (C) 2010 Seth Mos <seth.mos@dds.nl>. All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/usr/local/www/system_gateway_groups.php b/usr/local/www/system_gateway_groups.php index 43dfea7..f767aff 100755 --- a/usr/local/www/system_gateway_groups.php +++ b/usr/local/www/system_gateway_groups.php @@ -4,7 +4,7 @@ system_gateway_groups.php part of pfSense (http://pfsense.com) - Copyright (C) 2007 Seth Mos <seth.mos@xs4all.nl>. + Copyright (C) 2010 Seth Mos <seth.mos@dds.nl>. All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/usr/local/www/system_gateway_groups_edit.php b/usr/local/www/system_gateway_groups_edit.php index 1a504c5..268a5da 100755 --- a/usr/local/www/system_gateway_groups_edit.php +++ b/usr/local/www/system_gateway_groups_edit.php @@ -4,7 +4,7 @@ system_gateway_groups_edit.php part of pfSense (http://pfsense.com) - Copyright (C) 2007 Seth Mos <seth.mos@xs4all.nl>. + Copyright (C) 2010 Seth Mos <seth.mos@dds.nl>. All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/usr/local/www/system_gateways.php b/usr/local/www/system_gateways.php index 82004a7..d789d76 100755 --- a/usr/local/www/system_gateways.php +++ b/usr/local/www/system_gateways.php @@ -4,7 +4,7 @@ system_gateways.php part of pfSense (http://pfsense.com) - Copyright (C) 2007 Seth Mos <seth.mos@xs4all.nl>. + Copyright (C) 2010 Seth Mos <seth.mos@dds.nl>. All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/usr/local/www/system_gateways_edit.php b/usr/local/www/system_gateways_edit.php index 98d1e81..e679b90 100755 --- a/usr/local/www/system_gateways_edit.php +++ b/usr/local/www/system_gateways_edit.php @@ -4,7 +4,7 @@ system_gateways_edit.php part of pfSense (http://pfsense.com) - Copyright (C) 2007 Seth Mos <seth.mos@xs4all.nl>. + Copyright (C) 2010 Seth Mos <seth.mos@dds.nl>. All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/usr/local/www/themes/code-red/rrdcolors.inc.php b/usr/local/www/themes/code-red/rrdcolors.inc.php index cbd6a8d..1ab0fd0 100755 --- a/usr/local/www/themes/code-red/rrdcolors.inc.php +++ b/usr/local/www/themes/code-red/rrdcolors.inc.php @@ -46,5 +46,6 @@ $colorqualityloss = "ee0000"; $colorwireless = array('990000','a83c3c','b36666');
$colorspamdtime = array('DDDDFF', 'AAAAFF', 'DDDDFF', '000066');
$colorspamdconn = array('00AA00BB', 'FFFFFFFF', '00660088', 'FFFFFF88', '006600');
+$colorvpnusers = array('990000');
?>
diff --git a/usr/local/www/themes/metallic/rrdcolors.inc.php b/usr/local/www/themes/metallic/rrdcolors.inc.php index e3153fd..8e74545 100644 --- a/usr/local/www/themes/metallic/rrdcolors.inc.php +++ b/usr/local/www/themes/metallic/rrdcolors.inc.php @@ -46,5 +46,6 @@ $colorqualityloss = "ee0000"; $colorwireless = array('333333','a83c3c','999999'); $colorspamdtime = array('DDDDFF', 'AAAAFF', 'DDDDFF', '000066'); $colorspamdconn = array('00AA00BB', 'FFFFFFFF', '00660088', 'FFFFFF88', '006600'); +$colorvpnusers = array('990000'); ?> diff --git a/usr/local/www/themes/nervecenter/rrdcolors.inc.php b/usr/local/www/themes/nervecenter/rrdcolors.inc.php index e3153fd..8e74545 100644 --- a/usr/local/www/themes/nervecenter/rrdcolors.inc.php +++ b/usr/local/www/themes/nervecenter/rrdcolors.inc.php @@ -46,5 +46,6 @@ $colorqualityloss = "ee0000"; $colorwireless = array('333333','a83c3c','999999'); $colorspamdtime = array('DDDDFF', 'AAAAFF', 'DDDDFF', '000066'); $colorspamdconn = array('00AA00BB', 'FFFFFFFF', '00660088', 'FFFFFF88', '006600'); +$colorvpnusers = array('990000'); ?> diff --git a/usr/local/www/themes/pfsense-dropdown/rrdcolors.inc.php b/usr/local/www/themes/pfsense-dropdown/rrdcolors.inc.php index e3153fd..8e74545 100644 --- a/usr/local/www/themes/pfsense-dropdown/rrdcolors.inc.php +++ b/usr/local/www/themes/pfsense-dropdown/rrdcolors.inc.php @@ -46,5 +46,6 @@ $colorqualityloss = "ee0000"; $colorwireless = array('333333','a83c3c','999999'); $colorspamdtime = array('DDDDFF', 'AAAAFF', 'DDDDFF', '000066'); $colorspamdconn = array('00AA00BB', 'FFFFFFFF', '00660088', 'FFFFFF88', '006600'); +$colorvpnusers = array('990000'); ?> diff --git a/usr/local/www/themes/pfsense/rrdcolors.inc.php b/usr/local/www/themes/pfsense/rrdcolors.inc.php index e3153fd..8e74545 100644 --- a/usr/local/www/themes/pfsense/rrdcolors.inc.php +++ b/usr/local/www/themes/pfsense/rrdcolors.inc.php @@ -46,5 +46,6 @@ $colorqualityloss = "ee0000"; $colorwireless = array('333333','a83c3c','999999'); $colorspamdtime = array('DDDDFF', 'AAAAFF', 'DDDDFF', '000066'); $colorspamdconn = array('00AA00BB', 'FFFFFFFF', '00660088', 'FFFFFF88', '006600'); +$colorvpnusers = array('990000'); ?> diff --git a/usr/local/www/themes/pfsense_ng/rrdcolors.inc.php b/usr/local/www/themes/pfsense_ng/rrdcolors.inc.php index e3153fd..8e74545 100644 --- a/usr/local/www/themes/pfsense_ng/rrdcolors.inc.php +++ b/usr/local/www/themes/pfsense_ng/rrdcolors.inc.php @@ -46,5 +46,6 @@ $colorqualityloss = "ee0000"; $colorwireless = array('333333','a83c3c','999999'); $colorspamdtime = array('DDDDFF', 'AAAAFF', 'DDDDFF', '000066'); $colorspamdconn = array('00AA00BB', 'FFFFFFFF', '00660088', 'FFFFFF88', '006600'); +$colorvpnusers = array('990000'); ?> diff --git a/usr/local/www/themes/the_wall/rrdcolors.inc.php b/usr/local/www/themes/the_wall/rrdcolors.inc.php index e3153fd..8e74545 100644 --- a/usr/local/www/themes/the_wall/rrdcolors.inc.php +++ b/usr/local/www/themes/the_wall/rrdcolors.inc.php @@ -46,5 +46,6 @@ $colorqualityloss = "ee0000"; $colorwireless = array('333333','a83c3c','999999'); $colorspamdtime = array('DDDDFF', 'AAAAFF', 'DDDDFF', '000066'); $colorspamdconn = array('00AA00BB', 'FFFFFFFF', '00660088', 'FFFFFF88', '006600'); +$colorvpnusers = array('990000'); ?> diff --git a/usr/local/www/vpn_ipsec.php b/usr/local/www/vpn_ipsec.php index 2c34085..9f2e97e 100755 --- a/usr/local/www/vpn_ipsec.php +++ b/usr/local/www/vpn_ipsec.php @@ -117,7 +117,7 @@ if ($_GET['act'] == "delph2") } } -$pgtitle = array("VPN","IPsec"); +$pgtitle = array(gettext("VPN"),gettext("IPsec")); $statusurl = "diag_ipsec.php"; $logurl = "diag_logs_ipsec.php"; @@ -132,16 +132,16 @@ include("head.inc"); if ($savemsg) print_info_box($savemsg); if ($pconfig['enable'] && is_subsystem_dirty('ipsec')) - print_info_box_np("The IPsec tunnel configuration has been changed.<br>You must apply the changes in order for them to take effect."); + print_info_box_np(gettext("The IPsec tunnel configuration has been changed") . ".<br>" . gettext("You must apply the changes in order for them to take effect.")); ?> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td class="tabnavtbl"> <?php $tab_array = array(); - $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[0] = array(gettext("Tunnels"), true, "vpn_ipsec.php"); + $tab_array[1] = array(gettext("Mobile clients"), false, "vpn_ipsec_mobile.php"); + $tab_array[2] = array(gettext("Pre-shared keys"), false, "vpn_ipsec_keys.php"); display_top_tabs($tab_array); ?> </td> @@ -158,7 +158,7 @@ include("head.inc"); <input name="enable" type="checkbox" id="enable" value="yes" <?php if ($pconfig['enable']) echo "checked";?>> </td> <td> - <strong>Enable IPsec</strong> + <strong><?=gettext("Enable IPsec"); ?></strong> </td> </tr> </table> @@ -166,7 +166,7 @@ include("head.inc"); </tr> <tr> <td> - <input name="submit" type="submit" class="formbtn" value="Save"> + <input name="submit" type="submit" class="formbtn" value="<?=gettext("Save"); ?>"> </td> </tr> </table> @@ -201,7 +201,7 @@ include("head.inc"); if (!isset($ph1ent['mobile'])) echo $if."<br>".$ph1ent['remote-gateway']; else - echo $if."<br><strong>Mobile Client</strong>"; + echo $if."<br><strong>" . gettext("Mobile Client") . "</strong>"; ?> <?=$spane;?> </td> @@ -216,9 +216,9 @@ include("head.inc"); <?php if ($ph1ent['encryption-algorithm']['keylen']) { if ($ph1ent['encryption-algorithm']['keylen']=="auto") - echo " (auto)"; + echo " (" . gettext("auto") . ")"; else - echo " ({$ph1ent['encryption-algorithm']['keylen']} bits)"; + echo " ({$ph1ent['encryption-algorithm']['keylen']} " . gettext("bits") . ")"; } ?> <?=$spane;?> @@ -238,12 +238,12 @@ include("head.inc"); <tr> <td> <a href="vpn_ipsec_phase1.php?p1index=<?=$i;?>"> - <img src="./themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" title="edit phase1 entry" width="17" height="17" border="0"> + <img src="./themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" title="<?=gettext("edit phase1 entry"); ?>" width="17" height="17" border="0"> </a> </td> <td> - <a href="vpn_ipsec.php?act=delph1&p1index=<?=$i;?>" onclick="return confirm('Do you really want to delete this phase1 and all associated phase2 entries?')"> - <img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" title="delete phase1 entry" width="17" height="17" border="0"> + <a href="vpn_ipsec.php?act=delph1&p1index=<?=$i;?>" onclick="return confirm('<?=gettext("Do you really want to delete this phase1 and all associated phase2 entries?"); ?>')"> + <img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" title="<?=gettext("delete phase1 entry"); ?>" width="17" height="17" border="0"> </a> </td> </tr> @@ -253,7 +253,7 @@ include("head.inc"); </td> <td> <a href="vpn_ipsec_phase1.php?dup=<?=$i;?>"> - <img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" title="copy phase1 entry" width="17" height="17" border="0"> + <img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" title="<?=gettext("copy phase1 entry"); ?>" width="17" height="17" border="0"> </a> </td> </tr> @@ -274,21 +274,21 @@ include("head.inc"); $phase2count++; } ?> - <input type="button" onClick="show_phase2('tdph2-<?=$i?>','shph2but-<?=$i?>')" value="+"></input> - Show <?=$phase2count?> Phase-2 entries</a> + <input type="button" onClick="show_phase2('tdph2-<?=$i?>','shph2but-<?=$i?>')" value="+"></input> - <?php printf(gettext("Show %s Phase-2 entries"), $phase2count); ?></a> </div> <table class="tabcont" width="100%" height="100%" border="0" cellspacing="0" cellpadding="0" id="tdph2-<?=$i?>" style="display:none"> <tr> - <td class="listhdrr">Mode</td> + <td class="listhdrr"><?=gettext("Mode"); ?></td> <?php if($ph2ent['mode'] == "tunnel"): ?> - <td class="listhdrr">Local Subnet</td> - <td class="listhdrr">Remote Subnet</td> + <td class="listhdrr"><?=gettext("Local Subnet"); ?></td> + <td class="listhdrr"><?=gettext("Remote Subnet"); ?></td> <?php endif; ?> - <td class="listhdrr">P2 Protocol</td> - <td class="listhdrr">P2 Transforms</td> - <td class="listhdrr">P2 Auth Methods</td> + <td class="listhdrr"><?=gettext("P2 Protocol"); ?></td> + <td class="listhdrr"><?=gettext("P2 Transforms"); ?></td> + <td class="listhdrr"><?=gettext("P2 Auth Methods"); ?></td> <td class ="list"> <a href="vpn_ipsec_phase2.php?ikeid=<?=$ph1ent['ikeid'];?><?php if (isset($ph1ent['mobile'])) echo "&mobile=true";?>"> - <img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" title="add phase2 entry" width="17" height="17" border="0"> + <img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" title="<?=gettext("add phase2 entry"); ?>" width="17" height="17" border="0"> </a> </td> </tr> @@ -346,9 +346,9 @@ include("head.inc"); echo $p2_ealgos[$ph2ea['name']]['name']; if ($ph2ea['keylen']) { if ($ph2ea['keylen']=="auto") - echo " (auto)"; + echo " (" . gettext("auto") . ")"; else - echo " ({$ph2ea['keylen']} bits)"; + echo " ({$ph2ea['keylen']} " . gettext("bits") . ")"; } } ?> @@ -368,10 +368,10 @@ include("head.inc"); </td> <td nowrap class="list"> <a href="vpn_ipsec_phase2.php?p2index=<?=$j;?>"> - <img src="./themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" title="edit phase2 entry" width="17" height="17" border="0"> + <img src="./themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" title="<?=gettext("edit phase2 entry"); ?>" width="17" height="17" border="0"> </a> - <a href="vpn_ipsec.php?act=delph2&p2index=<?=$j;?>" onclick="return confirm('Do you really want to delete this phase2 entry?')"> - <img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" title="delete phase2 entry" width="17" height="17" border="0"> + <a href="vpn_ipsec.php?act=delph2&p2index=<?=$j;?>" onclick="return confirm('<?=gettext("Do you really want to delete this phase2 entry?"); ?>')"> + <img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" title="<?=gettext("delete phase2 entry"); ?>" width="17" height="17" border="0"> </a> </td> </tr> @@ -402,7 +402,7 @@ include("head.inc"); <td width="17"></td> <td> <a href="vpn_ipsec_phase1.php"> - <img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" title="add phase1 entry" width="17" height="17" border="0"> + <img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" title="<?=gettext("add phase1 entry"); ?>" width="17" height="17" border="0"> </a> </td> </tr> @@ -414,9 +414,9 @@ include("head.inc"); <p> <span class="vexpl"> <span class="red"> - <strong>Note:<br></strong> + <strong><?=gettext("Note"); ?>:<br></strong> </span> - You can check your IPsec status at <a href="diag_ipsec.php">Status:IPsec</a>. + <?=gettext("You can check your IPsec status at"); ?> <a href="diag_ipsec.php"><?=gettext("Status:IPsec"); ?></a>. </span> </p> </td> @@ -446,11 +446,11 @@ function show_ipsec_header($ph1ent) { $mobile = "&mobile=true"; echo <<<EOF <tr> - <td class="listhdrr">Remote Gateway</td> - <td class="listhdrr">Mode</td> - <td class="listhdrr">P1 Protocol</td> - <td class="listhdrr">P1 Transforms</td> - <td class="listhdrr">P1 Description</td> + <td class="listhdrr"><?=gettext("Remote Gateway"); ?></td> + <td class="listhdrr"><?=gettext("Mode"); ?></td> + <td class="listhdrr"><?=gettext("P1 Protocol"); ?></td> + <td class="listhdrr"><?=gettext("P1 Transforms"); ?></td> + <td class="listhdrr"><?=gettext("P1 Description"); ?></td> <td class ="list"> </td> </tr> diff --git a/usr/local/www/vpn_ipsec_keys.php b/usr/local/www/vpn_ipsec_keys.php index c446e05..d9d0d4c 100644 --- a/usr/local/www/vpn_ipsec_keys.php +++ b/usr/local/www/vpn_ipsec_keys.php @@ -68,7 +68,7 @@ if ($_GET['act'] == "del") { } } -$pgtitle = "VPN: IPsec: Keys"; +$pgtitle = gettext("VPN: IPsec: Keys"); $statusurl = "diag_ipsec.php"; $logurl = "diag_logs_ipsec.php"; @@ -83,16 +83,16 @@ include("head.inc"); if ($savemsg) print_info_box($savemsg); if (is_subsystem_dirty('ipsec')) - print_info_box_np("The IPsec tunnel configuration has been changed.<br>You must apply the changes in order for them to take effect."); + print_info_box_np(gettext("The IPsec tunnel configuration has been changed") . ".<br>" . gettext("You must apply the changes in order for them to take effect.")); ?> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr><td class="tabnavtbl"> <?php $tab_array = array(); - $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[0] = array(gettext("Tunnels"), false, "vpn_ipsec.php"); + $tab_array[1] = array(gettext("Mobile clients"), false, "vpn_ipsec_mobile.php"); + $tab_array[2] = array(gettext("Pre-shared keys"), true, "vpn_ipsec_keys.php"); display_top_tabs($tab_array); ?> </td></tr> @@ -101,13 +101,13 @@ if (is_subsystem_dirty('ipsec')) <div id="mainarea"> <table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> - <td class="listhdrr">Identifier</td> - <td class="listhdr">Pre-shared key</td> + <td class="listhdrr"><?=gettext("Identifier"); ?></td> + <td class="listhdr"><?=gettext("Pre-shared key"); ?></td> <td class="list"> <table border="0" cellspacing="0" cellpadding="1"> <tr> <td width="20" heigth="17"></td> - <td><a href="vpn_ipsec_keys_edit.php"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" title="add key" width="17" height="17" border="0"></a></td> + <td><a href="vpn_ipsec_keys_edit.php"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" title="<?=gettext("add key"); ?>" width="17" height="17" border="0"></a></td> </tr> </table> </td> @@ -120,7 +120,7 @@ if (is_subsystem_dirty('ipsec')) <td class="listr gray"> <?=htmlspecialchars($secretent['pre-shared-key']);?> </td> - <td class="list" nowrap><a href="system_usermanager.php?act=edit&id=<?=$secretent['id'];?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" title="edit key" width="17" height="17" border="0"></a> + <td class="list" nowrap><a href="system_usermanager.php?act=edit&id=<?=$secretent['id'];?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" title="<?=gettext("edit key"); ?>" width="17" height="17" border="0"></a> </td> </tr> <?php $i++; endforeach; ?> @@ -133,8 +133,8 @@ if (is_subsystem_dirty('ipsec')) <td class="listr"> <?=htmlspecialchars($secretent['pre-shared-key']);?> </td> - <td class="list" nowrap> <a href="vpn_ipsec_keys_edit.php?id=<?=$i;?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" title="edit key" width="17" height="17" border="0"></a> - <a href="vpn_ipsec_keys.php?act=del&id=<?=$i;?>" onclick="return confirm('Do you really want to delete this pre-shared key?')"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" title="delete key" width="17" height="17" border="0"></a></td> + <td class="list" nowrap> <a href="vpn_ipsec_keys_edit.php?id=<?=$i;?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" title="<?=gettext("edit key"); ?>" width="17" height="17" border="0"></a> + <a href="vpn_ipsec_keys.php?act=del&id=<?=$i;?>" onclick="return confirm('<?=gettext("Do you really want to delete this pre-shared key?"); ?>')"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" title="<?=gettext("delete key"); ?>" width="17" height="17" border="0"></a></td> </tr> <?php $i++; endforeach; ?> <tr> @@ -143,7 +143,7 @@ if (is_subsystem_dirty('ipsec')) <table border="0" cellspacing="0" cellpadding="1"> <tr> <td width="20" heigth="17"></td> - <td><a href="vpn_ipsec_keys_edit.php"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" title="add key" width="17" height="17" border="0"></a></td> + <td><a href="vpn_ipsec_keys_edit.php"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" title="<?=gettext("add key"); ?>" width="17" height="17" border="0"></a></td> </tr> </table> </td> diff --git a/usr/local/www/vpn_ipsec_keys_edit.php b/usr/local/www/vpn_ipsec_keys_edit.php index ff1ef9a..8a76dd2 100644 --- a/usr/local/www/vpn_ipsec_keys_edit.php +++ b/usr/local/www/vpn_ipsec_keys_edit.php @@ -66,21 +66,21 @@ if ($_POST) { /* input validation */ $reqdfields = explode(" ", "ident psk"); - $reqdfieldsn = explode(",", "Identifier,Pre-shared key"); + $reqdfieldsn = array(gettext("Identifier,Pre-shared key")); do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); if (preg_match("/[^a-zA-Z0-9@\.\-]/", $_POST['ident'])) - $input_errors[] = "The identifier contains invalid characters."; + $input_errors[] = gettext("The identifier contains invalid characters."); if (array_key_exists($_POST['ident'], $userids)) - $input_errors[] = "A user with this name already exists. Add the key to the user instead."; + $input_errors[] = gettext("A user with this name already exists. Add the key to the user instead."); if (!$input_errors && !(isset($id) && $a_secret[$id])) { /* make sure there are no dupes */ foreach ($a_secret as $secretent) { if ($secretent['ident'] == $_POST['ident']) { - $input_errors[] = "Another entry with the same identifier already exists."; + $input_errors[] = gettext("Another entry with the same identifier already exists."); break; } } @@ -97,10 +97,10 @@ if ($_POST) { if (isset($id) && $a_secret[$id]) { $a_secret[$id] = $secretent; - $text = "Edited"; + $text = gettext("Edited"); } else { $a_secret[] = $secretent; - $text = "Added"; + $text = gettext("Added"); } write_config("{$text} IPsec Pre-Shared Keys"); @@ -111,7 +111,7 @@ if ($_POST) { } } -$pgtitle = "VPN: IPsec: Edit pre-shared key"; +$pgtitle = gettext("VPN: IPsec: Edit pre-shared key"); $statusurl = "diag_ipsec.php"; $logurl = "diag_logs_ipsec.php"; @@ -125,15 +125,15 @@ include("head.inc"); <form action="vpn_ipsec_keys_edit.php" method="post" name="iform" id="iform"> <table width="100%" border="0" cellpadding="6" cellspacing="0"> <tr> - <td valign="top" class="vncellreq">Identifier</td> + <td valign="top" class="vncellreq"><?=gettext("Identifier"); ?></td> <td class="vtable"> <?=$mandfldhtml;?><input name="ident" type="text" class="formfld unknown" id="ident" size="30" value="<?=$pconfig['ident'];?>"> <br> -This can be either an IP address, fully qualified domain name or an e-mail address. +<?=gettext("This can be either an IP address, fully qualified domain name or an e-mail address"); ?>. </td> </tr> <tr> - <td width="22%" valign="top" class="vncellreq">Pre-shared key</td> + <td width="22%" valign="top" class="vncellreq"><?=gettext("Pre-shared key"); ?></td> <td width="78%" class="vtable"> <?=$mandfldhtml;?><input name="psk" type="text" class="formfld unknown" id="psk" size="40" value="<?=htmlspecialchars($pconfig['psk']);?>"> </td> @@ -141,7 +141,7 @@ This can be either an IP address, fully qualified domain name or an e-mail addre <tr> <td width="22%" valign="top"> </td> <td width="78%"> - <input name="Submit" type="submit" class="formbtn" value="Save"> + <input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save"); ?>"> <?php if (isset($id) && $a_secret[$id]): ?> <input name="id" type="hidden" value="<?=$id;?>"> <?php endif; ?> diff --git a/usr/local/www/vpn_ipsec_mobile.php b/usr/local/www/vpn_ipsec_mobile.php index 379cf15..ddfc7ee 100755 --- a/usr/local/www/vpn_ipsec_mobile.php +++ b/usr/local/www/vpn_ipsec_mobile.php @@ -121,44 +121,44 @@ if ($_POST['submit']) { /* input validation */ $reqdfields = explode(" ", "user_source group_source"); - $reqdfieldsn = explode(",", "User Authentication Source,Group Authentication Source"); + $reqdfieldsn = array(gettext("User Authentication Source"),gettext("Group Authentication Source")); do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); if ($pconfig['pool_enable']) if (!is_ipaddr($pconfig['pool_address'])) - $input_errors[] = "A valid IP address for 'Virtual Address Pool Network' must be specified."; + $input_errors[] = gettext("A valid IP address for 'Virtual Address Pool Network' must be specified."); if ($pconfig['dns_domain_enable']) if (!is_domain($pconfig['dns_domain'])) - $input_errors[] = "A valid value for 'DNS Default Domain' must be specified."; + $input_errors[] = gettext("A valid value for 'DNS Default Domain' must be specified."); if ($pconfig['dns_server_enable']) { if (!$pconfig['dns_server1'] && !$pconfig['dns_server2'] && !$pconfig['dns_server3'] && !$pconfig['dns_server4'] ) - $input_errors[] = "At least one DNS server must be specified to enable the DNS Server option."; + $input_errors[] = gettext("At least one DNS server must be specified to enable the DNS Server option."); if ($pconfig['dns_server1'] && !is_ipaddr($pconfig['dns_server1'])) - $input_errors[] = "A valid IP address for 'DNS Server #1' must be specified."; + $input_errors[] = gettext("A valid IP address for 'DNS Server #1' must be specified."); if ($pconfig['dns_server2'] && !is_ipaddr($pconfig['dns_server2'])) - $input_errors[] = "A valid IP address for 'DNS Server #2' must be specified."; + $input_errors[] = gettext("A valid IP address for 'DNS Server #2' must be specified."); if ($pconfig['dns_server3'] && !is_ipaddr($pconfig['dns_server3'])) - $input_errors[] = "A valid IP address for 'DNS Server #3' must be specified."; + $input_errors[] = gettext("A valid IP address for 'DNS Server #3' must be specified."); if ($pconfig['dns_server4'] && !is_ipaddr($pconfig['dns_server4'])) - $input_errors[] = "A valid IP address for 'DNS Server #4' must be specified."; + $input_errors[] = gettext("A valid IP address for 'DNS Server #4' must be specified."); } if ($pconfig['wins_server_enable']) { if (!$pconfig['wins_server1'] && !$pconfig['wins_server2']) - $input_errors[] = "At least one WINS server must be specified to enable the DNS Server option."; + $input_errors[] = gettext("At least one WINS server must be specified to enable the DNS Server option."); if ($pconfig['wins_server1'] && !is_ipaddr($pconfig['wins_server1'])) - $input_errors[] = "A valid IP address for 'WINS Server #1' must be specified."; + $input_errors[] = gettext("A valid IP address for 'WINS Server #1' must be specified."); if ($pconfig['wins_server2'] && !is_ipaddr($pconfig['wins_server2'])) - $input_errors[] = "A valid IP address for 'WINS Server #2' must be specified."; + $input_errors[] = gettext("A valid IP address for 'WINS Server #2' must be specified."); } if ($pconfig['login_banner_enable']) if (!strlen($pconfig['login_banner'])) - $input_errors[] = "A valid value for 'Login Banner' must be specified."; + $input_errors[] = gettext("A valid value for 'Login Banner' must be specified."); if (!$input_errors) { $client = array(); @@ -210,7 +210,7 @@ if ($_POST['submit']) { } } -$pgtitle = array("VPN","IPsec","Mobile"); +$pgtitle = array(gettext("VPN"),gettext("IPsec"),gettext("Mobile")); $statusurl = "diag_ipsec.php"; $logurl = "diag_logs_ipsec.php"; @@ -293,12 +293,12 @@ function login_banner_change() { if ($savemsg) print_info_box($savemsg); if (isset($config['ipsec']['enable']) && is_subsystem_dirty('ipsec')) - print_info_box_np("The IPsec tunnel configuration has been changed.<br>You must apply the changes in order for them to take effect."); + print_info_box_np(gettext("The IPsec tunnel configuration has been changed") . ".<br>" . gettext("You must apply the changes in order for them to take effect.")); foreach ($a_phase1 as $ph1ent) if (isset($ph1ent['mobile'])) $ph1found = true; if ($pconfig['enable'] && !$ph1found) - print_info_box_np("Support for IPsec Mobile clients is enabled but a Phase1 definition was not found.<br>Please click Create to define one.","create","Create Phase1"); + print_info_box_np(gettext("Support for IPsec Mobile clients is enabled but a Phase1 definition was not found") . ".<br>" . gettext("Please click Create to define one."),gettext("create"),gettext("Create Phase1")); if ($input_errors) print_input_errors($input_errors); ?> @@ -308,9 +308,9 @@ function login_banner_change() { <td class="tabnavtbl"> <?php $tab_array = array(); - $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[0] = array(gettext("Tunnels"), false, "vpn_ipsec.php"); + $tab_array[1] = array(gettext("Mobile clients"), true, "vpn_ipsec_mobile.php"); + $tab_array[2] = array(gettext("Pre-shared keys"), false, "vpn_ipsec_keys.php"); display_top_tabs($tab_array); ?> </td> @@ -320,7 +320,7 @@ function login_banner_change() { <div class="tabcont"> <table width="100%" border="0" cellpadding="6" cellspacing="0"> <tr> - <td width="22%" valign="top" class="vncellreq">IKE Extensions</td> + <td width="22%" valign="top" class="vncellreq"><?=gettext("IKE Extensions"); ?></td> <td width="78%" class="vtable"> <table border="0" cellspacing="2" cellpadding="0"> <tr> @@ -329,7 +329,7 @@ function login_banner_change() { <input name="enable" type="checkbox" id="enable" value="yes" <?=$chk;?>> </td> <td> - <strong>Enable IPsec Mobile Client Support</strong> + <strong><?=gettext("Enable IPsec Mobile Client Support"); ?></strong> </td> </tr> </table> @@ -340,24 +340,24 @@ function login_banner_change() { </tr> <tr> <td colspan="2" valign="top" class="listtopic"> - Extended Authentication (Xauth) + <?=gettext("Extended Authentication (Xauth)"); ?> </td> </tr> <tr> - <td width="22%" valign="top" class="vncellreq">User Authentication</td> + <td width="22%" valign="top" class="vncellreq"><?=gettext("User Authentication"); ?></td> <td width="78%" class="vtable"> - Source: + <?=gettext("Source"); ?>: <select name="user_source" class="formselect" id="user_source"> - <option value="system">system</option> + <option value="system"><?=gettext("system"); ?></option> </select> </td> </tr> <tr> - <td width="22%" valign="top" class="vncellreq">Group Authentication</td> + <td width="22%" valign="top" class="vncellreq"><?=gettext("Group Authentication"); ?></td> <td width="78%" class="vtable"> - Source: + <?=gettext("Source"); ?>: <select name="group_source" class="formselect" id="group_source"> - <option value="system">system</option> + <option value="system"><?=gettext("system"); ?></option> </select> </td> </tr> @@ -366,11 +366,11 @@ function login_banner_change() { </tr> <tr> <td colspan="2" valign="top" class="listtopic"> - Client Configuration (mode-cfg) + <?=gettext("Client Configuration (mode-cfg)"); ?> </td> </tr> <tr> - <td width="22%" valign="top" class="vncell">Virtual Address Pool</td> + <td width="22%" valign="top" class="vncell"><?=gettext("Virtual Address Pool"); ?></td> <td width="78%" class="vtable"> <table border="0" cellspacing="2" cellpadding="0"> <tr> @@ -379,14 +379,14 @@ function login_banner_change() { <input name="pool_enable" type="checkbox" id="pool_enable" value="yes" <?=$chk;?> onClick="pool_change()"> </td> <td> - Provide a vitual IP address to clients<br> + <?=gettext("Provide a vitual IP address to clients"); ?><br> </td> </tr> </table> <table border="0" cellspacing="2" cellpadding="0"> <tr> <td> - Network: + <?=gettext("Network"); ?>: <input name="pool_address" type="text" class="formfld unknown" id="pool_address" size="20" value="<?=$pconfig['pool_address'];?>"> / <select name="pool_netbits" class="formselect" id="pool_netbits"> @@ -402,7 +402,7 @@ function login_banner_change() { </td> </tr> <tr> - <td width="22%" valign="top" class="vncell">Network List</td> + <td width="22%" valign="top" class="vncell"><?=gettext("Network List"); ?></td> <td width="78%" class="vtable"> <table border="0" cellspacing="2" cellpadding="0"> <tr> @@ -411,14 +411,14 @@ function login_banner_change() { <input name="net_list_enable" type="checkbox" id="net_list_enable" value="yes" <?=$chk;?>> </td> <td> - Provide a list of accessible networks to clients<br> + <?=gettext("Provide a list of accessible networks to clients"); ?><br> </td> </tr> </table> </td> </tr> <tr> - <td width="22%" valign="top" class="vncell">DNS Default Domain</td> + <td width="22%" valign="top" class="vncell"><?=gettext("DNS Default Domain"); ?></td> <td width="78%" class="vtable"> <table border="0" cellspacing="2" cellpadding="0"> <tr> @@ -427,7 +427,7 @@ function login_banner_change() { <input name="dns_domain_enable" type="checkbox" id="dns_domain_enable" value="yes" <?=$chk;?> onClick="dns_domain_change()"> </td> <td> - Provide a default domain name to clients<br> + <?=gettext("Provide a default domain name to clients"); ?><br> </td> </tr> </table> @@ -441,7 +441,7 @@ function login_banner_change() { </td> </tr> <tr> - <td width="22%" valign="top" class="vncell">DNS Servers</td> + <td width="22%" valign="top" class="vncell"><?=gettext("DNS Servers"); ?></td> <td width="78%" class="vtable"> <table border="0" cellspacing="2" cellpadding="0"> <tr> @@ -450,32 +450,32 @@ function login_banner_change() { <input name="dns_server_enable" type="checkbox" id="dns_server_enable" value="yes" <?=$chk;?> onClick="dns_server_change()"> </td> <td> - Provide a DNS server list to clients<br> + <?=gettext("Provide a DNS server list to clients"); ?><br> </td> </tr> </table> <table border="0" cellspacing="2" cellpadding="0"> <tr> <td> - Server #1: + <?=gettext("Server"); ?> #1: <input name="dns_server1" type="text" class="formfld unknown" id="dns_server1" size="20" value="<?=$pconfig['dns_server1'];?>"> </td> </tr> <tr> <td> - Server #2: + <?=gettext("Server"); ?> #2: <input name="dns_server2" type="text" class="formfld unknown" id="dns_server2" size="20" value="<?=$pconfig['dns_server2'];?>"> </td> </tr> <tr> <td> - Server #3: + <?=gettext("Server"); ?> #3: <input name="dns_server3" type="text" class="formfld unknown" id="dns_server3" size="20" value="<?=$pconfig['dns_server3'];?>"> </td> </tr> <tr> <td> - Server #4: + <?=gettext("Server"); ?> #4: <input name="dns_server4" type="text" class="formfld unknown" id="dns_server4" size="20" value="<?=$pconfig['dns_server4'];?>"> </td> </tr> @@ -483,7 +483,7 @@ function login_banner_change() { </td> </tr> <tr> - <td width="22%" valign="top" class="vncell">WINS Servers</td> + <td width="22%" valign="top" class="vncell"><?=gettext("WINS Servers"); ?></td> <td width="78%" class="vtable"> <table border="0" cellspacing="2" cellpadding="0"> <tr> @@ -492,20 +492,20 @@ function login_banner_change() { <input name="wins_server_enable" type="checkbox" id="wins_server_enable" value="yes" <?=$chk;?> onClick="wins_server_change()"> </td> <td> - Provide a WINS server list to clients<br> + <?=gettext("Provide a WINS server list to clients"); ?><br> </td> </tr> </table> <table border="0" cellspacing="2" cellpadding="0"> <tr> <td> - Server #1: + <?=gettext("Server"); ?> #1: <input name="wins_server1" type="text" class="formfld unknown" id="wins_server1" size="20" value="<?=$pconfig['wins_server1'];?>"> </td> </tr> <tr> <td> - Server #2: + <?=gettext("Server"); ?> #2: <input name="wins_server2" type="text" class="formfld unknown" id="wins_server2" size="20" value="<?=$pconfig['wins_server2'];?>"> </td> </tr> @@ -513,7 +513,7 @@ function login_banner_change() { </td> </tr> <tr> - <td width="22%" valign="top" class="vncell">Phase2 PFS Group</td> + <td width="22%" valign="top" class="vncell"><?=gettext("Phase2 PFS Group"); ?></td> <td width="78%" class="vtable"> <table border="0" cellspacing="2" cellpadding="0"> <tr> @@ -522,14 +522,14 @@ function login_banner_change() { <input name="pfs_group_enable" type="checkbox" id="pfs_group_enable" value="yes" <?=$chk;?> onClick="pfs_group_change()"> </td> <td> - Provide the Phase2 PFS group to clients ( overrides all mobile phase2 settings )<br> + <?=gettext("Provide the Phase2 PFS group to clients ( overrides all mobile phase2 settings )"); ?><br> </td> </tr> </table> <table border="0" cellspacing="2" cellpadding="0"> <tr> <td> - Group: + <?=gettext("Group"); ?>: <select name="pfs_group" class="formselect" id="pfs_group"> <?php foreach ($p2_pfskeygroups as $keygroup => $keygroupname): ?> <option value="<?=$keygroup;?>" <?php if ($pconfig['pfs_group'] == $keygroup) echo "selected"; ?>> @@ -543,7 +543,7 @@ function login_banner_change() { </td> </tr> <tr> - <td width="22%" valign="top" class="vncell">Login Banner</td> + <td width="22%" valign="top" class="vncell"><?=gettext("Login Banner"); ?></td> <td width="78%" class="vtable"> <table border="0" cellspacing="2" cellpadding="0"> <tr> @@ -552,7 +552,7 @@ function login_banner_change() { <input name="login_banner_enable" type="checkbox" id="login_banner_enable" value="yes" <?=$chk;?> onClick="login_banner_change()"> </td> <td> - Provide a login banner to clients<br> + <?=gettext("Provide a login banner to clients"); ?><br> </td> </tr> </table> @@ -569,7 +569,7 @@ function login_banner_change() { <tr> <td width="22%" valign="top"> </td> <td width="78%"> - <input name="submit" type="submit" class="formbtn" value="Save"> + <input name="submit" type="submit" class="formbtn" value="<?=gettext("Save"); ?>"> </td> </tr> </table> diff --git a/usr/local/www/vpn_ipsec_phase1.php b/usr/local/www/vpn_ipsec_phase1.php index 71ea6d8..0b28521 100644 --- a/usr/local/www/vpn_ipsec_phase1.php +++ b/usr/local/www/vpn_ipsec_phase1.php @@ -139,23 +139,23 @@ if ($_POST) { // Only require PSK here for normal PSK tunnels (not mobile) or xauth. if ((($method == "pre_shared_key") && (!$pconfig['mobile']))||($method == "xauth_psk_server")) { $reqdfields = explode(" ", "pskey"); - $reqdfieldsn = explode(",", "Pre-Shared Key"); + $reqdfieldsn = array(gettext("Pre-Shared Key")); } else { $reqdfields = explode(" ", "certref"); - $reqdfieldsn = explode(",", "My Certificate"); + $reqdfieldsn = array(gettext("My Certificate")); } if (!$pconfig['mobile']) { $reqdfields[] = "remotegw"; - $reqdfieldsn[] = "Remote gateway"; + $reqdfieldsn[] = gettext("Remote gateway"); } do_input_validation($pconfig, $reqdfields, $reqdfieldsn, &$input_errors); if (($pconfig['lifetime'] && !is_numeric($pconfig['lifetime']))) - $input_errors[] = "The P1 lifetime must be an integer."; + $input_errors[] = gettext("The P1 lifetime must be an integer."); if (($pconfig['remotegw'] && !is_ipaddr($pconfig['remotegw']) && !is_domain($pconfig['remotegw']))) - $input_errors[] = "A valid remote gateway address or host name must be specified."; + $input_errors[] = gettext("A valid remote gateway address or host name must be specified."); if (($pconfig['remotegw'] && is_ipaddr($pconfig['remotegw']) && !isset($pconfig['disabled']) )) { $t = 0; @@ -163,7 +163,7 @@ if ($_POST) { if ($p1index <> $t) { $tremotegw = $pconfig['remotegw']; if (($ph1tmp['remote-gateway'] == $tremotegw) && !isset($ph1tmp['disabled'])) { - $input_errors[] = "The remote gateway \"$tremotegw\" is already used by phase1 \"${ph1tmp['descr']}\"."; + $input_errors[] = sprintf(gettext("The remote gateway \"%s\" is already used by phase1 \"${ph1tmp['descr']}\"."), $tremotegw); } } $t++; @@ -191,24 +191,24 @@ if ($_POST) { $input_errors[] = gettext("Please enter a dynamic domain name for 'My Identifier'"); if ((($pconfig['myid_type'] == "address") && !is_ipaddr($pconfig['myid_data']))) - $input_errors[] = "A valid IP address for 'My identifier' must be specified."; + $input_errors[] = gettext("A valid IP address for 'My identifier' must be specified."); if ((($pconfig['myid_type'] == "fqdn") && !is_domain($pconfig['myid_data']))) - $input_errors[] = "A valid domain name for 'My identifier' must be specified."; + $input_errors[] = gettext("A valid domain name for 'My identifier' must be specified."); if ($pconfig['myid_type'] == "fqdn") if (is_domain($pconfig['myid_data']) == false) - $input_errors[] = "A valid FQDN for 'My identifier' must be specified."; + $input_errors[] = gettext("A valid FQDN for 'My identifier' must be specified."); if ($pconfig['myid_type'] == "user_fqdn") { $user_fqdn = explode("@",$pconfig['myid_data']); if (is_domain($user_fqdn[1]) == false) - $input_errors[] = "A valid User FQDN in the form of user@my.domain.com for 'My identifier' must be specified."; + $input_errors[] = gettext("A valid User FQDN in the form of user@my.domain.com for 'My identifier' must be specified."); } if ($pconfig['myid_type'] == "dyn_dns") if (is_domain($pconfig['myid_data']) == false) - $input_errors[] = "A valid Dynamic DNS address for 'My identifier' must be specified."; + $input_errors[] = gettext("A valid Dynamic DNS address for 'My identifier' must be specified."); /* Peer identity */ @@ -230,28 +230,28 @@ if ($_POST) { $input_errors[] = gettext("Please enter a user and fully qualified domain name for 'Peer Identifier'"); if ((($pconfig['peerid_type'] == "address") && !is_ipaddr($pconfig['peerid_data']))) - $input_errors[] = "A valid IP address for 'Peer identifier' must be specified."; + $input_errors[] = gettext("A valid IP address for 'Peer identifier' must be specified."); if ((($pconfig['peerid_type'] == "fqdn") && !is_domain($pconfig['peerid_data']))) - $input_errors[] = "A valid domain name for 'Peer identifier' must be specified."; + $input_errors[] = gettext("A valid domain name for 'Peer identifier' must be specified."); if ($pconfig['peerid_type'] == "fqdn") if (is_domain($pconfig['peerid_data']) == false) - $input_errors[] = "A valid FQDN for 'Peer identifier' must be specified."; + $input_errors[] = gettext("A valid FQDN for 'Peer identifier' must be specified."); if ($pconfig['peerid_type'] == "user_fqdn") { $user_fqdn = explode("@",$pconfig['peerid_data']); if (is_domain($user_fqdn[1]) == false) - $input_errors[] = "A valid User FQDN in the form of user@my.domain.com for 'Peer identifier' must be specified."; + $input_errors[] = gettext("A valid User FQDN in the form of user@my.domain.com for 'Peer identifier' must be specified."); } } if ($pconfig['dpd_enable']) { if (!is_numeric($pconfig['dpd_delay'])) - $input_errors[] = "A numeric value must be specified for DPD delay."; + $input_errors[] = gettext("A numeric value must be specified for DPD delay."); if (!is_numeric($pconfig['dpd_maxfail'])) - $input_errors[] = "A numeric value must be specified for DPD retries."; + $input_errors[] = gettext("A numeric value must be specified for DPD retries."); } /* build our encryption algorithms array */ @@ -330,9 +330,9 @@ if ($_POST) { } if ($pconfig['mobile']) - $pgtitle = array("VPN","IPsec","Edit Phase 1", "Mobile Client"); + $pgtitle = array(gettext("VPN"),gettext("IPsec"),gettext("Edit Phase 1"), gettext("Mobile Client")); else - $pgtitle = array("VPN","IPsec","Edit Phase 1"); + $pgtitle = array(gettext("VPN"),gettext("IPsec"),gettext("Edit Phase 1")); $statusurl = "diag_ipsec.php"; $logurl = "diag_logs_ipsec.php"; @@ -457,9 +457,9 @@ function dpdchkbox_change() { <td id="tabnav"> <?php $tab_array = array(); - $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[0] = array(gettext("Tunnels"), true, "vpn_ipsec.php"); + $tab_array[1] = array(gettext("Mobile clients"), false, "vpn_ipsec_mobile.php"); + $tab_array[2] = array(gettext("Pre-shared keys"), false, "vpn_ipsec_keys.php"); display_top_tabs($tab_array); ?> </td> @@ -469,21 +469,21 @@ function dpdchkbox_change() { <div class="tabcont"> <table width="100%" border="0" cellpadding="6" cellspacing="0"> <tr> - <td colspan="2" valign="top" class="listtopic">General information</td> + <td colspan="2" valign="top" class="listtopic"><?=gettext("General information"); ?></td> </tr> <tr> - <td width="22%" valign="top" class="vncellreq">Disabled</td> + <td width="22%" valign="top" class="vncellreq"><?=gettext("Disabled"); ?></td> <td width="78%" class="vtable"> <input name="disabled" type="checkbox" id="disabled" value="yes" <?php if ($pconfig['disabled']) echo "checked"; ?>> - <strong>Disable this phase1 entry</strong><br> + <strong><?=gettext("Disable this phase1 entry"); ?></strong><br> <span class="vexpl"> - Set this option to disable this phase1 without - removing it from the list. + <?=gettext("Set this option to disable this phase1 without " . + "removing it from the list"); ?>. </span> </td> </tr> <tr> - <td width="22%" valign="top" class="vncellreq">Interface</td> + <td width="22%" valign="top" class="vncellreq"><?=gettext("Interface"); ?></td> <td width="78%" class="vtable"> <select name="interface" class="formselect"> <?php @@ -499,31 +499,31 @@ function dpdchkbox_change() { <?php endforeach; ?> </select> <br> - <span class="vexpl">Select the interface for the local endpoint of this phase1 entry.</span> + <span class="vexpl"><?=gettext("Select the interface for the local endpoint of this phase1 entry"); ?>.</span> </td> </tr> <?php if (!$pconfig['mobile']): ?> <tr> - <td width="22%" valign="top" class="vncellreq">Remote gateway</td> + <td width="22%" valign="top" class="vncellreq"><?=gettext("Remote gateway"); ?></td> <td width="78%" class="vtable"> <?=$mandfldhtml;?><input name="remotegw" type="text" class="formfld unknown" id="remotegw" size="20" value="<?=$pconfig['remotegw'];?>"> <br> - Enter the public IP address or host name of the remote gateway + <?=gettext("Enter the public IP address or host name of the remote gateway"); ?> </td> </tr> <?php endif; ?> <tr> - <td width="22%" valign="top" class="vncell">Description</td> + <td width="22%" valign="top" class="vncell"><?=gettext("Description"); ?></td> <td width="78%" class="vtable"> <input name="descr" type="text" class="formfld unknown" id="descr" size="40" value="<?=htmlspecialchars($pconfig['descr']);?>"> <br> <span class="vexpl"> - You may enter a description here - for your reference (not parsed). + <?=gettext("You may enter a description here " . + "for your reference (not parsed)"); ?>. </span> </td> </tr> @@ -532,11 +532,11 @@ function dpdchkbox_change() { </tr> <tr> <td colspan="2" valign="top" class="listtopic"> - Phase 1 proposal (Authentication) + <?=gettext("Phase 1 proposal (Authentication)"); ?> </td> </tr> <tr> - <td width="22%" valign="top" class="vncellreq">Authentication method</td> + <td width="22%" valign="top" class="vncellreq"><?=gettext("Authentication method"); ?></td> <td width="78%" class="vtable"> <select name="authentication_method" class="formselect" onChange="methodsel_change()"> <?php @@ -551,12 +551,12 @@ function dpdchkbox_change() { </select> <br> <span class="vexpl"> - Must match the setting chosen on the remote side. + <?=gettext("Must match the setting chosen on the remote side"); ?>. </span> </td> </tr> <tr> - <td width="22%" valign="top" class="vncellreq">Negotiation mode</td> + <td width="22%" valign="top" class="vncellreq"><?=gettext("Negotiation mode"); ?></td> <td width="78%" class="vtable"> <select name="mode" class="formselect"> <?php @@ -567,11 +567,11 @@ function dpdchkbox_change() { <?=htmlspecialchars($mode);?> </option> <?php endforeach; ?> - </select> <br> <span class="vexpl">Aggressive is more flexible, but less secure.</span> + </select> <br> <span class="vexpl"><?=gettext("Aggressive is more flexible, but less secure"); ?>.</span> </td> </tr> <tr> - <td width="22%" valign="top" class="vncellreq">My identifier</td> + <td width="22%" valign="top" class="vncellreq"><?=gettext("My identifier"); ?></td> <td width="78%" class="vtable"> <select name="myid_type" class="formselect" onChange="myidsel_change()"> <?php foreach ($my_identifier_list as $id_type => $id_params): ?> @@ -584,7 +584,7 @@ function dpdchkbox_change() { </td> </tr> <tr id="opt_peerid"> - <td width="22%" valign="top" class="vncellreq">Peer identifier</td> + <td width="22%" valign="top" class="vncellreq"><?=gettext("Peer identifier"); ?></td> <td width="78%" class="vtable"> <select name="peerid_type" class="formselect" onChange="peeridsel_change()"> <?php @@ -599,23 +599,23 @@ function dpdchkbox_change() { </select> <input name="peerid_data" type="text" class="formfld unknown" id="peerid_data" size="30" value="<?=$pconfig['peerid_data'];?>"> <?php if ($pconfig['mobile']) { ?> - <br/><br/>NOTE: This is known as the "group" setting on some VPN client implementations. + <br/><br/><?=gettext("NOTE: This is known as the \"group\" setting on some VPN client implementations"); ?>. <?php } ?> </td> </tr> <tr id="opt_psk"> - <td width="22%" valign="top" class="vncellreq">Pre-Shared Key</td> + <td width="22%" valign="top" class="vncellreq"><?=gettext("Pre-Shared Key"); ?></td> <td width="78%" class="vtable"> <?=$mandfldhtml;?> <input name="pskey" type="text" class="formfld unknown" id="pskey" size="40" value="<?=htmlspecialchars($pconfig['pskey']);?>"> <span class="vexpl"> <br> - Input your pre-shared key string. + <?=gettext("Input your pre-shared key string"); ?>. </span> </td> </tr> <tr> - <td width="22%" valign="top" class="vncellreq">Encryption algorithm</td> + <td width="22%" valign="top" class="vncellreq"><?=gettext("Encryption algorithm"); ?></td> <td width="78%" class="vtable"> <select name="ealgo" class="formselect" onChange="ealgosel_change()"> <?php @@ -634,7 +634,7 @@ function dpdchkbox_change() { </td> </tr> <tr> - <td width="22%" valign="top" class="vncellreq">Hash algorithm</td> + <td width="22%" valign="top" class="vncellreq"><?=gettext("Hash algorithm"); ?></td> <td width="78%" class="vtable"> <select name="halgo" class="formselect"> <?php foreach ($p1_halgos as $algo => $algoname): ?> @@ -645,12 +645,12 @@ function dpdchkbox_change() { </select> <br> <span class="vexpl"> - Must match the setting chosen on the remote side. + <?=gettext("Must match the setting chosen on the remote side"); ?>. </span> </td> </tr> <tr> - <td width="22%" valign="top" class="vncellreq">DH key group</td> + <td width="22%" valign="top" class="vncellreq"><?=gettext("DH key group"); ?></td> <td width="78%" class="vtable"> <select name="dhgroup" class="formselect"> <?php $keygroups = explode(" ", "1 2 5"); foreach ($keygroups as $keygroup): ?> @@ -661,21 +661,21 @@ function dpdchkbox_change() { </select> <br> <span class="vexpl"> - <em>1 = 768 bit, 2 = 1024 bit, 5 = 1536 bit</em> + <em><?=gettext("1 = 768 bit, 2 = 1024 bit, 5 = 1536 bit"); ?></em> <br> - Must match the setting chosen on the remote side. + <?=gettext("Must match the setting chosen on the remote side"); ?>. </span> </td> </tr> <tr> - <td width="22%" valign="top" class="vncell">Lifetime</td> + <td width="22%" valign="top" class="vncell"><?=gettext("Lifetime"); ?></td> <td width="78%" class="vtable"> <input name="lifetime" type="text" class="formfld unknown" id="lifetime" size="20" value="<?=$pconfig['lifetime'];?>"> - seconds + <?=gettext("seconds"); ?> </td> </tr> <tr id="opt_cert"> - <td width="22%" valign="top" class="vncellreq">My Certificate</td> + <td width="22%" valign="top" class="vncellreq"><?=gettext("My Certificate"); ?></td> <td width="78%" class="vtable"> <select name='certref' class="formselect"> <?php @@ -689,7 +689,7 @@ function dpdchkbox_change() { </select> <br> <span class="vexpl"> - Select a certificate previously configured in the Certificate Manager. + <?=gettext("Select a certificate previously configured in the Certificate Manager"); ?>. </span> </td> </tr> @@ -697,40 +697,40 @@ function dpdchkbox_change() { <td colspan="2" class="list" height="12"></td> </tr> <tr> - <td colspan="2" valign="top" class="listtopic">Advanced Options</td> + <td colspan="2" valign="top" class="listtopic"><?=gettext("Advanced Options"); ?></td> </tr> <tr> - <td width="22%" valign="top" class="vncell">NAT Traversal</td> + <td width="22%" valign="top" class="vncell"><?=gettext("NAT Traversal"); ?></td> <td width="78%" class="vtable"> <select name="nat_traversal" class="formselect"> - <option value="off" <?php if ($pconfig['nat_traversal'] == "off") echo "selected"; ?>>Disable</option> - <option value="on" <?php if ($pconfig['nat_traversal'] == "on") echo "selected"; ?>>Enable</option> - <option value="force" <?php if ($pconfig['nat_traversal'] == "force") echo "selected"; ?>>Force</option> + <option value="off" <?php if ($pconfig['nat_traversal'] == "off") echo "selected"; ?>><?=gettext("Disable"); ?></option> + <option value="on" <?php if ($pconfig['nat_traversal'] == "on") echo "selected"; ?>><?=gettext("Enable"); ?></option> + <option value="force" <?php if ($pconfig['nat_traversal'] == "force") echo "selected"; ?>><?=gettext("Force"); ?></option> </select> <br/> <span class="vexpl"> - Set this option to enable the use of NAT-T (i.e. the encapsulation of ESP in UDP packets) if needed, - which can help with clients that are behind restrictive firewalls. + <?=gettext("Set this option to enable the use of NAT-T (i.e. the encapsulation of ESP in UDP packets) if needed, " . + "which can help with clients that are behind restrictive firewalls"); ?>. </span> </td> </tr> <tr> - <td width="22%" valign="top" class="vncell">Dead Peer Detection</td> + <td width="22%" valign="top" class="vncell"><?=gettext("Dead Peer Detection"); ?></td> <td width="78%" class="vtable"> <input name="dpd_enable" type="checkbox" id="dpd_enable" value="yes" <?php if (isset($pconfig['dpd_enable'])) echo "checked"; ?> onClick="dpdchkbox_change()"> - Enable DPD<br> + <?=gettext("Enable DPD"); ?><br> <div id="opt_dpd"> <br> <input name="dpd_delay" type="text" class="formfld unknown" id="dpd_delay" size="5" value="<?=$pconfig['dpd_delay'];?>"> - seconds<br> + <?=gettext("seconds"); ?><br> <span class="vexpl"> - Delay between requesting peer acknowledgement. + <?=gettext("Delay between requesting peer acknowledgement"); ?>. </span><br> <br> <input name="dpd_maxfail" type="text" class="formfld unknown" id="dpd_maxfail" size="5" value="<?=$pconfig['dpd_maxfail'];?>"> - retries<br> + <?=gettext("retries"); ?><br> <span class="vexpl"> - Number of consecutive failures allowed before disconnect. + <?=gettext("Number of consecutive failures allowed before disconnect"); ?>. </span> <br> </div> @@ -746,7 +746,7 @@ function dpdchkbox_change() { <input name="mobile" type="hidden" value="true"> <?php endif; ?> <input name="ikeid" type="hidden" value="<?=$pconfig['ikeid'];?>"> - <input name="Submit" type="submit" class="formbtn" value="Save"> + <input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save"); ?>"> </td> </tr> </table> diff --git a/usr/local/www/vpn_ipsec_phase2.php b/usr/local/www/vpn_ipsec_phase2.php index e00535e..bc124e1 100644 --- a/usr/local/www/vpn_ipsec_phase2.php +++ b/usr/local/www/vpn_ipsec_phase2.php @@ -106,14 +106,14 @@ if ($_POST) { $pconfig = $_POST; if (!isset( $_POST['ikeid'])) - $input_errors[] = "A valid ikeid must be specified."; + $input_errors[] = gettext("A valid ikeid must be specified."); /* input validation */ $reqdfields = explode(" ", "localid_type halgos"); - $reqdfieldsn = explode(",", "Local network type,P2 Hash Algorithms"); + $reqdfieldsn = array(gettext("Local network type"),gettext("P2 Hash Algorithms")); if (!isset($pconfig['mobile'])){ $reqdfields[] = "remoteid_type"; - $reqdfieldsn[] = "Remote network type"; + $reqdfieldsn[] = gettext("Remote network type"); } do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); @@ -123,20 +123,20 @@ if ($_POST) { switch ($pconfig['localid_type']) { case "network": if (($pconfig['localid_netbits'] != 0 && !$pconfig['localid_netbits']) || !is_numeric($pconfig['localid_netbits'])) - $input_errors[] = "A valid local network bit count must be specified."; + $input_errors[] = gettext("A valid local network bit count must be specified."); case "address": if (!$pconfig['localid_address'] || !is_ipaddr($pconfig['localid_address'])) - $input_errors[] = "A valid local network IP address must be specified."; + $input_errors[] = gettext("A valid local network IP address must be specified."); break; } switch ($pconfig['remoteid_type']) { case "network": if (($pconfig['remoteid_netbits'] != 0 && !$pconfig['remoteid_netbits']) || !is_numeric($pconfig['remoteid_netbits'])) - $input_errors[] = "A valid remote network bit count must be specified."; + $input_errors[] = gettext("A valid remote network bit count must be specified."); case "address": if (!$pconfig['remoteid_address'] || !is_ipaddr($pconfig['remoteid_address'])) - $input_errors[] = "A valid remote network IP address must be specified."; + $input_errors[] = gettext("A valid remote network IP address must be specified."); break; } } @@ -146,10 +146,10 @@ if ($_POST) { $ealgos = pconfig_to_ealgos($pconfig); if (!count($ealgos)) { - $input_errors[] = "At least one encryption algorithm must be selected."; + $input_errors[] = gettext("At least one encryption algorithm must be selected."); } if (($_POST['lifetime'] && !is_numeric($_POST['lifetime']))) { - $input_errors[] = "The P2 lifetime must be an integer."; + $input_errors[] = gettext("The P2 lifetime must be an integer."); } if (!$input_errors) { @@ -196,9 +196,9 @@ if ($_POST) { } if ($pconfig['mobile']) - $pgtitle = array("VPN","IPsec","Edit Phase 2", "Mobile Client"); + $pgtitle = array(gettext("VPN"),gettext("IPsec"),gettext("Edit Phase 2"), gettext("Mobile Client")); else - $pgtitle = array("VPN","IPsec","Edit Phase 2"); + $pgtitle = array(gettext("VPN"),gettext("IPsec"),gettext("Edit Phase 2")); $statusurl = "diag_ipsec.php"; $logurl = "diag_logs_ipsec.php"; @@ -314,9 +314,9 @@ function change_protocol() { <td id="tabnav"> <?php $tab_array = array(); - $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[0] = array(gettext("Tunnels"), true, "vpn_ipsec.php"); + $tab_array[1] = array(gettext("Mobile clients"), false, "vpn_ipsec_mobile.php"); + $tab_array[2] = array(gettext("Pre-shared keys"), false, "vpn_ipsec_keys.php"); display_top_tabs($tab_array); ?> </td> @@ -326,18 +326,18 @@ function change_protocol() { <div class="tabcont"> <table width="100%" border="0" cellpadding="6" cellspacing="0"> <tr> - <td width="22%" valign="top" class="vncellreq">Disabled</td> + <td width="22%" valign="top" class="vncellreq"><?=gettext("Disabled"); ?></td> <td width="78%" class="vtable"> <input name="disabled" type="checkbox" id="disabled" value="yes" <?php if ($pconfig['disabled']) echo "checked"; ?>> - <strong>Disable this phase2 entry</strong> + <strong><?=gettext("Disable this phase2 entry"); ?></strong> <br> - <span class="vexpl">Set this option to disable this phase2 entry without - removing it from the list. + <span class="vexpl"><?=gettext("Set this option to disable this phase2 entry without " . + "removing it from the list"); ?>. </span> </td> </tr> <tr> - <td width="22%" valign="top" class="vncellreq">Mode</td> + <td width="22%" valign="top" class="vncellreq"><?=gettext("Mode"); ?></td> <td width="78%" class="vtable"> <select name="mode" class="formselect" onChange="change_mode()"> <?php @@ -352,18 +352,18 @@ function change_protocol() { </td> </tr> <tr id="opt_localid"> - <td width="22%" valign="top" class="vncellreq">Local Network</td> + <td width="22%" valign="top" class="vncellreq"><?=gettext("Local Network"); ?></td> <td width="78%" class="vtable"> <table border="0" cellspacing="0" cellpadding="0"> <tr> - <td>Type: </td> + <td><?=gettext("Type"); ?>: </td> <td></td> <td> <select name="localid_type" class="formselect" onChange="typesel_change_local()"> - <option value="address" <?php if ($pconfig['localid_type'] == "address") echo "selected";?>>Address</option> - <option value="network" <?php if ($pconfig['localid_type'] == "network") echo "selected";?>>Network</option> - <option value="lan" <?php if ($pconfig['localid_type'] == "lan" ) echo "selected";?>>LAN subnet</option> - <option value="none" <?php if ($pconfig['localid_type'] == "none" ) echo "selected";?>>None</option> + <option value="address" <?php if ($pconfig['localid_type'] == "address") echo "selected";?>><?=gettext("Address"); ?></option> + <option value="network" <?php if ($pconfig['localid_type'] == "network") echo "selected";?>><?=gettext("Network"); ?></option> + <option value="lan" <?php if ($pconfig['localid_type'] == "lan" ) echo "selected";?>><?=gettext("LAN subnet"); ?></option> + <option value="none" <?php if ($pconfig['localid_type'] == "none" ) echo "selected";?>><?=gettext("None"); ?></option> </select> </td> </tr> @@ -389,21 +389,21 @@ function change_protocol() { <?php if (!isset($pconfig['mobile'])): ?> <tr id="opt_remoteid"> - <td width="22%" valign="top" class="vncellreq">Remote Network</td> + <td width="22%" valign="top" class="vncellreq"><?=gettext("Remote Network"); ?></td> <td width="78%" class="vtable"> <table border="0" cellspacing="0" cellpadding="0"> <tr> - <td>Type: </td> + <td><?=gettext("Type"); ?>: </td> <td></td> <td> <select name="remoteid_type" class="formselect" onChange="typesel_change_remote()"> - <option value="address" <?php if ($pconfig['remoteid_type'] == "address") echo "selected"; ?>>Address</option> - <option value="network" <?php if ($pconfig['remoteid_type'] == "network") echo "selected"; ?>>Network</option> + <option value="address" <?php if ($pconfig['remoteid_type'] == "address") echo "selected"; ?>><?=gettext("Address"); ?></option> + <option value="network" <?php if ($pconfig['remoteid_type'] == "network") echo "selected"; ?>><?=gettext("Network"); ?></option> </select> </td> </tr> <tr> - <td>Address: </td> + <td><?=gettext("Address"); ?>: </td> <td><?=$mandfldhtmlspc;?></td> <td> <input name="remoteid_address" type="text" class="formfld unknown" id="remoteid_address" size="20" value="<?=$pconfig['remoteid_address'];?>"> @@ -425,13 +425,13 @@ function change_protocol() { <?php endif; ?> <tr> - <td width="22%" valign="top" class="vncell">Description</td> + <td width="22%" valign="top" class="vncell"><?=gettext("Description"); ?></td> <td width="78%" class="vtable"> <input name="descr" type="text" class="formfld unknown" id="descr" size="40" value="<?=htmlspecialchars($pconfig['descr']);?>"> <br> <span class="vexpl"> - You may enter a description here - for your reference (not parsed). + <?=gettext("You may enter a description here " . + "for your reference (not parsed)"); ?>. </span> </td> </tr> @@ -440,11 +440,11 @@ function change_protocol() { </tr> <tr> <td colspan="2" valign="top" class="listtopic"> - Phase 2 proposal (SA/Key Exchange) + <?=gettext("Phase 2 proposal (SA/Key Exchange)"); ?> </td> </tr> <tr> - <td width="22%" valign="top" class="vncellreq">Protocol</td> + <td width="22%" valign="top" class="vncellreq"><?=gettext("Protocol"); ?></td> <td width="78%" class="vtable"> <select name="proto" class="formselect" onChange="change_protocol()"> <?php foreach ($p2_protos as $proto => $protoname): ?> @@ -455,12 +455,12 @@ function change_protocol() { </select> <br> <span class="vexpl"> - ESP is encryption, AH is authentication only + <?=gettext("ESP is encryption, AH is authentication only"); ?> </span> </td> </tr> <tr id="opt_enc"> - <td width="22%" valign="top" class="vncellreq">Encryption algorithms</td> + <td width="22%" valign="top" class="vncellreq"><?=gettext("Encryption algorithms"); ?></td> <td width="78%" class="vtable"> <table border="0" cellspacing="0" cellpadding="0"> <?php @@ -480,7 +480,7 @@ function change_protocol() { <?php if(is_array($algodata['keysel'])): ?> <select name="keylen_<?=$algo;?>" class="formselect"> - <option value="auto">auto</option> + <option value="auto"><?=gettext("auto"); ?></option> <?php $key_hi = $algodata['keysel']['hi']; $key_lo = $algodata['keysel']['lo']; @@ -491,7 +491,7 @@ function change_protocol() { if ($keylen == $pconfig["keylen_".$algo]) $selected = " selected"; ?> - <option value="<?=$keylen;?>"<?=$selected;?>><?=$keylen;?> bits</option> + <option value="<?=$keylen;?>"<?=$selected;?>><?=$keylen;?> <?=gettext("bits"); ?></option> <?php endfor; ?> </select> <?php endif; ?> @@ -502,13 +502,13 @@ function change_protocol() { </table> <br> - Hint: use 3DES for best compatibility or if you have a hardware - crypto accelerator card. Blowfish is usually the fastest in - software encryption. + <?=gettext("Hint: use 3DES for best compatibility or if you have a hardware " . + "crypto accelerator card. Blowfish is usually the fastest in " . + "software encryption"); ?>. </td> </tr> <tr> - <td width="22%" valign="top" class="vncellreq">Hash algorithms</td> + <td width="22%" valign="top" class="vncellreq"><?=gettext("Hash algorithms"); ?></td> <td width="78%" class="vtable"> <?php foreach ($p2_halgos as $algo => $algoname): ?> <input type="checkbox" name="halgos[]" value="<?=$algo;?>" <?php if (in_array($algo, $pconfig['halgos'])) echo "checked"; ?>> @@ -518,7 +518,7 @@ function change_protocol() { </td> </tr> <tr> - <td width="22%" valign="top" class="vncellreq">PFS key group</td> + <td width="22%" valign="top" class="vncellreq"><?=gettext("PFS key group"); ?></td> <td width="78%" class="vtable"> <?php if (!isset($pconfig['mobile']) || !isset($a_client['pfs_group'])): ?> <select name="pfsgroup" class="formselect"> @@ -531,7 +531,7 @@ function change_protocol() { <br> <span class="vexpl"> <em> - 1 = 768 bit, 2 = 1024 bit, 5 = 1536 bit + <?=gettext("1 = 768 bit, 2 = 1024 bit, 5 = 1536 bit"); ?> </em> </span> @@ -542,28 +542,28 @@ function change_protocol() { </select> <input name="pfsgroup" type="hidden" value="<?=$pconfig['pfsgroup'];?>"> <br> - <span class="vexpl"><em>Set globally in mobile client options</em></span> + <span class="vexpl"><em><?=gettext("Set globally in mobile client options"); ?></em></span> <?php endif; ?> </td> </tr> <tr> - <td width="22%" valign="top" class="vncell">Lifetime</td> + <td width="22%" valign="top" class="vncell"><?=gettext("Lifetime"); ?></td> <td width="78%" class="vtable"> <input name="lifetime" type="text" class="formfld unknown" id="lifetime" size="20" value="<?=$pconfig['lifetime'];?>"> - seconds + <?=gettext("seconds"); ?> </td> </tr> <tr> <td colspan="2" class="list" height="12"></td> </tr> <tr> - <td colspan="2" valign="top" class="listtopic">Advanced Options</td> + <td colspan="2" valign="top" class="listtopic"><?=gettext("Advanced Options"); ?></td> </tr> <tr> - <td width="22%" valign="top" class="vncell">Automatically ping host</td> + <td width="22%" valign="top" class="vncell"><?=gettext("Automatically ping host"); ?></td> <td width="78%" class="vtable"> <input name="pinghost" type="text" class="formfld unknown" id="pinghost" size="20" value="<?=$pconfig['pinghost'];?>"> - IP address + <?=gettext("IP address"); ?> </td> </tr> <tr> @@ -576,7 +576,7 @@ function change_protocol() { <input name="mobile" type="hidden" value="true"> <input name="remoteid_type" type="hidden" value="mobile"> <?php endif; ?> - <input name="Submit" type="submit" class="formbtn" value="Save"> + <input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save"); ?>"> <input name="ikeid" type="hidden" value="<?=$pconfig['ikeid'];?>"> </td> </tr> diff --git a/usr/local/www/vpn_l2tp.php b/usr/local/www/vpn_l2tp.php index 2b61209..29aa3b8 100644 --- a/usr/local/www/vpn_l2tp.php +++ b/usr/local/www/vpn_l2tp.php @@ -266,13 +266,13 @@ function enable_change(enable_over) { <td width="78%" class="vtable"> <input name="mode" type="radio" onclick="enable_change(false)" value="off" <?php if (($pconfig['mode'] != "server") && ($pconfig['mode'] != "redir")) echo "checked=\"checked\"";?> /> - Off</td> + <?=gettext("Off"); ?></td> </tr> <tr> <td width="22%" valign="top" class="vtable"> </td> <td width="78%" class="vtable"> <input type="radio" name="mode" value="server" onclick="enable_change(false)" <?php if ($pconfig['mode'] == "server") echo "checked=\"checked\""; ?> /> - Enable l2tp server</td> + <?=gettext("Enable l2tp server"); ?></td> </tr> <tr> @@ -308,7 +308,7 @@ function enable_change(enable_over) { </td> </tr> <tr> - <td width="22%" valign="top" class="vncellreq">Subnet netmask</td> + <td width="22%" valign="top" class="vncellreq"><?=gettext("Subnet netmask"); ?></td> <td width="78%" class="vtable"> <select id="l2tp_subnet" name="l2tp_subnet"> <?php @@ -321,11 +321,11 @@ function enable_change(enable_over) { } ?> </select> - <br>Hint: 24 is 255.255.255.0 + <br><?=gettext("Hint"); ?>: 24 <?=gettext("is"); ?> 255.255.255.0 </td> </tr> <tr> - <td width="22%" valign="top" class="vncellreq">Number of L2TP users</td> + <td width="22%" valign="top" class="vncellreq"><?=gettext("Number of L2TP users"); ?></td> <td width="78%" class="vtable"> <select id="n_l2tp_units" name="n_l2tp_units"> <?php @@ -338,7 +338,7 @@ function enable_change(enable_over) { } ?> </select> - <br>Hint: 10 is ten L2TP clients + <br><?=gettext("Hint"); ?>: 10 <?=gettext("is ten L2TP clients"); ?> </td> </tr> <tr> @@ -353,15 +353,15 @@ function enable_change(enable_over) { <td width="22%" valign="top" class="vncellreq"><?=gettext("Encyrption type");?></td> <td width="78%" class="vtable"> <?=$mandfldhtml;?><select name="paporchap" id="paporchap"> - <option value='chap'<?php if($pconfig['paporchap'] == "chap") echo " SELECTED"; ?>>CHAP</option> - <option value='pap'<?php if($pconfig['paporchap'] == "pap") echo " SELECTED"; ?>>PAP</option> + <option value='chap'<?php if($pconfig['paporchap'] == "chap") echo " SELECTED"; ?>><?=gettext("CHAP"); ?></option> + <option value='pap'<?php if($pconfig['paporchap'] == "pap") echo " SELECTED"; ?>><?=gettext("PAP"); ?></option> </select> <br /> <?=gettext("Specifies which protocol to use for authentication.");?><br /> </td> </tr> <tr> - <td width="22%" valign="top" class="vncell">RADIUS</td> + <td width="22%" valign="top" class="vncell"><?=gettext("RADIUS"); ?></td> <td width="78%" class="vtable"> <input name="radiusenable" type="checkbox" id="radiusenable" onclick="enable_change(false)" value="yes" <?php if ($pconfig['radiusenable']) echo "checked=\"checked\""; ?> /> <strong> <?=gettext("Use a RADIUS server for authentication");?><br /></strong> @@ -396,7 +396,7 @@ function enable_change(enable_over) { <tr> <td width="22%" valign="top"> </td> <td width="78%"> - <input id="submit" name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)" /> + <input id="submit" name="Submit" type="submit" class="formbtn" value="<?=gettext("Save"); ?>" onclick="enable_change(true)" /> </td> </tr> <tr> diff --git a/usr/local/www/vpn_l2tp_users.php b/usr/local/www/vpn_l2tp_users.php index 3cba0a2..4156583 100644 --- a/usr/local/www/vpn_l2tp_users.php +++ b/usr/local/www/vpn_l2tp_users.php @@ -83,7 +83,7 @@ include("head.inc"); <?php if (isset($config['l2tp']['radius']['enable'])) print_info_box(gettext("Warning: RADIUS is enabled. The local user database will not be used.")); ?> <?php if (file_exists($d_l2tpuserdirty_path)): ?><p> -<?php print_info_box_np(gettext("The l2tp user list has been modified.<br />You must apply the changes in order for them to take effect.<br /><b>Warning: this will terminate all current l2tp sessions!</b>"));?><br /> +<?php print_info_box_np(gettext("The l2tp user list has been modified") . ".<br />" . gettext("You must apply the changes in order for them to take effect") . ".<br /><b>" . gettext("Warning: this will terminate all current l2tp sessions!") . "</b>");?><br /> <?php endif; ?> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr><td class="tabnavtbl"> @@ -112,12 +112,12 @@ include("head.inc"); <?=htmlspecialchars($secretent['ip']);?> </td> <td class="list" nowrap> <a href="vpn_l2tp_users_edit.php?id=<?=$i;?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" title="edit user" width="17" height="17" border="0" alt="" /></a> - <a href="vpn_l2tp_users.php?act=del&id=<?=$i;?>" onclick="return confirm('<?=gettext("Do you really want to delete this user?");?>')"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" title="delete user" width="17" height="17" border="0" alt="" /></a></td> + <a href="vpn_l2tp_users.php?act=del&id=<?=$i;?>" onclick="return confirm('<?=gettext("Do you really want to delete this user?");?>')"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" title="<?=gettext("delete user"); ?>" width="17" height="17" border="0" alt="" /></a></td> </tr> <?php $i++; endforeach; ?> <tr> <td class="list" colspan="2"></td> - <td class="list"> <a href="vpn_l2tp_users_edit.php"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" title="add user" width="17" height="17" border="0" alt="" /></a></td> + <td class="list"> <a href="vpn_l2tp_users_edit.php"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" title="<?=gettext("add user"); ?>" width="17" height="17" border="0" alt="" /></a></td> </tr> </table> </div> diff --git a/usr/local/www/vpn_l2tp_users_edit.php b/usr/local/www/vpn_l2tp_users_edit.php index f88d821..31a33b7 100644 --- a/usr/local/www/vpn_l2tp_users_edit.php +++ b/usr/local/www/vpn_l2tp_users_edit.php @@ -75,10 +75,10 @@ if ($_POST) { /* input validation */ if (isset($id) && ($a_secret[$id])) { $reqdfields = explode(" ", "usernamefld"); - $reqdfieldsn = explode(",", "Username"); + $reqdfieldsn = array(gettext("Username")); } else { $reqdfields = explode(" ", "usernamefld passwordfld"); - $reqdfieldsn = explode(",", "Username,Password"); + $reqdfieldsn = array(gettext("Username"),gettext("Password")); } do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); |