X-Git-Url: http://git.ipfire.org/?p=people%2Fms%2Fddns.git;a=blobdiff_plain;f=src%2Fddns%2Fproviders.py;fp=src%2Fddns%2Fproviders.py;h=e708fd648139b552a0ecc93aa8c18d771ae06ef7;hp=9eaaa6ce5dd7d4072c91a2f47a869dce3e184389;hb=d1cb1b54e167ef1d238c704f162ed9afaa8f9c14;hpb=2e09c70d3309e53b48fe4df0c95b9d77731d2ac0 diff --git a/src/ddns/providers.py b/src/ddns/providers.py index 9eaaa6c..e708fd6 100644 --- a/src/ddns/providers.py +++ b/src/ddns/providers.py @@ -1552,6 +1552,54 @@ class DDNSProviderZoneedit(DDNSProvider): raise DDNSUpdateError +class DDNSProviderDNSmadeEasy(DDNSProvider): + handle = "dnsmadeeasy.com" + name = "DNSmadeEasy.com" + website = "http://www.dnsmadeeasy.com/" + protocols = ("ipv4",) + + # DNS Made Easy Nameserver Provider also offering Dynamic DNS + # Documentation can be found here: + # http://www.dnsmadeeasy.com/dynamic-dns/ + + url = "https://cp.dnsmadeeasy.com/servlet/updateip?" + can_remove_records = False + + def update_protocol(self, proto): + data = { + "ip" : self.get_address(proto), + "id" : self.hostname, + "username" : self.username, + "password" : self.password, + } + + # Send update to the server. + response = self.send_request(self.url, data=data) + + # Get the full response message. + output = response.read() + + # Handle success messages. + if output.startswith("success") or output.startswith("error-record-ip-same"): + return + + # Handle error codes. + if output.startswith("error-auth-suspend"): + raise DDNSRequestError(_("Account has been suspended.")) + + elif output.startswith("error-auth-voided"): + raise DDNSRequestError(_("Account has been revoked.")) + + elif output.startswith("error-record-invalid"): + raise DDNSRequestError(_("Specified host does not exist.")) + + elif output.startswith("error-auth"): + raise DDNSAuthenticationError + + # If we got here, some other update error happened. + raise DDNSUpdateError(_("Server response: %s") % output) + + class DDNSProviderZZZZ(DDNSProvider): handle = "zzzz.io" name = "zzzz"