Changeset - 6e75963503cc
[Not reviewed]
default
0 1 0
Thomas De Schampheleire - 8 years ago 2018-04-23 22:06:37
thomas.de_schampheleire@nokia.com
admin: auth: make sure list of auth modules is consistent

When authentication modules are enabled, but fail to be enabled e.g. due to
missing dependencies (pam, ldap), the list of enabled plugins still contains
the failing module. However, the 'Enabled/Disabled' button correctly shows
Disabled, causing a mismatch between both.

Worse, the mismatch cannot be corrected by clicking the Enabled/Disabled
button, one needs to manually clear the problematic entry in the list of
enabled plugins.

Fix by always populating the list with the actually enabled plugins, not
those requested by the user in case there are failures.
1 file changed with 3 insertions and 3 deletions:
0 comments (0 inline, 0 general)
kallithea/controllers/admin/auth_settings.py
Show inline comments
 
@@ -79,12 +79,12 @@ class AuthSettingsController(BaseControl
 
                setting = Setting.get_by_name(fullname)
 
                if setting is not None:
 
                    c.defaults[fullname] = setting.app_settings_value
 
        if defaults:
 
            c.defaults.update(defaults)
 

	
 
        # we want to show , separated list of enabled plugins
 
        c.defaults['auth_plugins'] = ','.join(c.enabled_plugin_names)
 

	
 
        if defaults:
 
            c.defaults.update(defaults)
 

	
 
        log.debug(formatted_json(defaults))
 
        return formencode.htmlfill.render(
 
            render('admin/auth/auth_settings.html'),
0 comments (0 inline, 0 general)