plugins: style sweep

This commit is contained in:
Franco Fichtner
2021-02-16 15:17:29 +01:00
parent 429eda9b1c
commit fdf21c8f45
4 changed files with 16 additions and 15 deletions
@@ -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;
@@ -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);
}
}
@@ -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);
@@ -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)
);
}