parent
f6dd7ff652
commit
681546b860
|
@ -243,8 +243,10 @@ class ProjectsController < ApplicationController
|
|||
# Author lizanle
|
||||
# Description 项目动态展示方法,删除了不必要的代码
|
||||
def show
|
||||
|
||||
# 试图跳转到请求的按钮
|
||||
# params[:login]为邮箱邀请用户加入,主要功能:
|
||||
# 1、自动注册
|
||||
# 2、加入项目、创建角色
|
||||
# 3、用户得分
|
||||
if params[:login]
|
||||
login = params[:login]
|
||||
login = login.sub(/%40/,'@')
|
||||
|
@ -252,6 +254,7 @@ class ProjectsController < ApplicationController
|
|||
password = params[:password]
|
||||
us = UsersService.new
|
||||
user = us.register_auto(login,mail, password)
|
||||
|
||||
Member.create(:role_ids => [4], :user_id => user.id,:project_id => @project.id)
|
||||
UserGrade.create(:user_id => user.id, :project_id => @project.id)
|
||||
User.current = user unless User.current.nil?
|
||||
|
|
|
@ -53,7 +53,8 @@ class Mailer < ActionMailer::Base
|
|||
@subject = "#{invitor.name} #{l(:label_invite_project)} #{project.name} "
|
||||
@password = newpass(6)
|
||||
@project_url = url_for(:controller => 'projects', :action => 'show', :id => project.id,
|
||||
:password => @password, :login => email)
|
||||
:password => @password,
|
||||
:login => email)
|
||||
mail :to => email, :subject => @subject
|
||||
end
|
||||
|
||||
|
|
|
@ -44,6 +44,8 @@ class UsersService
|
|||
#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}
|
||||
end
|
||||
|
||||
# 自动注册功能 FOR:邮件邀请
|
||||
def register_auto(login,mail,password)
|
||||
@user = User.new
|
||||
@user.admin = false
|
||||
|
@ -51,6 +53,7 @@ class UsersService
|
|||
@user.login = login
|
||||
@user.mail = mail
|
||||
password_confirmation = password
|
||||
# 自动注册,跳过代码验证
|
||||
should_confirmation_password = true
|
||||
if !password.blank? && !password_confirmation.blank? && should_confirmation_password
|
||||
@user.password, @user.password_confirmation = password, password_confirmation
|
||||
|
@ -59,9 +62,7 @@ class UsersService
|
|||
else
|
||||
@user.password = ""
|
||||
end
|
||||
|
||||
@user = automatically_register(@user)
|
||||
|
||||
if @user.id != nil
|
||||
ue = @user.user_extensions ||= UserExtensions.new
|
||||
ue.user_id = @user.id
|
||||
|
@ -69,6 +70,7 @@ class UsersService
|
|||
end
|
||||
@user
|
||||
end
|
||||
|
||||
#显示用户
|
||||
#id用户id
|
||||
def show_user(params)
|
||||
|
|
|
@ -64,7 +64,7 @@
|
|||
<% images = attachments.select(&:thumbnailable?) %>
|
||||
<% if images.any? %>
|
||||
<% images.each do |attachment| %>
|
||||
<div class="pro_pic fl "><%= thumbnail_issue_tag(attachment) %></div>
|
||||
<div class="pro_pic fl " width="100" height="73"><%= thumbnail_issue_tag(attachment) %></div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
|
Loading…
Reference in New Issue