|
|
|
@ -109,12 +109,23 @@ class MyController < ApplicationController
|
|
|
|
|
# Edit user's account
|
|
|
|
|
def account
|
|
|
|
|
@user = User.current
|
|
|
|
|
|
|
|
|
|
lg=@user.login
|
|
|
|
|
@pref = @user.pref
|
|
|
|
|
diskfile = disk_filename('User', @user.id)
|
|
|
|
|
diskfile1 = diskfile + 'temp'
|
|
|
|
|
begin
|
|
|
|
|
if request.post?
|
|
|
|
|
# 修改邮箱的时候同步修改到gitlab
|
|
|
|
|
if @user.mail != params[:user][:mail]
|
|
|
|
|
g = Gitlab.client
|
|
|
|
|
begin
|
|
|
|
|
g.edit_user(@user.gid, :email => params[:user][:mail])
|
|
|
|
|
rescue
|
|
|
|
|
logger.error "sync user's email of gitlab failed!"
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
@user.safe_attributes = params[:user]
|
|
|
|
|
@user.pref.attributes = params[:pref]
|
|
|
|
|
@user.pref[:no_self_notified] = (params[:no_self_notified] == '1')
|
|
|
|
|