summaryrefslogtreecommitdiffstats
path: root/app/controllers/users_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/users_controller.rb')
-rw-r--r--app/controllers/users_controller.rb15
1 files changed, 10 insertions, 5 deletions
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index e32a8ddb8..26e9151d9 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -231,17 +231,22 @@ class UsersController < ApplicationController
@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)
+ if params[:confirm] == I18n.t(:general_text_Yes)
@users.destroy_all
flash[:notice] = l(:notice_successful_delete)
redirect_to users_path
end
end
+ def bulk_lock
+ @users = User.logged.where(id: params[:ids]).where.not(id: User.current)
+ (render_404; return) unless @users.any?
+
+ @users.update_all status: User::STATUS_LOCKED
+ flash[:notice] = l(:notice_successful_update)
+ redirect_to users_path
+ end
+
private
def find_user(logged = true)