From fedcd8eef006243cc02576d93d2dab0a1177f0b7 Mon Sep 17 00:00:00 2001 From: Neil Lathwood Date: Sat, 24 Sep 2016 02:53:55 +0100 Subject: [PATCH] refactor: OS discovery files (b) (#4531) * refactor: OS discovery files (b) * Switched order * small if() if() fix --- ...cuda.inc.php => barracudaloadbalancer.inc.php} | 12 ++---------- includes/discovery/os/barracudangfirewall.inc.php | 15 +++++++++++++++ .../discovery/os/barracudaspamfirewall.inc.php | 15 +++++++++++++++ includes/discovery/os/bcm963.inc.php | 6 ++---- includes/discovery/os/bdcom.inc.php | 6 ++---- includes/discovery/os/binos.inc.php | 8 ++------ includes/discovery/os/binox.inc.php | 8 ++------ includes/discovery/os/bintec-smart.inc.php | 7 +++---- includes/discovery/os/bnt.inc.php | 12 ++++-------- includes/discovery/os/brother.inc.php | 6 ++---- includes/discovery/os/buffalo.inc.php | 6 ++---- 11 files changed, 51 insertions(+), 50 deletions(-) rename includes/discovery/os/{barracuda.inc.php => barracudaloadbalancer.inc.php} (56%) create mode 100644 includes/discovery/os/barracudangfirewall.inc.php create mode 100644 includes/discovery/os/barracudaspamfirewall.inc.php diff --git a/includes/discovery/os/barracuda.inc.php b/includes/discovery/os/barracudaloadbalancer.inc.php similarity index 56% rename from includes/discovery/os/barracuda.inc.php rename to includes/discovery/os/barracudaloadbalancer.inc.php index 51341ef449..74c612bf64 100644 --- a/includes/discovery/os/barracuda.inc.php +++ b/includes/discovery/os/barracudaloadbalancer.inc.php @@ -10,14 +10,6 @@ * the source code distribution for details. */ -if (!$os) { - if (stristr($sysDescr, 'Barracuda Load Balancer') || stristr($sysDescr, 'Barracuda Load Balancer ADC')) { - $os = 'barracudaloadbalancer'; - } - if (stristr($sysDescr, 'Barracuda Spam Firewall')) { - $os = 'barracudaspamfirewall'; - } - if (stristr($sysDescr, 'Barracuda Firewall')) { - $os = 'barracudangfirewall'; - } +if (str_contains($sysDescr, array('Barracuda Load Balancer', 'Barracuda Load Balancer ADC'), true)) { + $os = 'barracudaloadbalancer'; } diff --git a/includes/discovery/os/barracudangfirewall.inc.php b/includes/discovery/os/barracudangfirewall.inc.php new file mode 100644 index 0000000000..0143cf6c70 --- /dev/null +++ b/includes/discovery/os/barracudangfirewall.inc.php @@ -0,0 +1,15 @@ + + * 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, either version 3 of the License, or (at your + * option) any later version. Please see LICENSE.txt at the top level of + * the source code distribution for details. + */ + +if (str_contains($sysDescr, 'Barracuda Firewall', true)) { + $os = 'barracudangfirewall'; +} diff --git a/includes/discovery/os/barracudaspamfirewall.inc.php b/includes/discovery/os/barracudaspamfirewall.inc.php new file mode 100644 index 0000000000..d573c14d52 --- /dev/null +++ b/includes/discovery/os/barracudaspamfirewall.inc.php @@ -0,0 +1,15 @@ + + * 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, either version 3 of the License, or (at your + * option) any later version. Please see LICENSE.txt at the top level of + * the source code distribution for details. + */ + +if (str_contains($sysDescr, 'Barracuda Spam Firewall', true)) { + $os = 'barracudaspamfirewall'; +} diff --git a/includes/discovery/os/bcm963.inc.php b/includes/discovery/os/bcm963.inc.php index 4113d29e01..2fb0e09914 100644 --- a/includes/discovery/os/bcm963.inc.php +++ b/includes/discovery/os/bcm963.inc.php @@ -1,7 +1,5 @@