when CAS is switched app functions as normal but does not use any other auth methods.

This commit is contained in:
Erik Ordway 2009-11-24 13:09:29 -08:00 committed by Eric Allen
parent 00d06b7a00
commit f259924a85
5 changed files with 31 additions and 17 deletions

View file

@ -66,6 +66,11 @@ class UsersController < ApplicationController
end
user = User.new(params['user'])
if Tracks::Config.auth_schemes.include?('cas')
user.auth_type = "cas" #since CAS will be doing all the auth we may as well set it for everyone when CAS in enabled
end
unless user.valid?
session['new_user'] = user
redirect_to :action => 'new'
@ -74,11 +79,9 @@ class UsersController < ApplicationController
first_user_signing_up = User.no_users_yet?
user.is_admin = true if first_user_signing_up
if Tracks::Config.auth_schemes.include?('cas')
user.auth_type = "cas" #since CAS will be doing all the auth we may as well set it for everyone when CAS in enabled
end
if user.save
@user = User.authenticate(user.login, params['user']['password'])
@user.create_preference
@ -99,6 +102,9 @@ class UsersController < ApplicationController
return
end
user = User.new(params[:request])
if Tracks::Config.auth_schemes.include?('cas')
user.auth_type = "cas" #since CAS will be doing all the auth we may as well set it for everyone when CAS in enabled
end
user.password_confirmation = params[:request][:password]
if user.save
render :text => "User created.", :status => 200
@ -208,4 +214,4 @@ class UsersController < ApplicationController
return true
end
end
end