From: Jean-Philippe Lang Date: Fri, 29 Feb 2008 21:18:35 +0000 (+0000) Subject: Login field name changed to username (#755). X-Git-Tag: 0.7.0-RC1~107 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=87742f23edb3bbcbaf12540d2ff510ad8edac09e;p=redmine.git Login field name changed to username (#755). git-svn-id: http://redmine.rubyforge.org/svn/trunk@1181 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/app/controllers/account_controller.rb b/app/controllers/account_controller.rb index 40debb1f6..e719e8c9b 100644 --- a/app/controllers/account_controller.rb +++ b/app/controllers/account_controller.rb @@ -43,7 +43,7 @@ class AccountController < ApplicationController self.logged_user = nil else # Authenticate user - user = User.try_to_login(params[:login], params[:password]) + user = User.try_to_login(params[:username], params[:password]) if user self.logged_user = user # generate a key and set cookie if autologin diff --git a/app/views/account/login.rhtml b/app/views/account/login.rhtml index 5bfbfb8d6..ea1a1cd44 100644 --- a/app/views/account/login.rhtml +++ b/app/views/account/login.rhtml @@ -2,8 +2,8 @@ <% form_tag({:action=> "login"}) do %> - - + + @@ -28,6 +28,6 @@

<%= text_field_tag 'login', nil, :size => 40 %>

<%= text_field_tag 'username', nil, :size => 40 %>

-<%= javascript_tag "Form.Element.focus('login');" %> +<%= javascript_tag "Form.Element.focus('username');" %> <% end %> diff --git a/test/functional/account_controller_test.rb b/test/functional/account_controller_test.rb index a923de3ea..666acf0dd 100644 --- a/test/functional/account_controller_test.rb +++ b/test/functional/account_controller_test.rb @@ -45,7 +45,7 @@ class AccountControllerTest < Test::Unit::TestCase end def test_login_with_wrong_password - post :login, :login => 'admin', :password => 'bad' + post :login, :username => 'admin', :password => 'bad' assert_response :success assert_template 'login' assert_tag 'div', @@ -56,7 +56,7 @@ class AccountControllerTest < Test::Unit::TestCase def test_autologin Setting.autologin = "7" Token.delete_all - post :login, :login => 'admin', :password => 'admin', :autologin => 1 + post :login, :username => 'admin', :password => 'admin', :autologin => 1 assert_redirected_to 'my/page' token = Token.find :first assert_not_nil token diff --git a/test/test_helper.rb b/test/test_helper.rb index 7c81c3607..61670318a 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -49,7 +49,7 @@ class Test::Unit::TestCase assert_equal nil, session[:user_id] assert_response :success assert_template "account/login" - post "/account/login", :login => login, :password => password + post "/account/login", :username => login, :password => password assert_redirected_to "my/page" assert_equal login, User.find(session[:user_id]).login end