2013-02-20 Miguel de Dios <miguel.dedios@artica.es>

* godmode/servers/recon_script.php, godmode/servers/plugin.php,
	godmode/snmpconsole/snmp_filters.php,
	godmode/massive/massive_delete_alerts.php,
	godmode/massive/massive_enable_disable_alerts.php,
	godmode/massive/massive_edit_agents.php,
	godmode/massive/massive_delete_modules.php,
	godmode/massive/massive_add_action_alerts.php,
	godmode/massive/massive_delete_action_alerts.php: improved the code
	style.
	
	* include/ajax/events.php, include/functions_events.php,
	operation/agentes/custom_fields.php: fixed the show admin custom
	fields for user without permisitions.
	
	Fixes: #3605278




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7683 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2013-02-20 12:07:00 +00:00
parent cdc431f8b8
commit 067b5a1d8b
13 changed files with 191 additions and 136 deletions

View File

@ -1,3 +1,21 @@
2013-02-20 Miguel de Dios <miguel.dedios@artica.es>
* godmode/servers/recon_script.php, godmode/servers/plugin.php,
godmode/snmpconsole/snmp_filters.php,
godmode/massive/massive_delete_alerts.php,
godmode/massive/massive_enable_disable_alerts.php,
godmode/massive/massive_edit_agents.php,
godmode/massive/massive_delete_modules.php,
godmode/massive/massive_add_action_alerts.php,
godmode/massive/massive_delete_action_alerts.php: improved the code
style.
* include/ajax/events.php, include/functions_events.php,
operation/agentes/custom_fields.php: fixed the show admin custom
fields for user without permisitions.
Fixes: #3605278
2013-02-19 Ramon Novoa <rnovoa@artica.es>
* include/auth/ldap.php: Do not bind anonymously to check whether the

View File

@ -52,7 +52,8 @@ $delete = (bool) get_parameter_post ('delete');
if ($delete) {
if (empty($id_agents) || $id_agents[0] == 0)
ui_print_result_message (false, '', __('Could not be deleted').". ".__('No agents selected'));
ui_print_result_message (false, '',
__('Could not be deleted. No agents selected'));
else {
$actions = get_parameter ('action');
@ -67,7 +68,8 @@ if ($delete) {
}
if (empty($alerts_agent_modules)) {
ui_print_result_message (false, '', __('Could not be deleted').". ".__('No alerts selected'));
ui_print_result_message (false, '',
__('Could not be deleted. No alerts selected'));
}
else {
$results = true;
@ -99,11 +101,14 @@ if ($delete) {
' Actions: ' . implode(',',$actions));
}
ui_print_result_message ($results, __('Successfully deleted'), __('Could not be deleted'));
ui_print_result_message ($results,
__('Successfully deleted'),
__('Could not be deleted'));
}
}
else {
ui_print_result_message (false, '', __('Could not be deleted').". ".__('No action selected'));
ui_print_result_message (false, '',
__('Could not be deleted. No action selected'));
}
}
@ -150,12 +155,17 @@ $table->data[2][1] = html_print_select (index_array ($alert_templates, 'id_alert
$actions = alerts_get_alert_actions ();
$table->data[3][0] = __('Action');
$table->data[3][1] = html_print_select ($actions, 'action[]', '', '', '', '', true, true);
$table->data[3][1] = html_print_select ($actions, 'action[]', '', '',
'', '', true, true);
echo '<form method="post" id="form_alert" action="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&option=delete_action_alerts">';
html_print_table ($table);
$sql = 'SELECT id_agente FROM tagente_modulo WHERE id_agente_modulo IN (SELECT id_agent_module FROM talert_template_modules)';
$sql = 'SELECT id_agente
FROM tagente_modulo
WHERE id_agente_modulo IN (
SELECT id_agent_module
FROM talert_template_modules)';
$agents_with_templates = db_get_all_rows_sql($sql);
$agents_with_templates_json = array();
foreach($agents_with_templates as $ag) {

View File

@ -489,11 +489,16 @@ function changeIcons() {
$("#icon_warning").attr("style", "display:none;");
}
else {
$("#icon_without_status").attr("src", "<?php echo $path; ?>" + icon + ".default.png");
$("#icon_default").attr("src", "<?php echo $path; ?>" + icon + ".default.png");
$("#icon_ok").attr("src", "<?php echo $path; ?>" + icon + ".ok.png");
$("#icon_bad").attr("src", "<?php echo $path; ?>" + icon + ".bad.png");
$("#icon_warning").attr("src", "<?php echo $path; ?>" + icon + ".warning.png");
$("#icon_without_status").attr("src",
"<?php echo $path; ?>" + icon + ".default.png");
$("#icon_default").attr("src",
"<?php echo $path; ?>" + icon + ".default.png");
$("#icon_ok").attr("src",
"<?php echo $path; ?>" + icon + ".ok.png");
$("#icon_bad").attr("src",
"<?php echo $path; ?>" + icon + ".bad.png");
$("#icon_warning").attr("src",
"<?php echo $path; ?>" + icon + ".warning.png");
$("#icon_without_status").attr("style", "");
$("#icon_default").attr("style", "");
$("#icon_ok").attr("style", "");

View File

@ -55,6 +55,7 @@ if ($view != "") {
$macros = $plugin ["macros"];
$parameters = $plugin ["parameters"];
}
if ($create != "") {
$form_name = "";
$form_description = "";

View File

@ -1679,7 +1679,16 @@ function events_page_custom_fields ($event) {
$table->style[1] = 'text-align: left;';
$table->class = "databox alternate";
$all_customs_fields = (bool)check_acl($config["id_user"],
$agent["id_grupo"], "AW");
if ($all_customs_fields) {
$fields = db_get_all_rows_filter('tagent_custom_fields');
}
else {
$fields = db_get_all_rows_filter('tagent_custom_fields',
array('display_on_front' => 1));
}
if ($event['id_agente'] == 0) {
$fields_data = array();

View File

@ -36,8 +36,16 @@ if (! check_acl ($config["id_user"], $agent["id_grupo"], "AR")) {
return;
}
$all_customs_fields = (bool)check_acl($config["id_user"],
$agent["id_grupo"], "AW");
$fields = db_get_all_fields_in_table('tagent_custom_fields');
if ($all_customs_fields) {
$fields = db_get_all_rows_filter('tagent_custom_fields');
}
else {
$fields = db_get_all_rows_filter('tagent_custom_fields',
array('display_on_front' => 1));
}
if ($fields === false) {
$fields = array();
@ -47,7 +55,8 @@ else {
$table->width = '98%';
$table->head = array ();
$table->head[0] = __('Field');
$table->head[1] = __('Display on front') . ui_print_help_tip (__('The fields with display on front enabled will be displayed into the agent details'), true);
$table->head[1] = __('Display on front') .
ui_print_help_tip (__('The fields with display on front enabled will be displayed into the agent details'), true);
$table->head[2] = __('Description');
$table->align = array ();
$table->align[1] = 'center';
@ -65,7 +74,10 @@ else {
$data[1] = html_print_image('images/delete.png', true);
}
$custom_value = db_get_value_filter('description', 'tagent_custom_data', array('id_field' => $field['id_field'], 'id_agent' => $id_agente));
$custom_value = db_get_value_filter('description',
'tagent_custom_data', array(
'id_field' => $field['id_field'],
'id_agent' => $id_agente));
if ($custom_value === false || $custom_value == '') {
$custom_value = '<i>-'.__('empty').'-</i>';