From fdf21c8f458da79de3a47c43ce15fa21f488314e Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 16 Feb 2021 15:17:29 +0100 Subject: [PATCH] plugins: style sweep --- .../src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc | 8 ++++---- .../OPNsense/Quagga/Api/DiagnosticsController.php | 4 ++-- .../app/library/OPNsense/AcmeClient/LeCertificate.php | 8 ++++---- www/nginx/src/opnsense/scripts/nginx/setup.php | 11 ++++++----- 4 files changed, 16 insertions(+), 15 deletions(-) diff --git a/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc b/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc index df3cb8ce1..67c250a3a 100644 --- a/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc +++ b/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc @@ -883,11 +883,11 @@ class updatedns case 'gratisdns': $server = "https://admin.gratisdns.com/ddns.php"; curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true); - if(substr_count($this->_dnsHost, ".") < 2) { - $domain = $this->_dnsHost; - $hostname = $this->_dnsHost; + if (substr_count($this->_dnsHost, ".") < 2) { + $domain = $this->_dnsHost; + $hostname = $this->_dnsHost; } else { - list($hostname, $domain) = explode(".", $this->_dnsHost, 2); + list($hostname, $domain) = explode(".", $this->_dnsHost, 2); } curl_setopt($ch, CURLOPT_URL, $server . '?u=' . urlencode($this->_dnsUser) . '&p=' . $this->_dnsPass . '&h=' . $this->_dnsHost . '&d=' . $domain . '&i=' . $this->_dnsIP); break; diff --git a/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/Api/DiagnosticsController.php b/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/Api/DiagnosticsController.php index 7426a5f53..a92a3d8e0 100644 --- a/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/Api/DiagnosticsController.php +++ b/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/Api/DiagnosticsController.php @@ -44,7 +44,7 @@ class DiagnosticsController extends ApiControllerBase private function getInformation(string $daemon, string $name, string $format): array { $backend = new Backend(); - $response = $backend->configdRun("quagga diagnostics ".$daemon."_".$name.($format === "json" ? "_json" : "")); + $response = $backend->configdRun("quagga diagnostics " . $daemon . "_" . $name . ($format === "json" ? "_json" : "")); return array("response" => ($format === "json" ? json_decode($response) : $response)); } @@ -60,7 +60,7 @@ class DiagnosticsController extends ApiControllerBase if ($format === "json") { return array("response" => array("ipv4" => $routes4, "ipv6" => $routes6)); } else { - return array("response" => $routes4.$routes6); + return array("response" => $routes4 . $routes6); } } diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeCertificate.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeCertificate.php index 6855acb3b..97b4d2364 100644 --- a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeCertificate.php +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeCertificate.php @@ -344,11 +344,11 @@ class LeCertificate extends LeCommon // Check if called by auto renewal process. if (($acme_action == 'renew') and ($this->cron == 1) and ($auto_renewal == 0)) { - LeUtils::log('auto renewal is globally disabled, skipping certificate: ' . (string)$this->config->name); - return false; + LeUtils::log('auto renewal is globally disabled, skipping certificate: ' . (string)$this->config->name); + return false; } elseif (($acme_action == 'renew') and ($this->cron == 1) and ((string)$this->config->autoRenewal == 0)) { - LeUtils::log('auto renewal is disabled for certificate: ' . (string)$this->config->name); - return false; + LeUtils::log('auto renewal is disabled for certificate: ' . (string)$this->config->name); + return false; } LeUtils::log("${acme_action} certificate: " . (string)$this->config->name); diff --git a/www/nginx/src/opnsense/scripts/nginx/setup.php b/www/nginx/src/opnsense/scripts/nginx/setup.php index 8623106bd..d8452c804 100755 --- a/www/nginx/src/opnsense/scripts/nginx/setup.php +++ b/www/nginx/src/opnsense/scripts/nginx/setup.php @@ -200,13 +200,14 @@ if (isset($nginx['upstream'])) { $cas = array(); $carefs = explode(",", $upstream['tls_trusted_certificate']); foreach ($carefs as $caref) { - $ca = find_ca($caref); - if (isset($ca)) { - $cas[] = base64_decode($ca['crt']); - } + $ca = find_ca($caref); + if (isset($ca)) { + $cas[] = base64_decode($ca['crt']); + } } export_pem_file( - '/usr/local/etc/nginx/key/trust_upstream_' . $upstream_uuid . '.pem','', + '/usr/local/etc/nginx/key/trust_upstream_' . $upstream_uuid . '.pem', + '', implode("\n", $cas) ); }