summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErmal Luçi <eri@pfsense.org>2009-11-30 01:35:03 +0000
committerErmal Luçi <eri@pfsense.org>2009-11-30 01:35:03 +0000
commit9d96a4759019862034be4bf361d4db889787663f (patch)
tree3468152c8dcf79ffc39899ec91cb598c9bb8125c
parent854415fa39d466dfd8e0f207f4c2f8271777fce4 (diff)
downloadpfsense-9d96a4759019862034be4bf361d4db889787663f.zip
pfsense-9d96a4759019862034be4bf361d4db889787663f.tar.gz
Cleanup code to make it easier to read and faster.
-rw-r--r--etc/inc/dyndns.class43
1 files changed, 23 insertions, 20 deletions
diff --git a/etc/inc/dyndns.class b/etc/inc/dyndns.class
index 4055f22..a6f4463 100644
--- a/etc/inc/dyndns.class
+++ b/etc/inc/dyndns.class
@@ -130,27 +130,30 @@
if ($this->_detectChange() == FALSE) {
$this->_error(10);
} else {
- if ($this->_dnsService == 'dnsomatic' ||
- $this->_dnsService == 'dyndns' ||
- $this->_dnsService == 'dyndns-static' ||
- $this->_dnsService == 'dyndns-custom' ||
- $this->_dnsService == 'dhs' ||
- $this->_dnsService == 'noip' ||
- $this->_dnsService == 'easydns' ||
- $this->_dnsService == 'hn' ||
- $this->_dnsService == 'zoneedit' ||
- $this->_dnsService == 'dyns' ||
- $this->_dnsService == 'ods' ||
- $this->_dnsService == 'freedns' ||
- $this->_dnsService == 'loopia' ||
- $this->_dnsService == 'staticcling'||
- $this->_dnsService == 'dnsexit' ||
- $this->_dnsService == 'opendns') {
- $this->_update();
- } else {
+ switch ($this->_dnsService) {
+ case 'dnsomatic':
+ case 'dyndns':
+ case 'dyndns-static':
+ case 'dyndns-custom':
+ case 'dhs':
+ case 'noip':
+ case 'easydns':
+ case 'hn':
+ case 'zoneedit':
+ case 'dyns':
+ case 'ods':
+ case 'freedns':
+ case 'loopia':
+ case 'staticcling':
+ case 'dnsexit':
+ case 'opendns':
+ $this->_update();
+ break;
+ default:
$this->_error(6);
+ break;
}
- }
+ }
}
/*
@@ -181,7 +184,7 @@
$server = $this->_dnsServer;
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');
$data = curl_exec($ch);
if (@curl_error($ch)) log_error("Curl error occurred: " . curl_error($ch));
curl_close($ch);
OpenPOWER on IntegriCloud