diff options
author | Scott Dale <sdale@pfsense.org> | 2008-05-23 00:04:41 +0000 |
---|---|---|
committer | Scott Dale <sdale@pfsense.org> | 2008-05-23 00:04:41 +0000 |
commit | 2a9db752fb723b6c00ee8c15434ea5b011387940 (patch) | |
tree | 2a687ba44ea350346d1701da23d18a767682af26 /etc | |
parent | 1d622048193b2e330e4488379fe4c90d5ad08eb7 (diff) | |
download | pfsense-2a9db752fb723b6c00ee8c15434ea5b011387940.zip pfsense-2a9db752fb723b6c00ee8c15434ea5b011387940.tar.gz |
Move alias popup to function. Display Alias popup for NATs now.
Diffstat (limited to 'etc')
-rw-r--r-- | etc/inc/pfsense-utils.inc | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc index 2b47d8c..0eb3463 100644 --- a/etc/inc/pfsense-utils.inc +++ b/etc/inc/pfsense-utils.inc @@ -4095,5 +4095,75 @@ function safe_write_file($file, $content, $force_binary) { return true; } +function rule_popup($src,$srcport,$dst,$dstport){ +global $config; +$aliases_array = array(); +if($config['aliases']['alias'] <> "" and is_array($config['aliases']['alias'])) +{ +$span_begin = ""; + $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 = ""; + 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++; + } + //max character length for caption field + $maxlength = 60; + + $alias_descr_substr = $alias_name['descr']; + $alias_content_text = htmlspecialchars($alias_objects_with_details); + $alias_caption = htmlspecialchars($alias_descr_substr . ":"); + $strlength = strlen ($alias_caption); + if ($strlength >= $maxlength) + $alias_caption = substr($alias_caption, 0, $maxlength) . "..."; + + $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>"; + + + if ($alias_name['name'] == $src) + { + $alias_src_span_begin = $span_begin; + } + if ($alias_name['name'] == $srcport) + { + $alias_src_port_span_begin = $span_begin; + } + if ($alias_name['name'] == $dst) + { + $alias_dst_span_begin = $span_begin; + } + if ($alias_name['name'] == $dstport) + { + $alias_dst_port_span_begin = $span_begin; + } + + } + $descriptions = array (); + $descriptions['src'] = $alias_src_span_begin; + $descriptions['srcport'] = $alias_src_port_span_begin; + $descriptions['dst'] = $alias_dst_span_begin; + $descriptions['dstport'] = $alias_dst_port_span_begin; + return $descriptions; + } +} ?> |