From ceefba274308896d504630f58738d9576da3e3dd Mon Sep 17 00:00:00 2001 From: Ozzieisaacs Date: Sun, 15 Nov 2020 17:16:01 +0100 Subject: [PATCH] Fix for #1550 (password prompt for LDAP and anonymous browsing) --- cps/admin.py | 4 +++- cps/opds.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/cps/admin.py b/cps/admin.py index fe2769e2..786c2281 100644 --- a/cps/admin.py +++ b/cps/admin.py @@ -646,7 +646,9 @@ def _configuration_update_helper(): return _configuration_result(_('Certfile Location is not Valid, Please Enter Correct Path'), gdriveError) _config_checkbox_int(to_save, "config_uploading") - _config_checkbox_int(to_save, "config_anonbrowse") + # Reboot on config_anonbrowse with enabled ldap, as decoraters are changed in this case + reboot_required |= (_config_checkbox_int(to_save, "config_anonbrowse") + and config.config_login_type == constants.LOGIN_LDAP) _config_checkbox_int(to_save, "config_public_reg") _config_checkbox_int(to_save, "config_register_email") reboot_required |= _config_checkbox_int(to_save, "config_kobo_sync") diff --git a/cps/opds.py b/cps/opds.py index 1eb3c49f..8ec48a46 100644 --- a/cps/opds.py +++ b/cps/opds.py @@ -51,7 +51,7 @@ def requires_basic_auth_if_no_ano(f): if not auth or auth.type != 'basic' or not check_auth(auth.username, auth.password): return authenticate() return f(*args, **kwargs) - if config.config_login_type == constants.LOGIN_LDAP and services.ldap: + if config.config_login_type == constants.LOGIN_LDAP and services.ldap and config.config_anonbrowse != 1: return services.ldap.basic_auth_required(f) return decorated