瀏覽代碼

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
tags/4.1.0
Toshi MARUYAMA 4 年之前
父節點
當前提交
fd7675adf2
共有 2 個文件被更改,包括 10 次插入8 次删除
  1. 0
    1
      .rubocop_todo.yml
  2. 10
    7
      app/models/user.rb

+ 0
- 1
.rubocop_todo.yml 查看文件

@@ -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:

+ 10
- 7
app/models/user.rb 查看文件

@@ -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

Loading…
取消
儲存