Feature #41937 ยป 41937.patch
| app/views/account/login.html.erb | ||
|---|---|---|
|
<%= back_url_hidden_field_tag %>
|
||
|
|
||
|
<label for="username"><%=l(:field_login)%></label>
|
||
|
<%= text_field_tag 'username', params[:username], :tabindex => '1', :autofocus => params[:username].blank? %>
|
||
|
<%= text_field_tag 'username', params[:username], :tabindex => '1', :autocomplete => 'username', :autofocus => params[:username].blank? %>
|
||
|
|
||
|
<label for="password">
|
||
|
<%=l(:field_password)%>
|
||
|
<%= link_to l(:label_password_lost), lost_password_path, :class => "lost_password" if Setting.lost_password? %>
|
||
|
</label>
|
||
|
<%= password_field_tag 'password', nil, :tabindex => '2', :autofocus => params[:username].present? %>
|
||
|
<%= password_field_tag 'password', nil, :tabindex => '2', :autocomplete => 'current-password', :autofocus => params[:username].present? %>
|
||
|
|
||
|
<% if Setting.autologin? %>
|
||
|
<label for="autologin"><%= check_box_tag 'autologin', 1, false, :tabindex => 4 %> <%= l(:label_stay_logged_in) %></label>
|
||
| app/views/account/password_recovery.html.erb | ||
|---|---|---|
|
<div class="box tabular">
|
||
|
<p>
|
||
|
<label for="new_password"><%=l(:field_new_password)%> <span class="required">*</span></label>
|
||
|
<%= password_field_tag 'new_password', nil, :size => 25 %>
|
||
|
<%= password_field_tag 'new_password', nil, :size => 25, :autocomplete => 'new-password' %>
|
||
|
<em class="info"><%= l(:text_caracters_minimum, :count => Setting.password_min_length) %></em>
|
||
|
<% if Setting.password_required_char_classes.any? %>
|
||
|
<em class="info"><%= l(:text_characters_must_contain, :character_classes => Setting.password_required_char_classes.collect{|c| l("label_password_char_class_#{c}")}.join(", ")) %></em>
|
||
| ... | ... | |
|
<p>
|
||
|
<label for="new_password_confirmation"><%=l(:field_password_confirmation)%> <span class="required">*</span></label>
|
||
|
<%= password_field_tag 'new_password_confirmation', nil, :size => 25 %>
|
||
|
<%= password_field_tag 'new_password_confirmation', nil, :size => 25, :autocomplete => 'new-password' %>
|
||
|
</p>
|
||
|
</div>
|
||
|
<p><%= submit_tag l(:button_save) %></p>
|
||
| app/views/my/password.html.erb | ||
|---|---|---|
|
<%= form_tag({}, :class => "tabular") do %>
|
||
|
<div class="box">
|
||
|
<p><label for="password"><%=l(:field_current_password)%> <span class="required">*</span></label>
|
||
|
<%= password_field_tag 'password', nil, :size => 25 %></p>
|
||
|
<%= password_field_tag 'password', nil, :size => 25, :autocomplete => 'current-password' %></p>
|
||
|
<p><label for="new_password"><%=l(:field_new_password)%> <span class="required">*</span></label>
|
||
|
<%= password_field_tag 'new_password', nil, :size => 25 %>
|
||
|
<%= password_field_tag 'new_password', nil, :size => 25, :autocomplete => 'new-password' %>
|
||
|
<em class="info"><%= l(:text_caracters_minimum, :count => Setting.password_min_length) %></em>
|
||
|
<% if Setting.password_required_char_classes.any? %>
|
||
|
<em class="info"><%= l(:text_characters_must_contain, :character_classes => Setting.password_required_char_classes.collect{|c| l("label_password_char_class_#{c}")}.join(", ")) %></em>
|
||
| ... | ... | |
|
</p>
|
||
|
<p><label for="new_password_confirmation"><%=l(:field_password_confirmation)%> <span class="required">*</span></label>
|
||
|
<%= password_field_tag 'new_password_confirmation', nil, :size => 25 %></p>
|
||
|
<%= password_field_tag 'new_password_confirmation', nil, :size => 25, :autocomplete => 'new-password' %></p>
|
||
|
</div>
|
||
|
<%= submit_tag l(:button_apply) %>
|
||
|
<% end %>
|
||
| app/views/sudo_mode/_new_modal.html.erb | ||
|---|---|---|
|
<div class="box tabular">
|
||
|
<p>
|
||
|
<label for="sudo_password"><%= l :field_password %><span class="required">*</span></label>
|
||
|
<%= password_field_tag :sudo_password, nil, size: 25 %>
|
||
|
<%= password_field_tag :sudo_password, nil, size: 25, :autocomplete => 'current-password' %>
|
||
|
<br/><%= link_to l(:label_password_lost), lost_password_path, :class => "lost_password" if Setting.lost_password? %>
|
||
|
</p>
|
||
|
</div>
|
||
| app/views/sudo_mode/new.html.erb | ||
|---|---|---|
|
<div class="box">
|
||
|
<p>
|
||
|
<label for="sudo_password"><%= l :field_password %><span class="required">*</span></label>
|
||
|
<%= password_field_tag :sudo_password, nil, size: 25, autofocus: true %>
|
||
|
<%= password_field_tag :sudo_password, nil, size: 25, :autocomplete => 'current-password', autofocus: true %>
|
||
|
</br><%= link_to l(:label_password_lost), lost_password_path, :class => "lost_password" if Setting.lost_password? %>
|
||
|
</p>
|
||
|
</div>
|
||
| test/functional/account_controller_test.rb | ||
|---|---|---|
|
get :login
|
||
|
assert_response :success
|
||
|
assert_select 'input[name=username]'
|
||
|
assert_select 'input[name=password]'
|
||
|
assert_select 'input[name=username][autocomplete=username]'
|
||
|
assert_select 'input[name=password][autocomplete=current-password]'
|
||
|
end
|
||
|
def test_get_login_while_logged_in_should_redirect_to_back_url_if_present
|
||
| test/functional/my_controller_test.rb | ||
|---|---|---|
|
def test_change_password
|
||
|
get :password
|
||
|
assert_response :success
|
||
|
assert_select 'input[type=password][name=password]'
|
||
|
assert_select 'input[type=password][name=new_password]'
|
||
|
assert_select 'input[type=password][name=new_password_confirmation]'
|
||
|
assert_select 'input[type=password][name=password][autocomplete=current-password]'
|
||
|
assert_select 'input[type=password][name=new_password][autocomplete=new-password]'
|
||
|
assert_select 'input[type=password][name=new_password_confirmation][autocomplete=new-password]'
|
||
|
end
|
||
|
def test_update_password
|
||
| test/integration/account_test.rb | ||
|---|---|---|
|
follow_redirect!
|
||
|
assert_response :success
|
||
|
assert_select 'input[type=hidden][name=token][value=?]', token.value
|
||
|
assert_select 'input[name=new_password]'
|
||
|
assert_select 'input[name=new_password_confirmation]'
|
||
|
assert_select 'input[name=new_password][autocomplete=new-password]'
|
||
|
assert_select 'input[name=new_password_confirmation][autocomplete=new-password]'
|
||
|
post(
|
||
|
"/account/lost_password",
|
||