Merge pull request #880 from NARKOZ/dashboard-feed

Dashboard feed
This commit is contained in:
Dmitriy Zaporozhets 2012-06-01 07:25:54 -07:00
commit 16427f4c40
5 changed files with 69 additions and 6 deletions

View file

@ -1,7 +1,7 @@
class ApplicationController < ActionController::Base
before_filter :authenticate_user!
before_filter :reject_blocked!
before_filter :set_current_user_for_mailer
before_filter :set_current_user_for_mailer, :check_token_auth
protect_from_forgery
helper_method :abilities, :can?
@ -21,9 +21,16 @@ class ApplicationController < ActionController::Base
protected
def check_token_auth
# Redirect to login page if not atom feed
if params[:private_token].present? && params[:format] != 'atom'
redirect_to new_user_session_path
end
end
def reject_blocked!
if current_user && current_user.blocked
sign_out current_user
sign_out current_user
flash[:alert] = "Your account was blocked"
redirect_to new_user_session_path
end