diff --git a/usr/local/www/firewall_rules.php b/usr/local/www/firewall_rules.php index 5656de8637..dd6c90ffef 100755 --- a/usr/local/www/firewall_rules.php +++ b/usr/local/www/firewall_rules.php @@ -294,11 +294,6 @@ if (isset($_POST['del_x'])) { $closehead = false; include("head.inc"); - -echo ""; -echo ""; -echo ""; -echo ""; ?> @@ -410,7 +405,7 @@ if($_REQUEST['undodrag']) {
| + | * | =gettext("RFC 1918 networks");?> | * | @@ -450,7 +445,7 @@ if($_REQUEST['undodrag']) {* | * | * | -+ | =gettext("Block private networks");?> |
{$alias_caption}".$alias_objects_with_details; +} + +function rule_popup($src,$srcport,$dst,$dstport){ + global $config,$g; $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; - if ($alias_name['url']) { - $alias_objects_with_details .= $alias_name['url'] . ""; - } - 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 .= " "; - $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) . "..."; - - $alias_caption_escaped = str_replace("'", "\'", $alias_caption); - $alias_content_escaped = str_replace("'", "\'", $alias_content_text); - $span_begin = "$alias_caption_escaped $alias_content_escaped ', 'trail', true, 'delay', 0, 'fade', 'both', 'fadeMax', 93, 'styleClass', 'niceTitle');\" onmouseout=\"this.style.color = ''; domTT_mouseout(this, event);\">"; - - 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; + { + $descriptions = array (); + foreach($config['aliases']['alias'] as $alias_id=>$alias_name){ + $loading_image=" " .gettext("loading...")."";
+ switch ($alias_name['type']){
+ case "port":
+ $width="250";
+ break;
+ case "urltable":
+ $width="500";
+ break;
+ default:
+ $width="350";
+ break;
+ }
+ $span_begin = "";
+ if ($alias_name['name'] == $src)
+ $descriptions['src']= $span_begin;
+ if ($alias_name['name'] == $srcport)
+ $descriptions['srcport'] = $span_begin;
+ if ($alias_name['name'] == $dst )
+ $descriptions['dst'] = $span_begin;
+ if ($alias_name['name'] == $dstport)
+ $descriptions['dstport'] = $span_begin;
+ }
+ return $descriptions;
}
}
diff --git a/usr/local/www/index.php b/usr/local/www/index.php
index 9b19a48935..1287672e4e 100755
--- a/usr/local/www/index.php
+++ b/usr/local/www/index.php
@@ -58,11 +58,14 @@ require_once('guiconfig.inc');
require_once('notices.inc');
if(isset($_REQUEST['closenotice'])){
- include("functions.inc");
close_notice($_REQUEST['closenotice']);
echo get_menu_messages();
exit;
}
+if ($_REQUEST['act'] == 'alias_info_popup' && !preg_match("/\D/",$_REQUEST['aliasid'])){
+ alias_info_popup($_REQUEST['aliasid']);
+ exit;
+}
if($g['disablecrashreporter'] != true) {
// Check to see if we have a crash report
diff --git a/usr/local/www/javascript/ticker.js b/usr/local/www/javascript/ticker.js
index 3c8b6ccd35..defb1d84d4 100755
--- a/usr/local/www/javascript/ticker.js
+++ b/usr/local/www/javascript/ticker.js
@@ -1,6 +1,6 @@
/* $Id$ */
/*
- functions.inc
+ ticker.js
Copyright (C) 2012 Marcello Coutinho
Copyright (C) 2012 Carlos Cesario - carloscesario@gmail.com
All rights reserved.
@@ -57,3 +57,17 @@ jQuery(document).ready(function() {
jQuery(this).css('cursor','pointer');
});
});
+
+function alias_popup(alias_id,theme,loading) {
+ domTT_update('ttalias_'+alias_id," "+loading+"");
+ jQuery.ajax({
+ type: 'post',
+ cache: false,
+ url: "/index.php",
+ data: {aliasid:alias_id, act:'alias_info_popup'},
+ success: function(response) {
+ //alert(''+response.match(/ .*<\/table>/i)+''+response.match(/ .*<\/table>/i)+' | |||||||||||||||||||||||||