diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 55d38ad7..61c7c331 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -74,6 +74,11 @@ 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 diff --git a/app/models/user.rb b/app/models/user.rb index 7dccbfe5..2dd6f6de 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -153,6 +153,9 @@ class User < ActiveRecord::Base if Tracks::Config.auth_schemes.include?('ldap') return candidate if candidate.auth_type == 'ldap' && SimpleLdapAuthenticator.valid?(login, pass) end + if Tracks::Config.auth_schemes.include?('cas') + return candidate #because we can not auth them with out thier real password we have to settle for this + end return nil end diff --git a/app/views/users/new.html.erb b/app/views/users/new.html.erb index fa0c30fd..592945b0 100644 --- a/app/views/users/new.html.erb +++ b/app/views/users/new.html.erb @@ -12,7 +12,17 @@ <%= text_field "user", "login", :size => 20 %> - + <%if Tracks::Config.auth_schemes.include?('cas')%> + + + <%= password_field "user", "password", :size => 20 , :value => "fakebecauseweusecas" %> + + + + <%= password_field "user", "password_confirmation", :size => 20, :value => "fakebecauseweusecas" %> + + <%else%> + <%= password_field "user", "password", :size => 20 %> @@ -20,6 +30,7 @@ <%= password_field "user", "password_confirmation", :size => 20 %> + <%end%>