2013-07-31 Sergio Martin <sergio.martin@artica.es>

* 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



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8606 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
zarzuelo 2013-07-31 11:34:42 +00:00
parent af0a970cea
commit 77b944b6e1
5 changed files with 106 additions and 92 deletions

View File

@ -1,3 +1,16 @@
2013-07-31 Sergio Martin <sergio.martin@artica.es>
* 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 <miguel.dedios@artica.es>
* operation/agentes/networkmap.php: added dinamic tab.

View File

@ -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 '<form name="grupo" method="post" action="index.php?sec=gagente&sec2=godmode/groups/group_list">';
echo '<form name="grupo" method="post" action="index.php?sec=gagente&sec2=godmode/groups/group_list&pure=' . $config['pure'] . '">';
html_print_table ($table);
echo '<div class="action-buttons" style="width: '.$table->width.'">';
if ($id_group) {
@ -186,7 +186,7 @@ function icon_changed () {
jQuery.ajax ({
data: params.join ("&"),
type: 'POST',
url: action="ajax.php",
url: action="<?php echo ui_get_full_url("ajax.php", false, false, false); ?>",
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="<?php echo ui_get_full_url("ajax.php", false, false, false); ?>",
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="<?php echo ui_get_full_url("ajax.php", false, false, false); ?>",
async: false,
timeout: 10000,
success: function (result) {

View File

@ -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":

View File

@ -547,36 +547,34 @@ echo '</form>';
echo '<br />';
/* Don't show anything else if we're creating an user */
if (empty ($id) || $new_user)
return;
if (!empty ($id) && !$new_user) {
echo '<h4>'. __('Profiles/Groups assigned to this user') . '</h4>';
echo '<h4>'. __('Profiles/Groups assigned to this user') . '</h4>';
$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) {
/*
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 = db_get_all_rows_field_filter ("tusuario_perfil", "id_usuario", $id);
if ($result === false) {
$result = array ();
}
}
foreach ($result as $profile) {
foreach ($result as $profile) {
if($profile["id_grupo"] == -1) {
continue;
}
@ -610,38 +608,40 @@ foreach ($result as $profile) {
$data[3] .= '</form>';
array_push ($table->data, $data);
}
}
$data = array ();
$data = array ();
$data[0] = '<form method="post">';
if (check_acl ($config['id_user'], 0, "PM")) {
$data[0] = '<form method="post">';
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 {
}
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",
$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();
$tags = tags_get_all_tags();
$data[2] = html_print_select($tags, 'assign_tags[]', '', '', __('Any'), '', true, true);
$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] .= '</form>';
$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] .= '</form>';
array_push ($table->data, $data);
array_push ($table->data, $data);
html_print_table ($table);
unset ($table);
html_print_table ($table);
unset ($table);
}
enterprise_hook('close_meta_frame');

View File

@ -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 {