修改密码验证的方法
This commit is contained in:
parent
d82f1f5696
commit
ec21a98e64
|
@ -154,7 +154,7 @@ class AccountController < ApplicationController
|
|||
else
|
||||
register_manually_by_administrator(@user)
|
||||
end
|
||||
|
||||
|
||||
#added by bai
|
||||
if @user.id != nil
|
||||
ue = @user.user_extensions ||= UserExtensions.new
|
||||
|
@ -168,7 +168,7 @@ class AccountController < ApplicationController
|
|||
ue.location_city = params[:city] if params[:city] != nil
|
||||
ue.save
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
end
|
||||
if params[:identity] == "2"
|
||||
|
|
|
@ -930,7 +930,7 @@ class User < Principal
|
|||
|
||||
def validate_password_length
|
||||
# Password length validation based on setting
|
||||
if !password.nil? && password.size < Setting.password_min_length.to_i
|
||||
if password.nil? || password.size < Setting.password_min_length.to_i
|
||||
errors.add(:password, :too_short, :count => Setting.password_min_length.to_i)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue