diff options
author | Phil Davis <phil.davis@inf.org> | 2015-12-10 17:01:11 +0545 |
---|---|---|
committer | Stephen Beaver <sbeaver@netgate.com> | 2015-12-10 10:09:30 -0500 |
commit | 4e322e2c189e18133324c933ad35f0735fab510f (patch) | |
tree | 91cb8c627c8efbe69ceb7e7dc41635d6a144e12e /src/etc/inc/dyndns.class | |
parent | b3b10d30794a60ed9a781cc3c8e0d29b774bf86e (diff) | |
download | pfsense-4e322e2c189e18133324c933ad35f0735fab510f.zip pfsense-4e322e2c189e18133324c933ad35f0735fab510f.tar.gz |
Code style and white space in etc
Diffstat (limited to 'src/etc/inc/dyndns.class')
-rw-r--r-- | src/etc/inc/dyndns.class | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/etc/inc/dyndns.class b/src/etc/inc/dyndns.class index a241485..1d1641b 100644 --- a/src/etc/inc/dyndns.class +++ b/src/etc/inc/dyndns.class @@ -300,7 +300,7 @@ $ch = curl_init(); if ($this->_useIPv6 == false) { - curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4 ); + curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4); } if ($this->_dnsService != 'ods' and $this->_dnsService != 'route53 ') { @@ -691,7 +691,7 @@ case 'cloudflare': $needsIP = TRUE; $dnsServer ='api.cloudflare.com'; - $dnsHost = str_replace(' ','', $this->_dnsHost); + $dnsHost = str_replace(' ', '', $this->_dnsHost); $host_names = explode(".", $dnsHost); $bottom_host_name = $host_names[count($host_names)-2] . "." . $host_names[count($host_names)-1]; @@ -707,12 +707,12 @@ curl_setopt($ch, CURLOPT_URL, $getZoneId); $output = json_decode(curl_exec($ch)); $zone = $output->result[0]->id; - if ($zone){ // If zone ID was found get host ID + if ($zone) { // If zone ID was found get host ID $getHostId = "https://{$dnsServer}/client/v4/zones/{$zone}/dns_records?name={$this->_dnsHost}"; curl_setopt($ch, CURLOPT_URL, $getHostId); $output = json_decode(curl_exec($ch)); $host = $output->result[0]->id; - if ($host){ // If host ID was found update host + if ($host) { // If host ID was found update host $hostData = array( "content" => "{$this->_dnsIP}", "type" => "A", @@ -724,7 +724,7 @@ $updateHostId = "https://{$dnsServer}/client/v4/zones/{$zone}/dns_records/{$host}"; curl_setopt($ch, CURLOPT_URL, $updateHostId); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT'); - curl_setopt($ch, CURLOPT_POSTFIELDS,$data_json); + curl_setopt($ch, CURLOPT_POSTFIELDS, $data_json); } } break; @@ -831,15 +831,18 @@ case 'spdns': case 'spdns-v6': $needsIP = FALSE; - if ($this->_dnsVerboseLog) + if ($this->_dnsVerboseLog) { log_error("SPDNS: ({$this->_dnsHost}) DNS update() starting."); + } curl_setopt($ch, CURLOPT_USERPWD, $this->_dnsUser.':'.$this->_dnsPass); $server = "https://update.spdns.de/nic/update"; $port = ""; - if($this->_dnsServer) + if ($this->_dnsServer) { $server = $this->_dnsServer; - if($this->_dnsPort) + } + if ($this->_dnsPort) { $port = ":" . $this->_dnsPort; + } curl_setopt($ch, CURLOPT_URL, $server .$port . '?hostname=' . $this->_dnsHost . '&myip=' . $this->_dnsIP); break; default: @@ -1300,17 +1303,14 @@ break; case 'cloudflare': $output = json_decode($data); - if ($output->result->content === $this->_dnsIP){ + if ($output->result->content === $this->_dnsIP) { $status = "DynDNS: (Success) {$this->_dnsHost} updated to {$this->_dnsIP}"; $successful_update = true; - } - elseif ($output->errors[0]->code === 9103){ + } elseif ($output->errors[0]->code === 9103) { $status = "DynDNS ({$this->_dnsHost}): ERROR - Invalid Credentials! Don't forget to use API Key for password field with CloudFlare."; - } - elseif (($output->success) && (!$output->result[0]->id)) { + } elseif (($output->success) && (!$output->result[0]->id)) { $status = "DynDNS ({$this->_dnsHost}): ERROR - Zone or Host ID was not found, check your hostname."; - } - else { + } else { $status = "DynDNS ({$this->_dnsHost}): UNKNOWN ERROR - {$output->errors[0]->message}"; log_error("DynDNS ({$this->_dnsHost}): PAYLOAD: {$data}"); } |