From 6ace52bb2b0d999d1f185bf74b2954b9ee41dbe4 Mon Sep 17 00:00:00 2001 From: jdamick Date: Fri, 15 Jun 2012 17:07:53 -0400 Subject: [PATCH] customizing the user login screen for primarily ldap authentication --- app/views/devise/sessions/new.html.erb | 34 ++++++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/app/views/devise/sessions/new.html.erb b/app/views/devise/sessions/new.html.erb index a2956eb31..89b2569df 100644 --- a/app/views/devise/sessions/new.html.erb +++ b/app/views/devise/sessions/new.html.erb @@ -1,5 +1,33 @@ +<% if ldap_enable? -%> + <%= form_for(resource, :as => resource_name, :url => user_omniauth_callback_path(:ldap), :html => { :class => "login-box", :id => 'new_ldap_user' }) do |f| %> + <%= image_tag "login-logo.png", :width => "304", :height => "66", :class => "login-logo", :alt => "Login Logo" %> + + <%= text_field_tag :username, nil, {:class => "text top", :placeholder => "LDAP Login"} %> + <%= password_field_tag :password, nil, {:class => "text bottom", :placeholder => "Password"} %> + + <% if devise_mapping.rememberable? -%> +
+ <% end -%> +
+ <%= f.submit "LDAP Sign in", :class => "primary btn" %> +
+ Admin Sign in + + + <% end %> +<% end %> + <%= form_for(resource, :as => resource_name, :url => session_path(resource_name), :html => { :class => "login-box" }) do |f| %> - <%= image_tag "login-logo.png", :width => "304", :height => "66", :class => "login-logo", :alt => "Login Logo" %> + <% unless ldap_enable? %> + <%= image_tag "login-logo.png", :width => "304", :height => "66", :class => "login-logo", :alt => "Login Logo" %> + <% else %> + + <% end %> + <%= f.text_field :email, :class => "text top", :placeholder => "Email" %> <%= f.password_field :password, :class => "text bottom", :placeholder => "Password" %> @@ -16,7 +44,5 @@ <%= link_to "Sign in with #{provider.to_s.titleize}", omniauth_authorize_path(resource_name, provider), :class => "btn primary" %>
<% end -%> <% end -%> - <% if ldap_enable? -%> -

<%= link_to "via LDAP", user_omniauth_authorize_path(:ldap)%>

- <% end -%> + <% end %> -- 2.11.0