diaspora/app/controllers/admin/users_controller.rb
Florian Staudacher 13b716a449 allow admins to close user accounts from the backend
* thanks to @maxwell for the initial work on this

port admin pages to bootstrap
* improve user view on admin search page
* add 'close account' link to each user in the search results
* keep the same blue color for the admin menu

some refactoring of the routes and the admin code
* try to be more RESTful (possibly)
* use a 'UserSearch' model for search parameters and querying

add changelog entry
2014-07-01 23:33:15 +02:00

16 lines
327 B
Ruby

class Admin::UsersController < Admin::AdminController
def close_account
u = User.find(close_account_params)
u.close_account!
redirect_to user_search_path, notice: t('admins.user_search.account_closing_scheduled', name: u.username)
end
private
def close_account_params
params.require(:id)
end
end