From 98548b27811ae7d847bef9640d78ed043a25f99b Mon Sep 17 00:00:00 2001 From: Victor Kislov Date: Wed, 21 Apr 2021 10:48:43 +0300 Subject: [PATCH] =?UTF-8?q?DynDNS=20-=20Updated=20No-Ip=20client=20code=20?= =?UTF-8?q?to=20use=20APIv2=20which=20also=20supports=20g=E2=80=A6=20(#183?= =?UTF-8?q?6)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../inc/plugins.inc.d/dyndns/phpDynDNS.inc | 76 +++++++------------ 1 file changed, 26 insertions(+), 50 deletions(-) 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 5a3348780..5f78efdd5 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 @@ -47,7 +47,7 @@ * Linode - Last Tested: 25 February 2020 * Linode v6 - Last Tested: 25 February 2020 * Namecheap - Last Tested: 31 August 2010 - * No-IP - Last Tested: 20 July 2008 + * No-IP - Last Tested: 15 May 2020 * ODS - Last Tested: 02 August 2005 * Oray - Last Tested: 26 May 2017 * STRATO - Last Tested: 09 May 2017 @@ -446,8 +446,11 @@ class updatedns break; case 'noip': case 'noip-free': - curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); - $server = "https://dynupdate.no-ip.com/ducupdate.php"; + curl_setopt_array($ch, [ + CURLOPT_SSL_VERIFYPEER => true, + CURLOPT_USERPWD => $this->_dnsUser.':'.$this->_dnsPass + ]); + $server = "https://dynupdate.no-ip.com/nic/update"; $port = ""; if ($this->_dnsServer) { $server = $this->_dnsServer; @@ -467,7 +470,7 @@ 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 . '?hostname=' . $this->_dnsHost.'&myip=' . $iptoset); break; case 'easydns': curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true); @@ -1323,63 +1326,36 @@ class updatedns break; case 'noip': case 'noip-free': - list($ip,$code) = explode(":", $data); + $noIpPrc = explode(' ', $data); + $code = $noIpPrc[0]; + $ip = isset($noIpPrc[1]) ? $noIpPrc[1] : 'n/a'; switch ($code) { - case 0: - $status = "Dynamic DNS ({$this->_dnsHost}): (Success) IP address is current, no update performed."; - $successful_update = true; - break; - case 1: + case 'good': $status = "Dynamic DNS ({$this->_dnsHost}): (Success) DNS hostname update successful."; $successful_update = true; break; - case 2: + case 'nochg': + $status = "Dynamic DNS ({$this->_dnsHost}): (Success) IP address is current, no update performed."; + $successful_update = true; + break; + case 'nohost': $status = "Dynamic DNS ({$this->_dnsHost}): (Error) Hostname supplied does not exist."; break; - case 3: - $status = "Dynamic DNS ({$this->_dnsHost}): (Error) Invalid Username."; + case 'badauth': + $status = "Dynamic DNS ({$this->_dnsHost}): (Error) Invalid Username or Password."; break; - case 4: - $status = "Dynamic DNS ({$this->_dnsHost}): (Error) Invalid Password."; + case 'badagent': + $status = "Dynamic DNS ({$this->_dnsHost}): (Error) Client disabled. Client should exit and not perform any more updates without user intervention."; break; - case 5: - $status = "Dynamic DNS ({$this->_dnsHost}): (Error) To many updates sent."; + case '!donate': + $status = "Dynamic DNS ({$this->_dnsHost}): (Error) Requested update feature only available to Enhanced subscribers."; break; - case 6: + case '911': + $status = "Dynamic DNS ({$this->_dnsHost}): (Error) No-IP servers currently experiencing outages. Retry no sooner than 30 minutes."; + break; + case 'abuse': $status = "Dynamic DNS ({$this->_dnsHost}): (Error) Account disabled due to violation of No-IP terms of service."; break; - case 7: - $status = "Dynamic DNS ({$this->_dnsHost}): (Error) Invalid IP. IP Address submitted is improperly formatted or is a private IP address or is on a blacklist."; - break; - case 8: - $status = "Dynamic DNS ({$this->_dnsHost}): (Error) Disabled / Locked Hostname."; - break; - case 9: - $status = "Dynamic DNS ({$this->_dnsHost}): (Error) Host updated is configured as a web redirect and no update was performed."; - break; - case 10: - $status = "Dynamic DNS ({$this->_dnsHost}): (Error) Group supplied does not exist."; - break; - case 11: - $status = "Dynamic DNS ({$this->_dnsHost}): (Success) DNS group update is successful."; - $successful_update = true; - break; - case 12: - $status = "Dynamic DNS ({$this->_dnsHost}): (Success) DNS group is current, no update performed."; - $successful_update = true; - break; - case 13: - $status = "Dynamic DNS ({$this->_dnsHost}): (Error) Update client support not available for supplied hostname or group."; - break; - case 14: - $status = "Dynamic DNS ({$this->_dnsHost}): (Error) Hostname supplied does not have offline settings configured."; - break; - case 99: - $status = "Dynamic DNS ({$this->_dnsHost}): (Error) Client disabled. Client should exit and not perform any more updates without user intervention."; - break; - case 100: - $status = "Dynamic DNS ({$this->_dnsHost}): (Error) Client disabled. Client should exit and not perform any more updates without user intervention."; - break; default: $status = "Dynamic DNS ({$this->_dnsHost}): (Unknown Response)"; $this->_debug("Unknown Response: " . $data);