admin status change
This commit is contained in:
1 parent
e360baadde
commit
4b4cdbfd31
7 files changed
+17
-3
No files matched your search
@@ -43,7 +43,10 @@ class Panel::UsersController < ApplicationController
|
||||
@user.remove_avatar! if params[:file]
|
||||
@user.avatar = params[:file] if params[:file]
|
||||
|
||||
if @user.update_attributes(params[:user])
|
||||
if @user.id.to_s.eql?(session['warden.user.user.key'][1].to_s) && @user.admin != params[:user][:admin].to_i.to_b
|
||||
flash.now[:error] = t('panel.cant_revoke_self_admin')
|
||||
end
|
||||
if !flash[:error] && @user.update_attributes(params[:user])
|
||||
flash[:notice] = t('panel.update_success_user')
|
||||
redirect_to :action => :index
|
||||
else
|
||||
|
||||
Reference in new issue
Block a user