Adds disabled flag to user and checks it if iChain is enabled

This commit is contained in:
chrisbr 2014-11-06 16:17:11 +01:00
parent b95d35d5d9
commit 56cb805110
4 changed files with 23 additions and 1 deletions

View file

@ -54,6 +54,14 @@ class ApplicationController < ActionController::Base
redirect_to root_path
end
rescue_from UserDisabled do
Rails.logger.debug('User is disabled!')
sign_out(current_user)
mail = User.admin.first ? User.admin.first.email : 'the admin!'
flash[:error] = "This User is disabled. Please contact #{mail}!"
redirect_to root_path
end
def not_found
raise ActionController::RoutingError.new('Not Found')
end