ldap_create_user set to true by default #57

Closed
wants to merge 6 commits into
from
View
@@ -98,7 +98,7 @@ In initializer `config/initializers/devise.rb` :
* ldap\_logger _(default: true)_
* If set to true, will log LDAP queries to the Rails logger.
-* ldap\_create\_user _(default: false)_
+* ldap\_create\_user _(default: true)_
* If set to true, all valid LDAP users will be allowed to login and an appropriate user record will be created.
If set to false, you will have to create the user record before they will be allowed to login.
@@ -15,7 +15,7 @@ module Devise
# Add valid users to database
mattr_accessor :ldap_create_user
- @@ldap_create_user = false
+ @@ldap_create_user = true
mattr_accessor :ldap_config
# @@ldap_config = "#{Rails.root}/config/ldap.yml"
@@ -79,7 +79,7 @@ def authenticate_with_ldap(attributes={})
resource[auth_key] = attributes[auth_key]
resource.password = attributes[:password]
end
-
+

This comment has been minimized.

Show comment Hide comment
@cam-stitt

cam-stitt Oct 21, 2011

Just ignore this. I added and removed a debugger line for testing.

@cam-stitt

cam-stitt Oct 21, 2011

Just ignore this. I added and removed a debugger line for testing.

if resource.try(:valid_ldap_authentication?, attributes[:password])
if resource.new_record?
resource.ldap_before_save if resource.respond_to?(:ldap_before_save)
@@ -30,7 +30,7 @@ def default_devise_settings
settings = <<-eof
# ==> LDAP Configuration
# config.ldap_logger = true
- # config.ldap_create_user = false
+ # config.ldap_create_user = true
# config.ldap_update_password = true
# config.ldap_config = "\#{Rails.root}/config/ldap.yml"
# config.ldap_check_group_membership = false