dev_local
jingquan huang 6 years ago
parent 210d138fb9
commit 8ffc0d51eb

@ -3266,6 +3266,9 @@ class UsersController < ApplicationController
end end
def edit def edit
unless User.current.admin?
render_403
end
@auth_sources = AuthSource.all @auth_sources = AuthSource.all
@membership ||= Member.new @membership ||= Member.new
end end
@ -3282,6 +3285,9 @@ class UsersController < ApplicationController
end end
def update def update
unless User.current.admin?
render_403
end
@user.admin = params[:user][:admin] if params[:user][:admin] @user.admin = params[:user][:admin] if params[:user][:admin]
@user.login = params[:user][:login] if params[:user][:login] @user.login = params[:user][:login] if params[:user][:login]
if params[:user][:password].present? && (@user.auth_source_id.nil? || params[:user][:auth_source_id].blank?) if params[:user][:password].present? && (@user.auth_source_id.nil? || params[:user][:auth_source_id].blank?)

Loading…
Cancel
Save