2013-02-04 Miguel de Dios <miguel.dedios@artica.es>
* godmode/modules/manage_network_components.php: cleaned source code style. * operation/netflow/nf_live_view.php: fixed the lost to simplified the filter. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7579 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
fc4f6045fd
commit
01e3cbafac
|
@ -1,3 +1,11 @@
|
|||
2013-02-04 Miguel de Dios <miguel.dedios@artica.es>
|
||||
|
||||
* godmode/modules/manage_network_components.php: cleaned source code
|
||||
style.
|
||||
|
||||
* operation/netflow/nf_live_view.php: fixed the lost to simplified
|
||||
the filter.
|
||||
|
||||
2013-02-04 Miguel de Dios <miguel.dedios@artica.es>
|
||||
|
||||
* include/functions_ui.php: fixed the javascript of function
|
||||
|
|
|
@ -59,7 +59,7 @@ $plugin_parameter = (string) get_parameter ('plugin_parameter');
|
|||
|
||||
$macros = (string) get_parameter ('macros');
|
||||
|
||||
if(!empty($macros)) {
|
||||
if (!empty($macros)) {
|
||||
$macros = json_decode(base64_decode($macros), true);
|
||||
|
||||
foreach($macros as $k => $m) {
|
||||
|
@ -94,7 +94,7 @@ $id_category = (int) get_parameter('id_category');
|
|||
$id_tag_selected = (array) get_parameter('id_tag_selected');
|
||||
$pure = get_parameter('pure', 0);
|
||||
|
||||
if(count($id_tag_selected) == 1 && empty($id_tag_selected[0])) {
|
||||
if (count($id_tag_selected) == 1 && empty($id_tag_selected[0])) {
|
||||
$tags = '';
|
||||
}
|
||||
else {
|
||||
|
@ -123,7 +123,8 @@ if ($duplicate_network_component) {
|
|||
|
||||
$id = network_components_duplicate_network_component ($source_id);
|
||||
ui_print_result_message ($id,
|
||||
__('Successfully created from %s', network_components_get_name ($source_id)),
|
||||
__('Successfully created from %s',
|
||||
network_components_get_name ($source_id)),
|
||||
__('Could not be created'));
|
||||
|
||||
//List unset for jump the bug in the pagination (TODO) that the make another
|
||||
|
@ -139,7 +140,8 @@ if ($create_component) {
|
|||
$custom_string_1 = '';
|
||||
$custom_string_2 = '';
|
||||
$custom_string_3 = '';
|
||||
$name_check = db_get_value ('name', 'tnetwork_component', 'name', $name);
|
||||
$name_check = db_get_value ('name', 'tnetwork_component', 'name',
|
||||
$name);
|
||||
if ($type >= 15 && $type <= 18) {
|
||||
// New support for snmp v3
|
||||
$tcp_send = $snmp_version;
|
||||
|
@ -149,7 +151,8 @@ if ($create_component) {
|
|||
$custom_string_1 = $snmp3_privacy_method;
|
||||
$custom_string_2 = $snmp3_privacy_pass;
|
||||
$custom_string_3 = $snmp3_security_level;
|
||||
$name_check = db_get_value ('name', 'tnetwork_component', 'name', $name);
|
||||
$name_check = db_get_value ('name', 'tnetwork_component',
|
||||
'name', $name);
|
||||
}
|
||||
|
||||
|
||||
|
@ -413,7 +416,8 @@ if ($component_groups === false)
|
|||
$component_groups = array();
|
||||
|
||||
foreach ($component_groups as $component_group_key => $component_group_val) {
|
||||
$num_components = db_get_num_rows('SELECT id_nc
|
||||
$num_components = db_get_num_rows(
|
||||
'SELECT id_nc
|
||||
FROM tnetwork_component
|
||||
WHERE id_group = ' . $component_group_key);
|
||||
|
||||
|
@ -425,7 +429,8 @@ foreach ($component_groups as $component_group_key => $component_group_val) {
|
|||
|
||||
foreach ($childs as $child) {
|
||||
|
||||
$num_components_childs += db_get_num_rows('SELECT id
|
||||
$num_components_childs += db_get_num_rows(
|
||||
'SELECT id
|
||||
FROM tlocal_component
|
||||
WHERE id_network_component_group = ' . $child['id_sg']);
|
||||
|
||||
|
@ -513,7 +518,8 @@ foreach ($components as $component) {
|
|||
}
|
||||
|
||||
if (isset($data)) {
|
||||
echo "<form method='post' action='index.php?sec=".$sec."&sec2=godmode/modules/manage_network_components&search_id_group=0search_string=&pure=".$pure."'>";
|
||||
echo "<form method='post' action='index.php?sec=" . $sec .
|
||||
"&sec2=godmode/modules/manage_network_components&search_id_group=0search_string=&pure=".$pure."'>";
|
||||
html_print_input_hidden('multiple_delete', 1);
|
||||
html_print_table ($table);
|
||||
echo "<div style='padding-bottom: 20px; text-align: right; width:" . $table->width . "'>";
|
||||
|
|
|
@ -150,6 +150,11 @@ else if ($update != '' && check_acl ($config["id_user"], 0, "AW")) {
|
|||
// The filter name will not be needed anymore
|
||||
$filter['id_name'] = '';
|
||||
|
||||
$netflow_disable_custom_lvfilters = false;
|
||||
if (isset($config['netflow_disable_custom_lvfilters'])) {
|
||||
$netflow_disable_custom_lvfilters = $config['netflow_disable_custom_lvfilters'];
|
||||
}
|
||||
|
||||
echo '<form method="post" action="' . $config['homeurl'] . 'index.php?sec=netf&sec2=operation/netflow/nf_live_view&pure='.$pure.'">';
|
||||
|
||||
if (defined ('METACONSOLE')) {
|
||||
|
@ -252,11 +257,17 @@ echo '<form method="post" action="' . $config['homeurl'] . 'index.php?sec=netf&s
|
|||
echo "</tr>";
|
||||
echo "<tr>";
|
||||
|
||||
if ($netflow_disable_custom_lvfilters) {
|
||||
echo "<td></td>";
|
||||
echo "<td></td>";
|
||||
}
|
||||
else {
|
||||
echo "<td>" . '<b>'.__('Filter').'</b>' . "</td>";
|
||||
echo "<td>" .
|
||||
__('Normal') . ' ' . html_print_radio_button_extended ('filter_type', 0, '', $filter_type, false, 'displayNormalFilter();', 'style="margin-right: 40px;"', true) .
|
||||
__('Advanced') . ' ' . html_print_radio_button_extended ('filter_type', 1, '', $filter_type, false, 'displayAdvancedFilter();', 'style="margin-right: 40px;"', true) .
|
||||
"</td>";
|
||||
}
|
||||
|
||||
echo "<td>" . '<b>'.__('Load filter').'</b>' . "</td>";
|
||||
$user_groups = users_get_groups ($config['id_user'], "AR", $own_info['is_admin'], true);
|
||||
|
@ -267,20 +278,44 @@ echo '<form method="post" action="' . $config['homeurl'] . 'index.php?sec=netf&s
|
|||
|
||||
echo "<tr class='filter_normal'>";
|
||||
|
||||
if ($netflow_disable_custom_lvfilters) {
|
||||
echo "<td></td>";
|
||||
echo "<td></td>";
|
||||
}
|
||||
else {
|
||||
echo "<td>" . __('Dst Ip'). ui_print_help_tip (__("Destination IP. A comma separated list of destination ip. If we leave the field blank, will show all ip. Example filter by ip:<br>25.46.157.214,160.253.135.249"), true) . "</td>";
|
||||
echo "<td colspan='2'>" . html_print_input_text ('ip_dst', $filter['ip_dst'], false, 30, 80, true) . "</td>";
|
||||
}
|
||||
|
||||
if ($netflow_disable_custom_lvfilters) {
|
||||
echo "<td></td>";
|
||||
echo "<td></td>";
|
||||
}
|
||||
else {
|
||||
echo "<td>" . __('Src Ip'). ui_print_help_tip (__("Source IP. A comma separated list of source ip. If we leave the field blank, will show all ip. Example filter by ip:<br>25.46.157.214,160.253.135.249"), true) . "</td>";
|
||||
echo "<td colspan='2'>" . html_print_input_text ('ip_src', $filter['ip_src'], false, 30, 80, true) . "</td>";
|
||||
}
|
||||
|
||||
echo "</tr>";
|
||||
echo "<tr class='filter_normal'>";
|
||||
|
||||
if ($netflow_disable_custom_lvfilters) {
|
||||
echo "<td></td>";
|
||||
echo "<td></td>";
|
||||
}
|
||||
else {
|
||||
echo "<td>" . __('Dst Port'). ui_print_help_tip (__("Destination port. A comma separated list of destination ports. If we leave the field blank, will show all ports. Example filter by ports 80 and 22:<br>80,22"), true) . "</td>";
|
||||
echo "<td colspan='2'>" . html_print_input_text ('dst_port', $filter['dst_port'], false, 30, 80, true) . "</td>";
|
||||
}
|
||||
|
||||
if ($netflow_disable_custom_lvfilters) {
|
||||
echo "<td></td>";
|
||||
echo "<td></td>";
|
||||
}
|
||||
else {
|
||||
echo "<td>" . __('Src Port'). ui_print_help_tip (__("Source port. A comma separated list of source ports. If we leave the field blank, will show all ports. Example filter by ports 80 and 22:<br>80,22"), true) . "</td>";
|
||||
echo "<td colspan='2'>" . html_print_input_text ('src_port', $filter['src_port'], false, 30, 80, true) . "</td>";
|
||||
}
|
||||
|
||||
echo "</tr>";
|
||||
echo "<tr class='filter_advance' style='display: none;'>";
|
||||
|
@ -310,12 +345,16 @@ echo '<form method="post" action="' . $config['homeurl'] . 'index.php?sec=netf&s
|
|||
echo "<table class='databox' width='800' style='border: 0px;'><tr><td>";
|
||||
}
|
||||
|
||||
|
||||
html_print_submit_button (__('Draw'), 'draw_button', false, 'class="sub upd"');
|
||||
|
||||
if (!$netflow_disable_custom_lvfilters) {
|
||||
if (check_acl ($config["id_user"], 0, "AW")) {
|
||||
html_print_submit_button (__('Save as new filter'), 'save_button', false, 'class="sub upd" onClick="return defineFilterName();"');
|
||||
|
||||
html_print_submit_button (__('Update current filter'), 'update_button', false, 'class="sub upd"');
|
||||
}
|
||||
}
|
||||
|
||||
if (defined ('METACONSOLE')) {
|
||||
echo "</td></tr></table>";
|
||||
|
|
Loading…
Reference in New Issue