Merge branch 'ent-3813-Autocompletado-de-campo-Proxy-auth-server-al-crear-webserver-module' into 'develop'

Removed autofill proxi in auth server

See merge request artica/pandorafms!2361
This commit is contained in:
Daniel Rodriguez 2019-09-05 18:29:43 +02:00
commit d02f3621f3
2 changed files with 57 additions and 7 deletions

View File

@ -1358,7 +1358,11 @@ if ($update_module || $create_module) {
$parent_module_id = (int) get_parameter('parent_module_id'); $parent_module_id = (int) get_parameter('parent_module_id');
$ip_target = (string) get_parameter('ip_target'); $ip_target = (string) get_parameter('ip_target');
if ($ip_target == '') { // No autofill if the module is a webserver module.
if ($ip_target == ''
&& $id_module_type < MODULE_WEBSERVER_CHECK_LATENCY
&& $id_module_type > MODULE_WEBSERVER_RETRIEVE_STRING_DATA
) {
$ip_target = 'auto'; $ip_target = 'auto';
} }
@ -2107,8 +2111,7 @@ if ($delete_module) {
} }
} }
// MODULE DUPLICATION // MODULE DUPLICATION.
// ==================.
if (!empty($duplicate_module)) { if (!empty($duplicate_module)) {
// DUPLICATE agent module ! // DUPLICATE agent module !
$id_duplicate_module = $duplicate_module; $id_duplicate_module = $duplicate_module;
@ -2154,8 +2157,46 @@ if (!empty($duplicate_module)) {
} }
} }
// UPDATE GIS // MODULE ENABLE/DISABLE.
// ==========. if ($enable_module) {
$result = modules_change_disabled($enable_module, 0);
$modulo_nombre = db_get_row_sql('SELECT nombre FROM tagente_modulo WHERE id_agente_modulo = '.$enable_module.'');
$modulo_nombre = $modulo_nombre['nombre'];
if ($result === NOERR) {
enterprise_hook('config_agents_enable_module_conf', [$id_agente, $enable_module]);
db_pandora_audit('Module management', 'Enable #'.$enable_module.' | '.$modulo_nombre.' | '.$agent['alias']);
} else {
db_pandora_audit('Module management', 'Fail to enable #'.$enable_module.' | '.$modulo_nombre.' | '.$agent['alias']);
}
ui_print_result_message(
$result,
__('Successfully enabled'),
__('Could not be enabled')
);
}
if ($disable_module) {
$result = modules_change_disabled($disable_module, 1);
$modulo_nombre = db_get_row_sql('SELECT nombre FROM tagente_modulo WHERE id_agente_modulo = '.$disable_module.'');
$modulo_nombre = $modulo_nombre['nombre'];
if ($result === NOERR) {
enterprise_hook('config_agents_disable_module_conf', [$id_agente, $disable_module]);
db_pandora_audit('Module management', 'Disable #'.$disable_module.' | '.$modulo_nombre.' | '.$agent['alias']);
} else {
db_pandora_audit('Module management', 'Fail to disable #'.$disable_module.' | '.$modulo_nombre.' | '.$agent['alias']);
}
ui_print_result_message(
$result,
__('Successfully disabled'),
__('Could not be disabled')
);
}
// UPDATE GIS.
$updateGIS = get_parameter('update_gis', 0); $updateGIS = get_parameter('update_gis', 0);
if ($updateGIS) { if ($updateGIS) {
$updateGisData = get_parameter('update_gis_data'); $updateGisData = get_parameter('update_gis_data');
@ -2243,8 +2284,11 @@ switch ($tab) {
break; break;
case 'alert': case 'alert':
// Because $id_agente is set, it will show only agent alerts. /*
// This var is for not display create button on alert list. * Because $id_agente is set, it will show only agent alerts
* This var is for not display create button on alert list
*/
$dont_display_alert_create_bttn = true; $dont_display_alert_create_bttn = true;
include 'godmode/alerts/alert_list.php'; include 'godmode/alerts/alert_list.php';
break; break;

View File

@ -355,6 +355,12 @@ define('MODULE_PREDICTION_CLUSTER', 5);
define('MODULE_PREDICTION_CLUSTER_AA', 6); define('MODULE_PREDICTION_CLUSTER_AA', 6);
define('MODULE_PREDICTION_CLUSTER_AP', 7); define('MODULE_PREDICTION_CLUSTER_AP', 7);
// Type of Webserver Modules.
define('MODULE_WEBSERVER_CHECK_LATENCY', 30);
define('MODULE_WEBSERVER_CHECK_SERVER_RESPONSE', 31);
define('MODULE_WEBSERVER_RETRIEVE_NUMERIC_DATA', 32);
define('MODULE_WEBSERVER_RETRIEVE_STRING_DATA', 33);
// SNMP CONSTANTS. // SNMP CONSTANTS.
define('SNMP_DIR_MIBS', 'attachment/mibs'); define('SNMP_DIR_MIBS', 'attachment/mibs');