Merge remote-tracking branch 'origin/develop' into ent-8558-inventario-pasa-de-enterprise-open
This commit is contained in:
commit
fc7187ed0c
|
@ -404,6 +404,7 @@ if ($id_profile || $new_profile) {
|
||||||
html_print_input_hidden('create_profile', 1);
|
html_print_input_hidden('create_profile', 1);
|
||||||
} else {
|
} else {
|
||||||
html_print_input_hidden('id', $id_profile);
|
html_print_input_hidden('id', $id_profile);
|
||||||
|
html_print_input_hidden('old_name_profile', $name);
|
||||||
html_print_input_hidden('update_profile', 1);
|
html_print_input_hidden('update_profile', 1);
|
||||||
html_print_submit_button(__('Update'), 'upd', false, 'class="sub upd"');
|
html_print_submit_button(__('Update'), 'upd', false, 'class="sub upd"');
|
||||||
}
|
}
|
||||||
|
@ -425,5 +426,43 @@ enterprise_hook('close_meta_frame');
|
||||||
$(id).css({'cursor':'not-allowed', 'opacity':'0.5'});
|
$(id).css({'cursor':'not-allowed', 'opacity':'0.5'});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Not enable enter for prevent submits
|
||||||
|
$(window).keydown(function(event){
|
||||||
|
if(event.keyCode == 13) {
|
||||||
|
event.preventDefault();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#text-name').on('blur',function(){
|
||||||
|
/* Check if the name is already on use for new profiles or check if the
|
||||||
|
name is already on use for update checking if the name is distinct of the original*/
|
||||||
|
if($('#hidden-create_profile').val()==1 || ($('#hidden-update_profile').val()==1 && $('#hidden-old_name_profile').val()!=$('#text-name').val())){
|
||||||
|
$.ajax({
|
||||||
|
type: "POST",
|
||||||
|
url: "ajax.php",
|
||||||
|
dataType: "html",
|
||||||
|
data: {
|
||||||
|
page: 'include/ajax/profile',
|
||||||
|
search_profile_nanme: true,
|
||||||
|
profile_name: $('#text-name').val().trim(),
|
||||||
|
},
|
||||||
|
success: function (data) {
|
||||||
|
if(data === 'true'){
|
||||||
|
alert( <?php echo "'".__('Profile name already on use, please, change the name before save')."'"; ?> );
|
||||||
|
if($('#hidden-old_name_profile').val()){
|
||||||
|
$('#text-name').val($('#hidden-old_name_profile').val());
|
||||||
|
}else{
|
||||||
|
$('#text-name').val("");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
error: function (data) {
|
||||||
|
console.error("Fatal error in AJAX call to interpreter order", data)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -0,0 +1,29 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
// Pandora FMS- http://pandorafms.com
|
||||||
|
// ==================================================
|
||||||
|
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
|
||||||
|
// Please see http://pandorafms.org for full contribution list
|
||||||
|
// This program is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public License
|
||||||
|
// as published by the Free Software Foundation; version 2
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU General Public License for more details.
|
||||||
|
global $config;
|
||||||
|
|
||||||
|
require_once $config['homedir'].'/include/functions_profile.php';
|
||||||
|
|
||||||
|
// Clean the possible blanks introduced by the included files.
|
||||||
|
ob_clean();
|
||||||
|
|
||||||
|
$search_profile_name = (bool) get_parameter('search_profile_nanme');
|
||||||
|
|
||||||
|
if ($search_profile_name) {
|
||||||
|
$profile_name = (string) get_parameter('profile_name');
|
||||||
|
|
||||||
|
echo json_encode(profile_exist($profile_name));
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
|
@ -693,13 +693,8 @@ function treeview_printTable($id_agente, $server_data=[], $no_head=false)
|
||||||
$cluster = PandoraFMS\Cluster::loadFromAgentId(
|
$cluster = PandoraFMS\Cluster::loadFromAgentId(
|
||||||
$agent['id_agente']
|
$agent['id_agente']
|
||||||
);
|
);
|
||||||
$url = 'index.php?sec=reporting&sec2=';
|
$go_to_agent .= '<a target=_blank href="'.$console_url.'index.php?sec=reporting&sec2=operation/cluster/cluster&op=update&id='.$cluster->id().'">';
|
||||||
$url .= 'operation/cluster/cluster';
|
$go_to_agent .= html_print_submit_button(__('Go to cluster edition'), 'upd_button', false, 'class="sub config"', true);
|
||||||
$url = ui_get_full_url(
|
|
||||||
$url.'&op=update&id='.$cluster->id()
|
|
||||||
);
|
|
||||||
$go_to_agent .= '<a target="_blank" href="'.$url.'">';
|
|
||||||
$go_to_agent .= html_print_submit_button(__('Edit cluster'), 'upd_button', false, 'class="sub config"', true);
|
|
||||||
} else {
|
} else {
|
||||||
$go_to_agent .= '<a target=_blank href="'.$console_url.'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente='.$id_agente.$ent.'">';
|
$go_to_agent .= '<a target=_blank href="'.$console_url.'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente='.$id_agente.$ent.'">';
|
||||||
$go_to_agent .= html_print_submit_button(__('Go to agent edition'), 'upd_button', false, 'class="sub config"', true);
|
$go_to_agent .= html_print_submit_button(__('Go to agent edition'), 'upd_button', false, 'class="sub config"', true);
|
||||||
|
|
|
@ -695,7 +695,7 @@ class Manager implements PublicLogin
|
||||||
|
|
||||||
// Check ACl.
|
// Check ACl.
|
||||||
if (\is_user_admin($config['id_user']) !== true) {
|
if (\is_user_admin($config['id_user']) !== true) {
|
||||||
// User no admin see dashboards of him groups and profile 'AR'.
|
// Non-admin user can see dashboards of his groups and 'AR' profile.
|
||||||
$group_list = \users_get_groups(
|
$group_list = \users_get_groups(
|
||||||
$config['id_user'],
|
$config['id_user'],
|
||||||
'RR',
|
'RR',
|
||||||
|
@ -802,7 +802,7 @@ class Manager implements PublicLogin
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
if (is_user_admin($config['id_user']) !== false) {
|
if (is_user_admin($config['id_user']) !== false) {
|
||||||
// User no admin see dashboards of him groups and profile 'AR'.
|
// Non-admin user can see dashboards of his groups and 'AR' profile.
|
||||||
$group_list = \users_get_groups(
|
$group_list = \users_get_groups(
|
||||||
$config['id_user'],
|
$config['id_user'],
|
||||||
'RR',
|
'RR',
|
||||||
|
@ -820,18 +820,11 @@ class Manager implements PublicLogin
|
||||||
$sql_dashboard = sprintf(
|
$sql_dashboard = sprintf(
|
||||||
"SELECT COUNT(*)
|
"SELECT COUNT(*)
|
||||||
FROM tdashboard
|
FROM tdashboard
|
||||||
WHERE (id_group IN (%s) AND id_user = '') OR
|
WHERE (id_group IN (%s))",
|
||||||
id_user = '%s'",
|
$string_groups
|
||||||
$string_groups,
|
|
||||||
$config['id_user']
|
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
$sql_dashboard = sprintf(
|
$sql_dashboard = 'SELECT COUNT(*) FROM tdashboard WHERE id_group = 0';
|
||||||
"SELECT COUNT(*)
|
|
||||||
FROM tdashboard
|
|
||||||
WHERE id_group = 0 AND id_user = '%s'",
|
|
||||||
$config['id_user']
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$sql_dashboard = 'SELECT COUNT(*) FROM tdashboard';
|
$sql_dashboard = 'SELECT COUNT(*) FROM tdashboard';
|
||||||
|
|
|
@ -401,7 +401,7 @@ if (!$meta) {
|
||||||
// User only can change skins if has more than one group.
|
// User only can change skins if has more than one group.
|
||||||
if (function_exists('skins_print_select')) {
|
if (function_exists('skins_print_select')) {
|
||||||
if (count($usr_groups) > 1) {
|
if (count($usr_groups) > 1) {
|
||||||
$skin = '<div class="label_select"><p class="edit_user_labels">'.__('Skin').': </p>';
|
$skin = '<div class="label_select"><p class="edit_user_labels">'.__('Theme').': </p>';
|
||||||
$skin .= skins_print_select($id_usr, 'skin', $user_info['id_skin'], '', __('None'), 0, true).'</div>';
|
$skin .= skins_print_select($id_usr, 'skin', $user_info['id_skin'], '', __('None'), 0, true).'</div>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -410,7 +410,7 @@ if (!$meta) {
|
||||||
// User only can change skins if has more than one group.
|
// User only can change skins if has more than one group.
|
||||||
if (function_exists('skins_print_select')) {
|
if (function_exists('skins_print_select')) {
|
||||||
if (count($usr_groups) > 1) {
|
if (count($usr_groups) > 1) {
|
||||||
$skin = '<div class="label_select"><p class="edit_user_labels">'.__('Skin').ui_print_help_tip(
|
$skin = '<div class="label_select"><p class="edit_user_labels">'.__('Theme').ui_print_help_tip(
|
||||||
__('This change will only apply to nodes'),
|
__('This change will only apply to nodes'),
|
||||||
true
|
true
|
||||||
).'</p>';
|
).'</p>';
|
||||||
|
|
Loading…
Reference in New Issue