parent
cae882b3d6
commit
d9ae9c8061
|
@ -248,8 +248,20 @@ class ProjectsController < ApplicationController
|
|||
# 2、加入项目、创建角色
|
||||
# 3、用户得分
|
||||
if params[:mail]
|
||||
Member.create(:role_ids => [4], :user_id => params[:user],:project_id => params[:id])
|
||||
UserGrade.create(:user_id =>params[:user], :project_id => params[:id])
|
||||
user = User.find(params[:user_id])
|
||||
user.activate!
|
||||
Member.create(:role_ids => [4], :user_id => params[:user_id],:project_id => params[:id])
|
||||
UserGrade.create(:user_id => params[:user_id], :project_id => params[:id])
|
||||
token = Token.get_token_from_user(user, 'autologin')
|
||||
#user = User.try_to_autologin(token.value)
|
||||
if user
|
||||
start_user_session(user)
|
||||
user.save
|
||||
redirect_to project_member_path(params[:id])
|
||||
return
|
||||
# account_ project_member_path(params[:id])
|
||||
flash[:notice] = l(:label_mail_invite_success)
|
||||
end
|
||||
end
|
||||
if params[:jump] && redirect_to_project_menu_item(@project, params[:jump])
|
||||
return
|
||||
|
|
|
@ -60,8 +60,8 @@ class Mailer < ActionMailer::Base
|
|||
user = us.register_auto(login, @email, @password)
|
||||
User.current = user unless User.current.nil?
|
||||
@user = user
|
||||
@token = Token.get_token_from_user(user, 'autologin')
|
||||
@project_url = url_for(:controller => 'projects', :action => 'show', :id => project.id, :user => user.id, :mail => true, :token => @token.value)
|
||||
|
||||
@project_url = url_for(:controller => 'projects', :action => 'show', :id => project.id, :user_id => user.id, :mail => true)
|
||||
mail :to => email, :subject => @subject
|
||||
end
|
||||
|
||||
|
|
|
@ -342,6 +342,7 @@ zh:
|
|||
label_invite_trustie_user_tips: "输入姓名、邮箱、昵称"
|
||||
label_user_role_null: 用户和角色不能留空!
|
||||
label_invite_project: 邀请您加入项目
|
||||
label_mail_invite_success: 您已成功加入项目!
|
||||
label_invite_success: 邀请成功
|
||||
label_invite_members: 邀请用户
|
||||
#
|
||||
|
|
Loading…
Reference in New Issue