|
|
@ -44,13 +44,16 @@ class UsersService
|
|
|
|
#location = get_user_location @user
|
|
|
|
#location = get_user_location @user
|
|
|
|
#{:id => @user.id, :img_url => img_url, :nickname => @user.login, :gender => gender, :work_unit => work_unit, :mail => @user.mail, :location => location, :brief_introduction => @user.user_extensions.brief_introduction}
|
|
|
|
#{:id => @user.id, :img_url => img_url, :nickname => @user.login, :gender => gender, :work_unit => work_unit, :mail => @user.mail, :location => location, :brief_introduction => @user.user_extensions.brief_introduction}
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 自动注册功能 FOR:邮件邀请
|
|
|
|
def register_auto(login,mail,password)
|
|
|
|
def register_auto(login,mail,password)
|
|
|
|
@user = User.new
|
|
|
|
@user = User.new
|
|
|
|
@user.admin = false
|
|
|
|
@user.admin = false
|
|
|
|
@user.register
|
|
|
|
@user.register
|
|
|
|
@user.login = login
|
|
|
|
@user.login = login
|
|
|
|
@user.mail =mail
|
|
|
|
@user.mail = mail
|
|
|
|
password_confirmation = password
|
|
|
|
password_confirmation = password
|
|
|
|
|
|
|
|
# 自动注册,跳过代码验证
|
|
|
|
should_confirmation_password = true
|
|
|
|
should_confirmation_password = true
|
|
|
|
if !password.blank? && !password_confirmation.blank? && should_confirmation_password
|
|
|
|
if !password.blank? && !password_confirmation.blank? && should_confirmation_password
|
|
|
|
@user.password, @user.password_confirmation = password, password_confirmation
|
|
|
|
@user.password, @user.password_confirmation = password, password_confirmation
|
|
|
@ -59,9 +62,7 @@ class UsersService
|
|
|
|
else
|
|
|
|
else
|
|
|
|
@user.password = ""
|
|
|
|
@user.password = ""
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
@user = automatically_register(@user)
|
|
|
|
@user = automatically_register(@user)
|
|
|
|
|
|
|
|
|
|
|
|
if @user.id != nil
|
|
|
|
if @user.id != nil
|
|
|
|
ue = @user.user_extensions ||= UserExtensions.new
|
|
|
|
ue = @user.user_extensions ||= UserExtensions.new
|
|
|
|
ue.user_id = @user.id
|
|
|
|
ue.user_id = @user.id
|
|
|
@ -69,6 +70,7 @@ class UsersService
|
|
|
|
end
|
|
|
|
end
|
|
|
|
@user
|
|
|
|
@user
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
#显示用户
|
|
|
|
#显示用户
|
|
|
|
#id用户id
|
|
|
|
#id用户id
|
|
|
|
def show_user(params)
|
|
|
|
def show_user(params)
|
|
|
|