From c3328e60c04b1abefb57862eb34082df4043a8b1 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 7 Oct 2019 16:27:10 +0200 Subject: [PATCH] plugins: PSR12 "b", "d" and "m" --- .../OPNsense/iperf/IndexController.php | 1 + .../OPNsense/Redis/IndexController.php | 1 + .../mvc/app/models/OPNsense/Redis/Redis.php | 1 + .../GridExample/Api/SettingsController.php | 1 + .../OPNsense/GridExample/IndexController.php | 1 + .../OPNsense/GridExample/GridExample.php | 1 + .../HelloWorld/Api/ServiceController.php | 1 + .../HelloWorld/Api/SettingsController.php | 5 +- .../Api/SimplifiedSettingsController.php | 1 + .../OPNsense/HelloWorld/IndexController.php | 1 + .../models/OPNsense/HelloWorld/HelloWorld.php | 1 + .../OPNsense/Bind/Api/AclController.php | 1 + .../OPNsense/Bind/Api/DomainController.php | 1 + .../OPNsense/Bind/Api/RecordController.php | 3 +- .../Dnscryptproxy/Api/CloakController.php | 1 + .../Dnscryptproxy/Api/ForwardController.php | 1 + .../Dnscryptproxy/Api/WhitelistController.php | 1 + .../inc/plugins.inc.d/dyndns/phpDynDNS.inc | 94 ++++++++++--------- .../app/models/OPNsense/Postfix/Address.php | 1 + .../app/models/OPNsense/Postfix/Antispam.php | 1 + .../app/models/OPNsense/Postfix/Domain.php | 1 + .../app/models/OPNsense/Postfix/General.php | 1 + .../app/models/OPNsense/Postfix/Recipient.php | 1 + .../models/OPNsense/Postfix/Recipientbcc.php | 1 + .../app/models/OPNsense/Postfix/Sender.php | 1 + .../app/models/OPNsense/Postfix/Senderbcc.php | 1 + .../OPNsense/Postfix/Sendercanonical.php | 1 + .../OPNsense/Rspamd/IndexController.php | 1 + .../mvc/app/models/OPNsense/Rspamd/RSpamd.php | 1 + 29 files changed, 79 insertions(+), 49 deletions(-) diff --git a/benchmarks/iperf/src/opnsense/mvc/app/controllers/OPNsense/iperf/IndexController.php b/benchmarks/iperf/src/opnsense/mvc/app/controllers/OPNsense/iperf/IndexController.php index 8992b913e..1b1ed9ab0 100644 --- a/benchmarks/iperf/src/opnsense/mvc/app/controllers/OPNsense/iperf/IndexController.php +++ b/benchmarks/iperf/src/opnsense/mvc/app/controllers/OPNsense/iperf/IndexController.php @@ -1,4 +1,5 @@ "failed"); + $result = array("result" => "failed"); if ($this->request->isPost()) { // load model and update with provided data $mdlHelloWorld = new HelloWorld(); @@ -75,7 +76,7 @@ class SettingsController extends ApiControllerBase if (!array_key_exists("validations", $result)) { $result["validations"] = array(); } - $result["validations"]["helloworld.".$msg->getField()] = $msg->getMessage(); + $result["validations"]["helloworld." . $msg->getField()] = $msg->getMessage(); } // serialize model to config and save diff --git a/devel/helloworld/src/opnsense/mvc/app/controllers/OPNsense/HelloWorld/Api/SimplifiedSettingsController.php b/devel/helloworld/src/opnsense/mvc/app/controllers/OPNsense/HelloWorld/Api/SimplifiedSettingsController.php index 81059fa83..53e3a36f5 100644 --- a/devel/helloworld/src/opnsense/mvc/app/controllers/OPNsense/HelloWorld/Api/SimplifiedSettingsController.php +++ b/devel/helloworld/src/opnsense/mvc/app/controllers/OPNsense/HelloWorld/Api/SimplifiedSettingsController.php @@ -1,4 +1,5 @@ * diff --git a/dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/Api/DomainController.php b/dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/Api/DomainController.php index d4894ed4d..9de4842d1 100644 --- a/dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/Api/DomainController.php +++ b/dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/Api/DomainController.php @@ -1,4 +1,5 @@ * Copyright (C) 2019 Deciso B.V. diff --git a/dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/Api/RecordController.php b/dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/Api/RecordController.php index c9b04bc97..2e81e5da1 100644 --- a/dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/Api/RecordController.php +++ b/dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/Api/RecordController.php @@ -1,4 +1,5 @@ * Copyright (C) 2019 Deciso B.V. @@ -50,7 +51,7 @@ class RecordController extends ApiMutableModelControllerBase if ($this->request->isPost()) { $record = $this->getModel()->getRecord($uuid); if ($record !== null) { - (new Domain)->updateSerial((string)$record->domain)->serializeToConfig(); + (new Domain())->updateSerial((string)$record->domain)->serializeToConfig(); Config::getInstance()->save(); } } diff --git a/dns/dnscrypt-proxy/src/opnsense/mvc/app/controllers/OPNsense/Dnscryptproxy/Api/CloakController.php b/dns/dnscrypt-proxy/src/opnsense/mvc/app/controllers/OPNsense/Dnscryptproxy/Api/CloakController.php index 6d01e97df..23bbb5a25 100644 --- a/dns/dnscrypt-proxy/src/opnsense/mvc/app/controllers/OPNsense/Dnscryptproxy/Api/CloakController.php +++ b/dns/dnscrypt-proxy/src/opnsense/mvc/app/controllers/OPNsense/Dnscryptproxy/Api/CloakController.php @@ -1,4 +1,5 @@ * diff --git a/dns/dnscrypt-proxy/src/opnsense/mvc/app/controllers/OPNsense/Dnscryptproxy/Api/ForwardController.php b/dns/dnscrypt-proxy/src/opnsense/mvc/app/controllers/OPNsense/Dnscryptproxy/Api/ForwardController.php index 0525dee1c..6676fdbea 100644 --- a/dns/dnscrypt-proxy/src/opnsense/mvc/app/controllers/OPNsense/Dnscryptproxy/Api/ForwardController.php +++ b/dns/dnscrypt-proxy/src/opnsense/mvc/app/controllers/OPNsense/Dnscryptproxy/Api/ForwardController.php @@ -1,4 +1,5 @@ * diff --git a/dns/dnscrypt-proxy/src/opnsense/mvc/app/controllers/OPNsense/Dnscryptproxy/Api/WhitelistController.php b/dns/dnscrypt-proxy/src/opnsense/mvc/app/controllers/OPNsense/Dnscryptproxy/Api/WhitelistController.php index 7950a2099..dc27411e4 100644 --- a/dns/dnscrypt-proxy/src/opnsense/mvc/app/controllers/OPNsense/Dnscryptproxy/Api/WhitelistController.php +++ b/dns/dnscrypt-proxy/src/opnsense/mvc/app/controllers/OPNsense/Dnscryptproxy/Api/WhitelistController.php @@ -1,4 +1,5 @@ * 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 19387cde8..0159bcaf6 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 @@ -181,7 +181,7 @@ class updatedns log_error("Dynamic DNS: updatedns() starting"); } - $dyndnslck = lock("DDNS".$dnsID, LOCK_EX); + $dyndnslck = lock("DDNS" . $dnsID, LOCK_EX); if (!$dnsService) { $this->_error(2); @@ -370,7 +370,7 @@ class updatedns $this->_dnsWildcard = "ON"; } curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); - curl_setopt($ch, CURLOPT_USERPWD, $this->_dnsUser.':'.$this->_dnsPass); + curl_setopt($ch, CURLOPT_USERPWD, $this->_dnsUser . ':' . $this->_dnsPass); $server = "https://members.dyndns.org/nic/update"; $port = ""; if ($this->_dnsServer) { @@ -379,7 +379,7 @@ class updatedns if ($this->_dnsPort) { $port = ":" . $this->_dnsPort; } - curl_setopt($ch, CURLOPT_URL, $server .$port . '?system=dyndns&hostname=' . $this->_dnsHost . '&myip=' . $this->_dnsIP . '&wildcard='.$this->_dnsWildcard . '&mx=' . $this->_dnsMX . '&backmx=NO'); + curl_setopt($ch, CURLOPT_URL, $server . $port . '?system=dyndns&hostname=' . $this->_dnsHost . '&myip=' . $this->_dnsIP . '&wildcard=' . $this->_dnsWildcard . '&mx=' . $this->_dnsMX . '&backmx=NO'); break; case 'dhs': $post_data['hostscmd'] = 'edit'; @@ -406,7 +406,7 @@ class updatedns $port = ":" . $this->_dnsPort; } curl_setopt($ch, CURLOPT_URL, '{$server}{$port}'); - curl_setopt($ch, CURLOPT_USERPWD, $this->_dnsUser.':'.$this->_dnsPass); + curl_setopt($ch, CURLOPT_USERPWD, $this->_dnsUser . ':' . $this->_dnsPass); curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data); break; case 'noip': @@ -420,9 +420,11 @@ class updatedns if ($this->_dnsPort) { $port = ":" . $this->_dnsPort; } - if (($this->_dnsService == "noip-free") && - ($this->_forceUpdateNeeded == true) && - ($this->_dnsDummyUpdateDone == false)) { + if ( + ($this->_dnsService == "noip-free") && + ($this->_forceUpdateNeeded == true) && + ($this->_dnsDummyUpdateDone == false) + ) { // Update the IP to a dummy value to force No-IP free accounts to see a change. $iptoset = "192.168.1.1"; $this->_dnsDummyUpdateDone = true; @@ -430,11 +432,11 @@ class updatedns } else { $iptoset = $this->_dnsIP; } - curl_setopt($ch, CURLOPT_URL, $server . $port . '?username=' . urlencode($this->_dnsUser) . '&pass=' . urlencode($this->_dnsPass) . '&hostname=' . $this->_dnsHost.'&ip=' . $iptoset); + curl_setopt($ch, CURLOPT_URL, $server . $port . '?username=' . urlencode($this->_dnsUser) . '&pass=' . urlencode($this->_dnsPass) . '&hostname=' . $this->_dnsHost . '&ip=' . $iptoset); break; case 'easydns': curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true); - curl_setopt($ch, CURLOPT_USERPWD, $this->_dnsUser.':'.$this->_dnsPass); + curl_setopt($ch, CURLOPT_USERPWD, $this->_dnsUser . ':' . $this->_dnsPass); $server = "https://members.easydns.com/dyn/dyndns.php"; $port = ""; if ($this->_dnsServer) { @@ -446,7 +448,7 @@ class updatedns curl_setopt($ch, CURLOPT_URL, $server . $port . '?hostname=' . $this->_dnsHost . '&myip=' . $this->_dnsIP . '&wildcard=' . $this->_dnsWildcard . '&mx=' . $this->_dnsMX . '&backmx=' . $this->_dnsBackMX); break; case 'hn': - curl_setopt($ch, CURLOPT_USERPWD, $this->_dnsUser.':'.$this->_dnsPass); + curl_setopt($ch, CURLOPT_USERPWD, $this->_dnsUser . ':' . $this->_dnsPass); $server = "http://dup.hn.org/vanity/update"; $port = ""; if ($this->_dnsServer) { @@ -460,7 +462,7 @@ class updatedns case 'zoneedit': curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); - curl_setopt($ch, CURLOPT_USERPWD, $this->_dnsUser.':'.$this->_dnsPass); + curl_setopt($ch, CURLOPT_USERPWD, $this->_dnsUser . ':' . $this->_dnsPass); $server = "https://dynamic.zoneedit.com/auth/dynamic.html"; $port = ""; @@ -470,7 +472,7 @@ class updatedns if ($this->_dnsPort) { $port = ":" . $this->_dnsPort; } - curl_setopt($ch, CURLOPT_URL, "{$server}{$port}?host=" .$this->_dnsHost); + curl_setopt($ch, CURLOPT_URL, "{$server}{$port}?host=" . $this->_dnsHost); break; case 'dyns': /* XXX HTTPS is currently broken for them */ @@ -508,13 +510,13 @@ class updatedns sleep(1); switch ($code) { case 100: - fputs($this->con['socket'], "LOGIN ".$this->_dnsUser." ".$this->_dnsPass."\n"); + fputs($this->con['socket'], "LOGIN " . $this->_dnsUser . " " . $this->_dnsPass . "\n"); break; case 225: - fputs($this->con['socket'], "DELRR ".$this->_dnsHost." A\n"); + fputs($this->con['socket'], "DELRR " . $this->_dnsHost . " A\n"); break; case 901: - fputs($this->con['socket'], "ADDRR ".$this->_dnsHost." A ".$this->_dnsIP."\n"); + fputs($this->con['socket'], "ADDRR " . $this->_dnsHost . " A " . $this->_dnsIP . "\n"); break; case 795: fputs($this->con['socket'], "QUIT\n"); @@ -527,16 +529,16 @@ class updatedns curl_setopt($ch, CURLOPT_URL, 'https://freedns.afraid.org/dynamic/update.php?' . $this->_dnsPass); break; case 'dnsexit': - curl_setopt($ch, CURLOPT_URL, 'https://www.dnsexit.com/RemoteUpdate.sv?login='.urlencode($this->_dnsUser). '&password='.$this->_dnsPass.'&host='.$this->_dnsHost.'&myip='.$this->_dnsIP); + curl_setopt($ch, CURLOPT_URL, 'https://www.dnsexit.com/RemoteUpdate.sv?login=' . urlencode($this->_dnsUser) . '&password=' . $this->_dnsPass . '&host=' . $this->_dnsHost . '&myip=' . $this->_dnsIP); break; case 'loopia': $this->_dnsWildcard = (isset($this->_dnsWildcard) && $this->_dnsWildcard == true) ? 'ON' : 'OFF'; curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); - curl_setopt($ch, CURLOPT_USERPWD, $this->_dnsUser.':'.$this->_dnsPass); - curl_setopt($ch, CURLOPT_URL, 'https://dns.loopia.se/XDynDNSServer/XDynDNS.php?hostname='.$this->_dnsHost.'&myip='.$this->_dnsIP.'&wildcard='.$this->_dnsWildcard); + curl_setopt($ch, CURLOPT_USERPWD, $this->_dnsUser . ':' . $this->_dnsPass); + curl_setopt($ch, CURLOPT_URL, 'https://dns.loopia.se/XDynDNSServer/XDynDNS.php?hostname=' . $this->_dnsHost . '&myip=' . $this->_dnsIP . '&wildcard=' . $this->_dnsWildcard); break; case 'staticcling': - curl_setopt($ch, CURLOPT_URL, 'https://www.staticcling.org/update.html?login='.urlencode($this->_dnsUser).'&pass='.$this->_dnsPass); + curl_setopt($ch, CURLOPT_URL, 'https://www.staticcling.org/update.html?login=' . urlencode($this->_dnsUser) . '&pass=' . $this->_dnsPass); break; case 'dnsomatic': /* Example syntax @@ -562,7 +564,7 @@ class updatedns if ($this->_dnsPort) { $port = ":" . $this->_dnsPort; } - curl_setopt($ch, CURLOPT_URL, $server . $this->_dnsHost . '&myip=' . $this->_dnsIP . '&wildcard='.$this->_dnsWildcard . '&mx=' . $this->_dnsMX . '&backmx=NOCHG'); + curl_setopt($ch, CURLOPT_URL, $server . $this->_dnsHost . '&myip=' . $this->_dnsIP . '&wildcard=' . $this->_dnsWildcard . '&mx=' . $this->_dnsMX . '&backmx=NOCHG'); break; case 'namecheap': /* Example: @@ -570,7 +572,7 @@ class updatedns */ curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); $dparts = explode(".", trim($this->_dnsHost)); - $domain_part_count = ($dparts[count($dparts)-1] == "uk") ? 3 : 2; + $domain_part_count = ($dparts[count($dparts) - 1] == "uk") ? 3 : 2; $domain_offset = count($dparts) - $domain_part_count; $hostname = implode(".", array_slice($dparts, 0, $domain_offset)); $domain = implode(".", array_slice($dparts, $domain_offset)); @@ -614,7 +616,7 @@ class updatedns $this->_dnsWildcard = "ON"; } curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true); - curl_setopt($ch, CURLOPT_USERPWD, $this->_dnsUser.':'.$this->_dnsPass); + curl_setopt($ch, CURLOPT_USERPWD, $this->_dnsUser . ':' . $this->_dnsPass); $server = "https://carol.selfhost.de/nic/update"; $port = ""; if ($this->_dnsServer) { @@ -623,17 +625,17 @@ class updatedns if ($this->_dnsPort) { $port = ":" . $this->_dnsPort; } - curl_setopt($ch, CURLOPT_URL, $server .$port . '?system=dyndns&hostname=' . $this->_dnsHost . '&myip=' . $this->_dnsIP . '&wildcard='.$this->_dnsWildcard . '&mx=' . $this->_dnsMX . '&backmx=NO'); + curl_setopt($ch, CURLOPT_URL, $server . $port . '?system=dyndns&hostname=' . $this->_dnsHost . '&myip=' . $this->_dnsIP . '&wildcard=' . $this->_dnsWildcard . '&mx=' . $this->_dnsMX . '&backmx=NO'); break; case 'route53': case 'route53-v6': /* Setting Variables */ $hostname = "{$this->_dnsHost}."; $ZoneID = $this->_dnsZoneID; - $AccessKeyId=$this->_dnsUser; - $SecretAccessKey=$this->_dnsPass; - $NewIP=$this->_dnsIP; - $NewTTL=$this->_dnsTTL; + $AccessKeyId = $this->_dnsUser; + $SecretAccessKey = $this->_dnsPass; + $NewIP = $this->_dnsIP; + $NewTTL = $this->_dnsTTL; $RecordType = ($this->_useIPv6) ? "AAAA" : "A"; /* Set Amazon AWS Credentials for this record */ @@ -673,10 +675,10 @@ class updatedns } } - $OldTTL=$oldTTLResult; - $OldIP=$oldIPResult; + $OldTTL = $oldTTLResult; + $OldIP = $oldIPResult; } else { - $OldIP=""; + $OldIP = ""; } /* Check if we need to update DNS Record */ @@ -773,13 +775,13 @@ class updatedns break; case 'eurodns': curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); - curl_setopt($ch, CURLOPT_USERPWD, $this->_dnsUser.':'.$this->_dnsPass); + curl_setopt($ch, CURLOPT_USERPWD, $this->_dnsUser . ':' . $this->_dnsPass); $server = "https://update.eurodyndns.org/update/"; $port = ""; if ($this->_dnsPort) { $port = ":" . $this->_dnsPort; } - curl_setopt($ch, CURLOPT_URL, $server .$port . '?hostname=' . $this->_dnsHost . '&myip=' . $this->_dnsIP); + curl_setopt($ch, CURLOPT_URL, $server . $port . '?hostname=' . $this->_dnsHost . '&myip=' . $this->_dnsIP); break; case 'gratisdns': $server = "https://ssl.gratisdns.dk/ddns.phtml"; @@ -792,7 +794,7 @@ class updatedns $this->_dnsWildcard = "ON"; } curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true); - curl_setopt($ch, CURLOPT_USERPWD, $this->_dnsUser.':'.$this->_dnsPass); + curl_setopt($ch, CURLOPT_USERPWD, $this->_dnsUser . ':' . $this->_dnsPass); $server = "https://www.ovh.com/nic/update"; $port = ""; if ($this->_dnsServer) { @@ -801,11 +803,11 @@ class updatedns if ($this->_dnsPort) { $port = ":" . $this->_dnsPort; } - curl_setopt($ch, CURLOPT_URL, $server .$port . '?system=dyndns&hostname=' . $this->_dnsHost . '&myip=' . $this->_dnsIP . '&wildcard='.$this->_dnsWildcard . '&mx=' . $this->_dnsMX . '&backmx=NO'); + curl_setopt($ch, CURLOPT_URL, $server . $port . '?system=dyndns&hostname=' . $this->_dnsHost . '&myip=' . $this->_dnsIP . '&wildcard=' . $this->_dnsWildcard . '&mx=' . $this->_dnsMX . '&backmx=NO'); break; case 'citynetwork': curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true); - curl_setopt($ch, CURLOPT_USERPWD, $this->_dnsUser.':'.$this->_dnsPass); + curl_setopt($ch, CURLOPT_USERPWD, $this->_dnsUser . ':' . $this->_dnsPass); $server = 'https://dyndns.citynetwork.se/nic/update'; $port = ""; if ($this->_dnsServer) { @@ -814,7 +816,7 @@ class updatedns if ($this->_dnsPort) { $port = ":" . $this->_dnsPort; } - curl_setopt($ch, CURLOPT_URL, $server .$port . '?hostname=' . $this->_dnsHost . '&myip=' . $this->_dnsIP); + curl_setopt($ch, CURLOPT_URL, $server . $port . '?hostname=' . $this->_dnsHost . '&myip=' . $this->_dnsIP); break; case 'duckdns': $server = "https://www.duckdns.org/update"; @@ -827,7 +829,7 @@ class updatedns $post_data['myip'] = $this->_dnsIP; $post_data['offline'] = 'no'; curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true); - curl_setopt($ch, CURLOPT_USERPWD, $this->_dnsUser.':'.$this->_dnsPass); + curl_setopt($ch, CURLOPT_USERPWD, $this->_dnsUser . ':' . $this->_dnsPass); curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data); curl_setopt($ch, CURLOPT_URL, $server); curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4); @@ -835,19 +837,19 @@ class updatedns case 'strato': $server = "https://dyndns.strato.com/nic/update?hostname={$this->_dnsHost}&myip={$this->_dnsIP}"; curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true); - curl_setopt($ch, CURLOPT_USERPWD, $this->_dnsUser.':'.$this->_dnsPass); + curl_setopt($ch, CURLOPT_USERPWD, $this->_dnsUser . ':' . $this->_dnsPass); curl_setopt($ch, CURLOPT_URL, $server); curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4); break; case '3322': $server = "http://members.3322.net/dyndns/update?hostname={$this->_dnsHost}&myip={$this->_dnsIP}"; - curl_setopt($ch, CURLOPT_USERPWD, $this->_dnsUser.':'.$this->_dnsPass); + curl_setopt($ch, CURLOPT_USERPWD, $this->_dnsUser . ':' . $this->_dnsPass); curl_setopt($ch, CURLOPT_URL, $server); curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4); break; case 'oray': $server = "http://ddns.oray.com/ph/update?hostname={$this->_dnsHost}&myip={$this->_dnsIP}"; - curl_setopt($ch, CURLOPT_USERPWD, $this->_dnsUser.':'.$this->_dnsPass); + curl_setopt($ch, CURLOPT_USERPWD, $this->_dnsUser . ':' . $this->_dnsPass); curl_setopt($ch, CURLOPT_URL, $server); curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4); break; @@ -948,7 +950,7 @@ class updatedns break; default: $status = "Dynamic DNS ({$this->_dnsHost}): (Unknown Response)"; - $this->_debug("Unknown Response: ".$data); + $this->_debug("Unknown Response: " . $data); break; } break; @@ -998,7 +1000,7 @@ class updatedns } elseif (preg_match('/403/i', $data)) { $status = "Dynamic DNS ({$this->_dnsHost}): (Error) Database Error - There was a server-sided database error."; } elseif (preg_match('/405/i', $data)) { - $status = "Dynamic DNS ({$this->_dnsHost}): (Error) Hostname Error - The hostname (".$this->_dnsHost.") doesn't belong to you."; + $status = "Dynamic DNS ({$this->_dnsHost}): (Error) Hostname Error - The hostname (" . $this->_dnsHost . ") doesn't belong to you."; } elseif (preg_match('/200/i', $data)) { $status = "Dynamic DNS ({$this->_dnsHost}): (Success) IP Address Updated Successfully!"; $successful_update = true; @@ -1105,7 +1107,7 @@ class updatedns $this->_dnsResultMatch = str_replace("%IP%", $this->_dnsIP, $this->_dnsResultMatch); $matches = preg_split("/(?_dnsResultMatch); foreach ($matches as $match) { - $match= str_replace("\\|", "|", $match); + $match = str_replace("\\|", "|", $match); if (strcmp($match, trim($data, "\t\n\r")) == 0) { $successful_update = true; } @@ -1345,7 +1347,7 @@ class updatedns if (file_exists($this->_cacheFile_v6)) { $contents = file_get_contents($this->_cacheFile_v6); list($cacheIP,$cacheTime) = explode('|', $contents); - $this->_debug($cacheIP.'/'.$cacheTime); + $this->_debug($cacheIP . '/' . $cacheTime); $initial = false; $log_error .= "Cached IPv6: {$cacheIP} "; } else { @@ -1359,7 +1361,7 @@ class updatedns if (file_exists($this->_cacheFile)) { $contents = file_get_contents($this->_cacheFile); list($cacheIP,$cacheTime) = explode('|', $contents); - $this->_debug($cacheIP.'/'.$cacheTime); + $this->_debug($cacheIP . '/' . $cacheTime); $initial = false; $log_error .= "Cached IP: {$cacheIP} "; } else { @@ -1416,7 +1418,7 @@ class updatedns */ function _debug($data) { - $string = date('m-d-y h:i:s').' - ('.$this->_debugID.') - ['.$this->_dnsService.'] - '.$data."\n"; + $string = date('m-d-y h:i:s') . ' - (' . $this->_debugID . ') - [' . $this->_dnsService . '] - ' . $data . "\n"; $file = fopen($this->_debugFile, 'a'); fwrite($file, $string); fclose($file); diff --git a/mail/postfix/src/opnsense/mvc/app/models/OPNsense/Postfix/Address.php b/mail/postfix/src/opnsense/mvc/app/models/OPNsense/Postfix/Address.php index 688ae41d3..a1e80cec7 100644 --- a/mail/postfix/src/opnsense/mvc/app/models/OPNsense/Postfix/Address.php +++ b/mail/postfix/src/opnsense/mvc/app/models/OPNsense/Postfix/Address.php @@ -1,4 +1,5 @@