diff --git a/app/lib/utils.py b/app/lib/utils.py index 881fddc..95eaa9c 100644 --- a/app/lib/utils.py +++ b/app/lib/utils.py @@ -30,12 +30,12 @@ def get_idp_data(): global idp_data, idp_timestamp lifetime = timedelta(minutes=app.config['SAML_METADATA_CACHE_LIFETIME']) if idp_timestamp+lifetime < datetime.now(): - background_thread = Thread(target=retreive_idp_data) + background_thread = Thread(target=retrieve_idp_data) background_thread.start() return idp_data -def retreive_idp_data(): +def retrieve_idp_data(): global idp_data, idp_timestamp if 'SAML_IDP_SSO_BINDING' in app.config: new_idp_data = OneLogin_Saml2_IdPMetadataParser.parse_remote(app.config['SAML_METADATA_URL'], entity_id=app.config.get('SAML_IDP_ENTITY_ID', None), required_sso_binding=app.config['SAML_IDP_SSO_BINDING']) @@ -44,9 +44,9 @@ def retreive_idp_data(): if new_idp_data is not None: idp_data = new_idp_data idp_timestamp = datetime.now() - print("SAML: IDP Metadata successfully retreived from: " + app.config['SAML_METADATA_URL']) + print("SAML: IDP Metadata successfully retrieved from: " + app.config['SAML_METADATA_URL']) else: - print("SAML: IDP Metadata could not be retreived") + print("SAML: IDP Metadata could not be retrieved") if 'TIMEOUT' in app.config.keys(): diff --git a/app/models.py b/app/models.py index d1fd97d..fdc77be 100644 --- a/app/models.py +++ b/app/models.py @@ -102,7 +102,7 @@ class User(db.Model): return bcrypt.hashpw(pw.encode('utf-8'), bcrypt.gensalt()) def check_password(self, hashed_password): - # Check hased password. Useing bcrypt, the salt is saved into the hash itself + # Check hased password. Using bcrypt, the salt is saved into the hash itself if (self.plain_text_password): return bcrypt.checkpw(self.plain_text_password.encode('utf-8'), hashed_password.encode('utf-8')) return False @@ -451,7 +451,7 @@ class User(db.Model): def revoke_privilege(self): """ - Revoke all privielges from a user + Revoke all privileges from a user """ user = User.query.filter(User.username == self.username).first() @@ -463,7 +463,7 @@ class User(db.Model): return True except Exception as e: db.session.rollback() - logging.error('Cannot revoke user {0} privielges. DETAIL: {1}'.format(self.username, e)) + logging.error('Cannot revoke user {0} privileges. DETAIL: {1}'.format(self.username, e)) return False return False @@ -614,7 +614,7 @@ class Account(db.Model): db.session.commit() except Exception as e: db.session.rollback() - logging.error('Cannot revoke user privielges on account {0}. DETAIL: {1}'.format(self.name, e)) + logging.error('Cannot revoke user privileges on account {0}. DETAIL: {1}'.format(self.name, e)) try: for uid in added_ids: @@ -627,7 +627,7 @@ class Account(db.Model): def revoke_privileges_by_id(self, user_id): """ - Remove a single user from prigilege list based on user_id + Remove a single user from privilege list based on user_id """ new_uids = [u for u in self.get_user() if u != user_id] users = [] @@ -646,7 +646,7 @@ class Account(db.Model): return True except Exception as e: db.session.rollback() - logging.error('Cannot add user privielges on account {0}. DETAIL: {1}'.format(self.name, e)) + logging.error('Cannot add user privileges on account {0}. DETAIL: {1}'.format(self.name, e)) return False def remove_user(self, user): @@ -659,7 +659,7 @@ class Account(db.Model): return True except Exception as e: db.session.rollback() - logging.error('Cannot revoke user privielges on account {0}. DETAIL: {1}'.format(self.name, e)) + logging.error('Cannot revoke user privileges on account {0}. DETAIL: {1}'.format(self.name, e)) return False @@ -983,7 +983,7 @@ class Domain(db.Model): if 0 != len(domain_users): self.name = domain_reverse_name self.grant_privileges(domain_users) - return {'status': 'ok', 'msg': 'New reverse lookup domain created with granted privilages'} + return {'status': 'ok', 'msg': 'New reverse lookup domain created with granted privileges'} return {'status': 'ok', 'msg': 'New reverse lookup domain created without users'} return {'status': 'ok', 'msg': 'Reverse lookup domain already exists'} @@ -1048,7 +1048,7 @@ class Domain(db.Model): db.session.commit() except Exception as e: db.session.rollback() - logging.error('Cannot revoke user privielges on domain {0}. DETAIL: {1}'.format(self.name, e)) + logging.error('Cannot revoke user privileges on domain {0}. DETAIL: {1}'.format(self.name, e)) try: for uid in added_ids: @@ -1057,7 +1057,7 @@ class Domain(db.Model): db.session.commit() except Exception as e: db.session.rollback() - logging.error('Cannot grant user privielges to domain {0}. DETAIL: {1}'.format(self.name, e)) + logging.error('Cannot grant user privileges to domain {0}. DETAIL: {1}'.format(self.name, e)) def update_from_master(self, domain_name): """ @@ -1819,6 +1819,7 @@ class Setting(db.Model): 'allow_user_create_domain': False, 'bg_domain_updates': False, 'site_name': 'PowerDNS-Admin', + 'session_timeout': 10, 'pdns_api_url': '', 'pdns_api_key': '', 'pdns_version': '4.1.1', diff --git a/app/static/custom/js/custom.js b/app/static/custom/js/custom.js index dd89d0e..d30cebe 100644 --- a/app/static/custom/js/custom.js +++ b/app/static/custom/js/custom.js @@ -129,7 +129,7 @@ function editRow(oTable, nRow) { jqTds[5].innerHTML = ''; jqTds[6].innerHTML = ''; - // set current value of dropdows column + // set current value of dropdown column if (aData[2] == 'Active'){ isDisabled = 'false'; } diff --git a/app/templates/admin_manageuser.html b/app/templates/admin_manageuser.html index b9a446c..2c8c3c4 100644 --- a/app/templates/admin_manageuser.html +++ b/app/templates/admin_manageuser.html @@ -104,7 +104,7 @@ var info = "Are you sure you want to revoke all privileges for " + username + ". They will not able to access any domain."; modal.find('.modal-body p').text(info); modal.find('#button_revoke_confirm').click(function() { - var postdata = {'action': 'revoke_user_privielges', 'data': username} + var postdata = {'action': 'revoke_user_privileges', 'data': username} applyChanges(postdata, $SCRIPT_ROOT + '/admin/manageuser'); modal.modal('hide'); }) diff --git a/app/templates/admin_setting_authentication.html b/app/templates/admin_setting_authentication.html index fbb3b22..6ea8644 100644 --- a/app/templates/admin_setting_authentication.html +++ b/app/templates/admin_setting_authentication.html @@ -505,7 +505,7 @@ } }); - // init validation reqirement at first time page load + // init validation requirement at first time page load {% if SETTING.get('google_oauth_enabled') %} $('#google_oauth_client_id').prop('required', true); $('#google_oauth_client_secret').prop('required', true); @@ -540,7 +540,7 @@ } }); - // init validation reqirement at first time page load + // init validation requirement at first time page load {% if SETTING.get('google_oauth_enabled') %} $('#github_oauth_key').prop('required', true); $('#github_oauth_secret').prop('required', true); diff --git a/app/templates/admin_setting_pdns.html b/app/templates/admin_setting_pdns.html index 3310680..ce44b48 100644 --- a/app/templates/admin_setting_pdns.html +++ b/app/templates/admin_setting_pdns.html @@ -63,7 +63,7 @@
You must configure the API connection information before PowerDNS-Admiin can query your PowerDNS data. Following fields are required:
+You must configure the API connection information before PowerDNS-Admin can query your PowerDNS data. Following fields are required: