%#-- copyright
OpenProject is a project management system.
Copyright (C) 2012-2013 the OpenProject Team
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License version 3.
See doc/COPYRIGHT.rdoc for more details.
++#%>
<%= form_tag({:action => 'edit', :tab => 'authentication'}) do %>
<%= I18n.t(:general, :scope => [:settings]) %>
<%= setting_check_box :login_required %>
<%= setting_select :self_registration, [[l(:label_disabled), "0"],
[l(:label_registration_activation_by_email), "1"],
[l(:label_registration_manual_activation), "2"],
[l(:label_registration_automatic_activation), "3"]] %>
<%= I18n.t(:passwords, :scope => [:settings]) %>
<%= setting_text_field :password_min_length, :size => 6 %>
<%= setting_multiselect :password_active_rules,
OpenProject::Passwords::Evaluator.known_rules.map do |r|
[l("label_password_rule_#{r}"), r]
end %>
<%= setting_text_field :password_min_adhered_rules, :size => 6 %>
<%= setting_text_field :password_days_valid, :size => 6 %>
<%= setting_text_field :password_count_former_banned, :size => 6 %>
<%= setting_check_box :lost_password, :label => :label_password_lost %>
<%= I18n.t(:brute_force_prevention, :scope => [:settings]) %>
<%= setting_text_field :brute_force_block_after_failed_logins %>
<%= setting_text_field :brute_force_block_minutes %>
<%= I18n.t(:session, :scope => [:settings]) %>
<%= setting_select :autologin,
([[l(:label_disabled), 0]] +
[1, 7, 30, 365].collect do |days|
[l('datetime.distance_in_words.x_days', :count => days),
days.to_s]
end) %>
<%= setting_check_box :session_ttl_enabled %>
<%= setting_text_field :session_ttl, :size => 6 %> min
<%= I18n.t('setting_session_ttl_hint') %>
<%= I18n.t(:other, :scope => [:settings]) %>
<%= setting_check_box :openid, :disabled => !Object.const_defined?(:OpenID) %>
<%= setting_check_box :rest_api_enabled %>
<%= link_to l(:label_ldap_authentication), {:controller => '/ldap_auth_sources', :action => 'index'}, :class => 'icon icon-server-authentication' %>
<%= submit_tag l(:button_save) %>
<% end %>