Make it possible to run rake gems:install for cas

The hard requires were causing rake to fail before it could even install
the rubycas-client gem. This kind of sucked.
This commit is contained in:
Eric Allen 2009-12-04 13:21:22 -05:00
parent aaf3965004
commit e17c1e1644
2 changed files with 15 additions and 10 deletions

View file

@ -33,10 +33,14 @@ class ApplicationController < ActionController::Base
# This will allow the user to view the index page without authentication
# but will process CAS authentication data if the user already
# has an SSO session open.
before_filter CASClient::Frameworks::Rails::GatewayFilter, :only => :login
if (CASClient rescue nil)
# Only require sub-library if gem is installed and loaded
require 'casclient/frameworks/rails/filter'
before_filter CASClient::Frameworks::Rails::GatewayFilter, :only => :login
# This requires the user to be authenticated for viewing all other pages.
before_filter CASClient::Frameworks::Rails::Filter, :except => [:login , :calendar]
# This requires the user to be authenticated for viewing all other pages.
before_filter CASClient::Frameworks::Rails::Filter, :except => [:login , :calendar]
end
end
before_filter :set_session_expiration
before_filter :set_time_zone