Set LDAP as source if both LDAP and Basic is enabled.

This commit is contained in:
Joachim Tingvold
2016-07-05 15:28:02 +00:00
parent ea42c78b9a
commit 9dc3c3ff98
3 changed files with 13 additions and 2 deletions

View File

@ -63,8 +63,12 @@
<div class="form-group">
<select class="form-control" name="auth_method">
<option value="LOCAL">LOCAL Authentication</option>
<option value="LDAP">LDAP Authentication</option>
</select>
{% if login_ldap_first_setting %}
<option value="LDAP" selected="selected">LDAP Authentication</option>
{% else %}
<option value="LDAP">LDAP Authentication</option>
{% endif %}
</select>
</div>
{% elif ldap_enabled and not basic_enabled %}
<div class="form-group">

View File

@ -40,6 +40,11 @@ def inject_record_helper_setting():
record_helper_setting = Setting.query.filter(Setting.name == 'record_helper').first()
return dict(record_helper_setting=strtobool(record_helper_setting.value))
@app.context_processor
def inject_login_ldap_first_setting():
login_ldap_first_setting = Setting.query.filter(Setting.name == 'login_ldap_first').first()
return dict(login_ldap_first_setting=strtobool(login_ldap_first_setting.value))
@app.context_processor
def inject_default_record_table_size_setting():
default_record_table_size_setting = Setting.query.filter(Setting.name == 'default_record_table_size').first()