Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: thinkwell/authlogic_crowd
base: 46887630ca
...
head fork: thinkwell/authlogic_crowd
compare: fd8686d5b5
Checking mergeability… Don't worry, you can still create the pull request.
  • 3 commits
  • 2 files changed
  • 0 commit comments
  • 1 contributor
Commits on Jul 23, 2012
@blt04 blt04 Add can_auto_register hook
Allows selectively auto registering depending on the crowd username.  By
default, all crowd usernames are allowed to auto register if
auto_register is true.
0c83d76
@blt04 blt04 Bump version eaab261
Commits on Jul 24, 2012
@blt04 blt04 Add search_for_record_from_crowd hook fd8686d
Showing with 11 additions and 3 deletions.
  1. +10 −2 lib/authlogic_crowd/session.rb
  2. +1 −1  lib/authlogic_crowd/version.rb
View
12 lib/authlogic_crowd/session.rb
@@ -59,6 +59,10 @@ def auto_register?
self.class.auto_register_value
end
+ def can_auto_register?(crowd_username)
+ auto_register?
+ end
+
def crowd_record
if @valid_crowd_user[:user_token] && !@valid_crowd_user.has_key?(:record)
@valid_crowd_user[:record] = crowd_client.find_user_by_token(@valid_crowd_user[:user_token])
@@ -293,9 +297,9 @@ def needs_crowd_validation?
def find_or_create_record_from_crowd
return nil unless crowd_username
- record = search_for_record(find_by_login_method, crowd_username)
+ record = search_for_record_from_crowd(find_by_login_method, crowd_username)
- if !record && auto_register?
+ if !record && auto_register? && can_auto_register?(crowd_username)
synchronizer = crowd_synchronizer
synchronizer.crowd_record = crowd_record
record = synchronizer.create_record_from_crowd
@@ -305,6 +309,10 @@ def find_or_create_record_from_crowd
record
end
+ def search_for_record_from_crowd(find_by_login_method, crowd_username)
+ search_for_record(find_by_login_method, crowd_username)
+ end
+
# Logout of crowd and remove the crowd cookie.
def logout_of_crowd
if crowd_user_token
View
2  lib/authlogic_crowd/version.rb
@@ -1,3 +1,3 @@
module AuthlogicCrowd
- VERSION = "0.3.1"
+ VERSION = "0.3.2"
end

No commit comments for this range

Something went wrong with that request. Please try again.