Add ability for admins and mods to send another activation email to a user, to activate an account, and deactivate an account

This commit is contained in:
Neil Lalonde
2013-05-07 21:58:34 -04:00
parent 6b536dcde5
commit f35a44aeae
8 changed files with 121 additions and 1 deletions

View File

@ -102,6 +102,20 @@ class Admin::UsersController < Admin::AdminController
render nothing: true
end
def activate
@user = User.where(id: params[:user_id]).first
guardian.ensure_can_activate!(@user)
@user.activate
render nothing: true
end
def deactivate
@user = User.where(id: params[:user_id]).first
guardian.ensure_can_deactivate!(@user)
@user.deactivate
render nothing: true
end
def destroy
user = User.where(id: params[:id]).first
guardian.ensure_can_delete_user!(user)