diff options
author | jessib <jessib@riseup.net> | 2013-11-04 09:05:03 -0800 |
---|---|---|
committer | jessib <jessib@riseup.net> | 2013-11-04 09:05:03 -0800 |
commit | d4f835662fac2d9dca705b5cba2e207562dec833 (patch) | |
tree | 23625c0daafbaade2a1aeb9bf9b17070f1f67d51 /users/app/controllers/users_controller.rb | |
parent | 7aaedeaf6fdd2d84ebab7bde2f6a6bdcf8d930b8 (diff) | |
parent | f6924bfe3b540c384fa53e55db9db3a64a34ced3 (diff) |
Merge pull request #108 from azul/feature/proper-user-deletion
notify user their account was successfully deleted (refs #4216)
Diffstat (limited to 'users/app/controllers/users_controller.rb')
-rw-r--r-- | users/app/controllers/users_controller.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/users/app/controllers/users_controller.rb b/users/app/controllers/users_controller.rb index f66277d..de21983 100644 --- a/users/app/controllers/users_controller.rb +++ b/users/app/controllers/users_controller.rb @@ -48,7 +48,15 @@ class UsersController < UsersBaseController def destroy @user.destroy - redirect_to admin? ? users_url : root_url + flash[:notice] = I18n.t(:account_destroyed) + # admins can destroy other users + if @user != current_user + redirect_to users_url + else + # let's remove the invalid session + logout + redirect_to root_url + end end end |