Merge pull request #174 from opf/feature/rails3_disable_password_autocompletion

Disable autocompletion for login forms and password fields
pull/182/merge
ulferts 12 years ago
commit a7f93ac707
  1. 7
      app/views/account/_login.html.erb
  2. 2
      app/views/account/login.html.erb
  3. 2
      app/views/account/password_recovery.html.erb
  4. 13
      app/views/account/register.html.erb
  5. 2
      app/views/my/password.html.erb
  6. 4
      app/views/users/_form.html.erb
  7. 9
      app/views/users/_general.html.erb
  8. 5
      app/views/users/new.html.erb

@ -11,7 +11,8 @@ See doc/COPYRIGHT.rdoc for more details.
++#%>
<div id="nav-login-content">
<%= form_tag({:controller => '/account', :action=> "login"}) do %>
<%= form_tag({:controller => '/account', :action=> "login"},
:autocomplete => 'off') do %>
<%= back_url_to_current_page_hidden_field_tag %>
<table>
<tr>
@ -20,7 +21,9 @@ See doc/COPYRIGHT.rdoc for more details.
</tr>
<tr>
<td><%= text_field_tag 'username', nil, :id => 'username-pulldown' %></td>
<td><%= password_field_tag 'password', nil, :id => 'password-pulldown' %></td>
<td><%= password_field_tag 'password',
nil,
:id => 'password-pulldown' %></td>
<td><input type="submit" name="login" value="<%=l(:button_login)%>" /></td>
</tr>
</table>

@ -15,7 +15,7 @@ See doc/COPYRIGHT.rdoc for more details.
<% breadcrumb_paths(l(:label_login)) %>
<%= call_hook :view_account_login_top %>
<div id="login-form">
<%= form_tag({:action=> "login"}) do %>
<%= form_tag({:action=> "login"}, :autocomplete => 'off') do %>
<%= back_url_hidden_field_tag %>
<table>
<tr>

@ -16,7 +16,7 @@ See doc/COPYRIGHT.rdoc for more details.
<%= error_messages_for 'user' %>
<%= form_tag({:token => @token.value}) do %>
<%= form_tag({:token => @token.value}, :autocomplete => 'off') do %>
<div class="box tabular">
<p><label for="new_password"><%= User.human_attribute_name(:new_password) %> <span class="required">*</span></label>
<%= password_field_tag 'new_password', nil, :size => 25 %><br />

@ -14,7 +14,8 @@ See doc/COPYRIGHT.rdoc for more details.
<h2><%=l(:label_register)%> <%=link_to l(:label_login_with_open_id_option), signin_url if Setting.openid? %></h2>
<%= form_tag({:action => 'register'}, :class => "tabular") do %>
<%= form_tag({:action => 'register'},
:class => "tabular") do %>
<%= error_messages_for 'user' %>
<div class="box">
@ -24,11 +25,17 @@ See doc/COPYRIGHT.rdoc for more details.
<%= text_field 'user', 'login', :size => 25 %></p>
<p><label for="user_password"><%= User.human_attribute_name :password %> <span class="required">*</span></label>
<%= password_field 'user', 'password', :size => 25 %><br />
<%= password_field 'user',
'password',
:size => 25,
:autocomplete => 'off' %><br />
<%= password_complexity_requirements %></p>
<p><label for="user_password_confirmation"><%= User.human_attribute_name :password_confirmation %> <span class="required">*</span></label>
<%= password_field 'user', 'password_confirmation', :size => 25 %></p>
<%= password_field 'user',
'password_confirmation',
:size => 25,
:autocomplete => 'off' %></p>
<% end %>
<p><label for="user_firstname"><%= User.human_attribute_name :firstname %> <span class="required">*</span></label>

@ -14,7 +14,7 @@ See doc/COPYRIGHT.rdoc for more details.
<%= error_messages_for 'user' %>
<%= form_tag({}, :class => "tabular") do %>
<%= form_tag({}, :class => "tabular", :autocomplete => 'off') do %>
<div class="box">
<p><label for="password"><%= User.human_attribute_name(:password)%> <span class="required">*</span></label>
<%= password_field_tag 'password', nil, :size => 25 %></p>

@ -42,9 +42,9 @@ See doc/COPYRIGHT.rdoc for more details.
<p><%= f.select :auth_source_id, ([[l(:label_internal), ""]] + @auth_sources.collect { |a| [a.name, a.id] }), {}, :onchange => "if (this.value=='') {Element.show('password_fields');} else {Element.hide('password_fields');}" %></p>
<% end %>
<div id="password_fields" style="<%= 'display:none;' if @user.auth_source %>">
<p><%= f.password_field :password, :required => true, :size => 25, :autocomplete => :off %><br />
<p><%= f.password_field :password, :required => true, :size => 25 %><br />
<%= password_complexity_requirements %></p>
<p><%= f.password_field :password_confirmation, :required => true, :size => 25, :autocomplete => :off %></p>
<p><%= f.password_field :password_confirmation, :required => true, :size => 25 %></p>
</div>
</div>

@ -10,7 +10,14 @@ See doc/COPYRIGHT.rdoc for more details.
++#%>
<%= labelled_tabular_form_for @user, :url => { :controller => '/users', :action => "update", :tab => nil }, :html => { :method => :put, :class => nil }, :as => :user do |f| %>
<%= labelled_tabular_form_for @user,
:url => { :controller => '/users',
:action => "update",
:tab => nil },
:html => { :method => :put,
:class => nil,
:autocomplete => 'off' },
:as => :user do |f| %>
<%= render :partial => 'form', :locals => { :f => f } %>
<% if @user.active? -%>
<p><label><%= check_box_tag 'send_information', 1, true %> <%= l(:label_send_information) %></label></p>

@ -12,7 +12,10 @@ See doc/COPYRIGHT.rdoc for more details.
<h2><%= link_to l(:label_user_plural), :controller => '/users', :action => 'index' %> &#187; <%=l(:label_user_new)%></h2>
<%= labelled_tabular_form_for @user, :url => { :action => "create" }, :html => { :class => nil }, :as => :user do |f| %>
<%= labelled_tabular_form_for @user,
:url => { :action => "create" },
:html => { :class => nil, :autocomplete => 'off' },
:as => :user do |f| %>
<%= render :partial => 'form', :locals => { :f => f } %>
<p><label><%= check_box_tag 'send_information', 1, true %> <%= l(:label_send_information) %></label></p>
<p>

Loading…
Cancel
Save