diff options
author | Scott Dale <sdale@pfsense.org> | 2007-02-12 19:18:59 +0000 |
---|---|---|
committer | Scott Dale <sdale@pfsense.org> | 2007-02-12 19:18:59 +0000 |
commit | 3a54b6ca1472bde41e9cc2c76d3086f3de88954c (patch) | |
tree | 0780618a83a81a79192cce6860ced969486d4566 /usr/local | |
parent | 092855f52223702625228ee19b9c99c108cdf9ed (diff) | |
download | pfsense-3a54b6ca1472bde41e9cc2c76d3086f3de88954c.zip pfsense-3a54b6ca1472bde41e9cc2c76d3086f3de88954c.tar.gz |
Added Alias popup description for firewall rules.
Diffstat (limited to 'usr/local')
-rwxr-xr-x | usr/local/www/firewall_rules.php | 97 | ||||
-rwxr-xr-x | usr/local/www/guiconfig.inc | 2 | ||||
-rw-r--r-- | usr/local/www/themes/metallic/all.css | 61 | ||||
-rw-r--r-- | usr/local/www/themes/nervecenter/all.css | 6 | ||||
-rw-r--r-- | usr/local/www/themes/pfsense-dropdown/all.css | 61 | ||||
-rw-r--r-- | usr/local/www/themes/pfsense/all.css | 61 |
6 files changed, 278 insertions, 10 deletions
diff --git a/usr/local/www/firewall_rules.php b/usr/local/www/firewall_rules.php index e2f5bfb..aef9341 100755 --- a/usr/local/www/firewall_rules.php +++ b/usr/local/www/firewall_rules.php @@ -166,11 +166,18 @@ if (isset($_POST['del_x'])) { exit; } } +$closehead = false; $pgtitle = "Firewall: Rules"; include("head.inc"); +echo "<script type=\"text/javascript\" language=\"javascript\" src=\"/javascript/domTT/domLib.js\"></script>"; +echo "<script type=\"text/javascript\" language=\"javascript\" src=\"/javascript/domTT/domTT.js\"></script>"; +echo "<script type=\"text/javascript\" language=\"javascript\" src=\"/javascript/domTT/behaviour.js\"></script>"; +echo "<script type=\"text/javascript\" language=\"javascript\" src=\"/javascript/domTT/fadomatic.js\"></script>"; ?> +</head> + <body link="#0000CC" vlink="#0000CC" alink="#0000CC"> <?php include("fbegin.inc"); ?> <p class="pgtitle"><?=$pgtitle?></p> @@ -181,6 +188,30 @@ include("head.inc"); <?php if (file_exists($d_filterconfdirty_path)): ?><p> <?php print_info_box_np("The firewall rule configuration has been changed.<br>You must apply the changes in order for them to take effect.");?><br> <?php endif; ?> +<?php + $aliases_array = array(); + if($config['aliases']['alias'] <> "" and is_array($config['aliases']['alias'])) + { + foreach($config['aliases']['alias'] as $alias_name) + { + $alias_addresses = explode (" ", $alias_name['address']); + $alias_details = explode ("||", $alias_name['detail']); + $alias_objects_with_details = ""; + $counter = 0; + foreach($alias_addresses as $alias_ports_address) + { + $alias_objects_with_details .= $alias_addresses[$counter]; + $alias_detail_default = strpos ($alias_details[$counter],"Entry added"); + if ($alias_details[$counter] != "" && $alias_detail_default === False){ + $alias_objects_with_details .=" - " . $alias_details[$counter]; + } + $alias_objects_with_details .= "<br>"; + $counter++; + } + $aliases_array[] = array($alias_name['name'], $alias_name['descr'], $alias_objects_with_details); + } + } +?> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr><td class="tabnavtbl"> <?php @@ -296,22 +327,76 @@ include("head.inc"); <br><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_<?=$iconfn;?>.gif" width="11" height="15" border="0"> <?php endif; ?> </td> + <?php + $span_begin = ""; + $span_end = ""; + $alias_src_span_begin = ""; + $alias_src_span_end = ""; + $alias_src_port_span_begin = ""; + $alias_src_port_span_end = ""; + $alias_dst_span_begin = ""; + $alias_dst_span_end = ""; + $alias_dst_port_span_begin = ""; + $alias_dst_port_span_end = ""; + $alias_content_text = ""; + //max character length for caption field + $maxlength = 60; + + foreach ($aliases_array as $alias) + { + $alias_id_substr = $alias[0]; + $alias_descr_substr = $alias[1]; + $alias_content_text = htmlspecialchars($alias[2]); + $alias_caption = htmlspecialchars($alias_descr_substr . ":"); + $strlength = strlen ($alias_caption); + if ($strlength >= $maxlength) + $alias_caption = substr($alias_caption, 0, $maxlength) . "..."; + + $alias_check_src = $filterent['source']['address']; + $alias_check_srcport = pprint_port($filterent['source']['port']); + $alias_check_dst = $filterent['destination']['address']; + $alias_check_dstport = pprint_port($filterent['destination']['port']); + + $span_begin = "<span style=\"cursor: help;\" onmouseover=\"domTT_activate(this, event, 'content', '<h1>$alias_caption</h1><p>$alias_content_text</p>', 'trail', true, 'delay', 0, 'fade', 'both', 'fadeMax', 93, 'styleClass', 'niceTitle');\" onmouseout=\"this.style.color = ''; domTT_mouseout(this, event);\"><U>"; + $span_end = "</U></span>"; + + if ($alias_id_substr == $alias_check_src) + { + $alias_src_span_begin = $span_begin; + $alias_src_span_end = $span_end; + } + if ($alias_id_substr == $alias_check_srcport) + { + $alias_src_port_span_begin = $span_begin; + $alias_src_port_span_end = $span_end; + } + if ($alias_id_substr == $alias_check_dst) + { + $alias_dst_span_begin = $span_begin; + $alias_dst_span_end = $span_end; + } + if ($alias_id_substr == $alias_check_dstport) + { + $alias_dst_port_span_begin = $span_begin; + $alias_dst_port_span_end = $span_end; + } + } + ?> <td class="listlr" onClick="fr_toggle(<?=$nrules;?>)" id="frd<?=$nrules;?>" ondblclick="document.location='firewall_rules_edit.php?id=<?=$i;?>';"> <?=$textss;?><?php if (isset($filterent['protocol'])) echo strtoupper($filterent['protocol']); else echo "*"; ?><?=$textse;?> </td> <td class="listr" onClick="fr_toggle(<?=$nrules;?>)" id="frd<?=$nrules;?>" ondblclick="document.location='firewall_rules_edit.php?id=<?=$i;?>';"> - <?=$textss;?><?php echo htmlspecialchars(pprint_address($filterent['source'])); ?><?=$textse;?> + <?=$textss;?><?php echo $alias_src_span_begin;?><?php echo htmlspecialchars(pprint_address($filterent['source']));?><?php echo $alias_src_span_end;?><?=$textse;?> </td> <td class="listr" onClick="fr_toggle(<?=$nrules;?>)" id="frd<?=$nrules;?>" ondblclick="document.location='firewall_rules_edit.php?id=<?=$i;?>';"> - <?=$textss;?><?php echo htmlspecialchars(pprint_port($filterent['source']['port'])); ?><?=$textse;?> + <?=$textss;?><?php echo $alias_src_port_span_begin;?><?php echo htmlspecialchars(pprint_port($filterent['source']['port'])); ?><?php echo $alias_src_port_span_end;?><?=$textse;?> </td> <td class="listr" onClick="fr_toggle(<?=$nrules;?>)" id="frd<?=$nrules;?>" ondblclick="document.location='firewall_rules_edit.php?id=<?=$i;?>';"> - <?=$textss;?><?php echo htmlspecialchars(pprint_address($filterent['destination'])); ?><?=$textse;?> + <?=$textss;?><?php echo $alias_dst_span_begin;?><?php echo htmlspecialchars(pprint_address($filterent['destination'])); ?><?php echo $alias_dst_span_end;?><?=$textse;?> </td> - <td class="listr" onClick="fr_toggle(<?=$nrules;?>)" id="frd<?=$nrules;?>" ondblclick="document.location='firewall_rules_edit.php?id=<?=$i;?>';"> - <?=$textss;?><?php echo htmlspecialchars(pprint_port($filterent['destination']['port'])); ?><?=$textse;?> + <td class="listr" onClick="fr_toggle(<?=$nrules;?>)" id="frd<?=$nrules;?>" ondblclick="document.location='firewall_rules_edit.php?id=<?=$i;?>';"> + <?=$textss;?><?php echo $alias_dst_port_span_begin;?><?php echo htmlspecialchars(pprint_port($filterent['destination']['port'])); ?><?php echo $alias_dst_port_span_end;?><?=$textse;?> </td> - <td class="listr" onClick="fr_toggle(<?=$nrules;?>)" id="frd<?=$nrules;?>" ondblclick="document.location='firewall_rules_edit.php?id=<?=$i;?>';"> <?=$textss;?><?php if (isset($config['interfaces'][$filterent['gateway']]['descr'])) echo htmlspecialchars($config['interfaces'][$filterent['gateway']]['descr']); else echo htmlspecialchars(pprint_port($filterent['gateway'])); ?><?=$textse;?> </td> diff --git a/usr/local/www/guiconfig.inc b/usr/local/www/guiconfig.inc index b80e8b5..185b706 100755 --- a/usr/local/www/guiconfig.inc +++ b/usr/local/www/guiconfig.inc @@ -284,7 +284,7 @@ function pprint_port($port) { $pport = ""; if (!$port) - echo "*"; + return "*"; else { $srcport = explode("-", $port); if ((!$srcport[1]) || ($srcport[0] == $srcport[1])) { diff --git a/usr/local/www/themes/metallic/all.css b/usr/local/www/themes/metallic/all.css index 442430f..3848c7f 100644 --- a/usr/local/www/themes/metallic/all.css +++ b/usr/local/www/themes/metallic/all.css @@ -4,6 +4,67 @@ html, body, td, th, input, select { font-size: 0.9em; } +/* DOM Tooltip CSS definitions */ +div.niceTitle +{ + background-color: #333333; + color: #FFFFFF; + font-weight: bold; + font-size: 13px; + font-family: "Trebuchet MS", sans-serif; + width: 220px; + left: 0; + top: 0; + padding: 4px; + position: absolute; + text-align: left; + z-index: 20; + -moz-border-radius: 0 10px 10px 10px; + filter: progid:DXImageTransform.Microsoft.Alpha(opacity=87); + -moz-opacity: .87; + -khtml-opacity: .87; + opacity: .87; +} +div.niceTitle h1 +{ + background: #990000; + border-bottom: 1px dotted #FFFFFF; + font-weight: bold; + font-size: 13px; + font-family: "Trebuchet MS", sans-serif; + margin: 3px; + padding-top: 1px; + padding-bottom: 1px; + padding-left: 3px; + text-align: left; + left: 0; + top: 0; + -moz-border-radius: 0 8px 0 0; + -moz-opacity: 1; +} +div.niceTitle .contents +{ + margin: 0; + padding: 0 3px; + filter: progid:DXImageTransform.Microsoft.Alpha(opacity=100); + -moz-opacity: 1; + -khtml-opacity: 1; + opacity: 1; +} +div.niceTitle p +{ + background: #FFFFFF; + border: 1px solid #990000; + color: #000000; + font-size: 11px; + font-family: "Trebuchet MS", sans-serif; + padding: 5px; + margin: 3px; + text-align: left; + -moz-opacity: 1; + -moz-border-radius: 0 0 8px 8px; +} + body { background-color: #333333; margin: 5px auto; diff --git a/usr/local/www/themes/nervecenter/all.css b/usr/local/www/themes/nervecenter/all.css index dad15c6..91f3847 100644 --- a/usr/local/www/themes/nervecenter/all.css +++ b/usr/local/www/themes/nervecenter/all.css @@ -20,11 +20,10 @@ div.niceTitle { background-color: #333333; color: #FFFFFF; - border-bottom: 1px dotted #FFFFFF; font-weight: bold; font-size: 13px; font-family: "Trebuchet MS", sans-serif; - width: 250px; + width: 220px; left: 0; top: 0; padding: 4px; @@ -68,7 +67,8 @@ div.niceTitle p background: #FFFFFF; border: 1px solid #990000; color: #000000; - font-size: 9px; + font-size: 11px; + font-family: "Trebuchet MS", sans-serif; padding: 5px; margin: 3px; text-align: left; diff --git a/usr/local/www/themes/pfsense-dropdown/all.css b/usr/local/www/themes/pfsense-dropdown/all.css index 4fa8c3b..608b6f8 100644 --- a/usr/local/www/themes/pfsense-dropdown/all.css +++ b/usr/local/www/themes/pfsense-dropdown/all.css @@ -13,6 +13,67 @@ form input { font-size: 1.1em; } +/* DOM Tooltip CSS definitions */ +div.niceTitle +{ + background-color: #333333; + color: #FFFFFF; + font-weight: bold; + font-size: 13px; + font-family: "Trebuchet MS", sans-serif; + width: 220px; + left: 0; + top: 0; + padding: 4px; + position: absolute; + text-align: left; + z-index: 20; + -moz-border-radius: 0 10px 10px 10px; + filter: progid:DXImageTransform.Microsoft.Alpha(opacity=87); + -moz-opacity: .87; + -khtml-opacity: .87; + opacity: .87; +} +div.niceTitle h1 +{ + background: #990000; + border-bottom: 1px dotted #FFFFFF; + font-weight: bold; + font-size: 13px; + font-family: "Trebuchet MS", sans-serif; + margin: 3px; + padding-top: 1px; + padding-bottom: 1px; + padding-left: 3px; + text-align: left; + left: 0; + top: 0; + -moz-border-radius: 0 8px 0 0; + -moz-opacity: 1; +} +div.niceTitle .contents +{ + margin: 0; + padding: 0 3px; + filter: progid:DXImageTransform.Microsoft.Alpha(opacity=100); + -moz-opacity: 1; + -khtml-opacity: 1; + opacity: 1; +} +div.niceTitle p +{ + background: #FFFFFF; + border: 1px solid #990000; + color: #000000; + font-size: 11px; + font-family: "Trebuchet MS", sans-serif; + padding: 5px; + margin: 3px; + text-align: left; + -moz-opacity: 1; + -moz-border-radius: 0 0 8px 8px; +} + body { background-color: #ffffff; } diff --git a/usr/local/www/themes/pfsense/all.css b/usr/local/www/themes/pfsense/all.css index bad8a62..13d7b58 100644 --- a/usr/local/www/themes/pfsense/all.css +++ b/usr/local/www/themes/pfsense/all.css @@ -13,6 +13,67 @@ form input { font-size: 1.1em; } +/* DOM Tooltip CSS definitions */ +div.niceTitle +{ + background-color: #333333; + color: #FFFFFF; + font-weight: bold; + font-size: 13px; + font-family: "Trebuchet MS", sans-serif; + width: 220px; + left: 0; + top: 0; + padding: 4px; + position: absolute; + text-align: left; + z-index: 20; + -moz-border-radius: 0 10px 10px 10px; + filter: progid:DXImageTransform.Microsoft.Alpha(opacity=87); + -moz-opacity: .87; + -khtml-opacity: .87; + opacity: .87; +} +div.niceTitle h1 +{ + background: #990000; + border-bottom: 1px dotted #FFFFFF; + font-weight: bold; + font-size: 13px; + font-family: "Trebuchet MS", sans-serif; + margin: 3px; + padding-top: 1px; + padding-bottom: 1px; + padding-left: 3px; + text-align: left; + left: 0; + top: 0; + -moz-border-radius: 0 8px 0 0; + -moz-opacity: 1; +} +div.niceTitle .contents +{ + margin: 0; + padding: 0 3px; + filter: progid:DXImageTransform.Microsoft.Alpha(opacity=100); + -moz-opacity: 1; + -khtml-opacity: 1; + opacity: 1; +} +div.niceTitle p +{ + background: #FFFFFF; + border: 1px solid #990000; + color: #000000; + font-size: 11px; + font-family: "Trebuchet MS", sans-serif; + padding: 5px; + margin: 3px; + text-align: left; + -moz-opacity: 1; + -moz-border-radius: 0 0 8px 8px; +} + body { background-color: #ffffff; } |