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,7 +63,11 @@
<div class="form-group">
<select class="form-control" name="auth_method">
<option value="LOCAL">LOCAL Authentication</option>
{% 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 %}

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()

View File

@ -12,6 +12,7 @@ user_role = Role('User', 'User')
maintenance_setting = Setting('maintenance', 'False')
fullscreen_layout_setting = Setting('fullscreen_layout', 'True')
record_helper_setting = Setting('record_helper', 'True')
login_ldap_first_setting = Setting('login_ldap_first', 'True')
default_record_table_size_setting = Setting('default_record_table_size', '15')
default_domain_table_size_setting = Setting('default_domain_table_size', '10')
db.session.add(admin_role)
@ -19,6 +20,7 @@ db.session.add(user_role)
db.session.add(maintenance_setting)
db.session.add(fullscreen_layout_setting)
db.session.add(record_helper_setting)
db.session.add(login_ldap_first_setting)
db.session.add(default_record_table_size_setting)
db.session.add(default_domain_table_size_setting)
db.session.commit()