summaryrefslogtreecommitdiffstats
path: root/usr/local
diff options
context:
space:
mode:
authorRafael Lucas <rafalucas.unicamp@gmail.com>2010-07-27 14:56:40 -0300
committerRafael Lucas <rafalucas.unicamp@gmail.com>2010-07-27 14:56:40 -0300
commitf96cc03432419b8974c5ad2652a0cfa817dc3de0 (patch)
tree278a4a4419aa4bf40ee2cfd7c328d43414e91175 /usr/local
parent891fba69e7a8a084c52c2353ac1a37e9ebd1d660 (diff)
parentada15acdddb88c1358ceddb00ed589a956c3be60 (diff)
downloadpfsense-f96cc03432419b8974c5ad2652a0cfa817dc3de0.zip
pfsense-f96cc03432419b8974c5ad2652a0cfa817dc3de0.tar.gz
Merge branch 'master' of git@rcs.pfsense.org:pfsense/pfsense-gettext
Diffstat (limited to 'usr/local')
-rwxr-xr-xusr/local/www/carp_status.php2
-rwxr-xr-xusr/local/www/diag_logs_relayd.php2
-rwxr-xr-xusr/local/www/diag_nanobsd.php6
-rwxr-xr-xusr/local/www/firewall_shaper.php10
-rwxr-xr-xusr/local/www/services_captiveportal_ip.php6
-rwxr-xr-xusr/local/www/services_captiveportal_ip_edit.php11
-rw-r--r--usr/local/www/services_rfc2136.php6
-rw-r--r--usr/local/www/services_rfc2136_edit.php2
-rwxr-xr-xusr/local/www/services_snmp.php2
-rwxr-xr-xusr/local/www/status_gateway_groups.php2
-rwxr-xr-xusr/local/www/status_gateways.php2
-rwxr-xr-xusr/local/www/status_lb_pool.php2
-rwxr-xr-xusr/local/www/status_lb_vs.php2
-rwxr-xr-xusr/local/www/status_rrd_graph.php157
-rw-r--r--usr/local/www/status_rrd_graph_img.php31
-rwxr-xr-xusr/local/www/status_rrd_graph_settings.php46
-rw-r--r--usr/local/www/status_upnp.php2
-rwxr-xr-xusr/local/www/system_gateway_groups.php2
-rwxr-xr-xusr/local/www/system_gateway_groups_edit.php2
-rwxr-xr-xusr/local/www/system_gateways.php2
-rwxr-xr-xusr/local/www/system_gateways_edit.php2
-rwxr-xr-xusr/local/www/themes/code-red/rrdcolors.inc.php1
-rw-r--r--usr/local/www/themes/metallic/rrdcolors.inc.php1
-rw-r--r--usr/local/www/themes/nervecenter/rrdcolors.inc.php1
-rw-r--r--usr/local/www/themes/pfsense-dropdown/rrdcolors.inc.php1
-rw-r--r--usr/local/www/themes/pfsense/rrdcolors.inc.php1
-rw-r--r--usr/local/www/themes/pfsense_ng/rrdcolors.inc.php1
-rw-r--r--usr/local/www/themes/the_wall/rrdcolors.inc.php1
-rwxr-xr-xusr/local/www/vpn_ipsec.php70
-rw-r--r--usr/local/www/vpn_ipsec_keys.php24
-rw-r--r--usr/local/www/vpn_ipsec_keys_edit.php22
-rwxr-xr-xusr/local/www/vpn_ipsec_mobile.php102
-rw-r--r--usr/local/www/vpn_ipsec_phase1.php136
-rw-r--r--usr/local/www/vpn_ipsec_phase2.php104
-rw-r--r--usr/local/www/vpn_l2tp.php20
-rw-r--r--usr/local/www/vpn_l2tp_users.php6
-rw-r--r--usr/local/www/vpn_l2tp_users_edit.php4
37 files changed, 460 insertions, 334 deletions
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/>&nbsp;
</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/>&nbsp;
</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">&nbsp;</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"); ?>, &quot;<?=gettext("public"); ?>&quot; <?=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}&amp;end={$end}&amp;database={$curdatabase}&amp;style={$curstyle}&amp;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}&amp;end={$end}&amp;database={$curdatabase}&amp;style={$curstyle}&amp;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}&amp;end={$end}&amp;database={$curdatabase}&amp;style={$curstyle}&amp;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">&nbsp;</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>
&nbsp;</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>
- &nbsp;<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>
+ &nbsp;<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">&nbsp;</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:&nbsp;&nbsp;
+ <?=gettext("Source"); ?>:&nbsp;&nbsp;
<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:&nbsp;&nbsp;
+ <?=gettext("Source"); ?>:&nbsp;&nbsp;
<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:&nbsp;
+ <?=gettext("Network"); ?>:&nbsp;
<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:&nbsp;
+ <?=gettext("Server"); ?> #1:&nbsp;
<input name="dns_server1" type="text" class="formfld unknown" id="dns_server1" size="20" value="<?=$pconfig['dns_server1'];?>">
</td>
</tr>
<tr>
<td>
- Server #2:&nbsp;
+ <?=gettext("Server"); ?> #2:&nbsp;
<input name="dns_server2" type="text" class="formfld unknown" id="dns_server2" size="20" value="<?=$pconfig['dns_server2'];?>">
</td>
</tr>
<tr>
<td>
- Server #3:&nbsp;
+ <?=gettext("Server"); ?> #3:&nbsp;
<input name="dns_server3" type="text" class="formfld unknown" id="dns_server3" size="20" value="<?=$pconfig['dns_server3'];?>">
</td>
</tr>
<tr>
<td>
- Server #4:&nbsp;
+ <?=gettext("Server"); ?> #4:&nbsp;
<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:&nbsp;
+ <?=gettext("Server"); ?> #1:&nbsp;
<input name="wins_server1" type="text" class="formfld unknown" id="wins_server1" size="20" value="<?=$pconfig['wins_server1'];?>">
</td>
</tr>
<tr>
<td>
- Server #2:&nbsp;
+ <?=gettext("Server"); ?> #2:&nbsp;
<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:&nbsp;&nbsp;
+ <?=gettext("Group"); ?>:&nbsp;&nbsp;
<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">&nbsp;</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:&nbsp;&nbsp;</td>
+ <td><?=gettext("Type"); ?>:&nbsp;&nbsp;</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:&nbsp;&nbsp;</td>
+ <td><?=gettext("Type"); ?>:&nbsp;&nbsp;</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:&nbsp;&nbsp;</td>
+ <td><?=gettext("Address"); ?>:&nbsp;&nbsp;</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'])): ?>
&nbsp;&nbsp;
<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">&nbsp;</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">&nbsp;</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']);?>&nbsp;
</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>
- &nbsp;<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>
+ &nbsp;<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);
OpenPOWER on IntegriCloud