diff options
author | bmeeks8 <bmeeks8@bellsouth.net> | 2014-02-19 22:34:27 -0500 |
---|---|---|
committer | bmeeks8 <bmeeks8@bellsouth.net> | 2014-02-19 22:34:27 -0500 |
commit | b33b9a9d050bd5bc8247fc4c95ff7bde39d612f2 (patch) | |
tree | 04bcd4a8f0cb1520a71668dd011eba529a248186 /config/suricata/suricata_define_vars.php | |
parent | 4b6a70ab6d1a3b50e29e4de5383bf69f867807b1 (diff) | |
download | pfsense-packages-b33b9a9d050bd5bc8247fc4c95ff7bde39d612f2.tar.gz pfsense-packages-b33b9a9d050bd5bc8247fc4c95ff7bde39d612f2.tar.bz2 pfsense-packages-b33b9a9d050bd5bc8247fc4c95ff7bde39d612f2.zip |
Incorporate Ermal's comments into Suricata BETA pkg code.
Diffstat (limited to 'config/suricata/suricata_define_vars.php')
-rw-r--r-- | config/suricata/suricata_define_vars.php | 46 |
1 files changed, 12 insertions, 34 deletions
diff --git a/config/suricata/suricata_define_vars.php b/config/suricata/suricata_define_vars.php index 05378477..c9ec2bcd 100644 --- a/config/suricata/suricata_define_vars.php +++ b/config/suricata/suricata_define_vars.php @@ -245,44 +245,22 @@ if ($savemsg) </table> </form> <script type="text/javascript"> -<?php - $isfirst = 0; - $aliases = ""; - $addrisfirst = 0; - $portisfirst = 0; - $aliasesaddr = ""; - $aliasesports = ""; - if(isset($config['aliases']['alias']) && is_array($config['aliases']['alias'])) - foreach($config['aliases']['alias'] as $alias_name) { - if ($alias_name['type'] == "host" || $alias_name['type'] == "network") { - // Skip any Aliases that resolve to an empty string - if (trim(filter_expand_alias($alias_name['name'])) == "") - continue; - if($addrisfirst == 1) $aliasesaddr .= ","; - $aliasesaddr .= "'" . $alias_name['name'] . "'"; - $addrisfirst = 1; - } else if ($alias_name['type'] == "port") { - if($portisfirst == 1) $aliasesports .= ","; - $aliasesports .= "'" . $alias_name['name'] . "'"; - $portisfirst = 1; - } - } -?> - - var addressarray=new Array(<?php echo $aliasesaddr; ?>); - var portsarray=new Array(<?php echo $aliasesports; ?>); +//<![CDATA[ + var addressarray = <?= json_encode(get_alias_list(array("host", "network"))) ?>; + var portsarray = <?= json_encode(get_alias_list("port")) ?>; -function createAutoSuggest() { -<?php - foreach ($suricata_servers as $key => $server) - echo "objAlias{$key} = new AutoSuggestControl(document.getElementById('def_{$key}'), new StateSuggestions(addressarray));\n"; - foreach ($suricata_ports as $key => $server) - echo "pobjAlias{$key} = new AutoSuggestControl(document.getElementById('def_{$key}'), new StateSuggestions(portsarray));\n"; -?> -} + function createAutoSuggest() { + <?php + foreach ($suricata_servers as $key => $server) + echo " var objAlias{$key} = new AutoSuggestControl(document.getElementById('def_{$key}'), new StateSuggestions(addressarray));\n"; + foreach ($suricata_ports as $key => $server) + echo "var pobjAlias{$key} = new AutoSuggestControl(document.getElementById('def_{$key}'), new StateSuggestions(portsarray));\n"; + ?> + } setTimeout("createAutoSuggest();", 500); +//]]> </script> <?php include("fend.inc"); ?> |