From aca95b5554ed40618b140efef67a8905c81c7c7a Mon Sep 17 00:00:00 2001 From: Lars Elgtvedt Susaas <9848846+nimrof@users.noreply.github.com> Date: Tue, 12 May 2020 22:49:39 +0200 Subject: [PATCH] bugfix: addhost (web) snmp v3 not used first (#11536) * Update addhost.inc.php bugfix: push snmp v3 user settings to the front of the config array and not the back. To reproduce the bug: Force add new snmp v3 device. The v3 settings added to the database will not be the same as entered in the webpage * Update addhost.inc.php Minor change in order to trigger travis build --- includes/html/pages/addhost.inc.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/html/pages/addhost.inc.php b/includes/html/pages/addhost.inc.php index 20a3166428..444b814840 100644 --- a/includes/html/pages/addhost.inc.php +++ b/includes/html/pages/addhost.inc.php @@ -67,11 +67,11 @@ if (!empty($_POST['hostname'])) { ); $v3_config = Config::get('snmp.v3'); - array_push($v3_config, $v3); + array_unshift($v3_config, $v3); Config::set('snmp.v3', $v3_config); $snmpver = 'v3'; - print_message("Adding SNMPv3 host $hostname port $port"); + print_message("Adding SNMPv3 host: $hostname port: $port"); } else { print_error('Unsupported SNMP Version. There was a dropdown menu, how did you reach this error ?'); }//end if