summaryrefslogtreecommitdiffstats
path: root/src/etc/inc/dyndns.class
diff options
context:
space:
mode:
authorfrank <frankthetank@users.noreply.github.com>2017-04-22 00:21:39 -0400
committerfrank <frankthetank@users.noreply.github.com>2017-04-22 00:21:39 -0400
commit6c6daeaefa895ab557de0ac63a15cec6512b59d0 (patch)
treeeb5ad6836b938b5fc7d953275061fc40eb88b5e1 /src/etc/inc/dyndns.class
parenta741f6e8af56c0cd6b013b60576287f0ffd6c84a (diff)
downloadpfsense-6c6daeaefa895ab557de0ac63a15cec6512b59d0.zip
pfsense-6c6daeaefa895ab557de0ac63a15cec6512b59d0.tar.gz
Resolved some unusual formatting errors that crept into the request.
Diffstat (limited to 'src/etc/inc/dyndns.class')
-rw-r--r--src/etc/inc/dyndns.class10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/etc/inc/dyndns.class b/src/etc/inc/dyndns.class
index b32d761..d8f0500 100644
--- a/src/etc/inc/dyndns.class
+++ b/src/etc/inc/dyndns.class
@@ -844,7 +844,7 @@
$port = "";
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
-
+
//step 1: login to API
$post_data['username'] = $this->_dnsUser;
$post_data['password'] = $this->_dnsPass;
@@ -852,13 +852,13 @@
curl_setopt($ch, CURLOPT_URL, "https://www.hover.com/api/login");
curl_setopt($ch, CURLOPT_HEADER, 1); //return the full headers to extract the cookies
$output = curl_exec($ch);
-
+
//extract the cookies
preg_match_all("/^Set-cookie: (.*?);/ism", $output, $cookies);
if( count($cookies[1]) > 0 ){
$cookie_data = implode("; ",$cookies[1]);
}
-
+
//step 2: find the id of the A record
$post_data = null;
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
@@ -866,13 +866,13 @@
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_URL, "https://www.hover.com/api/dns");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
-
+
$output = curl_exec($ch);
preg_match("/^{\"succeeded\":true.*?domain_name\":\"{$this->_dnsDomain}.*?entries.*?{\"id\":\"([^\"]*?)\",\"name\":\"{$this->_dnsHost}\".*?\$/", $output, $hostID);
$hostID = $hostID[1];
preg_match("/^{\"succeeded\":true.*?domain_name\":\"{$this->_dnsDomain}.*?entries.*?{[^\}]*?\"name\":\"{$this->_dnsHost}\".*?content\":\"([^\"]*?)\".*?\$/", $output, $hostIP);
$hostIP = $hostIP[1];
-
+
//step 3: update the IP
if ($hostID) {
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
OpenPOWER on IntegriCloud