Skip to content

Commit 31edfef

Browse files
author
Morgan Showman
committed
Move logic for matching users into method
This commit moves the logic for matching users in the sql authlogic authenticator into a separate method for extensibility. This will allow for a custom authenticator to inherit the sql authlogic class and override the matching users method with a custom query.
1 parent efd533f commit 31edfef

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/casserver/authenticators/sql_authlogic.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def validate(credentials)
5656
salt_column = @options[:salt_column]
5757

5858
log_connection_pool_size
59-
results = user_model.find(:all, :conditions => ["#{username_column} = ?", @username])
59+
results = matching_users
6060
user_model.connection_pool.checkin(user_model.connection)
6161

6262
begin
@@ -90,4 +90,10 @@ def validate(credentials)
9090
return false
9191
end
9292
end
93+
94+
protected
95+
96+
def matching_users
97+
user_model.find(:all, :conditions => ["#{username_column} = ?", @username])
98+
end
9399
end

0 commit comments

Comments
 (0)