Extract user suspension into model method + remove keys.
authorThomas Kjeldahl Nilsson <thomas@kjeldahlnilsson.net>
Thu, 22 Mar 2012 19:24:55 +0000 (20:24 +0100)
committerThomas Kjeldahl Nilsson <thomas@kjeldahlnilsson.net>
Thu, 22 Mar 2012 19:24:55 +0000 (20:24 +0100)
commitddc004097c55923156ff0eba89833b73d6d87d61
tree1aa690c0e153d92428946913fae7d1de011f8461
parent82bd09ae067ec8117e0c7ef7df11d0329bd29afe
Extract user suspension into model method + remove keys.

Moved some user suspension logic from controller into user model.
Added test coverage. Also, note that suspend / unsuspend is not completely
symmetrical: suspend kills ssh keys and sets suspend timestamp, unsuspend only
wipes the timestamp - an unsuspended user has to reupload his ssh keys
to start pushing code again.
app/controllers/admin/users_controller.rb
app/models/user.rb
test/unit/user_test.rb