summaryrefslogtreecommitdiff
path: root/users/app/controllers
diff options
context:
space:
mode:
authorjessib <jessib@leap.se>2013-07-11 11:14:43 -0700
committerjessib <jessib@leap.se>2013-07-11 11:14:43 -0700
commitcc83a756affe1cedd6d828f038632b36e8afe95c (patch)
treebf6d9255ee9709d1504832a61c8918e7ac5cc9bb /users/app/controllers
parent09b7f01cac6df1ae11f4129b20b781b78a3706ac (diff)
parent02b69c78eed7682c24cb8361da094bdac45a7749 (diff)
Merge branch 'master' into feature/authentication_generic_error
Diffstat (limited to 'users/app/controllers')
-rw-r--r--users/app/controllers/users_controller.rb16
1 files changed, 14 insertions, 2 deletions
diff --git a/users/app/controllers/users_controller.rb b/users/app/controllers/users_controller.rb
index 4ce970b..f66277d 100644
--- a/users/app/controllers/users_controller.rb
+++ b/users/app/controllers/users_controller.rb
@@ -5,8 +5,8 @@
class UsersController < UsersBaseController
before_filter :authorize, :only => [:show, :edit, :update, :destroy]
- before_filter :fetch_user, :only => [:show, :edit, :update, :destroy]
- before_filter :authorize_admin, :only => [:index]
+ before_filter :fetch_user, :only => [:show, :edit, :update, :destroy, :deactivate, :enable]
+ before_filter :authorize_admin, :only => [:index, :deactivate, :enable]
respond_to :html
@@ -34,6 +34,18 @@ class UsersController < UsersBaseController
def edit
end
+ def deactivate
+ @user.enabled = false
+ @user.save
+ respond_with @user
+ end
+
+ def enable
+ @user.enabled = true
+ @user.save
+ respond_with @user
+ end
+
def destroy
@user.destroy
redirect_to admin? ? users_url : root_url