diff options
author | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2013-02-21 22:38:49 -0300 |
---|---|---|
committer | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2013-02-21 22:38:49 -0300 |
commit | 9d583557e4c4037a31e36b2a6186ecf806047a1c (patch) | |
tree | da72fa35b992fa5e1bcccd1ad8bd5c36acbca825 | |
parent | 03a3cd161bcf96dc9db4ebb7f00f26ebb2be99ba (diff) | |
download | askbot-9d583557e4c4037a31e36b2a6186ecf806047a1c.tar.gz askbot-9d583557e4c4037a31e36b2a6186ecf806047a1c.tar.bz2 askbot-9d583557e4c4037a31e36b2a6186ecf806047a1c.zip |
auto-enabled password login fields with LDAP on
-rw-r--r-- | askbot/conf/ldap.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/askbot/conf/ldap.py b/askbot/conf/ldap.py index 7d384516..34b6ec87 100644 --- a/askbot/conf/ldap.py +++ b/askbot/conf/ldap.py @@ -10,12 +10,20 @@ LDAP_SETTINGS = livesettings.ConfigurationGroup( super_group = EXTERNAL_SERVICES ) +def enable_ldap_callback(current_value, new_value): + """enables local login form when ldap is on""" + if new_value == True: + settings.update('SIGNIN_LOCAL_ENABLED', True) + + return new_value + settings.register( livesettings.BooleanValue( LDAP_SETTINGS, 'USE_LDAP_FOR_PASSWORD_LOGIN', description=_('Use LDAP authentication for the password login'), - defaut=False + defaut=False, + update_callback=enable_ldap_callback ) ) |