diff --git a/pandora_console/ajax.php b/pandora_console/ajax.php
index 9c68547b60..9b59695555 100644
--- a/pandora_console/ajax.php
+++ b/pandora_console/ajax.php
@@ -148,7 +148,9 @@ if (__PAN_XHPROF__ === 1) {
}
-if ($config['force_instant_logout'] === true) {
+if (isset($config['force_instant_logout']) === true
+ && $config['force_instant_logout'] === true
+) {
// Force user logout.
if (session_status() !== PHP_SESSION_ACTIVE) {
session_start();
diff --git a/pandora_console/include/ajax/snmp_browser.ajax.php b/pandora_console/include/ajax/snmp_browser.ajax.php
index 8b0928589c..8c10fdb16c 100644
--- a/pandora_console/include/ajax/snmp_browser.ajax.php
+++ b/pandora_console/include/ajax/snmp_browser.ajax.php
@@ -107,7 +107,7 @@ try {
);
// Div for error/succes dialog.
- $output .= '
';
+ $output = '';
// Dialog error.
$output .= '';
@@ -183,6 +183,7 @@ try {
if ($method == 'snmp_browser_create_modules') {
// Get target ids from form.
$id_items = get_parameter('id_item2', null);
+ $id_target = null;
if (empty($id_items) === false) {
$id_target = explode(',', $id_items[0]);
}
@@ -263,7 +264,5 @@ try {
}
}
} catch (\Exception $e) {
- $e->getMessage();
-} finally {
- exit;
+ hd($e);
}
diff --git a/pandora_console/include/functions_html.php b/pandora_console/include/functions_html.php
index b013c8bc49..d00628000c 100644
--- a/pandora_console/include/functions_html.php
+++ b/pandora_console/include/functions_html.php
@@ -536,6 +536,8 @@ function html_print_select_groups(
$include_groups[$nothing_value] = $nothing;
}
+ $json_exclusions = '';
+ $json_inclusions = '';
if (is_array($delete_groups) === true) {
$json_exclusions = json_encode($delete_groups);
}
diff --git a/pandora_console/include/functions_modules.php b/pandora_console/include/functions_modules.php
index fb333b4dd8..28b3e36a4c 100755
--- a/pandora_console/include/functions_modules.php
+++ b/pandora_console/include/functions_modules.php
@@ -675,6 +675,8 @@ function modules_create_agent_module(
$time = 0;
if (empty($values['interval']) === false) {
$time = (time() - (int) $values['interval']);
+ } else {
+ $values['interval'] = null;
}
$result = db_process_sql_insert(
diff --git a/pandora_console/include/functions_snmp_browser.php b/pandora_console/include/functions_snmp_browser.php
index 962bd9be4c..e130dc788b 100644
--- a/pandora_console/include/functions_snmp_browser.php
+++ b/pandora_console/include/functions_snmp_browser.php
@@ -1094,17 +1094,55 @@ function snmp_browser_print_container(
*/
function snmp_browser_create_modules_snmp(string $module_target, array $snmp_values, ?array $id_target)
{
+ $target_ip = null;
+ $community = null;
+ $target_oid = null;
+ $snmp_version = null;
+ $snmp3_auth_user = null;
+ $snmp3_security_level = null;
+ $snmp3_auth_method = null;
+ $snmp3_auth_pass = null;
+ $snmp3_privacy_method = null;
+ $snmp3_privacy_pass = null;
+
if (is_array($snmp_values)) {
- $snmp_version = $snmp_values['snmp_browser_version'];
- $community = $snmp_values['community'];
- $target_ip = $snmp_values['target_ip'];
- $snmp3_auth_user = $snmp_values['snmp3_browser_auth_user'];
- $snmp3_security_level = $snmp_values['snmp3_browser_security_level'];
- $snmp3_auth_method = $snmp_values['snmp3_browser_auth_method'];
- $snmp3_auth_pass = $snmp_values['snmp3_browser_auth_pass'];
- $snmp3_privacy_method = $snmp_values['snmp3_privacy_method'];
- $snmp3_privacy_pass = $snmp_values['snmp3_browser_privacy_pass'];
- $targets_oids = $snmp_values['oids'];
+ if (isset($snmp_values['snmp_browser_version']) === true) {
+ $snmp_version = $snmp_values['snmp_browser_version'];
+ }
+
+ if (isset($snmp_values['community']) === true) {
+ $community = $snmp_values['community'];
+ }
+
+ if (isset($snmp_values['target_ip']) === true) {
+ $target_ip = $snmp_values['target_ip'];
+ }
+
+ if (isset($snmp_values['snmp3_browser_auth_user']) === true) {
+ $snmp3_auth_user = $snmp_values['snmp3_browser_auth_user'];
+ }
+
+ if (isset($snmp_values['snmp3_browser_security_level']) === true) {
+ $snmp3_security_level = $snmp_values['snmp3_browser_security_level'];
+ };
+ if (isset($snmp_values['snmp3_browser_auth_method']) === true) {
+ $snmp3_auth_method = $snmp_values['snmp3_browser_auth_method'];
+ }
+
+ if (isset($snmp_values['snmp3_browser_auth_pass']) === true) {
+ $snmp3_auth_pass = $snmp_values['snmp3_browser_auth_pass'];
+ }
+
+ if (isset($snmp_values['snmp3_privacy_method']) === true) {
+ $snmp3_privacy_method = $snmp_values['snmp3_privacy_method'];
+ };
+ if (isset($snmp_values['snmp3_browser_privacy_pass']) === true) {
+ $snmp3_privacy_pass = $snmp_values['snmp3_browser_privacy_pass'];
+ }
+
+ if (isset($snmp_values['oids']) === true) {
+ $targets_oids = $snmp_values['oids'];
+ }
}
$fail_modules = [];
@@ -1326,7 +1364,7 @@ function snmp_browser_create_modules_snmp(string $module_target, array $snmp_val
}
}
- if (is_array($ids)) {
+ if (isset($ids) === true && is_array($ids) === true) {
foreach ($ids as $id) {
// Id < 0 for error codes.
if (!$id || $id < 0) {
@@ -1354,6 +1392,8 @@ function snmp_browser_create_modules_snmp(string $module_target, array $snmp_val
*/
function snmp_browser_print_create_module_massive($target='agent', $snmp_conf, $return=false)
{
+ global $config;
+
// String for labels.
switch ($target) {
case 'agent':
@@ -1365,7 +1405,7 @@ function snmp_browser_print_create_module_massive($target='agent', $snmp_conf, $
break;
}
- $output .= "