Fixed code

This commit is contained in:
Jose Gonzalez 2021-05-28 13:20:16 +02:00
parent b75b55c0a5
commit 84902a5d3d
3 changed files with 82 additions and 39 deletions

View File

@ -196,6 +196,7 @@ function mainModuleGroups()
ON ta.id_agente = tam.id_agente
WHERE ta.disabled = 0
AND tam.disabled = 0
AND tam.id_modulo <> 0
AND tam.delete_pending = 0
AND ta.id_grupo IN (%s)
GROUP BY tam.id_agente_modulo

View File

@ -1,29 +1,43 @@
<?php
/**
* Resource registration.
*
* @category Extensions
* @package Pandora FMS
* @subpackage Community
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* 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 General Public License
* as published by the Free Software Foundation for 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.
* ============================================================================
*/
// 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 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.
// Remember the hard-coded values
/*
-- id_modulo now uses tmodule
-- ---------------------------
-- 1 - Data server modules (agent related modules)
-- 2 - Network server modules
-- 4 - Plugin server
-- 5 - Predictive server
-- 6 - WMI server
-- 7 - WEB Server (enteprise)
In the xml is the tag "module_source"
*/
/**
* Remember the hard-coded values.
* -- id_modulo now uses tmodule.
* -- ---------------------------.
* -- 1 - Data server modules (agent related modules)
* -- 2 - Network server modules
* -- 4 - Plugin server
* -- 5 - Predictive server
* -- 6 - WMI server
* -- 7 - WEB Server (enteprise)
* In the xml is the tag "module_source"
*/
require_once $config['homedir'].'/include/functions_agents.php';
enterprise_include_once('include/functions_local_components.php');
@ -1097,7 +1111,13 @@ function resource_registration_extension_main()
$xml = simplexml_load_file($_FILES['resource_upload']['tmp_name'], null, LIBXML_NOCDATA);
process_upload_xml($xml);
if ($xml === false) {
ui_print_error_message(
__('Error uploading resource. Check if the selected file is a valid resource template in .ptr format')
);
} else {
process_upload_xml($xml);
}
}

View File

@ -1,17 +1,32 @@
<?php
/**
* Common editor fields.
*
* @category Module manager
* @package Pandora FMS
* @subpackage Community
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* 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 General Public License
* as published by the Free Software Foundation for 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.
* ============================================================================
*/
// 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 General Public License
// as published by the Free Software Foundation for 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.
// Begin
require_once $config['homedir'].'/include/functions_modules.php';
require_once $config['homedir'].'/include/functions_categories.php';
require_once $config['homedir'].'/include/graphs/functions_d3.php';
@ -19,7 +34,9 @@ require_once $config['homedir'].'/include/graphs/functions_d3.php';
include_javascript_d3();
global $config;function prepend_table_simple($row, $id=false)
global $config;
function prepend_table_simple($row, $id=false)
{
global $table_simple;
@ -115,7 +132,12 @@ function add_component_selection($id_network_component_type)
'',
'---'.__('Manual setup').'---',
0,
true
true,
false,
true,
'',
false,
'width: 460px; '
);
$data[1] .= '</span>';
$data[1] .= ' <span id="component_loading" class="invisible">';