From e21f53085d9f4134959564fbe2200902ed15aa67 Mon Sep 17 00:00:00 2001 From: kkmanos Date: Thu, 17 Feb 2022 17:40:48 +0200 Subject: [PATCH] added DNSSEC enabling/disabling to history logs --- powerdnsadmin/routes/domain.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/powerdnsadmin/routes/domain.py b/powerdnsadmin/routes/domain.py index e3b61cc..7248d36 100644 --- a/powerdnsadmin/routes/domain.py +++ b/powerdnsadmin/routes/domain.py @@ -780,6 +780,12 @@ def dnssec(domain_name): def dnssec_enable(domain_name): domain = Domain() dnssec = domain.enable_domain_dnssec(domain_name) + domain_object = Domain.query.filter(domain_name == Domain.name).first() + history = History( + msg='DNSSEC was enabled for domain ' + domain_name , + created_by=current_user.username, + domain_id=domain_object.id) + history.add() return make_response(jsonify(dnssec), 200) @@ -793,7 +799,12 @@ def dnssec_disable(domain_name): for key in dnssec['dnssec']: domain.delete_dnssec_key(domain_name, key['id']) - + domain_object = Domain.query.filter(domain_name == Domain.name).first() + history = History( + msg='DNSSEC was disabled for domain ' + domain_name , + created_by=current_user.username, + domain_id=domain_object.id) + history.add() return make_response(jsonify({'status': 'ok', 'msg': 'DNSSEC removed.'}))