Applied the flash notices patch by Matt Jones (slightly edited).

flash[:notice] and flash[:error] are now used for notice/error messages.

git-svn-id: http://redmine.rubyforge.org/svn/trunk@600 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2007-08-02 17:42:20 +00:00
parent 7701de9ae4
commit 2d5ac54d2e
16 changed files with 44 additions and 21 deletions

View File

@@ -54,7 +54,7 @@ class AccountController < ApplicationController
end
redirect_back_or_default :controller => 'my', :action => 'page'
else
flash.now[:notice] = l(:notice_account_invalid_creditentials)
flash.now[:error] = l(:notice_account_invalid_creditentials)
end
end
end
@@ -89,9 +89,9 @@ class AccountController < ApplicationController
if request.post?
user = User.find_by_mail(params[:mail])
# user not found in db
flash.now[:notice] = l(:notice_account_unknown_email) and return unless user
flash.now[:error] = l(:notice_account_unknown_email) and return unless user
# user uses an external authentification
flash.now[:notice] = l(:notice_can_t_change_password) and return if user.auth_source_id
flash.now[:error] = l(:notice_can_t_change_password) and return if user.auth_source_id
# create a new token for password recovery
token = Token.new(:user => user, :action => "recovery")
if token.save