diff --git a/app/controllers/login_controller.rb b/app/controllers/login_controller.rb index b2198a7c..0c1037ed 100644 --- a/app/controllers/login_controller.rb +++ b/app/controllers/login_controller.rb @@ -10,7 +10,7 @@ class LoginController < ApplicationController # 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. - if (CASClient rescue nil) + if defined? CASClient # Only require sub-library if gem is installed and loaded require 'casclient/frameworks/rails/filter' before_filter CASClient::Frameworks::Rails::GatewayFilter, :only => :login_cas diff --git a/config/environment.rb b/config/environment.rb index 221f8daf..7e3faa69 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -104,7 +104,7 @@ end if ( SITE_CONFIG['authentication_schemes'].include? 'cas') #requires rubycas-client gem to be installed - if (CASClient rescue nil) + if defined? CASClient require 'casclient/frameworks/rails/filter' CASClient::Frameworks::Rails::Filter.configure( :cas_base_url => SITE_CONFIG['cas_server'] ,