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:
parent
af0a970cea
commit
77b944b6e1
|
@ -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.
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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":
|
||||
|
|
|
@ -547,102 +547,102 @@ 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) {
|
||||
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] = '<a href="index.php?sec='.$sec.'&sec2=godmode/users/configure_profile&id='.$profile['id_perfil'].'&pure='.$pure.'">'.profile_get_name ($profile['id_perfil']).'</a>';
|
||||
$data[1] = ui_print_group_icon($profile["id_grupo"], true);
|
||||
if (!defined('METACONSOLE'))
|
||||
$data[1] .= '<a href="index.php?sec=estado&sec2=operation/agentes/estado_agente&refr=60&group_id='.$profile['id_grupo'].'&pure='.$pure.'">';
|
||||
|
||||
$data[1] .= ' ' . ui_print_truncate_text(groups_get_name ($profile['id_grupo'], True), GENERIC_SIZE_TEXT);
|
||||
if (!defined('METACONSOLE'))
|
||||
$data[1] .= '</a>';
|
||||
|
||||
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] = '<form method="post" onsubmit="if (!confirm (\''.__('Are you sure?').'\')) return false">';
|
||||
$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] .= '</form>';
|
||||
|
||||
array_push ($table->data, $data);
|
||||
}
|
||||
|
||||
$data = array ();
|
||||
|
||||
$data[0] = '<a href="index.php?sec='.$sec.'&sec2=godmode/users/configure_profile&id='.$profile['id_perfil'].'&pure='.$pure.'">'.profile_get_name ($profile['id_perfil']).'</a>';
|
||||
$data[1] = ui_print_group_icon($profile["id_grupo"], true);
|
||||
if (!defined('METACONSOLE'))
|
||||
$data[1] .= '<a href="index.php?sec=estado&sec2=operation/agentes/estado_agente&refr=60&group_id='.$profile['id_grupo'].'&pure='.$pure.'">';
|
||||
|
||||
$data[1] .= ' ' . ui_print_truncate_text(groups_get_name ($profile['id_grupo'], True), GENERIC_SIZE_TEXT);
|
||||
if (!defined('METACONSOLE'))
|
||||
$data[1] .= '</a>';
|
||||
|
||||
if(empty($profile["tags"])) {
|
||||
$data[2] = '';
|
||||
|
||||
$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 {
|
||||
$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] = '<form method="post" onsubmit="if (!confirm (\''.__('Are you sure?').'\')) return false">';
|
||||
$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] .= '</form>';
|
||||
|
||||
|
||||
array_push ($table->data, $data);
|
||||
|
||||
html_print_table ($table);
|
||||
unset ($table);
|
||||
|
||||
}
|
||||
|
||||
$data = array ();
|
||||
|
||||
$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 {
|
||||
$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] .= '</form>';
|
||||
|
||||
array_push ($table->data, $data);
|
||||
|
||||
html_print_table ($table);
|
||||
unset ($table);
|
||||
|
||||
enterprise_hook('close_meta_frame');
|
||||
|
||||
?>
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue