summaryrefslogtreecommitdiffstats
path: root/usr/local/www/diag_packet_capture.php
diff options
context:
space:
mode:
authorRenato Botelho <renato.botelho@bluepex.com>2010-06-18 16:00:13 -0300
committerRenato Botelho <renato.botelho@bluepex.com>2010-06-18 16:04:19 -0300
commit1c550bed001f95807d8293f234403468bb8d42d7 (patch)
tree31403cffcf3498a533f07202fcb4006712a39a98 /usr/local/www/diag_packet_capture.php
parent441e7f01f04f10475fc6873eb2e9e9733ee2e43d (diff)
downloadpfsense-1c550bed001f95807d8293f234403468bb8d42d7.zip
pfsense-1c550bed001f95807d8293f234403468bb8d42d7.tar.gz
Implement gettext() calls
Diffstat (limited to 'usr/local/www/diag_packet_capture.php')
-rw-r--r--usr/local/www/diag_packet_capture.php73
1 files changed, 37 insertions, 36 deletions
diff --git a/usr/local/www/diag_packet_capture.php b/usr/local/www/diag_packet_capture.php
index 68248ea..e49d969 100644
--- a/usr/local/www/diag_packet_capture.php
+++ b/usr/local/www/diag_packet_capture.php
@@ -35,7 +35,7 @@
##|*MATCH=diag_packet_capture.php*
##|-PRIV
-$pgtitle = array("Diagnostics", "Packet Capture");
+$pgtitle = array(gettext("Diagnostics"), gettext("Packet Capture"));
require_once("guiconfig.inc");
require_once("pfsense-utils.inc");
@@ -64,14 +64,14 @@ if ($_POST) {
}
if ($_POST['startbtn'] != "" ) {
- $action = "Start";
+ $action = gettext("Start");
//delete previous packet capture if it exists
if (file_exists($fp.$fn))
unlink ($fp.$fn);
} elseif ($_POST['stopbtn']!= "") {
- $action = "Stop";
+ $action = gettext("Stop");
$processes_running = trim(shell_exec('/bin/ps axw -O pid= | /usr/bin/grep tcpdump | /usr/bin/grep $fn | /usr/bin/grep -v pflog'));
//explode processes into an array, (delimiter is new line)
@@ -95,7 +95,6 @@ if ($_POST) {
} else {
$do_tcpdump = false;
}
-$pgtitle = "Diagnostics: Packet Capture";
include("head.inc"); ?>
<body link="#000000" vlink="#0000CC" alink="#0000CC">
@@ -110,10 +109,10 @@ include("fbegin.inc");
<form action="diag_packet_capture.php" method="post" name="iform" id="iform">
<table width="100%" border="0" cellpadding="6" cellspacing="0">
<tr>
- <td colspan="2" valign="top" class="listtopic">Packet capture</td>
+ <td colspan="2" valign="top" class="listtopic"><?=gettext("Packet capture");?></td>
</tr>
<tr>
- <td width="17%" valign="top" class="vncellreq">Interface</td>
+ <td width="17%" valign="top" class="vncellreq"><?=gettext("Interface");?></td>
<td width="83%" class="vtable">
<select name="interface">
<?php
@@ -125,56 +124,58 @@ include("fbegin.inc");
</option>
<?php endforeach;?>
</select>
- <br/>Select the interface the traffic will be passing through. Typically this will be the WAN interface.
+ <br/><?=gettext("Select the interface the traffic will be passing through. Typically this will be the WAN interface.");?>
</td>
</tr>
<tr>
- <td width="17%" valign="top" class="vncellreq">Host Address</td>
+ <td width="17%" valign="top" class="vncellreq"><?=gettext("Host Address");?></td>
<td width="83%" class="vtable">
<input name="host" type="text" class="formfld host" id="host" size="20" value="<?=htmlspecialchars($host);?>">
- <br/>This value is either the Source or Destination IP address. The packet capture will look for this address in either field.
- <br/>This value can be a domain name or IP address.
- <br/>If you leave this field blank, all packets on the specified interface will be captured.
+ <br/><?=gettext("This value is either the Source or Destination IP address. The packet capture will look for this address in either field.");?>
+ <br/><?=gettext("This value can be a domain name or IP address.");?>
+ <br/><?=gettext("If you leave this field blank, all packets on the specified interface will be captured. ");?>
</td>
</tr>
<tr>
- <td width="17%" valign="top" class="vncellreq">Port</td>
+ <td width="17%" valign="top" class="vncellreq"><?=gettext("Port");?></td>
<td width="83%" class="vtable">
<input name="port" type="text" class="formfld unknown" id="port" size="5" value="<?=$port;?>">
- <br/>The port can be either the source or destination port. The packet capture will look for this port in either field.
- <br/>Leave blank if you do not want to filter by port.
+ <br/><?=gettext("The port can be either the source or destination port. The packet capture will look for this port in either field.");?>
+ <br/><?=gettext("Leave blank if you do not want to filter by port.");?>
</td>
</tr>
<tr>
- <td width="17%" valign="top" class="vncellreq">Packet Length</td>
+ <td width="17%" valign="top" class="vncellreq"><?=gettext("Packet Length");?></td>
<td width="83%" class="vtable">
<input name="snaplen" type="text" class="formfld unknown" id="snaplen" size="5" value="<?=$snaplen;?>">
- <br/>The Packet length is the number of bytes the packet will capture for each payload. Default value is 1500.
+ <br/><?=gettext("The Packet length is the number of bytes the packet will capture for each payload. Default value is 1500.");?>
</td>
</tr>
<tr>
- <td width="17%" valign="top" class="vncellreq">Count</td>
+ <td width="17%" valign="top" class="vncellreq"><?=gettext("Count");?></td>
<td width="83%" class="vtable">
<input name="count" type="text" class="formfld unknown" id="count" size="5" value="<?=$count;?>">
- <br/>This is the number of packets the packet capture will grab. Default value is 100. <br/>Enter 0 (zero) for no count limit.
+ <br/><?=gettext("This is the number of packets the packet capture will grab. Default value is 100.") . "<br/>" . gettext("Enter 0 (zero) for no count limit.");?>
</tr>
<tr>
- <td width="17%" valign="top" class="vncellreq">Level of Detail</td>
+ <td width="17%" valign="top" class="vncellreq"><?=gettext("Level of Detail");?></td>
<td width="83%" class="vtable">
<select name="detail" type="text" class="formselect" id="detail" size="1">
- <option value="-q" <?php if ($detail == "-q") echo "selected"; ?>>Normal</option>
- <option value="-v" <?php if ($detail == "-v") echo "selected"; ?>>Medium</option>
- <option value="-vv" <?php if ($detail == "-vv") echo "selected"; ?>>High</option>
- <option value="-vv -e" <?php if ($detail == "-vv -e") echo "selected"; ?>>Full</option>
+ <option value="-q" <?php if ($detail == "-q") echo "selected"; ?>><?=gettext("Normal");?></option>
+ <option value="-v" <?php if ($detail == "-v") echo "selected"; ?>><?=gettext("Medium");?></option>
+ <option value="-vv" <?php if ($detail == "-vv") echo "selected"; ?>><?=gettext("High");?></option>
+ <option value="-vv -e" <?php if ($detail == "-vv -e") echo "selected"; ?>><?=gettext("Full");?></option>
</select>
- <br/>This is the level of detail that will be displayed after hitting 'Stop' when the packets have been captured. <br/><b>Note:</b> This option does not affect the level of detail when downloading the packet capture.
+ <br/><?=gettext("This is the level of detail that will be displayed after hitting 'Stop' when the packets have been captured.") . "<br/><b>" .
+ gettext("Note") . ":</b> " .
+ gettext("This option does not affect the level of detail when downloading the packet capture.");?>
</tr>
<tr>
- <td width="17%" valign="top" class="vncellreq">Reverse DNS Lookup</td>
+ <td width="17%" valign="top" class="vncellreq"><?=gettext("Reverse DNS Lookup");?></td>
<td width="83%" class="vtable">
<input name="dnsquery" type="checkbox"<?php if($_POST['dnsquery']) echo " CHECKED"; ?>>
- <br/>This check box will cause the packet capture to perform a reverse DNS lookup associated with all IP addresses.
- <br/><b>Note: </b>This option can cause delays for large packet captures.
+ <br/><?=gettext("This check box will cause the packet capture to perform a reverse DNS lookup associated with all IP addresses.");?>
+ <br/><b><?=gettext("Note");?>: </b><?=gettext("This option can cause delays for large packet captures.");?>
</td>
</tr>
<tr>
@@ -190,14 +191,14 @@ include("fbegin.inc");
if ($processcheck != false)
$processisrunning = true;
- if (($action == "Stop" or $action == "") and $processisrunning != true)
- echo "<input type=\"submit\" name=\"startbtn\" value=\"Start\">&nbsp;";
+ if (($action == gettext("Stop") or $action == "") and $processisrunning != true)
+ echo "<input type=\"submit\" name=\"startbtn\" value=\"" . gettext("Start") . "\">&nbsp;";
else {
- echo "<input type=\"submit\" name=\"stopbtn\" value=\"Stop\">&nbsp;";
+ echo "<input type=\"submit\" name=\"stopbtn\" value=\"" . gettext("Stop") . "\">&nbsp;";
}
if (file_exists($fp.$fn) and $processisrunning != true) {
- echo "<input type=\"submit\" name=\"downloadbtn\" value=\"Download Capture\">";
- echo "&nbsp;&nbsp;(The packet capture file was last updated: " . date("F jS, Y g:i:s a.", filemtime($fp.$fn)) . ")";
+ echo "<input type=\"submit\" name=\"downloadbtn\" value=\"" . gettext("Download Capture") . "\">";
+ echo "&nbsp;&nbsp;(" . gettext("The packet capture file was last updated") . ": " . date("F jS, Y g:i:s a.", filemtime($fp.$fn)) . ")";
}
?>
</td>
@@ -207,7 +208,7 @@ include("fbegin.inc");
<?php
echo "<font face='terminal' size='2'>";
if ($processisrunning == true)
- echo("<strong>Packet Capture is running.</strong><br/>");
+ echo("<strong>" . gettext("Packet Capture is running.") . "</strong><br/>");
if ($do_tcpdump) {
@@ -234,12 +235,12 @@ include("fbegin.inc");
$selectedif = convert_friendly_interface_to_real_interface_name($selectedif);
- if ($action == "Start") {
- echo("<strong>Packet Capture is running.</strong><br/>");
+ if ($action == gettext("Start")) {
+ echo("<strong>" . gettext("Packet Capture is running.") . "</strong><br/>");
mwexec_bg ("/usr/sbin/tcpdump -i $selectedif $searchcount -s $packetlength -w $fp$fn $searchhost $searchport");
} else {
//action = stop
- echo("<strong>Packet Capture stopped. <br/><br/>Packets Captured:</strong><br/>");
+ echo("<strong>" . gettext("Packet Capture stopped.") . "<br/><br/>" . gettext("Packets Captured") . ":</strong><br/>");
?>
<textarea style="width:98%" name="code" rows="15" cols="66" wrap="off" readonly="readonly">
<?php
OpenPOWER on IntegriCloud