Revision e817ad19
Added by Warren Baker over 12 years ago
usr/local/www/diag_system_pftop.php | ||
---|---|---|
44 | 44 |
|
45 | 45 |
$pgtitle = gettext("Diagnostics: pfTop"); |
46 | 46 |
|
47 |
$sorttypes = array('age', 'bytes', 'dest', 'dport', 'exp', 'none', 'peak', 'pkt', 'rate', 'size', 'sport', 'src'); |
|
48 |
|
|
47 | 49 |
if($_REQUEST['getactivity']) { |
48 |
if($_REQUEST['sorttype']) |
|
50 |
if($_REQUEST['sorttype'] && in_array($_REQUEST['sorttype'], array_keys($sorttypes)))
|
|
49 | 51 |
$sorttype = escapeshellarg($_REQUEST['sorttype']); |
50 | 52 |
else |
51 | 53 |
$sorttype = gettext("bytes"); |
... | ... | |
56 | 58 |
|
57 | 59 |
include("head.inc"); |
58 | 60 |
|
59 |
if($_REQUEST['sorttype']) |
|
61 |
if($_REQUEST['sorttype'] && in_array($_REQUEST['sorttype'], array_keys($sorttypes)))
|
|
60 | 62 |
$sorttype = htmlentities($_REQUEST['sorttype']); |
61 | 63 |
else |
62 | 64 |
$sorttype = gettext("bytes"); |
... | ... | |
98 | 100 |
<form method="post"> |
99 | 101 |
<?=gettext("Sort type:"); ?> |
100 | 102 |
<select name='sorttype' id='sorttype' onChange='this.form.submit();'> |
101 |
<option value='<?=$sorttype?>'><?=$sorttype?></option> |
|
102 |
<option value='age'><?=gettext("age");?></option> |
|
103 |
<option value='bytes'><?=gettext("bytes");?></option> |
|
104 |
<option value='dest'><?=gettext("dest");?></option> |
|
105 |
<option value='dport'><?=gettext("dport");?></option> |
|
106 |
<option value='exp'><?=gettext("exp");?></option> |
|
107 |
<option value='none'><?=gettext("none");?></option> |
|
108 |
<option value='peak'><?=gettext("peak");?></option> |
|
109 |
<option value='pkt'><?=gettext("pkt");?></option> |
|
110 |
<option value='rate'><?=gettext("rate");?></option> |
|
111 |
<option value='size'><?=gettext("size");?></option> |
|
112 |
<option value='sport'><?=gettext("sport");?></option> |
|
113 |
<option value='src'><?=gettext("src");?></option> |
|
103 |
<option value='age' <?php echo ($sorttype == "age") ? "selected" : ""; ?>><?=gettext("Age");?></option> |
|
104 |
<option value='bytes' <?php echo ($sorttype == "bytes") ? "selected" : ""; ?>><?=gettext("Bytes");?></option> |
|
105 |
<option value='dest' <?php echo ($sorttype == "dest") ? "selected" : ""; ?>><?=gettext("Destination Host");?></option> |
|
106 |
<option value='dport' <?php echo ($sorttype == "dport") ? "selected" : ""; ?>><?=gettext("Destination Port");?></option> |
|
107 |
<option value='exp' <?php echo ($sorttype == "exp") ? "selected" : ""; ?>><?=gettext("Expiry");?></option> |
|
108 |
<option value='none' <?php echo ($sorttype == "none") ? "selected" : ""; ?>><?=gettext("None");?></option> |
|
109 |
<option value='peak' <?php echo ($sorttype == "peak") ? "selected" : ""; ?>><?=gettext("Peak");?></option> |
|
110 |
<option value='pkt' <?php echo ($sorttype == "pkt") ? "selected" : ""; ?>><?=gettext("Packet");?></option> |
|
111 |
<option value='rate' <?php echo ($sorttype == "rate") ? "selected" : ""; ?>><?=gettext("Rate");?></option> |
|
112 |
<option value='size' <?php echo ($sorttype == "size") ? "selected" : ""; ?>><?=gettext("Size");?></option> |
|
113 |
<option value='sport' <?php echo ($sorttype == "sport") ? "selected" : ""; ?>><?=gettext("Source Port");?></option> |
|
114 |
<option value='src' <?php echo ($sorttype == "src") ? "selected" : ""; ?>><?=gettext("Source Host");?></option> |
|
114 | 115 |
</select> |
115 | 116 |
<p/> |
116 | 117 |
<table width="100%" border="0" cellpadding="0" cellspacing="0"> |
Also available in: Unified diff
Make values look a little prettier and prevent a potential problem