git-svn-id: http://svn.redmine.org/redmine/trunk@14011 e93f8b46-1217-0410-a6f0-8f06a7374b81tags/3.0.0
if @user.save | if @user.save | ||||
# Reset the session creation time to not log out this session on next | # Reset the session creation time to not log out this session on next | ||||
# request due to ApplicationController#force_logout_if_password_changed | # request due to ApplicationController#force_logout_if_password_changed | ||||
session[:ctime] = Time.now.utc.to_i | |||||
session[:ctime] = User.current.passwd_changed_on.utc.to_i | |||||
flash[:notice] = l(:notice_account_password_updated) | flash[:notice] = l(:notice_account_password_updated) | ||||
redirect_to my_account_path | redirect_to my_account_path | ||||
end | end |
def salt_password(clear_password) | def salt_password(clear_password) | ||||
self.salt = User.generate_salt | self.salt = User.generate_salt | ||||
self.hashed_password = User.hash_password("#{salt}#{User.hash_password clear_password}") | self.hashed_password = User.hash_password("#{salt}#{User.hash_password clear_password}") | ||||
self.passwd_changed_on = Time.now | |||||
self.passwd_changed_on = Time.now.change(:usec => 0) | |||||
end | end | ||||
# Does the backend storage allow this user to change their password? | # Does the backend storage allow this user to change their password? |