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 @@