1
0
mirror of https://github.com/meineerde/redmine.git synced 2025-12-25 18:01:14 +00:00

code cleanup: rubocop: fix Lint/IneffectiveAccessModifier in app/models/user.rb

git-svn-id: http://svn.redmine.org/redmine/trunk@18779 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA 2019-10-19 13:33:32 +00:00
parent b0e28db7c7
commit fd7675adf2
2 changed files with 10 additions and 8 deletions

View File

@ -393,7 +393,6 @@ Lint/IneffectiveAccessModifier:
- 'app/models/attachment.rb'
- 'app/models/issue.rb'
- 'app/models/mail_handler.rb'
- 'app/models/user.rb'
Lint/InterpolationCheck:
Exclude:

View File

@ -903,14 +903,17 @@ class User < Principal
WikiContent::Version.where(['author_id = ?', id]).update_all(['author_id = ?', substitute.id])
end
# Return password digest
def self.hash_password(clear_password)
Digest::SHA1.hexdigest(clear_password || "")
end
# Singleton class method is public
class << self
# Return password digest
def hash_password(clear_password)
Digest::SHA1.hexdigest(clear_password || "")
end
# Returns a 128bits random salt as a hex string (32 chars long)
def self.generate_salt
Redmine::Utils.random_hex(16)
# Returns a 128bits random salt as a hex string (32 chars long)
def generate_salt
Redmine::Utils.random_hex(16)
end
end
# Send a security notification to all admins if the user has gained/lost admin privileges