new console report pandora_enterprise#6367

This commit is contained in:
Daniel Barbero Martin 2022-07-11 16:42:20 +02:00
parent 8987f733d3
commit 8e2b074460
5 changed files with 52 additions and 14 deletions

View File

@ -59,7 +59,7 @@ if (isset($config['autohidden_menu']) === true && (bool) $config['autohidden_men
// Start of full lateral menu.
echo sprintf('<div id="menu_full" class="menu_full_%s">', $menuTypeClass);
$url_logo = ui_get_full_url('index.php');
if (is_reporting_console_node() === false) {
if (is_reporting_console_node() === true) {
$url_logo = 'index.php?logged=1&sec=discovery&sec2=godmode/servers/discovery&wiz=tasklist';
}

View File

@ -158,7 +158,7 @@ if ($classname_selected === null) {
// Load classes and print selector.
$wiz_data = [];
foreach ($classes as $classpath) {
if (is_reporting_console_node() === false) {
if (is_reporting_console_node() === true) {
if ($classpath !== '/var/www/html/pandora_console/godmode/wizards/DiscoveryTaskList.class.php') {
continue;
}

View File

@ -6096,17 +6096,29 @@ function is_reporting_console_node()
*/
function acl_reporting_console_node($path)
{
global $config;
if (is_reporting_console_node() === false) {
return true;
}
if ($path === 'godmode/servers/discovery'
|| $path === 'operation/users/user_edit'
|| $path === 'operation/users/user_edit_notifications'
|| $path === 'godmode/setup/file_manager'
|| $path === 'godmode/update_manager/update_manager'
) {
return true;
if (is_metaconsole() === true) {
if ($path === $config['homedir'].'/godmode/users/configure_user'
|| $path === 'advanced/users_setup'
|| $path === 'advanced/metasetup'
|| $path === 'advanced/links'
|| $path === $config['homedir'].'/enterprise/extensions/cron'
) {
return true;
}
} else {
if ($path === 'godmode/servers/discovery'
|| $path === 'operation/users/user_edit'
|| $path === 'operation/users/user_edit_notifications'
|| $path === 'godmode/setup/file_manager'
|| $path === 'godmode/update_manager/update_manager'
) {
return true;
}
}
return false;

View File

@ -422,11 +422,37 @@ function cron_list_table()
array_keys(users_get_groups())
);
$defined_tasks = db_get_all_rows_filter(
'tuser_task_scheduled',
'id_grupo IN ('.$user_groups.')'
$filter = '';
if (is_reporting_console_node() === true) {
$write_perms = false;
$manage_perms = false;
$manage_pandora = false;
$filter .= sprintf(
' AND (
tuser_task.function_name = "cron_task_generate_report"
OR tuser_task.function_name = "cron_task_generate_report_by_template"
OR tuser_task.function_name = "cron_task_save_report_to_disk"
)'
);
}
// Admin.
$sql = sprintf(
'SELECT tuser_task_scheduled.*
FROM tuser_task_scheduled
INNER JOIN tuser_task
ON tuser_task_scheduled.id_user_task = tuser_task.id
WHERE
id_grupo IN (%s)
%s
',
$user_groups,
$filter
);
$defined_tasks = db_get_all_rows_sql($sql);
if (!check_acl($config['id_user'], 0, 'PM')) {
$read_tasks = [];
foreach ($defined_tasks as $task) {

View File

@ -605,7 +605,7 @@ if (isset($config['id_user']) === false) {
}
}
if (is_reporting_console_node() === false) {
if (is_reporting_console_node() === true) {
$_GET['sec'] = 'discovery';
$_GET['sec2'] = 'godmode/servers/discovery';
$_GET['wiz'] = 'tasklist';
@ -1047,7 +1047,7 @@ if ((bool) ($config['maintenance_mode'] ?? false) === true
exit('</html>');
}
if (is_reporting_console_node() === false
if (is_reporting_console_node() === true
&& (bool) users_is_admin() === false
) {
include 'general/reporting_console_node.php';