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:
@@ -62,7 +62,7 @@ class MyController < ApplicationController
|
||||
# Change user's password
|
||||
def change_password
|
||||
@user = self.logged_in_user
|
||||
flash[:notice] = l(:notice_can_t_change_password) and redirect_to :action => 'account' and return if @user.auth_source_id
|
||||
flash[:error] = l(:notice_can_t_change_password) and redirect_to :action => 'account' and return if @user.auth_source_id
|
||||
if @user.check_password?(params[:password])
|
||||
@user.password, @user.password_confirmation = params[:new_password], params[:new_password_confirmation]
|
||||
if @user.save
|
||||
@@ -72,7 +72,7 @@ class MyController < ApplicationController
|
||||
return
|
||||
end
|
||||
else
|
||||
flash[:notice] = l(:notice_account_wrong_password)
|
||||
flash[:error] = l(:notice_account_wrong_password)
|
||||
end
|
||||
redirect_to :action => 'account'
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user