<% content_for :settings_body do %>
<% if @ldap_configuration %> <%= render :partial => 'admin/organizations/ldap_configuration' %> <% else %> <%= form_for @organization, url: CartoDB.url(self, 'organization_auth_update', user: current_user), multipart: true do |f| %> <%= csrf_meta_tags %>
    Only valid domains, wildcard (*) accepted (ex. *.carto.com)
<%= f.hidden_field :whitelisted_email_domains, :value => "#{ @organization[:whitelisted_email_domains].join(',') if !@organization[:whitelisted_email_domains].blank? }", :class => "js-whitelist CDB-InputText CDB-Text", :placeholder => "Only valid domains, wildcard (*) accepted (ex. *.carto.com)" %>
<% if @organization.errors[:whitelisted_email_domains].present? %>

<%= @organization.errors[:whitelisted_email_domains].first%>

<% end %>

If empty, your organization's sign-up page will be disabled

<%= f.check_box :auth_username_password_enabled, :id => "auth_username_password_enabled" %> <%= label_tag(:auth_username_password_enabled, '') %>

Allow users to signup with their own username & email submission

<%= f.check_box :auth_google_enabled, :id => "auth_google_enabled" %> <%= label_tag(:auth_google_enabled, '') %>

Allow users to signup with their own Google domain account

<%= f.check_box :auth_github_enabled, :id => "auth_github_enabled" %> <%= label_tag(:auth_github_enabled, '') %>

Allow users to signup with their own GitHub account

<%= f.check_box :strong_passwords_enabled, :id => "strong_passwords_enabled" %> <%= label_tag(:strong_passwords_enabled, '') %>

Passwords must contain 8 characters, and require a combination of letters, numbers, and/or special characters.

<%= f.text_field :password_expiration_in_d, :type => "number", :class => "CDB-InputText CDB-Text FormAccount-input FormAccount-input--number", :placeholder => "#{@organization.default_password_expiration_in_d || 180}", :min => 1, :max => 365, :value => "#{@organization.password_expiration_in_d}", :disabled => @organization.password_expiration_in_d ? false : true %>
/>
<% end %> <% end %>
<% end %> <%= render template: 'admin/organizations/_organization_settings', locals: { title: 'auth settings' } %>