diff --git a/binder/bcommon/helpers.py b/binder/bcommon/helpers.py index ac977b0..e43a07b 100644 --- a/binder/bcommon/helpers.py +++ b/binder/bcommon/helpers.py @@ -58,20 +58,20 @@ def add_forward_record(form_data, zone_keyring): return response def add_reverse_record(form_data, zone_keyring): - + """ Given a FormAddRecord dict and zone_keyring, + add/update a reverse PTR record.""" reverse_ip_fqdn = str(dns.reversename.from_address(form_data["data"])) reverse_ip = re.search(r"([0-9]+).(.*).$", reverse_ip_fqdn).group(1) reverse_domain = re.search(r"([0-9]+).(.*).$", reverse_ip_fqdn).group(2) dns_update = dns.update.Update(reverse_domain, keyring = zone_keyring) dns_update.replace(reverse_ip, int(form_data["ttl"]), "PTR", str(form_data["name"]) + ".") - output = dns.query.tcp(dns_update, form_data["dns_server"]) return output def add_record(form_data): - """Add a DNS record with data from a FormAddRecord object. + """Add a DNS record with data from a FormAddRecord dict. If a reverse PTR record is requested, this will be added too.""" if form_data["key_name"]: diff --git a/binder/bcommon/views.py b/binder/bcommon/views.py index 62795c7..88adb8a 100644 --- a/binder/bcommon/views.py +++ b/binder/bcommon/views.py @@ -90,7 +90,8 @@ def view_add_record_result(request): context_instance=RequestContext(request)) return render_to_response('bcommon/add_record_result.htm', - { 'response' : add_record_response }, + { 'response' : add_record_response, + 'rr_data' : cd }, context_instance=RequestContext(request)) diff --git a/binder/templates/bcommon/add_record_result.htm b/binder/templates/bcommon/add_record_result.htm index 9684919..c16a354 100644 --- a/binder/templates/bcommon/add_record_result.htm +++ b/binder/templates/bcommon/add_record_result.htm @@ -2,23 +2,29 @@ {% block pageheader %} - +Add Record Result {% endblock pageheader %} {% block body %} + {% if response.forward_response %} -Forward Record Creation Output -
-{{ response.forward_response }}
-
+ + + + + + + + {% endif %} -

{% if response.reverse_response %} -Reverse Record Creation Output -

-{{ response.reverse_response }}
-
+ + + + + {% endif %} +
Record: {{ response.name }}Add Result
Forward: {{ rr_data.name }}
{{ response.forward_response }}
Reverse: {{ rr_data.data }}
{{ response.reverse_response }}
{% endblock body %} diff --git a/binder/templates/bcommon/delete_record_initial.htm b/binder/templates/bcommon/delete_record_initial.htm index f4fedf7..533fb4c 100644 --- a/binder/templates/bcommon/delete_record_initial.htm +++ b/binder/templates/bcommon/delete_record_initial.htm @@ -1,24 +1,43 @@ {% extends "base.htm" %} +{% block pageheader %} +Delete record(s) in {{ zone_name }} +{% endblock pageheader %} + {% block body %} +{% csrf_token %} -Do you really want to delete the following records? - + + + + + + + + + + + + + + + + + + + +
Do you really want to delete the following records?
Server{{ dns_server }}
Domain {{ zone_name }}
Records{% for current_rr in rr_array %} {{ current_rr}} {% endfor %}
Key - + {% endfor %}
+ - {% endblock body %} diff --git a/binder/templates/bcommon/delete_record_result.htm b/binder/templates/bcommon/delete_record_result.htm index 2b377f5..ab2c805 100644 --- a/binder/templates/bcommon/delete_record_result.htm +++ b/binder/templates/bcommon/delete_record_result.htm @@ -2,16 +2,22 @@ {% block pageheader %} - +Delete Record(s) Result {% endblock pageheader %} {% block body %} + {% for current_response in delete_result %} -Record: {{ current_response.rr_item }} -
-{{ current_response.output }}
-
+ + + + + + + + {% endfor %} +
RecordDelete Result
{{ current_response.rr_item }}
{{ current_response.output }}
{% endblock body %}