Commit 5874647c authored by Khanh Ngo's avatar Khanh Ngo Committed by GitHub

Merge pull request #150 from mir06/dydns_adjustment

re-fix root domain record update via dyndns
parents bf7924bb 624bbc09
......@@ -992,6 +992,12 @@ class Record(object):
jdata = self.get_record_data(domain)
jrecords = jdata['records']
if'@'): = '.'.join('.')[1:])
allowed = ['A', 'AAAA']
allowed = app.config['RECORDS_ALLOW_EDIT']
for jr in jrecords:
if jr['name'] == and jr['type'] == self.type: = jr['name']
......@@ -762,19 +762,19 @@ def dyndns_update():
domain = None
domain_segments = hostname.split('.')
for index in range(len(domain_segments)):
full_domain = '.'.join(domain_segments)
potential_domain = Domain.query.filter( == full_domain).first()
if potential_domain in domains:
domain = potential_domain
if not domain:
history = History(msg="DynDNS update: attempted update of %s but it does not exist for this user" % hostname, created_by=current_user.username)
return render_template('dyndns.html', response='nohost'), 200
r = Record(type='A')
r = Record() = hostname
# check if the user requested record exists within this domain
if r.exists( and r.is_allowed:
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment