summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2008-02-29 21:18:35 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2008-02-29 21:18:35 +0000
commit87742f23edb3bbcbaf12540d2ff510ad8edac09e (patch)
tree0fe336397522e28231697080929031acae2c4440
parent9daf39ec5242a6a87efb9c862952e176d4314856 (diff)
downloadredmine-87742f23edb3bbcbaf12540d2ff510ad8edac09e.tar.gz
redmine-87742f23edb3bbcbaf12540d2ff510ad8edac09e.zip
Login field name changed to username (#755).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1181 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--app/controllers/account_controller.rb2
-rw-r--r--app/views/account/login.rhtml6
-rw-r--r--test/functional/account_controller_test.rb4
-rw-r--r--test/test_helper.rb2
4 files changed, 7 insertions, 7 deletions
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 %>
<table>
<tr>
- <td align="right"><label for="login"><%=l(:field_login)%>:</label></td>
- <td align="left"><p><%= text_field_tag 'login', nil, :size => 40 %></p></td>
+ <td align="right"><label for="username"><%=l(:field_login)%>:</label></td>
+ <td align="left"><p><%= text_field_tag 'username', nil, :size => 40 %></p></td>
</tr>
<tr>
<td align="right"><label for="password"><%=l(:field_password)%>:</label></td>
@@ -28,6 +28,6 @@
</td>
</tr>
</table>
-<%= javascript_tag "Form.Element.focus('login');" %>
+<%= javascript_tag "Form.Element.focus('username');" %>
<% end %>
</div>
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