mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-18 00:00:12 +01:00
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:
parent
aaf3965004
commit
e17c1e1644
2 changed files with 15 additions and 10 deletions
|
|
@ -33,11 +33,15 @@ 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.
|
||||
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]
|
||||
end
|
||||
end
|
||||
before_filter :set_session_expiration
|
||||
before_filter :set_time_zone
|
||||
before_filter :set_zindex_counter
|
||||
|
|
|
|||
|
|
@ -65,9 +65,7 @@ Rails::Initializer.run do |config|
|
|||
# See Rails::Configuration for more options
|
||||
if ( SITE_CONFIG['authentication_schemes'].include? 'cas')
|
||||
#requires rubycas-client gem to be installed
|
||||
config.gem "rubycas-client"
|
||||
require 'casclient'
|
||||
require 'casclient/frameworks/rails/filter'
|
||||
config.gem "rubycas-client", :lib => 'casclient'
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -106,11 +104,14 @@ end
|
|||
|
||||
if ( SITE_CONFIG['authentication_schemes'].include? 'cas')
|
||||
#requires rubycas-client gem to be installed
|
||||
if (CASClient rescue nil)
|
||||
require 'casclient/frameworks/rails/filter'
|
||||
CASClient::Frameworks::Rails::Filter.configure(
|
||||
:cas_base_url => SITE_CONFIG['cas_server'] ,
|
||||
:cas_server_logout => SITE_CONFIG['cas_server_logout']
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
tracks_version='1.8devel'
|
||||
# comment out next two lines if you do not want (or can not) the date of the
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue