diff options
-rw-r--r-- | src/usr/local/www/diag_arp.php | 8 | ||||
-rw-r--r-- | src/usr/local/www/diag_authentication.php | 4 | ||||
-rwxr-xr-x | src/usr/local/www/diag_command.php | 4 | ||||
-rw-r--r-- | src/usr/local/www/diag_gmirror.php | 2 | ||||
-rwxr-xr-x | src/usr/local/www/diag_packet_capture.php | 36 | ||||
-rw-r--r-- | src/usr/local/www/diag_sockets.php | 28 | ||||
-rw-r--r-- | src/usr/local/www/diag_tables.php | 4 |
7 files changed, 49 insertions, 37 deletions
diff --git a/src/usr/local/www/diag_arp.php b/src/usr/local/www/diag_arp.php index d99bca0..4108192 100644 --- a/src/usr/local/www/diag_arp.php +++ b/src/usr/local/www/diag_arp.php @@ -382,10 +382,10 @@ events.push(function() { <div class="infoblock blockopen"> <?php -print_info_box(gettext("Local IPv6 peers use ") . '<a href="diag_ndp.php">' . gettext("NDP") . '</a>' . gettext(" instead of ARP.") . '<br />' . - '<br />' . gettext("Permanent ARP entries are shown for local interfaces or static ARP entries.") . - '<br />' . gettext("Normal dynamic ARP entries show a countdown timer until they will expire and then be re-checked.") . - '<br />' . gettext("Incomplete ARP entries indicate that the target host has not yet replied to an ARP request."), 'info', false); +print_info_box(sprintf(gettext('Local IPv6 peers use %1$sNDP%2$s instead of ARP.'), '<a href="diag_ndp.php">', '</a>') . '<br />' . + '<br />' . gettext('Permanent ARP entries are shown for local interfaces or static ARP entries.') . + '<br />' . gettext('Normal dynamic ARP entries show a countdown timer until they will expire and then be re-checked.') . + '<br />' . gettext('Incomplete ARP entries indicate that the target host has not yet replied to an ARP request.'), 'info', false); ?> </div> diff --git a/src/usr/local/www/diag_authentication.php b/src/usr/local/www/diag_authentication.php index 455b8a0..3da5e58 100644 --- a/src/usr/local/www/diag_authentication.php +++ b/src/usr/local/www/diag_authentication.php @@ -35,7 +35,7 @@ if ($_POST) { $authcfg = auth_get_authserver($_POST['authmode']); if (!$authcfg) { - $input_errors[] = $_POST['authmode'] . " " . gettext("is not a valid authentication server"); + $input_errors[] = sprintf(gettext('%s is not a valid authentication server'), $_POST['authmode']); } if (empty($_POST['username']) || empty($_POST['password'])) { @@ -45,7 +45,7 @@ if ($_POST) { if (!$input_errors) { $attributes = array(); if (authenticate_user($_POST['username'], $_POST['password'], $authcfg, $attributes)) { - $savemsg = gettext("User") . ": " . $_POST['username'] . " " . gettext("authenticated successfully."); + $savemsg = sprintf(gettext('User %s authenticated successfully.'), $_POST['username']); $groups = getUserGroups($_POST['username'], $authcfg, $attributes); $savemsg .= " " . gettext("This user is a member of groups") . ": <br /><br />"; $savemsg .= "<ul>"; diff --git a/src/usr/local/www/diag_command.php b/src/usr/local/www/diag_command.php index 4c32495..dc6037c 100755 --- a/src/usr/local/www/diag_command.php +++ b/src/usr/local/www/diag_command.php @@ -57,8 +57,8 @@ if ($_POST['submit'] == "DOWNLOAD" && file_exists($_POST['dlPath'])) { fpassthru($fd); exit; } else if ($_POST['submit'] == "UPLOAD" && is_uploaded_file($_FILES['ulfile']['tmp_name'])) { - move_uploaded_file($_FILES['ulfile']['tmp_name'], "/tmp/" . $_FILES['ulfile']['name']); - $ulmsg = sprintf(gettext('Uploaded file to /tmp/%s.'), htmlentities($_FILES['ulfile']['name'])); + move_uploaded_file($_FILES['ulfile']['tmp_name'], $g["tmp_path"] . "/" . $_FILES['ulfile']['name']); + $ulmsg = sprintf(gettext('Uploaded file to %s.'), $g["tmp_path"] . "/" . htmlentities($_FILES['ulfile']['name'])); } if ($_POST) { diff --git a/src/usr/local/www/diag_gmirror.php b/src/usr/local/www/diag_gmirror.php index 869fb02..0deaa09 100644 --- a/src/usr/local/www/diag_gmirror.php +++ b/src/usr/local/www/diag_gmirror.php @@ -323,7 +323,7 @@ else: if ($oldmirror): ?> <a class="btn btn-xs btn-success" href="diag_gmirror.php?action=activate&consumer=<?=htmlspecialchars($consumer['name']); ?>&mirror=<?=htmlspecialchars($oldmirror); ?>"> <i class="fa fa-chain icon-embed-btn"></i> - <?=gettext("Reactivate on") . ' ' . htmlspecialchars($oldmirror); ?> + <?=sprintf(gettext("Reactivate on %s"), htmlspecialchars($oldmirror)); ?> </a> <a class="btn btn-xs btn-danger" href="diag_gmirror.php?action=clear&consumer=<?=htmlspecialchars($consumer['name']); ?>"> diff --git a/src/usr/local/www/diag_packet_capture.php b/src/usr/local/www/diag_packet_capture.php index 0abbfab..010f6d6 100755 --- a/src/usr/local/www/diag_packet_capture.php +++ b/src/usr/local/www/diag_packet_capture.php @@ -104,11 +104,11 @@ if (ipsec_enabled()) { $interfaces['enc0'] = "IPsec"; } -foreach (array('server', 'client') as $mode) { +foreach (array('server' => gettext('OpenVPN Server'), 'client' => gettext('OpenVPN Client')) as $mode => $mode_descr) { if (is_array($config['openvpn']["openvpn-{$mode}"])) { foreach ($config['openvpn']["openvpn-{$mode}"] as $id => $setting) { if (!isset($setting['disable'])) { - $interfaces['ovpn' . substr($mode, 0, 1) . $setting['vpnid']] = gettext("OpenVPN") . " ".$mode.": ".htmlspecialchars($setting['description']); + $interfaces['ovpn' . substr($mode, 0, 1) . $setting['vpnid']] = $mode_descr . ": ".htmlspecialchars($setting['description']); } } } @@ -287,10 +287,12 @@ $section->addInput(new Form_Checkbox( 'Promiscuous', 'Enable promiscuous mode', $promiscuous -))->setHelp('The packet capture will be performed using promiscuous mode.<br />' . - 'Note: Some network adapters do not support or work well in promiscuous mode.'. '<br />' . - 'More: ' . '<a target="_blank" href="http://www.freebsd.org/cgi/man.cgi?query=tcpdump&apropos=0&sektion=0&manpath=FreeBSD+8.3-stable&arch=default&format=html">' . - 'Packet capture' . '</a>'); +))->setHelp('The packet capture will be performed using promiscuous mode.%1$s' . + 'Note: Some network adapters do not support or work well in promiscuous mode.%1$s' . + 'More: %2$sPacket capture%3$s', + '<br />', + '<a target="_blank" href="http://www.freebsd.org/cgi/man.cgi?query=tcpdump&apropos=0&sektion=0&manpath=FreeBSD+8.3-stable&arch=default&format=html">', + '</a>'); $section->addInput(new Form_Select( 'fam', @@ -314,10 +316,11 @@ $section->addInput(new Form_Input( 'Host Address', 'text', $host -))->setHelp('This value is either the Source or Destination IP address or subnet in CIDR notation. The packet capture will look for this address in either field.' . '<br />' . +))->setHelp('This value is either the Source or Destination IP address or subnet in CIDR notation. The packet capture will look for this address in either field.%1$s' . 'Matching can be negated by preceding the value with "!". Multiple IP addresses or CIDR subnets may be specified. Comma (",") separated values perform a boolean "AND". ' . - 'Separating with a pipe ("|") performs a boolean "OR".' . '<br />' . - 'If this field is left blank, all packets on the specified interface will be captured.'); + 'Separating with a pipe ("|") performs a boolean "OR".%1$s' . + 'If this field is left blank, all packets on the specified interface will be captured.', + '<br />'); $section->addInput(new Form_Input( 'port', @@ -340,8 +343,9 @@ $section->addInput(new Form_Input( 'Count', 'text', $count -))->setHelp('This is the number of packets the packet capture will grab. Default value is 100.' . '<br />' . - 'Enter 0 (zero) for no count limit.'); +))->setHelp('This is the number of packets the packet capture will grab. Default value is 100.%s' . + 'Enter 0 (zero) for no count limit.', + '<br />'); $section->addInput(new Form_Select( 'detail', @@ -352,16 +356,18 @@ $section->addInput(new Form_Select( 'high' => gettext('High'), 'full' => gettext('Full'), ) -))->setHelp('This is the level of detail that will be displayed after hitting "Stop" when the packets have been captured.' . '<br />' . - 'This option does not affect the level of detail when downloading the packet capture. '); +))->setHelp('This is the level of detail that will be displayed after hitting "Stop" when the packets have been captured.%s' . + 'This option does not affect the level of detail when downloading the packet capture. ', + '<br />'); $section->addInput(new Form_Checkbox( 'dnsquery', 'Reverse DNS Lookup', 'Do reverse DNS lookup', $_POST['dnsquery'] -))->setHelp('The packet capture will perform a reverse DNS lookup associated with all IP addresses.' . '<br />' . - 'This option can cause delays for large packet captures.'); +))->setHelp('The packet capture will perform a reverse DNS lookup associated with all IP addresses.%s' . + 'This option can cause delays for large packet captures.', + '<br />'); $form->add($section); diff --git a/src/usr/local/www/diag_sockets.php b/src/usr/local/www/diag_sockets.php index dcfc4c6..ccc3d6f 100644 --- a/src/usr/local/www/diag_sockets.php +++ b/src/usr/local/www/diag_sockets.php @@ -104,18 +104,24 @@ $showAllOption = $showAll ? "" : "?showAll"; <div> <div class="infoblock"> <?php -print_info_box(gettext('Socket Information') . '<br /><br />' . -gettext('This page shows all listening sockets by default, and shows both listening and outbound connection sockets when <strong>Show all socket connections</strong> is clicked.<br /><br />' . - 'The information listed for each socket is:' . '<br /><br />' . +print_info_box( + gettext('Socket Information') . + '<br /><br />' . + sprintf(gettext('This page shows all listening sockets by default, and shows both listening and outbound connection sockets when %1$sShow all socket connections%2$s is clicked.'), '<strong>', '</strong>') . + '<br /><br />' . + gettext('The information listed for each socket is:') . + '<br /><br />' . '<dl class="dl-horizontal responsive">' . - '<dt>USER</dt> <dd>The user who owns the socket.</dd>' . - '<dt>COMMAND</dt> <dd>The command which holds the socket.</dd>' . - '<dt>PID</dt> <dd>The process ID of the command which holds the socket.</dd>' . - '<dt>FD</dt> <dd>The file descriptor number of the socket.</dd>' . - '<dt>PROTO</dt> <dd>The transport protocol associated with the socket.</dd>' . - '<dt>LOCAL ADDRESS</dt> <dd>The address the local end of the socket is bound to.</dd>' . - '<dt>FOREIGN ADDRESS</dt> <dd>The address the foreign end of the socket is bound to.</dd>' . - '</dl>'), 'info', false); + sprintf(gettext('%1$sUSER%2$s %3$sThe user who owns the socket.%4$s'), '<dt>', '</dt>', '<dd>', '</dd>') . + sprintf(gettext('%1$sCOMMAND%2$s %3$sThe command which holds the socket.%4$s'), '<dt>', '</dt>', '<dd>', '</dd>') . + sprintf(gettext('%1$sPID%2$s %3$sThe process ID of the command which holds the socket.%4$s'), '<dt>', '</dt>', '<dd>', '</dd>') . + sprintf(gettext('%1$sFD%2$s %3$sThe file descriptor number of the socket.%4$s'), '<dt>', '</dt>', '<dd>', '</dd>') . + sprintf(gettext('%1$sPROTO%2$s %3$sThe transport protocol associated with the socket.%4$s'), '<dt>', '</dt>', '<dd>', '</dd>') . + sprintf(gettext('%1$sLOCAL ADDRESS%2$s %3$sThe address the local end of the socket is bound to.%4$s'), '<dt>', '</dt>', '<dd>', '</dd>') . + sprintf(gettext('%1$sFOREIGN ADDRESS%2$s %3$sThe address the foreign end of the socket is bound to.%4$s'), '<dt>', '</dt>', '<dd>', '</dd>') . + '</dl>', + 'info', + false); ?> </div> </div> diff --git a/src/usr/local/www/diag_tables.php b/src/usr/local/www/diag_tables.php index 9fe3a8b..c1d049d 100644 --- a/src/usr/local/www/diag_tables.php +++ b/src/usr/local/www/diag_tables.php @@ -136,9 +136,9 @@ $group->add(new Form_Select( null, $tablename, array_combine($tables, $tables) -))->setHelp('Select a user-defined alias name or system table name to view its contents. <br/><br/>' . +))->setHelp('Select a user-defined alias name or system table name to view its contents. %s' . 'Aliases become Tables when loaded into the active firewall ruleset. ' . - 'The contents displayed on this page reflect the current addresses inside tables used by the firewall.'); + 'The contents displayed on this page reflect the current addresses inside tables used by the firewall.', '<br/><br/>'); if ($bogons || $urltable || !empty($entries)) { if ($bogons || $urltable) { |