refactor user find
This commit is contained in:
parent
0998ca3974
commit
2f5ce553e2
|
@ -1066,14 +1066,13 @@ class User < Principal
|
||||||
|
|
||||||
# refactor User model find function,
|
# refactor User model find function,
|
||||||
# return anonymous user when can not find user id = user_id
|
# return anonymous user when can not find user id = user_id
|
||||||
def self.find user_id
|
def self.find (*args, &block)
|
||||||
user = User.new
|
|
||||||
begin
|
begin
|
||||||
user = super
|
super
|
||||||
rescue
|
rescue
|
||||||
user = self.anonymous
|
self.anonymous
|
||||||
end
|
end
|
||||||
user
|
# super
|
||||||
end
|
end
|
||||||
# Salts all existing unsalted passwords
|
# Salts all existing unsalted passwords
|
||||||
# It changes password storage scheme from SHA1(password) to SHA1(salt + SHA1(password))
|
# It changes password storage scheme from SHA1(password) to SHA1(salt + SHA1(password))
|
||||||
|
|
Loading…
Reference in New Issue