diff options
Diffstat (limited to 'app/controllers/users_controller.rb')
-rw-r--r-- | app/controllers/users_controller.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 5cd9eb931..0d80fc33a 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -215,6 +215,21 @@ class UsersController < ApplicationController end end + def bulk_destroy + @users = User.logged.where(id: params[:ids]).where.not(id: User.current) + (render_404; return) unless @users.any? + + if params[:lock] + @users.update_all status: User::STATUS_LOCKED + flash[:notice] = l(:notice_successful_update) + redirect_to users_path + elsif params[:confirm] == I18n.t(:general_text_Yes) + @users.destroy_all + flash[:notice] = l(:notice_successful_delete) + redirect_to users_path + end + end + private def find_user(logged = true) |