From f620d4a9ca1fb12ef0f87e38fecc714df5b189f8 Mon Sep 17 00:00:00 2001 From: Ozzieisaacs Date: Sun, 22 Nov 2020 11:19:14 +0100 Subject: [PATCH] Fix LDAP errors --- cps/admin.py | 13 +++++++------ cps/services/simpleldap.py | 2 +- cps/templates/config_edit.html | 6 +++--- cps/translations/de/LC_MESSAGES/messages.po | 2 +- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/cps/admin.py b/cps/admin.py index 85053489..78416089 100644 --- a/cps/admin.py +++ b/cps/admin.py @@ -614,12 +614,13 @@ def _configuration_ldap_helper(to_save, gdriveError): return reboot_required, _configuration_result(_('LDAP User Object Filter Has Unmatched Parenthesis'), gdriveError) - if config.config_ldap_cacert_path and not (os.path.isfile(config.config_ldap_cacert_path) - or os.path.isfile(config.config_ldap_cacert_path) - or os.path.isfile(config.config_ldap_key_path)): - return reboot_required, \ - _configuration_result(_('LDAP CACertificate, Certificate or Key Location is not Valid, Please Enter Correct Path'), - gdriveError) + if config.config_ldap_cacert_path or config.config_ldap_cert_path or config.config_ldap_key_path: + if not (os.path.isfile(config.config_ldap_cacert_path) and + os.path.isfile(config.config_ldap_cert_path) and + os.path.isfile(config.config_ldap_key_path)): + return reboot_required, \ + _configuration_result(_('LDAP CACertificate, Certificate or Key Location is not Valid, Please Enter Correct Path'), + gdriveError) return reboot_required, None diff --git a/cps/services/simpleldap.py b/cps/services/simpleldap.py index 8d57dc1b..d61f3fb6 100644 --- a/cps/services/simpleldap.py +++ b/cps/services/simpleldap.py @@ -38,7 +38,7 @@ def init_app(app, config): app.config['LDAP_HOST'] = config.config_ldap_provider_url app.config['LDAP_PORT'] = config.config_ldap_port - app.config['LDAP_CUSTOM_OPTIONS'] = {pyLDAP.OPT_REFERRALS, 0} + app.config['LDAP_CUSTOM_OPTIONS'] = {pyLDAP.OPT_REFERRALS: 0} if config.config_ldap_encryption == 2: app.config['LDAP_SCHEMA'] = 'ldaps' else: diff --git a/cps/templates/config_edit.html b/cps/templates/config_edit.html index 89e97ee5..2088223d 100644 --- a/cps/templates/config_edit.html +++ b/cps/templates/config_edit.html @@ -264,21 +264,21 @@
- +
- +
- +
diff --git a/cps/translations/de/LC_MESSAGES/messages.po b/cps/translations/de/LC_MESSAGES/messages.po index a0a7ec7b..a5240c9d 100644 --- a/cps/translations/de/LC_MESSAGES/messages.po +++ b/cps/translations/de/LC_MESSAGES/messages.po @@ -2122,7 +2122,7 @@ msgstr "Öffne ddie .kobo/Kobo eReader.conf Datei in einem Texteditor und füge #: cps/templates/http_error.html:38 msgid "Create Issue" -msgstr "Issue erzeuge" +msgstr "Issue erzeugen" #: cps/templates/http_error.html:45 msgid "Return to Home"