From 74bf043a44515e7ecd6da9cecab6728c6d703bff Mon Sep 17 00:00:00 2001 From: Bill Gertz Date: Tue, 15 Oct 2019 18:31:14 +0200 Subject: [PATCH] Output right switch depending on logLevel choice Noticed that from the controller form settings.xml the logLevel selection is a drop down allowing only once choice between: - normal - extensive - debug Added the additional choices: - debug 2 - debug 3 Altered the php code to implement a switch in line with that single possible choice. --- .../scripts/OPNsense/AcmeClient/certhelper.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/certhelper.php b/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/certhelper.php index 764bdcc0e..307aa79da 100755 --- a/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/certhelper.php +++ b/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/certhelper.php @@ -328,8 +328,18 @@ function eval_optional_acme_args() $acme_args[] = isset($options["S"]) ? "--staging" : null; // for debug purpose // Set log level - $acme_args[] = $configObj->OPNsense->AcmeClient->settings->logLevel == "normal" ? "--log-level 1" : "--log-level 2"; - $acme_args[] = $configObj->OPNsense->AcmeClient->settings->logLevel == "debug" ? "--debug" : null; + switch($configObj->OPNsense->AcmeClient->settings->logLevel) { + case "extended": + $acme_args[] = "--log-level 2"; + case "debug": + $acme_args[] = "--debug"; + case "debug2": + $acme_args[] = "--debug 2"; + case "debug3": + $acme_args[] = "--debug 3"; + default: + $acme_args[] = "--log-level 1"; + } // Remove empty and duplicate elements from array return(array_unique(array_filter($acme_args)));