From 3b2c83b8a6c2bd2c90b8470c112dde713bac48b6 Mon Sep 17 00:00:00 2001 From: Sjon Hortensius Date: Tue, 30 Dec 2014 22:12:39 +0100 Subject: initial commit of new firewall_rules css - add styling for tr.disabled firewall_rules - migrated to bootstrap guiconfig - changed alias-popup to be displayed inline instead of xhr index - no need to serve alias-popup via xhr --- usr/local/www/firewall_rules.php | 1038 ++++++++++++++++---------------------- 1 file changed, 445 insertions(+), 593 deletions(-) (limited to 'usr/local/www/firewall_rules.php') diff --git a/usr/local/www/firewall_rules.php b/usr/local/www/firewall_rules.php index 250ce64..8ec7f86 100644 --- a/usr/local/www/firewall_rules.php +++ b/usr/local/www/firewall_rules.php @@ -4,7 +4,7 @@ firewall_rules.php part of pfSense (https://www.pfsense.org) Copyright (C) 2005 Scott Ullrich (sullrich@gmail.com) - Copyright (C) 2013-2014 Electric Sheep Fencing, LP + Copyright (C) 2013-2014 Electric Sheep Fencing, LP originally part of m0n0wall (http://m0n0.ch/wall) Copyright (C) 2003-2004 Manuel Kasper . @@ -270,20 +270,20 @@ if (isset($_POST['del_x'])) { exit; } } -$closehead = false; +$pgtitle = array(gettext("System"),gettext("General Setup")); include("head.inc"); +$nrules = 0; + +?> + + - - - - -
- - +


- -

- loader -

 

-
+ - - +
- $ifname) { - if ($ifent == $if) - $active = true; - else - $active = false; - $tab_array[] = array($ifname, $active, "firewall_rules.php?if={$ifent}"); - } - display_top_tabs($tab_array); + + $ifname) { + $tab_array[] = array($ifname, ($ifent == $if), "firewall_rules.php?if={$ifent}"); +} + +display_top_tabs($tab_array); +?> + + + + + + + + + + + + + + + + + + + + + 1, or WAN with an if count of 1. + if (!isset($config['system']['webgui']['noantilockout']) && + (((count($config['interfaces']) > 1) && ($if == 'lan')) + || ((count($config['interfaces']) == 1) && ($if == 'wan')))): + + $alports = implode('
', filter_get_antilockout_ports(true)); ?> - - + + + + + + + + + + + + + +
-
- - - - - - - - - - - - - - - - - - - - 1, or WAN with an if count of 1. - if (!isset($config['system']['webgui']['noantilockout']) && - (((count($config['interfaces']) > 1) && ($if == 'lan')) - || ((count($config['interfaces']) == 1) && ($if == 'wan')))): - - $alports = implode('
', filter_get_antilockout_ports(true)); - ?> - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + +"; - else - $advanced_set = ""; + + $nrules++; ?> - - - - "" and is_array($config['schedules']['schedule'])) { - foreach ($a_schedules as $schedule) - { - if ($schedule['name'] == $filterent['sched'] ){ - $schedstatus = filter_get_time_based_rule_status($schedule); - - foreach($schedule['timerange'] as $timerange) { - $tempFriendlyTime = ""; - $tempID = ""; - $firstprint = false; - if ($timerange){ - $dayFriendly = ""; - $tempFriendlyTime = ""; - - //get hours - $temptimerange = $timerange['hour']; - $temptimeseparator = strrpos($temptimerange, "-"); - - $starttime = substr ($temptimerange, 0, $temptimeseparator); - $stoptime = substr ($temptimerange, $temptimeseparator+1); - - if ($timerange['month']){ - $tempmontharray = explode(",", $timerange['month']); - $tempdayarray = explode(",",$timerange['day']); - $arraycounter = 0; - $firstDayFound = false; - $firstPrint = false; - foreach ($tempmontharray as $monthtmp){ - $month = $tempmontharray[$arraycounter]; - $day = $tempdayarray[$arraycounter]; - - if (!$firstDayFound) - { - $firstDay = $day; - $firstmonth = $month; - $firstDayFound = true; - } - - $currentDay = $day; - $nextDay = $tempdayarray[$arraycounter+1]; - $currentDay++; - if (($currentDay != $nextDay) || ($tempmontharray[$arraycounter] != $tempmontharray[$arraycounter+1])){ - if ($firstPrint) - $dayFriendly .= ", "; - $currentDay--; - if ($currentDay != $firstDay) - $dayFriendly .= $monthArray[$firstmonth-1] . " " . $firstDay . " - " . $currentDay ; - else - $dayFriendly .= $monthArray[$month-1] . " " . $day; - $firstDayFound = false; - $firstPrint = true; - } - $arraycounter++; - } - } - else + > + + + "" and is_array($config['schedules']['schedule'])) { + foreach ($a_schedules as $schedule) + { + if ($schedule['name'] == $filterent['sched'] ){ + $schedstatus = filter_get_time_based_rule_status($schedule); + + foreach($schedule['timerange'] as $timerange) { + $tempFriendlyTime = ""; + $tempID = ""; + $firstprint = false; + if ($timerange){ + $dayFriendly = ""; + $tempFriendlyTime = ""; + + //get hours + $temptimerange = $timerange['hour']; + $temptimeseparator = strrpos($temptimerange, "-"); + + $starttime = substr ($temptimerange, 0, $temptimeseparator); + $stoptime = substr ($temptimerange, $temptimeseparator+1); + + if ($timerange['month']){ + $tempmontharray = explode(",", $timerange['month']); + $tempdayarray = explode(",",$timerange['day']); + $arraycounter = 0; + $firstDayFound = false; + $firstPrint = false; + foreach ($tempmontharray as $monthtmp){ + $month = $tempmontharray[$arraycounter]; + $day = $tempdayarray[$arraycounter]; + + if (!$firstDayFound) { - $tempdayFriendly = $timerange['position']; + $firstDay = $day; + $firstmonth = $month; + $firstDayFound = true; + } + + $currentDay = $day; + $nextDay = $tempdayarray[$arraycounter+1]; + $currentDay++; + if (($currentDay != $nextDay) || ($tempmontharray[$arraycounter] != $tempmontharray[$arraycounter+1])){ + if ($firstPrint) + $dayFriendly .= ", "; + $currentDay--; + if ($currentDay != $firstDay) + $dayFriendly .= $monthArray[$firstmonth-1] . " " . $firstDay . " - " . $currentDay ; + else + $dayFriendly .= $monthArray[$month-1] . " " . $day; $firstDayFound = false; - $tempFriendlyDayArray = explode(",", $tempdayFriendly); - $currentDay = ""; - $firstDay = ""; - $nextDay = ""; - $counter = 0; - foreach ($tempFriendlyDayArray as $day){ - if ($day != ""){ - if (!$firstDayFound) - { - $firstDay = $tempFriendlyDayArray[$counter]; - $firstDayFound = true; - } - $currentDay =$tempFriendlyDayArray[$counter]; - //get next day - $nextDay = $tempFriendlyDayArray[$counter+1]; - $currentDay++; - if ($currentDay != $nextDay){ - if ($firstprint) - $dayFriendly .= ", "; - $currentDay--; - if ($currentDay != $firstDay) - $dayFriendly .= $dayArray[$firstDay-1] . " - " . $dayArray[$currentDay-1]; - else - $dayFriendly .= $dayArray[$firstDay-1]; - $firstDayFound = false; - $firstprint = true; - } - $counter++; - } + $firstPrint = true; + } + $arraycounter++; + } + } + else + { + $tempdayFriendly = $timerange['position']; + $firstDayFound = false; + $tempFriendlyDayArray = explode(",", $tempdayFriendly); + $currentDay = ""; + $firstDay = ""; + $nextDay = ""; + $counter = 0; + foreach ($tempFriendlyDayArray as $day){ + if ($day != ""){ + if (!$firstDayFound) + { + $firstDay = $tempFriendlyDayArray[$counter]; + $firstDayFound = true; } + $currentDay =$tempFriendlyDayArray[$counter]; + //get next day + $nextDay = $tempFriendlyDayArray[$counter+1]; + $currentDay++; + if ($currentDay != $nextDay){ + if ($firstprint) + $dayFriendly .= ", "; + $currentDay--; + if ($currentDay != $firstDay) + $dayFriendly .= $dayArray[$firstDay-1] . " - " . $dayArray[$currentDay-1]; + else + $dayFriendly .= $dayArray[$firstDay-1]; + $firstDayFound = false; + $firstprint = true; + } + $counter++; } - $timeFriendly = $starttime . " - " . $stoptime; - $description = $timerange['rangedescr']; - $sched_content .= $dayFriendly . "; " . $timeFriendly . "
"; } } - $sched_caption_escaped = str_replace("'", "\'", $schedule['descr']); - $schedule_span_begin = "{$sched_caption_escaped}

{$sched_content}

', 'trail', true, 'delay', 0, 'fade', 'both', 'fadeMax', 93, 'styleClass', 'niceTitle');\" onmouseout=\"this.style.color = ''; domTT_mouseout(this, event);\">"; - $schedule_span_end = "
"; - } - } - } - $printicon = false; - $alttext = ""; - $image = ""; - if (!isset($filterent['disabled'])) { - if ($schedstatus) { - if ($iconfn == "block" || $iconfn == "reject") { - $image = "icon_block"; - $alttext = gettext("Traffic matching this rule is currently being denied"); - } else { - $image = "icon_pass"; - $alttext = gettext("Traffic matching this rule is currently being allowed"); + $timeFriendly = $starttime . " - " . $stoptime; + $description = $timerange['rangedescr']; + $sched_content .= $dayFriendly . "; " . $timeFriendly . "
"; } - $printicon = true; - } else if ($filterent['sched']) { - if ($iconfn == "block" || $iconfn == "reject") - $image = "icon_block_d"; - else - $image = "icon_block"; - $alttext = gettext("This rule is not currently active because its period has expired"); - $printicon = true; } + $sched_caption_escaped = str_replace("'", "\'", $schedule['descr']); + $schedule_span_begin = "{$sched_caption_escaped}

{$sched_content}

', 'trail', true, 'delay', 0, 'fade', 'both', 'fadeMax', 93, 'styleClass', 'niceTitle');\" onmouseout=\"this.style.color = ''; domTT_mouseout(this, event);\">"; + $schedule_span_end = "
"; } - ?> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
   - - - - - - -
- - " border="0" alt="delete" /> - " onclick="return confirm('')" /> - - " width="17" height="17" border="0" alt="add" />
-
 pass *** Address**  - - - - - - - - - -
" alt="move" />" width="17" height="17" border="0" alt="edit" />
" width="17" height="17" border="0" alt="add" />
-
*** Address** + "> + "> + "> +
 block ******  - - - - - - - - - -
" alt="edit" />" width="17" height="17" border="0" alt="edit" />
" width="17" height="17" border="0" alt="add" />
-
****** + "> + "> + "> +
 block ******* - - - - - - - - - -
" alt="move" />" width="17" height="17" border="0" alt=" edit" />
" width="17" height="17" border="0" alt="add" />
-
******* + "> + "> + "> +
- - - - "; - $textse = ""; - $iconfn .= "_d"; - } else { - $textss = $textse = ""; - } - ?> - " alt="icon" /> - -
icon - -
+ + + + + + + '; + + if (isset($filterent['log'])): + print ''; + ?> + + + - - - - '; - echo $filterent['icmptype']; - echo ''; - } - } else echo "*"; - ?> - - - - - - - - - - - - - - {$desc}"; - $desc = $filterent['defaultqueue']; - echo "/{$desc}"; - } else if (isset($filterent['defaultqueue'])) { - $desc = $filterent['defaultqueue']; - echo "{$desc}"; - } else - echo gettext("none"); - ?> - - - icon  - -   - - - - - - - - - - -
" onmouseover="fr_insline(, true)" onmouseout="fr_insline(, false)" />" width="17" height="17" border="0" alt="edit" />
" onclick="return confirm('Do you really want to delete this rule?')" alt="delete" />" width="17" height="17" border="0" alt="add" />
-
- - -

- -
-

- - " border="0" width="17" height="17" align="middle" alt="add" />
-
           - - - - - - - - - -
- " border="0" alt="move" />" onmouseover="fr_insline(, true)" onmouseout="fr_insline(, false)" />
- - " border="0" alt="delete" /> - " onclick="return confirm('')" /> - - " width="17" height="17" border="0" alt="add" />
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
passmatchblockrejectlog
pass disabled match disabled block disabled reject disabled log disabled
-

 

- - -
-
    - -
  • -
  • - -
  • -
  • - -
-
-
+ $printicon = true; + } else if ($filterent['sched']) { + if ($iconfn == "block" || $iconfn == "reject") + $image = "icon_block_d"; + else + $image = "icon_block"; + $alttext = gettext("This rule is not currently active because its period has expired"); + $printicon = true; + } + } + ?> +
+ '; + echo $filterent['icmptype']; + echo ''; + } + } else echo "*"; + ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {$desc}"; + $desc = $filterent['defaultqueue']; + echo "/{$desc}"; + } else if (isset($filterent['defaultqueue'])) { + $desc = $filterent['defaultqueue']; + echo "{$desc}"; + } else + echo gettext("none"); + ?> + + icon +   + + + + "> + "> + "> +
- - + + + + +
+ + + + + 0): ?> + + + + + + + + + +

Legend

+
    +
  • +
  • +
  • +
  • +
  • +
  • +
+ +

+ + + + + +

+
- + - + \ No newline at end of file -- cgit v1.1