2012-07-24 Miguel de Dios <miguel.dedios@artica.es>
* godmode/setup/file_manager.php, godmode/setup/news.php, godmode/users/configure_user.php, godmode/users/user_list.php, godmode/massive/massive_copy_modules.php, godmode/massive/massive_enable_disable_alerts.php, godmode/massive/massive_delete_action_alerts.php, godmode/massive/massive_delete_alerts.php, godmode/modules/manage_network_templates_form.php, godmode/modules/manage_nc_groups.php, godmode/modules/manage_nc_groups_form.php, godmode/modules/manage_network_templates.php, godmode/netflow/nf_edit.php, godmode/netflow/nf_edit_form.php, godmode/netflow/nf_item_list.php, godmode/netflow/nf_report_item.php, godmode/netflow/nf.php, operation/incidents/incident.php, operation/incidents/incident_detail.php, operation/agentes/estado_agente.php, operation/agentes/sla_view.php, operation/agentes/tactical.php, operation/agentes/estado_generalagente.php, operation/snmpconsole/snmp_view.php, operation/users/user_edit.php, operation/integria_incidents/incident_detail.php, operation/gis_maps/index.php, operation/events/events_list.php, operation/events/events.php, operation/messages/message_edit.php, operation/messages/message_list.php, operation/reporting/graph_viewer.php, operation/search_reports.php, operation/netflow/nf_view.php: cleaned source code. * godmode/massive/massive_operations.php, godmode/massive/massive_edit_modules.php: fixed the massive edition of "any" module in agents. Fixes: #3543484 git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6806 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
a986c601eb
commit
22fa90d004
|
@ -1,3 +1,37 @@
|
|||
2012-07-24 Miguel de Dios <miguel.dedios@artica.es>
|
||||
|
||||
* godmode/setup/file_manager.php, godmode/setup/news.php,
|
||||
godmode/users/configure_user.php, godmode/users/user_list.php,
|
||||
godmode/massive/massive_copy_modules.php,
|
||||
godmode/massive/massive_enable_disable_alerts.php,
|
||||
godmode/massive/massive_delete_action_alerts.php,
|
||||
godmode/massive/massive_delete_alerts.php,
|
||||
godmode/modules/manage_network_templates_form.php,
|
||||
godmode/modules/manage_nc_groups.php,
|
||||
godmode/modules/manage_nc_groups_form.php,
|
||||
godmode/modules/manage_network_templates.php,
|
||||
godmode/netflow/nf_edit.php, godmode/netflow/nf_edit_form.php,
|
||||
godmode/netflow/nf_item_list.php,
|
||||
godmode/netflow/nf_report_item.php, godmode/netflow/nf.php,
|
||||
operation/incidents/incident.php,
|
||||
operation/incidents/incident_detail.php,
|
||||
operation/agentes/estado_agente.php, operation/agentes/sla_view.php,
|
||||
operation/agentes/tactical.php,
|
||||
operation/agentes/estado_generalagente.php,
|
||||
operation/snmpconsole/snmp_view.php, operation/users/user_edit.php,
|
||||
operation/integria_incidents/incident_detail.php,
|
||||
operation/gis_maps/index.php, operation/events/events_list.php,
|
||||
operation/events/events.php, operation/messages/message_edit.php,
|
||||
operation/messages/message_list.php,
|
||||
operation/reporting/graph_viewer.php, operation/search_reports.php,
|
||||
operation/netflow/nf_view.php: cleaned source code.
|
||||
|
||||
* godmode/massive/massive_operations.php,
|
||||
godmode/massive/massive_edit_modules.php: fixed the massive edition
|
||||
of "any" module in agents.
|
||||
|
||||
Fixes: #3543484
|
||||
|
||||
2012-07-24 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
|
||||
|
||||
* include/functions_agents.php
|
||||
|
|
|
@ -243,7 +243,8 @@ $(document).ready (function () {
|
|||
function (data, status) {
|
||||
if (data.length == 0) {
|
||||
no_modules = true;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
jQuery.each (data, function (i, val) {
|
||||
option = $("<option></option>")
|
||||
.attr ("value", val["id_agente_modulo"])
|
||||
|
|
|
@ -68,7 +68,8 @@ if ($delete) {
|
|||
|
||||
if (empty($alerts_agent_modules)) {
|
||||
ui_print_result_message (false, '', __('Could not be deleted').". ".__('No alerts selected'));
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$results = true;
|
||||
$agent_module_actions = array();
|
||||
|
||||
|
@ -137,7 +138,8 @@ $table->data[1][1] = html_print_select (array(),'id_agents[]', 0, false, '', '',
|
|||
|
||||
if (empty($id_agents)) {
|
||||
$alert_templates = '';
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$alert_templates = agents_get_alerts_simple ($id_agents);
|
||||
}
|
||||
$table->data[2][0] = __('Alert templates');
|
||||
|
|
|
@ -192,7 +192,8 @@ $(document).ready (function () {
|
|||
if (this.value != 0) {
|
||||
$("#id_agents").enable ();
|
||||
$("#id_group").enable ().change ();
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$("#id_group, #id_agents").disable ();
|
||||
}
|
||||
});
|
||||
|
|
|
@ -28,78 +28,6 @@ require_once($config['homedir'] . "/include/functions_agents.php");
|
|||
require_once($config['homedir'] . "/include/functions_groups.php");
|
||||
require_once($config['homedir'] . '/include/functions_users.php');
|
||||
|
||||
function process_manage_edit ($module_name, $agents_select = null) {
|
||||
if (is_int ($module_name) && $module_name <= 0) {
|
||||
echo '<h3 class="error">'.__('No modules selected').'</h3>';
|
||||
return false;
|
||||
}
|
||||
|
||||
/* List of fields which can be updated */
|
||||
$fields = array ('min_warning', 'max_warning', 'str_warning', 'min_critical', 'max_critical', 'str_critical', 'min_ff_event', 'module_interval',
|
||||
'disabled', 'post_process', 'unit', 'snmp_community', 'tcp_send', 'custom_string_1', 'plugin_parameter',
|
||||
'custom_string_2', 'custom_string_3', 'min', 'max', 'id_module_group', 'plugin_user', 'plugin_pass', 'id_export', 'history_data');
|
||||
$values = array ();
|
||||
|
||||
// Specific snmp reused fields
|
||||
if(get_parameter ('tcp_send', '') == 3) {
|
||||
$plugin_user_snmp = get_parameter ('plugin_user_snmp', '');
|
||||
if($plugin_user_snmp != '') {
|
||||
$values['plugin_user'] = $plugin_user_snmp;
|
||||
}
|
||||
$plugin_pass_snmp = get_parameter ('plugin_pass_snmp', '');
|
||||
if($plugin_pass_snmp != '') {
|
||||
$values['plugin_pass'] = $plugin_pass_snmp;
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($fields as $field) {
|
||||
$value = get_parameter ($field, '');
|
||||
if ($value != '') {
|
||||
$values[$field] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
if (strlen(get_parameter('history_data')) > 0) {
|
||||
$values['history_data'] = get_parameter('history_data');
|
||||
}
|
||||
|
||||
// Whether to update module tag info
|
||||
$update_tags = get_parameter('id_tag', false);
|
||||
|
||||
|
||||
|
||||
if (array_search(0, $agents_select) !== false) {
|
||||
$modules = db_get_all_rows_filter ('tagente_modulo',
|
||||
array ('nombre' => $module_name),
|
||||
array ('id_agente_modulo'));
|
||||
}
|
||||
else {
|
||||
$modules = db_get_all_rows_filter ('tagente_modulo',
|
||||
array ('id_agente' => $agents_select,
|
||||
'nombre' => $module_name),
|
||||
array ('id_agente_modulo'));
|
||||
}
|
||||
|
||||
db_process_sql_begin ();
|
||||
|
||||
if ($modules === false)
|
||||
return false;
|
||||
|
||||
foreach ($modules as $module) {
|
||||
$result = modules_update_agent_module ($module['id_agente_modulo'], $values, true, $update_tags);
|
||||
|
||||
if (is_error($result)) {
|
||||
db_process_sql_rollback ();
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
db_process_sql_commit ();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
$module_type = (int) get_parameter ('module_type');
|
||||
$idGroupMassive = (int) get_parameter('id_group_massive');
|
||||
$idAgentMassive = (int) get_parameter('id_agent_massive');
|
||||
|
@ -116,20 +44,20 @@ $update = (bool) get_parameter_post ('update');
|
|||
|
||||
if ($update) {
|
||||
$agents_ = '';
|
||||
if($selection_mode == 'modules') {
|
||||
if ($selection_mode == 'modules') {
|
||||
$force = get_parameter('force_type', false);
|
||||
|
||||
if($agents_select == false) {
|
||||
if ($agents_select == false) {
|
||||
$agents_select = array();
|
||||
$agents_ = array();
|
||||
}
|
||||
|
||||
foreach($agents_select as $agent_name) {
|
||||
foreach ($agents_select as $agent_name) {
|
||||
$agents_[] = agents_get_agent_id($agent_name);
|
||||
}
|
||||
$modules_ = $module_name;
|
||||
}
|
||||
else if($selection_mode == 'agents') {
|
||||
else if ($selection_mode == 'agents') {
|
||||
$force = get_parameter('force_group', false);
|
||||
|
||||
$agents_ = $agents_id;
|
||||
|
@ -139,13 +67,13 @@ if ($update) {
|
|||
$success = 0;
|
||||
$count = 0;
|
||||
|
||||
if($agents_ == false) {
|
||||
if ($agents_ == false) {
|
||||
$agents_ = array();
|
||||
}
|
||||
|
||||
// If the option to select all of one group or module type is checked
|
||||
if($force) {
|
||||
if($force == 'type') {
|
||||
if ($force) {
|
||||
if ($force == 'type') {
|
||||
$condition = '';
|
||||
if($module_type != 0)
|
||||
$condition = ' AND t2.id_tipo_modulo = '.$module_type;
|
||||
|
@ -153,24 +81,24 @@ if ($update) {
|
|||
$agents_ = db_get_all_rows_sql('SELECT DISTINCT(t1.id_agente)
|
||||
FROM tagente t1, tagente_modulo t2
|
||||
WHERE t1.id_agente = t2.id_agente');
|
||||
foreach($agents_ as $id_agent) {
|
||||
foreach ($agents_ as $id_agent) {
|
||||
$module_name = db_get_all_rows_filter('tagente_modulo', array('id_agente' => $id_agent, 'id_tipo_modulo' => $module_type),'nombre');
|
||||
|
||||
if($module_name == false) {
|
||||
if ($module_name == false) {
|
||||
$module_name = array();
|
||||
}
|
||||
foreach($module_name as $mod_name) {
|
||||
foreach ($module_name as $mod_name) {
|
||||
$result = process_manage_edit ($mod_name['nombre'], $id_agent['id_agente']);
|
||||
$count ++;
|
||||
$success += (int)$result;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if($force == 'group') {
|
||||
else if ($force == 'group') {
|
||||
$agents_ = array_keys (agents_get_group_agents ($group_select, false, "none"));
|
||||
foreach($agents_ as $id_agent) {
|
||||
foreach ($agents_ as $id_agent) {
|
||||
$module_name = db_get_all_rows_filter('tagente_modulo', array('id_agente' => $id_agent),'nombre');
|
||||
if($module_name == false) {
|
||||
if ($module_name == false) {
|
||||
$module_name = array();
|
||||
}
|
||||
foreach($module_name as $mod_name) {
|
||||
|
@ -423,7 +351,7 @@ $table->data['edit8'][3] = html_print_select_from_sql ('SELECT id_tag, name FROM
|
|||
echo '<form method="post" action="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&option=edit_modules" id="form_edit">';
|
||||
html_print_table ($table);
|
||||
|
||||
echo '<div class="action-buttons" style="width: '.$table->width.'" onsubmit="if (!confirm(\' '.__('Are you sure?').'\')) return false;">';
|
||||
echo '<div class="action-buttons" style="width: '.$table->width.'">';
|
||||
html_print_input_hidden ('update', 1);
|
||||
html_print_submit_button (__('Update'), 'go', false, 'class="sub upd"');
|
||||
echo '</div>';
|
||||
|
@ -629,3 +557,84 @@ $(document).ready (function () {
|
|||
});
|
||||
/* ]]> */
|
||||
</script>
|
||||
<?php
|
||||
function process_manage_edit ($module_name, $agents_select = null) {
|
||||
if (is_int ($module_name) && $module_name < 0) {
|
||||
echo '<h3 class="error">'.__('No modules selected').'</h3>';
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/* List of fields which can be updated */
|
||||
$fields = array ('min_warning', 'max_warning', 'str_warning', 'min_critical', 'max_critical', 'str_critical', 'min_ff_event', 'module_interval',
|
||||
'disabled', 'post_process', 'unit', 'snmp_community', 'tcp_send', 'custom_string_1', 'plugin_parameter',
|
||||
'custom_string_2', 'custom_string_3', 'min', 'max', 'id_module_group', 'plugin_user', 'plugin_pass', 'id_export', 'history_data');
|
||||
$values = array ();
|
||||
|
||||
// Specific snmp reused fields
|
||||
if(get_parameter ('tcp_send', '') == 3) {
|
||||
$plugin_user_snmp = get_parameter ('plugin_user_snmp', '');
|
||||
if($plugin_user_snmp != '') {
|
||||
$values['plugin_user'] = $plugin_user_snmp;
|
||||
}
|
||||
$plugin_pass_snmp = get_parameter ('plugin_pass_snmp', '');
|
||||
if($plugin_pass_snmp != '') {
|
||||
$values['plugin_pass'] = $plugin_pass_snmp;
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($fields as $field) {
|
||||
$value = get_parameter ($field, '');
|
||||
if ($value != '') {
|
||||
$values[$field] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
if (strlen(get_parameter('history_data')) > 0) {
|
||||
$values['history_data'] = get_parameter('history_data');
|
||||
}
|
||||
|
||||
// Whether to update module tag info
|
||||
$update_tags = get_parameter('id_tag', false);
|
||||
|
||||
if (array_search(0, $agents_select) !== false) {
|
||||
//Apply at All agents.
|
||||
$modules = db_get_all_rows_filter ('tagente_modulo',
|
||||
array ('nombre' => $module_name),
|
||||
array ('id_agente_modulo'));
|
||||
}
|
||||
else {
|
||||
if ($module_name == 0) {
|
||||
//Any module
|
||||
$modules = db_get_all_rows_filter ('tagente_modulo',
|
||||
array ('id_agente' => $agents_select),
|
||||
array ('id_agente_modulo'));
|
||||
}
|
||||
else {
|
||||
$modules = db_get_all_rows_filter ('tagente_modulo',
|
||||
array ('id_agente' => $agents_select,
|
||||
'nombre' => $module_name),
|
||||
array ('id_agente_modulo'));
|
||||
}
|
||||
}
|
||||
|
||||
db_process_sql_begin ();
|
||||
|
||||
if ($modules === false)
|
||||
return false;
|
||||
|
||||
foreach ($modules as $module) {
|
||||
$result = modules_update_agent_module ($module['id_agente_modulo'], $values, true, $update_tags);
|
||||
|
||||
if (is_error($result)) {
|
||||
db_process_sql_rollback ();
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
db_process_sql_commit ();
|
||||
|
||||
return true;
|
||||
}
|
||||
?>
|
|
@ -43,7 +43,8 @@ if (is_ajax ()) {
|
|||
$alert_templates = agents_get_alerts_simple ($id_agents);
|
||||
echo json_encode (index_array ($alert_templates, 'id_alert_template', 'template_name'));
|
||||
return;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$id_alert_templates = (array) get_parameter ('id_alert_templates');
|
||||
$disabled = (int) get_parameter ('disabled');
|
||||
|
||||
|
|
|
@ -39,7 +39,8 @@ $options_alerts = array('add_alerts' => __('Massive alerts addition'), 'delete_a
|
|||
$options_agents = array('edit_agents' => __('Massive agents edition'), 'delete_agents' => __('Massive agents deletion'));
|
||||
|
||||
if (check_acl ($config['id_user'], 0, "PM")) {
|
||||
$options_users = array('add_profiles' => __('Massive profiles addition'), 'delete_profiles' => __('Massive profiles deletion'));
|
||||
$options_users = array('add_profiles' => __('Massive profiles addition'),
|
||||
'delete_profiles' => __('Massive profiles deletion'));
|
||||
}
|
||||
else {
|
||||
$options_users = array();
|
||||
|
@ -151,43 +152,38 @@ $submit_add = get_parameter('crtbutton');
|
|||
|
||||
echo '<div id="loading" display="none">';
|
||||
echo html_print_image("images/wait.gif", true, array("border" => '0')) . '<br />';
|
||||
echo '<strong>'.__('Please wait').'...</strong>';
|
||||
echo '<strong>' . __('Please wait...') . '</strong>';
|
||||
echo '</div>';
|
||||
|
||||
|
||||
?>
|
||||
|
||||
<script language="javascript" type="text/javascript">
|
||||
|
||||
|
||||
$(document).ready (function () {
|
||||
$(document).ready (function () {
|
||||
$('#manage_config_form').submit( function() {
|
||||
confirm = confirm(" <?php echo __('Are you sure?'); ?> ");
|
||||
if (confirm)
|
||||
confirm_status = confirm(" <?php echo __('Are you sure?'); ?> ");
|
||||
if (confirm_status)
|
||||
$("#loading").css("display", "");
|
||||
else
|
||||
return false;
|
||||
});
|
||||
|
||||
$('#form_edit').submit( function() {
|
||||
confirm = confirm(" <?php echo __('Are you sure?'); ?> ");
|
||||
if (confirm)
|
||||
confirm_status = confirm(" <?php echo __('Are you sure?'); ?> ");
|
||||
if (confirm_status)
|
||||
$("#loading").css("display", "");
|
||||
else
|
||||
return false;
|
||||
});
|
||||
|
||||
$('[id^=form]').submit( function() {
|
||||
confirm = confirm(" <?php echo __('Are you sure?'); ?> ");
|
||||
if (confirm)
|
||||
confirm_status = confirm(" <?php echo __('Are you sure?'); ?> ");
|
||||
if (confirm_status)
|
||||
$("#loading").css("display", "");
|
||||
else
|
||||
return false;
|
||||
});
|
||||
|
||||
$("#loading").css("display", "none");
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
<?php
|
||||
|
|
|
@ -46,13 +46,15 @@ if ($create) {
|
|||
ui_print_error_message (__('Could not be created. Blank name'));
|
||||
require_once ('manage_nc_groups_form.php');
|
||||
return;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$result = db_process_sql_insert ('tnetwork_component_group',
|
||||
array ('name' => $name,
|
||||
'parent' => $parent));
|
||||
if ($result) {
|
||||
db_pandora_audit( "Module management", "Create component group #$result");
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
db_pandora_audit( "Module management", "Fail try to create component group");
|
||||
}
|
||||
ui_print_result_message ($result,
|
||||
|
@ -75,7 +77,8 @@ if ($update) {
|
|||
array ('id_sg' => $id));
|
||||
if ($result) {
|
||||
db_pandora_audit( "Module management", "Update component group #$id");
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
db_pandora_audit( "Module management", "Fail try to update component group #$id");
|
||||
}
|
||||
|
||||
|
|
|
@ -33,7 +33,8 @@ if ($id) {
|
|||
$group = network_components_get_group ($id);
|
||||
$name = $group['name'];
|
||||
$parent = $group['parent'];
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$name = '';
|
||||
$parent = '';
|
||||
}
|
||||
|
@ -57,7 +58,8 @@ if ($id) {
|
|||
html_print_input_hidden ('update', 1);
|
||||
html_print_input_hidden ('id', $id);
|
||||
html_print_submit_button (__('Update'), 'crt', false, 'class="sub upd"');
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
html_print_input_hidden ('create', 1);
|
||||
html_print_submit_button (__('Create'), 'crt', false, 'class="sub wand"');
|
||||
}
|
||||
|
|
|
@ -141,7 +141,8 @@ if ($export_profile) {
|
|||
foreach ($components[0] as $row_name => $detail) {
|
||||
if (is_numeric ($row_name)) {
|
||||
$inv_names[] = $row_name;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$row_names[] = $row_name;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -85,7 +85,8 @@ if (isset ($_GET["create"]) || isset ($_GET["update"])) {
|
|||
|
||||
if ($result) {
|
||||
db_pandora_audit("Module management", "Update module template #$id_np");
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
db_pandora_audit("Module management", "Fail try to update module template #$id_np");
|
||||
}
|
||||
|
||||
|
@ -100,7 +101,8 @@ if (isset ($_GET["create"]) || isset ($_GET["update"])) {
|
|||
|
||||
if ($result) {
|
||||
db_pandora_audit("Module management", "Create module template #$result");
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
db_pandora_audit("Module management", "Fail try to create module template");
|
||||
}
|
||||
|
||||
|
@ -109,7 +111,8 @@ if (isset ($_GET["create"]) || isset ($_GET["update"])) {
|
|||
__('Error adding network profile'));
|
||||
$id_np = (int) $result; //Will return either 0 (in case of error) or an int
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
ui_print_result_message(false, "", _("Cannot create a template without name"));
|
||||
}
|
||||
|
||||
|
|
|
@ -53,7 +53,8 @@ if ($update) {
|
|||
|
||||
if (db_get_value('token', 'tconfig', 'token', 'netflow_path') === false) {
|
||||
config_create_value('netflow_path', $config['netflow_path']);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
db_process_sql_update ('tconfig',
|
||||
array ('value' => $config['netflow_path']),
|
||||
array ('token' => 'netflow_path'));
|
||||
|
|
|
@ -48,7 +48,8 @@ if ($delete) {
|
|||
|
||||
if ($result !== false) {
|
||||
$result = true;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$result = false;
|
||||
}
|
||||
|
||||
|
|
|
@ -66,8 +66,8 @@ if ($id) {
|
|||
$aggregate = $filter['aggregate'];
|
||||
$output = $filter['output'];
|
||||
$advanced_filter = $filter['advanced_filter'];
|
||||
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$name = '';
|
||||
$assign_group = '';
|
||||
$ip_dst = '';
|
||||
|
|
|
@ -171,17 +171,20 @@ $sql = "SELECT id_rc FROM tnetflow_report_content where `order`= (select max(`or
|
|||
$item_max = db_get_row_sql($sql);
|
||||
$last_item = $item_max['id_rc'];
|
||||
|
||||
foreach ($reports_item as $item) {
|
||||
foreach ($reports_item as $item) {
|
||||
|
||||
$data = array ();
|
||||
if (($item['id_rc'] == $first_item) && ($item['id_rc'] == $last_item)){
|
||||
$data[0] = '<span style="display: block; float: left; width: 16px;"> </span>';
|
||||
} else if (($item['id_rc'] == $first_item) && ($item['id_rc'] != $last_item)){
|
||||
}
|
||||
else if (($item['id_rc'] == $first_item) && ($item['id_rc'] != $last_item)){
|
||||
$data[0] = '<span style="display: block; float: left; width: 16px;"> </span>';
|
||||
$data[0] .= '<a href="index.php?sec=netf&sec2=godmode/netflow/nf_item_list&id='.$item['id_report'].'&order=1&dir=down&id_rc='.$item['id_rc'].'">' . html_print_image("images/down.png", true, array("title" => __('Move to down'))) . '</a>';
|
||||
} else if (($item['id_rc'] == $last_item) && ($item['id_rc'] != $first_item)){
|
||||
}
|
||||
else if (($item['id_rc'] == $last_item) && ($item['id_rc'] != $first_item)){
|
||||
$data[0] = '<a href="index.php?sec=netf&sec2=godmode/netflow/nf_item_list&id='.$item['id_report'].'&order=1&dir=up&id_rc='.$item['id_rc'].'">' . html_print_image("images/up.png", true, array("title" => __('Move to up'))) . '</a>';
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$data[0] = '<a href="index.php?sec=netf&sec2=godmode/netflow/nf_item_list&id='.$item['id_report'].'&order=1&dir=up&id_rc='.$item['id_rc'].'">' . html_print_image("images/up.png", true, array("title" => __('Move to up'))) . '</a>';
|
||||
$data[0] .= '<a href="index.php?sec=netf&sec2=godmode/netflow/nf_item_list&id='.$item['id_report'].'&order=1&dir=down&id_rc='.$item['id_rc'].'">' . html_print_image("images/down.png", true, array("title" => __('Move to down'))) . '</a>';
|
||||
}
|
||||
|
@ -214,7 +217,7 @@ $last_item = $item_max['id_rc'];
|
|||
array_push ($table->data, $data);
|
||||
}
|
||||
|
||||
if(isset($data)) {
|
||||
if (isset($data)) {
|
||||
echo '<form method="post" action="index.php?sec=netf&sec2=godmode/netflow/nf_item_list&id='.$id.'">';
|
||||
html_print_input_hidden('multiple_delete', 1);
|
||||
html_print_table ($table);
|
||||
|
@ -222,7 +225,8 @@ if(isset($data)) {
|
|||
html_print_submit_button(__('Delete'), 'delete_btn', false, 'class="sub delete"');
|
||||
echo "</div>";
|
||||
echo "</form>";
|
||||
}else {
|
||||
}
|
||||
else {
|
||||
echo "<div class='nf'>".__('There are no defined items')."</div>";
|
||||
}
|
||||
|
||||
|
|
|
@ -61,7 +61,8 @@ if ($id_rc) {
|
|||
$max_val = $item['max'];
|
||||
$show_graph = $item['show_graph'];
|
||||
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$name_filter = '';
|
||||
$max_val = '';
|
||||
$show_graph = '';
|
||||
|
@ -99,7 +100,8 @@ if ($create){
|
|||
$order = $result['max_order'];
|
||||
if ($order == '') {
|
||||
$order = 0;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$order++;
|
||||
}
|
||||
|
||||
|
@ -113,7 +115,8 @@ if ($create){
|
|||
$id_rc = db_process_sql_insert('tnetflow_report_content', $values);
|
||||
if ($id_rc === false) {
|
||||
echo '<h3 class="error">'.__ ('Error creating item').'</h3>';
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
echo '<h3 class="suc">'.__ ('Item created successfully').'</h3>';
|
||||
}
|
||||
}
|
||||
|
@ -168,11 +171,11 @@ if ($id_rc) {
|
|||
html_print_input_hidden ('update', 1);
|
||||
html_print_input_hidden ('id_rc', $id_rc);
|
||||
html_print_submit_button (__('Update'), 'crt', false, 'class="sub upd"');
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
html_print_input_hidden ('create', 1);
|
||||
html_print_submit_button (__('Create item'), 'crt', false, 'class="sub wand"');
|
||||
}
|
||||
echo '</div>';
|
||||
echo '</form>';
|
||||
|
||||
?>
|
|
@ -26,10 +26,6 @@ if (! check_acl ($config['id_user'], 0, "PM")) {
|
|||
|
||||
require_once ("include/functions_filemanager.php");
|
||||
|
||||
//$delete_file = (bool) get_parameter ('delete_file');
|
||||
//$upload_file = (bool) get_parameter ('upload_file');
|
||||
//$create_dir = (bool) get_parameter ('create_dir');
|
||||
|
||||
// Header
|
||||
ui_print_page_header (__('File manager'), "", false, "", true);
|
||||
|
||||
|
@ -38,47 +34,8 @@ if (isset($config['filemanager']['message'])) {
|
|||
$config['filemanager']['message'] = null;
|
||||
}
|
||||
|
||||
//// Upload file
|
||||
//if ($upload_file) {
|
||||
// if (isset ($_FILES['file']) && $_FILES['file']['name'] != "") {
|
||||
// $filename = $_FILES['file']['name'];
|
||||
// $filesize = $_FILES['file']['size'];
|
||||
// $directory = (string) get_parameter ('directory');
|
||||
//
|
||||
// // Copy file to directory and change name
|
||||
// $nombre_archivo = $config['homedir'].'/'.$directory.'/'.$filename;
|
||||
// if (! @copy ($_FILES['file']['tmp_name'], $nombre_archivo )) {
|
||||
// echo "<h3 class=error>".__('attach_error')."</h3>";
|
||||
// } else {
|
||||
// // Delete temporal file
|
||||
// unlink ($_FILES['file']['tmp_name']);
|
||||
// }
|
||||
//
|
||||
// }
|
||||
//}
|
||||
|
||||
//if ($delete_file) {
|
||||
// $filename = (string) get_parameter ('filename');
|
||||
// echo "<h3>".__('Deleting')." ".$filename."</h3>";
|
||||
// if (is_dir ($filename)) {
|
||||
// rmdir ($filename);
|
||||
// } else {
|
||||
// unlink ($filename);
|
||||
// }
|
||||
//}
|
||||
|
||||
|
||||
$directory = (string) get_parameter ('directory', "/");
|
||||
|
||||
//// CREATE DIR
|
||||
//if ($create_dir) {
|
||||
// $dirname = (string) get_parameter ('dirname');
|
||||
// if ($dirname) {
|
||||
// @mkdir ($directory.'/'.$dirname);
|
||||
// echo '<h3>'.__('Created directory %s', $dirname).'</h3>';
|
||||
// }
|
||||
//}
|
||||
|
||||
// A miminal security check to avoid directory traversal
|
||||
if (preg_match ("/\.\./", $directory))
|
||||
$directory = "images";
|
||||
|
@ -105,10 +62,7 @@ $available_directories[$directory] = $directory;
|
|||
|
||||
$real_directory = realpath ($config['homedir'].'/'.$directory);
|
||||
|
||||
//filemanager_box_upload_file_explorer($real_directory, $directory);
|
||||
|
||||
|
||||
echo '<h4>'.__('Index of %s', $directory).'</h4>';
|
||||
echo '<h4>' . __('Index of %s', $directory) . '</h4>';
|
||||
|
||||
filemanager_file_explorer($real_directory, $directory, 'index.php?sec=gsetup&sec2=godmode/setup/file_manager');
|
||||
?>
|
||||
|
|
|
@ -85,10 +85,12 @@ if ((isset ($_GET["form_add"])) || (isset ($_GET["form_edit"]))) {
|
|||
$text = $result["text"];
|
||||
$author = $result["author"];
|
||||
$timestamp = $result["timestamp"];
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
echo "<h3 class='error'>".__('Name error')."</h3>";
|
||||
}
|
||||
} else { // form_add
|
||||
}
|
||||
else { // form_add
|
||||
$creation_mode = 1;
|
||||
$text = "";
|
||||
$subject = "";
|
||||
|
|
|
@ -71,7 +71,8 @@ ui_print_page_header (__('User detail editor'), "images/god3.png", false, "", tr
|
|||
|
||||
if ($config['user_can_update_info']) {
|
||||
$view_mode = false;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$view_mode = true;
|
||||
}
|
||||
|
||||
|
@ -240,7 +241,8 @@ if ($update_user) {
|
|||
$pass_ok = login_validate_pass($password_new, $id, true);
|
||||
if ($pass_ok != 1) {
|
||||
ui_print_error_message($pass_ok);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$res2 = update_user_password ($id, $password_new);
|
||||
if ($res2) {
|
||||
$res3 = save_pass_history($id, $password_new);
|
||||
|
@ -249,7 +251,8 @@ if ($update_user) {
|
|||
__('User info successfully updated'),
|
||||
__('Error updating user info (no change?)'));
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$res2 = update_user_password ($id, $password_new);
|
||||
if ($res2) {
|
||||
$res3 = save_pass_history($id, $password_new);
|
||||
|
|
|
@ -235,7 +235,8 @@ foreach ($info as $user_id => $user_info) {
|
|||
$data[3] = html_print_image ("images/user_suit.png", true,
|
||||
array ("alt" => __('Admin'),
|
||||
"title" => __('Administrator'))).' ';
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$data[3] = html_print_image ("images/user_green.png", true,
|
||||
array ("alt" => __('User'),
|
||||
"title" => __('Standard User'))).' ';
|
||||
|
@ -250,7 +251,8 @@ foreach ($info as $user_id => $user_info) {
|
|||
$data[3] .= groups_get_name ($row["id_grupo"]);
|
||||
$data[3] .= "<br />";
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$data[3] .= __('The user doesn\'t have any assigned profile/group');
|
||||
}
|
||||
$data[3] .= "</span></a>";
|
||||
|
@ -266,7 +268,8 @@ foreach ($info as $user_id => $user_info) {
|
|||
$data[5] .= '<a href="index.php?sec=gusuarios&sec2=godmode/users/configure_user&id='.$user_id.'">'.html_print_image('images/config.png', true, array('title' => __('Edit'))).'</a>';
|
||||
if ($config["admin_can_delete_user"] && $user_info['id_user'] != $config['id_user']) {
|
||||
$data[5] .= " <a href='index.php?sec=gusuarios&sec2=godmode/users/user_list&user_del=1&delete_user=".$user_info['id_user']."'>".html_print_image('images/cross.png', true, array ('title' => __('Delete'), 'onclick' => "if (! confirm ('" .__('Deleting User'). " ". $user_info['id_user'] . ". " . __('Are you sure?') ."')) return false"))."</a>";
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$data[5] .= ''; //Delete button not in this mode
|
||||
}
|
||||
array_push ($table->data, $data);
|
||||
|
|
|
@ -473,13 +473,6 @@ foreach ($agents as $agent) {
|
|||
|
||||
$data[2] = ui_print_os_icon ($agent["id_os"], false, true);
|
||||
|
||||
//The interval we are thinking that it must be the agent interval in this
|
||||
//cell and it'snt the interval of modules.
|
||||
// if ($agent_info["interval"] > $agent["intervalo"]) {
|
||||
// $data[2] = '<span class="green">'.$agent_info["interval"].'</span>';
|
||||
// } else {
|
||||
// $data[2] = $agent["intervalo"];
|
||||
// }
|
||||
$data[3] = human_time_description_raw($agent["intervalo"]);
|
||||
|
||||
$data[4] = ui_print_group_icon ($agent["id_grupo"], true);
|
||||
|
@ -541,7 +534,8 @@ if (!empty ($table->data)) {
|
|||
html_print_table ($table);
|
||||
ui_pagination ($total_agents, ui_get_url_refresh (array ('group_id' => $group_id, 'search' => $search, 'sort_field' => $sortField, 'sort' => $sort, 'status' => $status)));
|
||||
unset ($table);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
echo '<div class="nf">'.__('There are no defined agents').'</div>';
|
||||
}
|
||||
?>
|
||||
|
|
|
@ -180,20 +180,21 @@ echo " / ";
|
|||
|
||||
if ($agent["ultimo_contacto_remoto"] == "01-01-1970 00:00:00") {
|
||||
echo __('Never');
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
echo $agent["ultimo_contacto_remoto"];
|
||||
}
|
||||
echo '</td></tr>';
|
||||
|
||||
// Timezone Offset
|
||||
if ($agent['timezone_offset'] != 0) {
|
||||
echo '<tr><td class="datos2"><b>'.__('Timezone Offset'). '</b></td>';
|
||||
echo '<td class="datos2" colspan="2">'.$agent["timezone_offset"].'</td></tr>';
|
||||
echo '<tr><td class="datos2"><b>' . __('Timezone Offset') . '</b></td>';
|
||||
echo '<td class="datos2" colspan="2">' . $agent["timezone_offset"] . '</td></tr>';
|
||||
}
|
||||
// Next contact (agent)
|
||||
$progress = agents_get_next_contact($id_agente);
|
||||
|
||||
echo '<tr><td class="datos"><b>'.__('Next agent contact').'</b></td>';
|
||||
echo '<tr><td class="datos"><b>' . __('Next agent contact') . '</b></td>';
|
||||
echo '<td class="datos f9" colspan="2">' . progress_bar($progress, 200, 20) . '</td></tr>';
|
||||
|
||||
// Custom fields
|
||||
|
|
|
@ -134,9 +134,10 @@ if ($result !== false) {
|
|||
$data[1] .= "(".$sla_data["sla_min"]." / ".$sla_data["sla_max"]." / ".$sla_data["sla_limit"].")";
|
||||
$data[2] = format_numeric (reporting_get_agentmodule_sla ($sla_data["id_agent_module"], $config["sla_period"], 1)).'%';
|
||||
$status = modules_get_agentmodule_status ($sla_data["id_agent_module"]);
|
||||
if ($status == 1){
|
||||
if ($status == 1) {
|
||||
$data[3] = html_print_image ("images/pixel_red.png", true, array ("width" => 40, "height" => 18, "title" => __('Module Down')));
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$data[3] = html_print_image ("images/pixel_green.png", true, array ("width" => 40, "height" => 18, "title" => __('Module Up')));
|
||||
}
|
||||
array_push ($table->data, $data);
|
||||
|
|
|
@ -274,7 +274,8 @@ if($is_admin) {
|
|||
|
||||
if ($server["status"] == 0){
|
||||
$data[2] = ui_print_status_image (STATUS_SERVER_DOWN, '', true);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$data[2] = ui_print_status_image (STATUS_SERVER_OK, '', true);
|
||||
}
|
||||
|
||||
|
@ -283,10 +284,12 @@ if($is_admin) {
|
|||
|
||||
if ($server["type"] != "recon"){
|
||||
$data[4] = $server["lag_txt"];
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$data[4] = __("N/A");
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$data[3] = "";
|
||||
$data[4] = __("N/A");
|
||||
}
|
||||
|
@ -296,8 +299,11 @@ if($is_admin) {
|
|||
|
||||
if (!empty ($table->data)) {
|
||||
html_print_table ($table);
|
||||
} else {
|
||||
echo '<div class="nf">'.__('There are no servers configured in the database').'</div>';
|
||||
}
|
||||
else {
|
||||
echo '<div class="nf">' .
|
||||
__('There are no servers configured in the database') .
|
||||
'</div>';
|
||||
}
|
||||
unset ($table);
|
||||
}
|
||||
|
|
|
@ -445,7 +445,8 @@ $(document).ready( function() {
|
|||
$option = $('#select_validate').val();
|
||||
if ($option == 2) {
|
||||
$(".standby_alert_checkbox").css('display', '');
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$(".standby_alert_checkbox").css('display', 'none');
|
||||
}
|
||||
});
|
||||
|
@ -453,10 +454,10 @@ $(document).ready( function() {
|
|||
$("#tgl_event_control").click (function () {
|
||||
$("#event_control").toggle ();
|
||||
// Trick to don't collapse filter if autorefresh button has been pushed
|
||||
if ($("#hidden-toogle_filter").val() == 'true'){
|
||||
if ($("#hidden-toogle_filter").val() == 'true') {
|
||||
$("#hidden-toogle_filter").val('false');
|
||||
}
|
||||
else{
|
||||
else {
|
||||
$("#hidden-toogle_filter").val('true');
|
||||
}
|
||||
return false;
|
||||
|
@ -471,11 +472,11 @@ $(document).ready( function() {
|
|||
var checkbox_standby_alert = $('#checkbox-standby-alert-'+id).attr('checked');
|
||||
var similars = $('#group_rep').val();
|
||||
|
||||
if(!select_validate) {
|
||||
if (!select_validate) {
|
||||
select_validate = 1;
|
||||
}
|
||||
|
||||
if(checkbox_standby_alert) {
|
||||
if (checkbox_standby_alert) {
|
||||
jQuery.post ("ajax.php",
|
||||
{"page" : "operation/events/events",
|
||||
"standby_alert" : 1,
|
||||
|
@ -587,12 +588,12 @@ $(document).ready( function() {
|
|||
});
|
||||
|
||||
// Remove delete link (if event is not grouped and there is more than one event)
|
||||
if ($("#group_rep").val() == 1){
|
||||
if (parseInt($("#count_event_group_"+id).text()) <= 1){
|
||||
if ($("#group_rep").val() == 1) {
|
||||
if (parseInt($("#count_event_group_"+id).text()) <= 1) {
|
||||
$("#delete-"+id).replaceWith('<img alt="' + <?php echo "'" . __('Is not allowed delete events in process') . "'"; ?> + '" title="' + <?php echo "'" . __('Is not allowed delete events in process') . "'"; ?> + '" src="images/cross.disabled.png">');
|
||||
}
|
||||
}
|
||||
else{ // Remove delete link (if event is not grouped)
|
||||
else { // Remove delete link (if event is not grouped)
|
||||
$("#delete-"+id).replaceWith('<img alt="' + <?php echo "'" . __('Is not allowed delete events in process') . "'"; ?> + '" title="' + <?php echo "'" . __('Is not allowed delete events in process') . "'"; ?> + '" src="images/cross.disabled.png">');
|
||||
}
|
||||
|
||||
|
@ -649,7 +650,8 @@ $(document).ready( function() {
|
|||
}
|
||||
|
||||
//location.reload();
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$("#result")
|
||||
.showMessage ("<?php echo __('Could not be validated')?>")
|
||||
.addClass ("error");
|
||||
|
@ -689,7 +691,8 @@ $(document).ready( function() {
|
|||
function toggleDiv (divid){
|
||||
if (document.getElementById(divid).style.display == 'none'){
|
||||
document.getElementById(divid).style.display = 'block';
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
document.getElementById(divid).style.display = 'none';
|
||||
}
|
||||
}
|
||||
|
@ -704,7 +707,8 @@ $(document).ready( function() {
|
|||
$option = $('#select_validate_' + id_event).val();
|
||||
if ($option == 2) {
|
||||
$("#standby_alert_checkbox_" + id_event).css('display', '');
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$("#standby_alert_checkbox_" + id_event).css('display', 'none');
|
||||
}
|
||||
});
|
||||
|
|
|
@ -401,15 +401,16 @@ if ($autorefresh_toogle == 'false'){
|
|||
}
|
||||
else{
|
||||
// Keeps state with pagination
|
||||
if ($autorefresh_toogle == 'no'){
|
||||
if ($autorefresh_toogle == 'no') {
|
||||
html_print_input_hidden('toogle_filter', 'false');
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
|
||||
// If update button has been pushed then don't collapse filter
|
||||
if ($update_pressed == 'false'){
|
||||
if ($update_pressed == 'false') {
|
||||
html_print_input_hidden('toogle_filter', 'false');
|
||||
} // Else collapse filter
|
||||
else{
|
||||
else {
|
||||
html_print_input_hidden('toogle_filter', 'true');
|
||||
}
|
||||
}
|
||||
|
@ -629,9 +630,11 @@ foreach ($result as $event) {
|
|||
if ($group_rep != 0) {
|
||||
if ($event["max_estado"] == 2) {
|
||||
$estado = 2;
|
||||
} else if ($event["min_estado"] == 0) {
|
||||
}
|
||||
else if ($event["min_estado"] == 0) {
|
||||
$estado = 0;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$estado = 1;
|
||||
}
|
||||
}
|
||||
|
@ -945,7 +948,8 @@ foreach ($result as $event) {
|
|||
$string .= '<b>' . __('Agent name') . '</b></td><td align="left">';
|
||||
if ($event["id_agente"] != 0) {
|
||||
$string .= ui_print_agent_name ($event["id_agente"], true);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$string .= '<i>- ' . __('Empty') . ' -</i>';
|
||||
}
|
||||
$string .= '</td></tr><tr class="'. $odd .'">';
|
||||
|
@ -1013,7 +1017,8 @@ foreach ($result as $event) {
|
|||
|
||||
$odd = ($odd == '')? 'rowOdd' : '';
|
||||
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$string .= '<i>- ' . __('Empty') . ' -</i>';
|
||||
$string .= '</a></td></tr><tr class="' . $odd . '">';
|
||||
$odd = ($odd == '')? 'rowOdd' : '';
|
||||
|
@ -1042,7 +1047,8 @@ foreach ($result as $event) {
|
|||
$string .= '<tr class="' . $odd . '"><td align="left" valign="top">' . '<b>' . __('Comments') . '</td><td id="comment_row_' . $event['id_evento'] . '" align="left">';
|
||||
if($event["user_comment"] != '') {
|
||||
$string .= $event["user_comment"];
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$string .= '<i>- ' . __('Empty') . ' -</i>';
|
||||
}
|
||||
$string .= '</td></tr>';
|
||||
|
@ -1073,7 +1079,8 @@ foreach ($result as $event) {
|
|||
$string .= $event["source"];
|
||||
$string .= '</td></tr><tr>';
|
||||
$odd = ($odd == '')? 'rowOdd' : '';
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$string .= '<i>- ' . __('Empty') . ' -</i>';
|
||||
$odd = ($odd == '')? 'rowOdd' : '';
|
||||
}
|
||||
|
@ -1083,7 +1090,8 @@ foreach ($result as $event) {
|
|||
$string .= $event["id_extra"];
|
||||
$string .= '</td></tr><tr>';
|
||||
$odd = ($odd == '')? 'rowOdd' : '';
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$string .= '<i>- ' . __('Empty') . ' -</i>';
|
||||
}
|
||||
$string .= '</td></tr>';
|
||||
|
|
|
@ -72,8 +72,9 @@ if ($maps !== false) {
|
|||
|
||||
if (!empty ($table->data)) {
|
||||
html_print_table ($table);
|
||||
} else {
|
||||
echo '<div class="nf">'.__('No maps found').'</div>';
|
||||
}
|
||||
else {
|
||||
echo '<div class="nf">' . __('No maps found') . '</div>';
|
||||
}
|
||||
unset ($table);
|
||||
?>
|
||||
|
|
|
@ -263,7 +263,8 @@ echo '</form>';
|
|||
|
||||
if ($count < 1) {
|
||||
echo '<div class="nf">'.__('No incidents match your search filter').'</div><br />';
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
// TOTAL incidents
|
||||
$url = "index.php?sec=workspace&sec2=operation/incidents/incident";
|
||||
|
||||
|
@ -342,7 +343,8 @@ if ($count < 1) {
|
|||
|
||||
if (check_acl ($config["id_user"], $row["id_grupo"], "IM") || $config["id_user"] == $row["id_usuario"] || $config["id_user"] == $row["id_creator"]) {
|
||||
$data[8] = html_print_checkbox ("id_inc[]", $row["id_incidencia"], false, true);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$data[8] = '';
|
||||
}
|
||||
|
||||
|
|
|
@ -237,7 +237,8 @@ echo '<tr><td class="datos"><b>'.__('Incident').'</b></td><td colspan="3" class=
|
|||
|
||||
if ((check_acl ($config["id_user"], $id_grupo, "IM") == 1) OR ($usuario == $config["id_user"])) {
|
||||
html_print_input_text ("titulo", $titulo,'', 70);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
html_print_input_text_extended ("titulo", $titulo, "", "", 70, "", false, "", "readonly");
|
||||
}
|
||||
|
||||
|
@ -250,14 +251,16 @@ echo '<tr><td class="datos"><b>'.__('Owner').'</b></td><td class="datos">';
|
|||
|
||||
if ((check_acl ($config["id_user"], $id_grupo, "IM") == 1) OR ($usuario == $config["id_user"])) {
|
||||
html_print_select (users_get_info (), "usuario_form", $usuario, '', 'SYSTEM', '', false, false, true, "w135");
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
html_print_select (users_get_info (), "usuario_form", $usuario, '', 'SYSTEM', '', false, false, true, "w135", true);
|
||||
}
|
||||
echo '</td><td class="datos"><b>'.__('Status').'</b></td><td class="datos">';
|
||||
|
||||
if ((check_acl ($config["id_user"], $id_grupo, "IM") == 1) OR ($usuario == $config["id_user"])) {
|
||||
html_print_select (incidents_get_status (), "estado_form", $estado, '', '', '', false, false, false, 'w135');
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
html_print_select (incidents_get_status (), "estado_form", $estado, '', '', '', false, false, false, 'w135', true);
|
||||
}
|
||||
echo '</td></tr>';
|
||||
|
@ -276,7 +279,8 @@ foreach ($return as $row) {
|
|||
// Only owner could change source or user with Incident management privileges
|
||||
if ((check_acl ($config["id_user"], $id_grupo, "IM") == 1) OR ($usuario == $config["id_user"])) {
|
||||
html_print_select ($fields, "origen_form", $origen, '', '', '', false, false, false, 'w135');
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
html_print_select ($fields, "origen_form", $origen, '', '', '', false, false, false, 'w135', true);
|
||||
}
|
||||
echo '</td><td class="datos2"><b>'.__('Group').'</b></td><td class="datos2">';
|
||||
|
@ -284,7 +288,8 @@ echo '</td><td class="datos2"><b>'.__('Group').'</b></td><td class="datos2">';
|
|||
// Group combo
|
||||
if ((check_acl ($config["id_user"], $id_grupo, "IM") == 1) OR ($usuario == $config["id_user"])) {
|
||||
html_print_select_groups($config["id_user"], "IR", true, "grupo_form", $id_grupo, '', '', '', false, false, false, 'w135');
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
html_print_select_groups($config["id_user"], "IR", true, "grupo_form", $id_grupo, '', '', '', false, false, true, 'w135', true);
|
||||
}
|
||||
|
||||
|
@ -300,7 +305,8 @@ else {
|
|||
echo '</td><td class="datos"><b>'.__('Creator').'</b></td><td class="datos">';
|
||||
if (empty ($id_creator)) {
|
||||
echo 'SYSTEM';
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
echo $id_creator.' (<i>'.get_user_fullname($id_creator).'</i>)';
|
||||
}
|
||||
|
||||
|
@ -336,9 +342,11 @@ echo '</td></tr></table><div style="width: 98%; text-align:right;">';
|
|||
// Only if user is the used who opened incident or (s)he is admin
|
||||
if (isset ($id_inc) AND ((check_acl ($config["id_user"], $id_grupo, "IM") == 1) OR ($usuario == $config["id_user"]))) {
|
||||
html_print_submit_button (__('Update incident'), "accion", false, 'class="sub upd"');
|
||||
} elseif (check_acl ($config["id_user"], $id_grupo, "IW")) {
|
||||
}
|
||||
elseif (check_acl ($config["id_user"], $id_grupo, "IW")) {
|
||||
html_print_submit_button (__('Create'), "accion", false, 'class="sub wand"');
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
html_print_submit_button (__('Submit'), "accion", true, 'class="sub upd"');
|
||||
}
|
||||
echo "</div></form>";
|
||||
|
@ -467,7 +475,6 @@ if (isset ($id_inc)) {
|
|||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<script>
|
||||
$(document).ready (function () {
|
||||
agent_autocomplete('#text-agent', '#hidden-server_name', '#hidden-id_agent');
|
||||
|
|
|
@ -178,7 +178,8 @@ elseif (isset ($_GET["insert_form"])) {
|
|||
}
|
||||
$prioridad = 0;
|
||||
$id_grupo = 0;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
db_pandora_audit("HACK","Trying to get to incident details in an unusual way");
|
||||
require ("general/noaccess.php");
|
||||
exit;
|
||||
|
@ -212,7 +213,8 @@ if (isset ($id_inc)) { //If $id_inc is set (when $_GET["id"] is set, not $_GET["
|
|||
ui_print_page_header (__('Incident details'). ' #'.$id_inc, "images/book_edit.png", false, "", false, "");
|
||||
echo '<form name="accion_form" method="POST" action="index.php?sec=incidencias&sec2=operation/incidents/incident&action=update">';
|
||||
echo '<input type="hidden" name="id_inc" value="'.$id_inc.'">';
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
ui_print_page_header (__('Create incident'), "images/book_edit.png", false, "", false, "");
|
||||
echo '<form name="accion_form" method="POST" action="index.php?sec=incidencias&sec2=operation/incidents/incident&action=insert">';
|
||||
}
|
||||
|
@ -222,7 +224,8 @@ echo '<tr><td class="datos"><b>'.__('Incident').'</b></td><td colspan="3" class=
|
|||
|
||||
if ((check_acl ($config["id_user"], $id_grupo, "IM") == 1) OR ($usuario == $config["id_user"])) {
|
||||
html_print_input_text ("titulo", $titulo,'', 70);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
html_print_input_text_extended ("titulo", $titulo, "", "", 70, "", false, "", "readonly");
|
||||
}
|
||||
|
||||
|
@ -235,7 +238,8 @@ echo '<tr><td class="datos"><b>'.__('Owner').'</b></td><td class="datos">';
|
|||
|
||||
if ((check_acl ($config["id_user"], $id_grupo, "IM") == 1) OR ($usuario == $config["id_user"])) {
|
||||
html_print_select (users_get_info (), "usuario_form", $usuario, '', 'SYSTEM', '', false, false, true, "w135");
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
html_print_select (users_get_info (), "usuario_form", $usuario, '', 'SYSTEM', '', false, false, true, "w135", true);
|
||||
}
|
||||
echo '</td><td class="datos"><b>'.__('Status').'</b></td><td class="datos">';
|
||||
|
@ -271,7 +275,8 @@ echo '</td><td class="datos2"><b>'.__('Group').'</b></td><td class="datos2">';
|
|||
// Group combo
|
||||
if ((check_acl ($config["id_user"], $id_grupo, "IM") == 1) OR ($usuario == $config["id_user"])) {
|
||||
html_print_select_groups($config["id_user"], "IR", true, "grupo_form", $id_grupo, '', '', '', false, false, false, 'w135');
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
html_print_select_groups($config["id_user"], "IR", true, "grupo_form", $id_grupo, '', '', '', false, false, true, 'w135', true);
|
||||
}
|
||||
|
||||
|
@ -279,14 +284,16 @@ echo '</td></tr><tr><td class="datos"><b>'.__('Priority').'</b></td><td class="d
|
|||
|
||||
if ((check_acl ($config["id_user"], $id_grupo, "IM") == 1) OR ($usuario == $config["id_user"])) {
|
||||
html_print_select (incidents_get_priorities (), "prioridad_form", $prioridad, '', '', '', false, false, false, 'w135');
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
html_print_select (incidents_get_priorities (), "prioridad_form", $prioridad, '', '', '', false, false, false, 'w135', true);
|
||||
}
|
||||
|
||||
echo '</td><td class="datos"><b>'.__('Creator').'</b></td><td class="datos">';
|
||||
if (empty ($id_creator)) {
|
||||
echo 'SYSTEM';
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
echo $id_creator.' (<i>'.get_user_fullname($id_creator).'</i>)';
|
||||
}
|
||||
|
||||
|
@ -294,7 +301,8 @@ echo '</td></tr><tr><td class="datos2" colspan="4">';
|
|||
|
||||
if ((check_acl ($config["id_user"], $id_grupo, "IM") == 1) OR ($usuario == $config["id_user"])) {
|
||||
html_print_textarea ("descripcion", 15, 80, $texto, 'style="height:200px;"');
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
html_print_textarea ("descripcion", 15, 80, $texto, 'style="height:200px;" disabled');
|
||||
}
|
||||
|
||||
|
@ -303,9 +311,11 @@ echo '</td></tr></table><div style="width: 650px; text-align:right;">';
|
|||
// Only if user is the used who opened incident or (s)he is admin
|
||||
if (isset ($id_inc) AND ((check_acl ($config["id_user"], $id_grupo, "IM") == 1) OR ($usuario == $config["id_user"]))) {
|
||||
html_print_submit_button (__('Update incident'), "accion", false, 'class="sub upd"');
|
||||
} elseif (check_acl ($config["id_user"], $id_grupo, "IW")) {
|
||||
}
|
||||
elseif (check_acl ($config["id_user"], $id_grupo, "IW")) {
|
||||
html_print_submit_button (__('Create'), "accion", false, 'class="sub wand"');
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
html_print_submit_button (__('Submit'), "accion", true, 'class="sub upd"');
|
||||
}
|
||||
echo "</div></form>";
|
||||
|
@ -389,7 +399,8 @@ if (isset ($id_inc)) {
|
|||
$data[2] = format_for_graph ($row["size"])."B";
|
||||
if ((check_acl ($config["id_user"], $id_grupo, "IM") == 1) OR ($usuario == $config["id_user"])) {
|
||||
$data[3] = html_print_input_image ("delete_file", "images/cross.png", $row["id_attachment"], 'border:0px;" onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;', true);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$data[3] = '';
|
||||
}
|
||||
array_push ($table->data, $data);
|
||||
|
|
|
@ -50,7 +50,8 @@ if ($read_message) {
|
|||
$message_id = (int) get_parameter ("id_message");
|
||||
if ($show_sent) {
|
||||
$message = messages_get_message_sent ($message_id);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$message = messages_get_message ($message_id);
|
||||
messages_process_read ($message_id);
|
||||
}
|
||||
|
@ -92,7 +93,8 @@ if ($read_message) {
|
|||
//Prevent RE: RE: RE:
|
||||
if (strstr ($message["subject"], "RE:")) {
|
||||
$new_subj = $message["subject"];
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$new_subj = "RE: ".$message["subject"];
|
||||
}
|
||||
|
||||
|
|
|
@ -87,7 +87,8 @@ if ($show_sent) { //sent view
|
|||
echo '<p>'.__('You have').' <b>'.$num_messages.'</b> '.' '.__('sent message(s)').'.</p>';
|
||||
}
|
||||
$messages = messages_get_overview_sent ('', 'DESC');
|
||||
} else { //messages received
|
||||
}
|
||||
else { //messages received
|
||||
$num_messages = messages_get_count ($config["id_user"]);
|
||||
if ($num_messages > 0 && !is_ajax()) {
|
||||
echo '<p>'.__('You have').' <b>'.$num_messages.'</b> '.' '.__('unread message(s)').'.</p>';
|
||||
|
@ -97,7 +98,8 @@ if ($show_sent) { //sent view
|
|||
|
||||
if (empty ($messages)) {
|
||||
echo '<div class="nf">'.__('There are no messages').'</div>';
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$table->width = "98%";
|
||||
$table->class = "databox";
|
||||
$table->cellpadding = 4;
|
||||
|
@ -135,17 +137,20 @@ if (empty ($messages)) {
|
|||
$data[0] .= '<a href="index.php?sec=workspace&sec2=operation/messages/message_edit&read_message=1&show_sent=1&id_message='.$message_id.'">';
|
||||
$data[0] .= html_print_image ("images/email_open.png", true, array ("border" => 0, "title" => __('Click to read')));
|
||||
$data[0] .= '</a>';
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$data[0] .= '<a href="index.php?sec=workspace&sec2=operation/messages/message_list&mark_unread=1&id_message='.$message_id.'">';
|
||||
$data[0] .= html_print_image ("images/email_open.png", true, array ("border" => 0, "title" => __('Mark as unread')));
|
||||
$data[0] .= '</a>';
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
if ($show_sent) {
|
||||
$data[0] .= '<a href="index.php?sec=workspace&sec2=operation/messages/message_edit&read_message=1&show_sent=1&id_message='.$message_id.'">';
|
||||
$data[0] .= html_print_image ("images/email.png", true, array ("border" => 0, "title" => __('Message unread - click to read')));
|
||||
$data[0] .= '</a>';
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$data[0] .= '<a href="index.php?sec=workspace&sec2=operation/messages/message_edit&read_message=1&id_message='.$message_id.'">';
|
||||
$data[0] .= html_print_image ("images/email.png", true, array ("border" => 0, "title" => __('Message unread - click to read')));
|
||||
$data[0] .= '</a>';
|
||||
|
@ -158,7 +163,8 @@ if (empty ($messages)) {
|
|||
$dest_user = $message["dest"];
|
||||
}
|
||||
$data[1] = $dest_user;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$orig_user = get_user_fullname ($message["sender"]);
|
||||
if (!$orig_user) {
|
||||
$orig_user = $message["sender"];
|
||||
|
@ -168,12 +174,14 @@ if (empty ($messages)) {
|
|||
|
||||
if ($show_sent) {
|
||||
$data[2] = '<a href="index.php?sec=workspace&sec2=operation/messages/message_edit&read_message=1&show_sent=1&id_message='.$message_id.'">';
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$data[2] = '<a href="index.php?sec=workspace&sec2=operation/messages/message_edit&read_message=1&id_message='.$message_id.'">';
|
||||
}
|
||||
if ($message["subject"] == "") {
|
||||
$data[2] .= __('No Subject');
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$data[2] .= $message["subject"];
|
||||
}
|
||||
$data[2] .= '</a>';
|
||||
|
@ -185,7 +193,8 @@ if (empty ($messages)) {
|
|||
onClick="javascript:if (!confirm(\''.__('Are you sure?').'\')) return false;">' .
|
||||
html_print_image ('images/cross.png', true, array("title" => __('Delete'))) . '</a>'.
|
||||
html_print_checkbox_extended ('delete_multiple[]', $message_id, false, false, '', 'class="check_delete"', true);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$data[4] = '<a href="index.php?sec=workspace&sec2=operation/messages/message_list&delete_message=1&id='.$message_id.'"
|
||||
onClick="javascript:if (!confirm(\''.__('Are you sure?').'\')) return false;">' .
|
||||
html_print_image ('images/cross.png', true, array("title" => __('Delete'))) . '</a>'.
|
||||
|
|
|
@ -42,7 +42,7 @@ if ($id) {
|
|||
|
||||
$period = get_parameter('period', '86400');
|
||||
$update_date = get_parameter('update_date', 0);
|
||||
if($update_date){
|
||||
if ($update_date) {
|
||||
$date = get_parameter_post ('date');
|
||||
$time = get_parameter_post ('time');
|
||||
$interval = get_parameter('period','86400');
|
||||
|
@ -123,7 +123,8 @@ for ($x = 0; isset($all_rcs[$x]['id_rc']); $x++) {
|
|||
|
||||
if ($filter['aggregate'] != 'none') {
|
||||
echo '<h4>' . $filter['id_name'] . ' (' . __($filter['aggregate']) . '/' . __($filter['output']) . ')</h4>';
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
echo '<h4>' . $filter['id_name'] . ' (' . __($filter['output']) . ')</h4>';
|
||||
}
|
||||
|
||||
|
@ -132,9 +133,5 @@ for ($x = 0; isset($all_rcs[$x]['id_rc']); $x++) {
|
|||
|
||||
// Draw
|
||||
netflow_draw_item ($start_date, $end_date, $type, $filter, $command, $filter, $max_aggregates, $unique_id);
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
|
||||
|
|
|
@ -115,7 +115,8 @@ if ($view_graph) {
|
|||
$options['screen'] = "<a href='$url&pure=1'>"
|
||||
. html_print_image ("images/fullscreen.png", true, array ("title" => __('Full screen mode')))
|
||||
. "</a>";
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$options['screen'] = "<a href='$url&pure=0'>"
|
||||
. html_print_image ("images/normalscreen.png", true, array ("title" => __('Back to normal mode')))
|
||||
. "</a>";
|
||||
|
|
|
@ -83,7 +83,8 @@ else {
|
|||
foreach ($reports as $report) {
|
||||
if($linkReport) {
|
||||
$reportstring = "<a href='?sec=reporting&sec2=godmode/reporting/reporting_builder&action=edit&id_report=" . $report['id_report'] . "' title='" . __("Edit") . "'>" . $report['name'] . "</a>";
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$reportstring = $report['name'];
|
||||
}
|
||||
$data = array(
|
||||
|
|
|
@ -644,7 +644,8 @@ function CheckAll() {
|
|||
function toggleDiv (divid){
|
||||
if (document.getElementById(divid).style.display == 'none'){
|
||||
document.getElementById(divid).style.display = 'block';
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
document.getElementById(divid).style.display = 'none';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -49,13 +49,13 @@ if (is_ajax ()){
|
|||
$shortcut_update = get_parameter("shortcut_update", 0);
|
||||
|
||||
// Update of user to show/don't show shortcut bar
|
||||
if ($shortcut_update){
|
||||
if ($shortcut_update) {
|
||||
|
||||
// First we get the actual state
|
||||
$shortcut_value = db_get_value_filter('shortcut', 'tusuario', array('id_user' => $id));
|
||||
|
||||
//Deactivate shorcut var
|
||||
if ($shortcut_value == 1){
|
||||
if ($shortcut_value == 1) {
|
||||
db_process_sql_update('tusuario', array('shortcut' => 0), array('id_user' => $id));
|
||||
}
|
||||
// Activate shortcut var
|
||||
|
@ -198,7 +198,8 @@ if ($view_mode === false) {
|
|||
html_print_input_text_extended ("password_new", "", '', '', '15', '25', $view_mode, '', 'class="input"', false, true);
|
||||
echo '</td></tr><tr><td class="datos">'.__('Password confirmation').'</td><td class="datos">';
|
||||
html_print_input_text_extended ("password_conf", "", '', '', '15', '25', $view_mode, '', 'class="input"', false, true);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
echo '<i>'.__('You can not change your password from Pandora FMS under the current authentication scheme').'</i>';
|
||||
}
|
||||
}
|
||||
|
@ -265,7 +266,8 @@ $dashboards = get_user_dashboards ($config['id_user']);
|
|||
$dashboards_aux = array();
|
||||
if ($dashboards === false) {
|
||||
$dashboards = array('None'=>'None');
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
foreach ($dashboards as $key=>$dashboard) {
|
||||
$dashboards_aux[$dashboard['name']] = $dashboard['name'];
|
||||
}
|
||||
|
@ -276,7 +278,8 @@ $layouts = visual_map_get_user_layouts ($config['id_user'], true);
|
|||
$layouts_aux = array();
|
||||
if ($layouts === false) {
|
||||
$layouts_aux = array('None'=>'None');
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
foreach ($layouts as $layout) {
|
||||
$layouts_aux[$layout] = $layout;
|
||||
}
|
||||
|
@ -290,7 +293,8 @@ echo '</td></tr></table>';
|
|||
echo '<div style="width:90%; text-align:right;">';
|
||||
if (!$config["user_can_update_info"]) {
|
||||
echo '<i>'.__('You can not change your user info from Pandora FMS under the current authentication scheme').'</i>';
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
html_print_submit_button (__('Update'), 'uptbutton', $view_mode, 'class="sub upd"');
|
||||
}
|
||||
echo '</div></form>';
|
||||
|
@ -324,7 +328,8 @@ foreach ($result as $profile) {
|
|||
|
||||
if (!empty ($table->data)) {
|
||||
html_print_table ($table);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
echo '<div class="nf">'.__('This user doesn\'t have any assigned profile/group').'</div>';
|
||||
}
|
||||
?>
|
||||
|
|
Loading…
Reference in New Issue