From 43a6e46e660e8513a12527188159ffc2052b3ee5 Mon Sep 17 00:00:00 2001 From: Steffen Schwebel Date: Thu, 27 May 2021 22:51:07 +0200 Subject: [PATCH] add setting to hide otp_token field on login page --- powerdnsadmin/models/setting.py | 1 + powerdnsadmin/routes/admin.py | 2 +- powerdnsadmin/templates/login.html | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/powerdnsadmin/models/setting.py b/powerdnsadmin/models/setting.py index c39274a..0d3a575 100644 --- a/powerdnsadmin/models/setting.py +++ b/powerdnsadmin/models/setting.py @@ -180,6 +180,7 @@ class Setting(db.Model): 'URI': False }, 'ttl_options': '1 minute,5 minutes,30 minutes,60 minutes,24 hours', + 'otp_field_enabled': True, } def __init__(self, id=None, name=None, value=None): diff --git a/powerdnsadmin/routes/admin.py b/powerdnsadmin/routes/admin.py index 307175f..59c37b2 100644 --- a/powerdnsadmin/routes/admin.py +++ b/powerdnsadmin/routes/admin.py @@ -642,7 +642,7 @@ def setting_basic(): 'pretty_ipv6_ptr', 'dnssec_admins_only', 'allow_user_create_domain', 'allow_user_view_history', 'bg_domain_updates', 'site_name', 'session_timeout', 'warn_session_timeout', 'ttl_options', - 'pdns_api_timeout', 'verify_ssl_connections', 'verify_user_email' + 'pdns_api_timeout', 'verify_ssl_connections', 'verify_user_email', 'otp_field_enabled' ] return render_template('admin_setting_basic.html', settings=settings) diff --git a/powerdnsadmin/templates/login.html b/powerdnsadmin/templates/login.html index 6352caa..1d597fd 100644 --- a/powerdnsadmin/templates/login.html +++ b/powerdnsadmin/templates/login.html @@ -46,7 +46,7 @@ data-error="Please input your password" required {% if password %}value="{{ password }}" {% endif %}> - {% if SETTING.get('otp_token_enabled') %} + {% if SETTING.get('otp_field_enabled') %}