diff options
Diffstat (limited to 'ddns')
-rw-r--r-- | ddns/backend/dnsupdate.py | 6 | ||||
-rw-r--r-- | ddns/frontend/dyn_com.py | 9 |
2 files changed, 10 insertions, 5 deletions
diff --git a/ddns/backend/dnsupdate.py b/ddns/backend/dnsupdate.py index 8257540..b64cefd 100644 --- a/ddns/backend/dnsupdate.py +++ b/ddns/backend/dnsupdate.py @@ -27,6 +27,12 @@ def get_zone(name): return zone return None +def get_key(name): + for key in cfg['dnskeys']: + if key['name'] == name: + return key + return None + def gen_keyring(dnskeys): global keyring diff --git a/ddns/frontend/dyn_com.py b/ddns/frontend/dyn_com.py index 9b803ec..e0a1ebb 100644 --- a/ddns/frontend/dyn_com.py +++ b/ddns/frontend/dyn_com.py @@ -40,11 +40,10 @@ def dyn_com(): if zone_name == zone['name']: for domain in zone['domains']: if domain['domain'] == hostname: - for user in domain['users']: - if request.authorization.username == user['username']: - ddns.backend.dnsupdate.update_dns(zone_name, hostname, ip) - # We should probably check something here... - return "good" + if request.authorization.username in users: + ddns.backend.dnsupdate.update_dns(zone_name, hostname, ip) + # We should probably check something here... + return "good" return auth.authenticate("!yours") return "nohost2" raise RuntimeError("ooops") |