From 79286c93842134ff6b0a31fa7d734a534b842b86 Mon Sep 17 00:00:00 2001 From: Krakinou Date: Sat, 8 Jun 2019 00:54:45 +0200 Subject: [PATCH] encode password --- cps/web.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cps/web.py b/cps/web.py index 9bed45e8..5c31df5f 100644 --- a/cps/web.py +++ b/cps/web.py @@ -186,8 +186,8 @@ if ldap_support and config.config_use_ldap: app.config['LDAP_HOST'] = config.config_ldap_provider_url app.config['LDAP_PORT'] = config.config_ldap_port app.config['LDAP_SCHEMA'] = config.config_ldap_schema - app.config['LDAP_USERNAME'] = config.config_ldap_serv_username - app.config['LDAP_PASSWORD'] = config.config_ldap_serv_password + app.config['LDAP_USERNAME'] = config.config_ldap_user_object.replace('%s', config.config_ldap_serv_username) + ',' + config.config_ldap_dn + app.config['LDAP_PASSWORD'] = base64.b64decode(config.config_ldap_serv_password) if config.config_ldap_use_ssl: app.config['LDAP_USE_SSL'] = True if config.config_ldap_use_tls: @@ -3162,7 +3162,7 @@ def configuration_helper(origin): content.config_ldap_port = to_save["config_ldap_port"] content.config_ldap_schema = to_save["config_ldap_schema"] content.config_ldap_serv_username = to_save["config_ldap_serv_username"] - content.config_ldap_serv_password = to_save["config_ldap_serv_password"] + content.config_ldap_serv_password = base64.b64encode(to_save["config_ldap_serv_password"]) content.config_ldap_dn = to_save["config_ldap_dn"] content.config_ldap_user_object = to_save["config_ldap_user_object"] reboot_required = True