diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 026b5a94aa..72504ed854 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,16 @@ +2013-07-31 Sergio Martin + + * include/functions_agents.php: Fix a if condition + broken for a previous test code + + * godmode/groups/group_list.php: Fix propagate ACL + field when create group + + * godmode/groups/configure_group.php: Fixed pure parameter + + * godmode/users/configure_user.php: Fixed autohidding of fields in + user edition due return avoiding javascript code + 2013-07-31 Miguel de Dios * operation/agentes/networkmap.php: added dinamic tab. diff --git a/pandora_console/godmode/groups/configure_group.php b/pandora_console/godmode/groups/configure_group.php index f76818b1db..27bb0c3de8 100644 --- a/pandora_console/godmode/groups/configure_group.php +++ b/pandora_console/godmode/groups/configure_group.php @@ -153,7 +153,7 @@ if ($isFunctionSkins !== ENTERPRISE_NOT_HOOK) { $table->data[9][1] = skins_print_select($config["id_user"], 'skin', $skin, '', __('None'), 0, true); } -echo '
'; +echo ''; html_print_table ($table); echo '
'; if ($id_group) { @@ -186,7 +186,7 @@ function icon_changed () { jQuery.ajax ({ data: params.join ("&"), type: 'POST', - url: action="ajax.php", + url: action="", async: false, timeout: 10000, success: function (result) { @@ -206,7 +206,7 @@ function parent_changed () { jQuery.ajax ({ data: inputs.join ("&"), type: 'GET', - url: action="ajax.php", + url: action="", timeout: 10000, dataType: 'json', success: function (data) { @@ -225,7 +225,7 @@ function parent_changed () { jQuery.ajax ({ data: params.join ("&"), type: 'POST', - url: action="ajax.php", + url: action="", async: false, timeout: 10000, success: function (result) { diff --git a/pandora_console/godmode/groups/group_list.php b/pandora_console/godmode/groups/group_list.php index 13446f13e5..9f4c56bc62 100644 --- a/pandora_console/godmode/groups/group_list.php +++ b/pandora_console/godmode/groups/group_list.php @@ -137,20 +137,21 @@ if (($create_group) && (check_acl($config['id_user'], 0, "PM"))) { $contact = (string) get_parameter ('contact'); $other = (string) get_parameter ('other'); $check = db_get_value('nombre', 'tgrupo', 'nombre', $name); - + $propagate = (bool) get_parameter('propagate'); /*Check if name field is empty*/ if ($name != "") { if (!$check) { $values = array( 'nombre' => $name, - 'icon' => substr ($icon, 0, -4), + 'icon' => empty($icon) ? '' : substr ($icon, 0, -4), 'parent' => $id_parent, 'disabled' => $alerts_disabled, 'custom_id' => $custom_id, 'id_skin' => $skin, 'description' => $description, 'contact' => $contact, + 'propagate' => $propagate, 'other' => $other ); @@ -194,7 +195,7 @@ if ($update_group) { $sql = sprintf ('UPDATE tgrupo SET nombre = "%s", icon = "%s", disabled = %d, parent = %d, custom_id = "%s", propagate = %d, id_skin = %d, description = "%s", contact = "%s", other = "%s" WHERE id_grupo = %d', - $name, substr ($icon, 0, -4), !$alerts_enabled, $id_parent, $custom_id, $propagate, $skin, $description, $contact, $other, $id_group); + $name, empty($icon) ? '' : substr ($icon, 0, -4), !$alerts_enabled, $id_parent, $custom_id, $propagate, $skin, $description, $contact, $other, $id_group); break; case "postgresql": case "oracle": diff --git a/pandora_console/godmode/users/configure_user.php b/pandora_console/godmode/users/configure_user.php index 784853131b..4a901461fa 100644 --- a/pandora_console/godmode/users/configure_user.php +++ b/pandora_console/godmode/users/configure_user.php @@ -547,102 +547,102 @@ echo ''; echo '
'; /* Don't show anything else if we're creating an user */ -if (empty ($id) || $new_user) - return; +if (!empty ($id) && !$new_user) { + echo '

'. __('Profiles/Groups assigned to this user') . '

'; -echo '

'. __('Profiles/Groups assigned to this user') . '

'; + $table->width = '98%'; + $table->data = array (); + $table->head = array (); + $table->align = array (); + $table->style = array (); + $table->style[0] = 'font-weight: bold'; + $table->style[1] = 'font-weight: bold'; + $table->head[0] = __('Profile name'); + $table->head[1] = __('Group'); + $table->head[2] = __('Tags'); + $table->head[3] = __('Action'); + $table->align[3] = 'center'; -$table->width = '98%'; -$table->data = array (); -$table->head = array (); -$table->align = array (); -$table->style = array (); -$table->style[0] = 'font-weight: bold'; -$table->style[1] = 'font-weight: bold'; -$table->head[0] = __('Profile name'); -$table->head[1] = __('Group'); -$table->head[2] = __('Tags'); -$table->head[3] = __('Action'); -$table->align[3] = 'center'; - -/* -if ($enterprise_include) { - add_enterprise_column_user_profile_form($table); -} -*/ - -$result = db_get_all_rows_field_filter ("tusuario_perfil", "id_usuario", $id); -if ($result === false) { - $result = array (); -} - -foreach ($result as $profile) { - if($profile["id_grupo"] == -1) { - continue; + /* + if ($enterprise_include) { + add_enterprise_column_user_profile_form($table); } - + */ + + $result = db_get_all_rows_field_filter ("tusuario_perfil", "id_usuario", $id); + if ($result === false) { + $result = array (); + } + + foreach ($result as $profile) { + if($profile["id_grupo"] == -1) { + continue; + } + + $data = array (); + + $data[0] = ''.profile_get_name ($profile['id_perfil']).''; + $data[1] = ui_print_group_icon($profile["id_grupo"], true); + if (!defined('METACONSOLE')) + $data[1] .= ''; + + $data[1] .= ' ' . ui_print_truncate_text(groups_get_name ($profile['id_grupo'], True), GENERIC_SIZE_TEXT); + if (!defined('METACONSOLE')) + $data[1] .= ''; + + if(empty($profile["tags"])) { + $data[2] = ''; + } + else { + $tags_ids = explode(',',$profile["tags"]); + $tags = tags_get_tags($tags_ids); + + $data[2] = tags_get_tags_formatted($tags); + } + + $data[3] = '
'; + $data[3] .= html_print_input_hidden ('delete_profile', 1, true); + $data[3] .= html_print_input_hidden ('id_user_profile', $profile['id_up'], true); + $data[3] .= html_print_input_hidden ('id_user', $id, true); + $data[3] .= html_print_input_image ('del', 'images/cross.png', 1, '', true); + $data[3] .= '
'; + + array_push ($table->data, $data); + } + $data = array (); - - $data[0] = ''.profile_get_name ($profile['id_perfil']).''; - $data[1] = ui_print_group_icon($profile["id_grupo"], true); - if (!defined('METACONSOLE')) - $data[1] .= ''; - - $data[1] .= ' ' . ui_print_truncate_text(groups_get_name ($profile['id_grupo'], True), GENERIC_SIZE_TEXT); - if (!defined('METACONSOLE')) - $data[1] .= ''; - - if(empty($profile["tags"])) { - $data[2] = ''; + + $data[0] = '
'; + if (check_acl ($config['id_user'], 0, "PM")) { + $data[0] .= html_print_select (profile_get_profiles (), 'assign_profile', 0, '', + __('None'), 0, true, false, false); } else { - $tags_ids = explode(',',$profile["tags"]); - $tags = tags_get_tags($tags_ids); - - $data[2] = tags_get_tags_formatted($tags); + $data[0] .= html_print_select (profile_get_profiles (array ('pandora_management' => '<> 1', + 'db_management' => '<> 1')), 'assign_profile', 0, '', __('None'), 0, + true, false, false); } - $data[3] = ''; - $data[3] .= html_print_input_hidden ('delete_profile', 1, true); - $data[3] .= html_print_input_hidden ('id_user_profile', $profile['id_up'], true); - $data[3] .= html_print_input_hidden ('id_user', $id, true); - $data[3] .= html_print_input_image ('del', 'images/cross.png', 1, '', true); + $data[1] = html_print_select_groups($config['id_user'], "UM", + $own_info['is_admin'], 'assign_group', -1, '', __('None'), -1, true, + false, false); + + $tags = tags_get_all_tags(); + + $data[2] = html_print_select($tags, 'assign_tags[]', '', '', __('Any'), '', true, true); + + $data[3] = html_print_input_image ('add', 'images/add.png', 1, '', true); + $data[3] .= html_print_input_hidden ('id', $id, true); + $data[3] .= html_print_input_hidden ('add_profile', 1, true); $data[3] .= '
'; - + array_push ($table->data, $data); + + html_print_table ($table); + unset ($table); + } -$data = array (); - -$data[0] = '
'; -if (check_acl ($config['id_user'], 0, "PM")) { - $data[0] .= html_print_select (profile_get_profiles (), 'assign_profile', 0, '', - __('None'), 0, true, false, false); -} -else { - $data[0] .= html_print_select (profile_get_profiles (array ('pandora_management' => '<> 1', - 'db_management' => '<> 1')), 'assign_profile', 0, '', __('None'), 0, - true, false, false); -} - -$data[1] = html_print_select_groups($config['id_user'], "UM", - $own_info['is_admin'], 'assign_group', -1, '', __('None'), -1, true, - false, false); - -$tags = tags_get_all_tags(); - -$data[2] = html_print_select($tags, 'assign_tags[]', '', '', __('Any'), '', true, true); - -$data[3] = html_print_input_image ('add', 'images/add.png', 1, '', true); -$data[3] .= html_print_input_hidden ('id', $id, true); -$data[3] .= html_print_input_hidden ('add_profile', 1, true); -$data[3] .= '
'; - -array_push ($table->data, $data); - -html_print_table ($table); -unset ($table); - enterprise_hook('close_meta_frame'); ?> diff --git a/pandora_console/include/functions_agents.php b/pandora_console/include/functions_agents.php index 2aac1b65e3..1dc27b3e44 100644 --- a/pandora_console/include/functions_agents.php +++ b/pandora_console/include/functions_agents.php @@ -167,7 +167,7 @@ function agents_get_alerts_simple ($id_agent = false, $filter = '', $options = f } // If there are any errors add imposible condition - if(in_array($where_tags, array(ERR_WRONG_PARAMETERS, ERR_ACL)) || TRUE) { + if(in_array($where_tags, array(ERR_WRONG_PARAMETERS, ERR_ACL))) { $subQuery .= ' AND 1 = 0'; } else {