add account deletion

This commit is contained in:
r888888888
2013-05-16 15:15:00 -07:00
parent 7db85d8301
commit 0a9e2a39b0
6 changed files with 196 additions and 2 deletions

View File

@@ -1,10 +1,18 @@
module Maintenance
module User
class DeletionsController < ApplicationController
rescue_from UserDeletion::ValidationError, :with => :rescue_exception
def show
end
def destroy
deletion = UserDeletion.new(CurrentUser.user, params[:password])
deletion.delete!
session.delete(:user_id)
cookies.delete(:cookie_password_hash)
cookies.delete(:user_name)
redirect_to(posts_path, :notice => "You are now logged out")
end
end
end