<%= form_tag({:action => 'edit', :tab => 'authentication'}, :class => 'form-box') do %>
  <div class="box tabular settings">
    <p><%= setting_check_box :login_required %></p>

    <p><%= setting_select :autologin, [[l(:label_disabled), 0]] + [1, 7, 30, 365].collect { |days| [l('datetime.distance_in_words.x_days', :count => days), days.to_s] } %></p>

    <p><%= 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"]] %></p>
    <p>
      <%= label_tag(:easy_setting_self_registered_user_to_group_id, l(:label_easy_setting_self_registered_user_to_group_id)) %>
      <%= select_tag('easy_setting[self_registered_user_to_group_id]', options_for_select(Group.givable.sorted.map { |g| [g.name, g.id.to_s] }, EasySetting.value('self_registered_user_to_group_id')), :include_blank => true) %>
    </p>

    <p><%= setting_check_box :unsubscribe %></p>

    <p><%= setting_text_field :password_min_length, :size => 6 %></p>

    <p>
      <%= setting_select :password_max_age, [[l(:label_disabled), 0]] + [7, 30, 60, 90, 180, 365].collect { |days| [l('datetime.distance_in_words.x_days', :count => days), days.to_s] } %>
    </p>

    <p><%= setting_check_box :lost_password %></p>

    <p><%= setting_text_field :max_additional_emails, :size => 6 %></p>

    <p><%= setting_check_box :openid, :disabled => !Object.const_defined?(:OpenID) %></p>
  </div>

  <% if Rails.application.config.redmine_verify_sessions != false %>
    <fieldset class="box">
      <legend><%= l(:label_session_expiration) %></legend>
      <div class="tabular settings">
        <p><%= setting_select :session_lifetime, session_lifetime_options %></p>
        <p><%= setting_select :session_timeout, session_timeout_options %></p>
        <p><em class="info text-center"><%= l(:text_session_expiration_settings) %></em></p>
      </div>
    </fieldset>
    <fieldset class="box">
      <legend><%= l(:label_default_values_for_new_users) %></legend>

      <div class="tabular settings">
        <p><%= setting_check_box :default_users_hide_mail, :label => :field_hide_mail %></p>
      </div>
    </fieldset>
  <% end %>
  <div class=" form-actions">
    <%= submit_tag l(:button_save), :class => 'button-positive' %>
  </div>
<% end %>
