Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

29 lines (23 sloc) 0.547 kb
class ApplicationController < ActionController::Base
protect_from_forgery
def login_required
if current_user.blank?
respond_to do |format|
format.html {
authenticate_user!
}
format.js{
render :partial => "common/not_logined"
}
format.all {
head(:unauthorized)
}
end
end
end
def require_is_admin
unless (current_user && current_user.admin?)
redirect_to root_path, :flash => { :error => "no permission" }
end
end
end
Jump to Line
Something went wrong with that request. Please try again.