From codesite-noreply at google.com Wed Jul 8 07:23:21 2009 From: codesite-noreply at google.com (codesite-noreply at google.com) Date: Wed, 08 Jul 2009 11:23:21 +0000 Subject: [activeldap-commit] [ruby-activeldap commit] r1018 - * add a TODO: [1.1.1] add :readonly option to :has_many. Message-ID: <0016368e207e807ce3046e2ff7be@google.com> Author: koutou Date: Wed Jul 8 04:22:46 2009 New Revision: 1018 Modified: trunk/TODO Log: * add a TODO: [1.1.1] add :readonly option to :has_many. Modified: trunk/TODO ============================================================================== --- trunk/TODO (original) +++ trunk/TODO Wed Jul 8 04:22:46 2009 @@ -1,3 +1,4 @@ +- [1.1.1] add :readonly option to :has_many. - Work as framework on Rails. - [1.1.x] ActiveLdap::Base#dn returns ActiveLdap::DN. [#23932] [Marc Dequ?nes] - How to support dSCorePropagationData? ignore it? From codesite-noreply at google.com Wed Jul 8 07:52:46 2009 From: codesite-noreply at google.com (codesite-noreply at google.com) Date: Wed, 08 Jul 2009 11:52:46 +0000 Subject: [activeldap-commit] [ruby-activeldap commit] r1019 - * belongs_to(:many) uses :primary_key instead of Message-ID: <00163698966fb7bf1f046e306002@google.com> Author: koutou Date: Wed Jul 8 04:49:14 2009 New Revision: 1019 Modified: trunk/lib/active_ldap/association/belongs_to_many.rb trunk/lib/active_ldap/associations.rb trunk/test/test_associations.rb Log: * belongs_to(:many) uses :primary_key instead of :foreign_key for primary key option. Suggested by tashen. Thanks!!! Modified: trunk/lib/active_ldap/association/belongs_to_many.rb ============================================================================== --- trunk/lib/active_ldap/association/belongs_to_many.rb (original) +++ trunk/lib/active_ldap/association/belongs_to_many.rb Wed Jul 8 04:49:14 2009 @@ -6,11 +6,11 @@ private def insert_entry(entry) old_value = entry[@options[:many], true] - foreign_key_name = @options[:foreign_key_name] - if foreign_key_name == "dn" + primary_key_name = @options[:primary_key_name] + if primary_key_name == "dn" old_value = dn_values_to_string_values(old_value) end - new_value = old_value + @owner[foreign_key_name, true] + new_value = old_value + @owner[primary_key_name, true] new_value = new_value.uniq.sort if old_value != new_value entry[@options[:many]] = new_value @@ -21,11 +21,11 @@ def delete_entries(entries) entries.each do |entry| old_value = entry[@options[:many], true] - foreign_key_name = @options[:foreign_key_name] - if foreign_key_name == "dn" + primary_key_name = @options[:primary_key_name] + if primary_key_name == "dn" old_value = dn_values_to_string_values(old_value) end - new_value = old_value - @owner[foreign_key_name, true] + new_value = old_value - @owner[primary_key_name, true] new_value = new_value.uniq.sort if old_value != new_value entry[@options[:many]] = new_value @@ -35,7 +35,7 @@ end def find_target - values = @owner[@options[:foreign_key_name], true].compact + values = @owner[@options[:primary_key_name], true].compact return [] if values.empty? key = @options[:many] Modified: trunk/lib/active_ldap/associations.rb ============================================================================== --- trunk/lib/active_ldap/associations.rb (original) +++ trunk/lib/active_ldap/associations.rb Wed Jul 8 04:49:14 2009 @@ -37,7 +37,8 @@ # Example: # belongs_to :groups, :class_name => "Group", # :many => "memberUid" # Group#memberUid - # # :foreign_key => "uid" # User#uid + # # :primary_key => "uid" # User#uid + # ## :foreign_key => "uid" # User#uid # deprecated since 1.1.0 # # dn attribute value is used by default # belongs_to :primary_group, :class_name => "Group", # :foreign_key => "gidNumber", # User#gidNumber @@ -61,7 +62,15 @@ } if opts[:many] association_class = Association::BelongsToMany - opts[:foreign_key_name] ||= dn_attribute + foreign_key_name = opts[:foreign_key_name] + if foreign_key_name + logger.warn do + _(":foreign_key belongs_to(:many) option is " \ + "deprecated since 1.1.0. Use :primary_key instead.") + end + opts[:primary_key_name] ||= foreign_key_name + end + opts[:primary_key_name] ||= dn_attribute else association_class = Association::BelongsTo opts[:foreign_key_name] ||= "#{association_id}_id" Modified: trunk/test/test_associations.rb ============================================================================== --- trunk/test/test_associations.rb (original) +++ trunk/test/test_associations.rb Wed Jul 8 04:49:14 2009 @@ -69,11 +69,26 @@ end end + def test_belongs_to_foreign_key_before_1_1_0 + @group_class.belongs_to :related_users, :many => "seeAlso", + :foreign_key => "dn" + @group_class.set_associated_class(:related_users, @user_class) + make_temporary_user do |user,| + make_temporary_group do |group| + user.see_also = group.dn + user.save! + + group = @group_class.find(group.id) + assert_equal([user.dn], group.related_users.collect(&:dn)) + end + end + end + def test_has_many_wrap_with_nonexistent_entry @user_class.has_many :references, :wrap => "seeAlso", :primary_key => "dn" @user_class.set_associated_class(:references, @group_class) @group_class.belongs_to :related_users, :many => "seeAlso", - :foreign_key => "dn" + :primary_key => "dn" @group_class.set_associated_class(:related_users, @user_class) make_temporary_user do |user,| make_temporary_group do |group1| @@ -101,7 +116,7 @@ @user_class.has_many :references, :wrap => "seeAlso", :primary_key => "dn" @user_class.set_associated_class(:references, @group_class) @group_class.belongs_to :related_users, :many => "seeAlso", - :foreign_key => "dn" + :primary_key => "dn" @group_class.set_associated_class(:related_users, @user_class) make_temporary_user do |user,| make_temporary_group do |group1| @@ -139,7 +154,7 @@ @user_class.has_many :references, :wrap => "seeAlso", :primary_key => "dn" @user_class.set_associated_class(:references, @group_class) @group_class.belongs_to :related_users, :many => "seeAlso", - :foreign_key => "dn" + :primary_key => "dn" @group_class.set_associated_class(:related_users, @user_class) make_temporary_group do |group| make_temporary_user do |user1,| @@ -177,7 +192,7 @@ end def test_belongs_to_many_with_dn_key - @user_class.belongs_to :dn_groups, :many => "memberUid", :foreign_key => "dn" + @user_class.belongs_to :dn_groups, :many => "memberUid", :primary_key => "dn" @user_class.set_associated_class(:dn_groups, @group_class) @group_class.has_many :dn_members, :wrap => "memberUid", :primary_key => "dn" @group_class.set_associated_class(:dn_members, @user_class) From codesite-noreply at google.com Wed Jul 8 07:56:50 2009 From: codesite-noreply at google.com (codesite-noreply at google.com) Date: Wed, 08 Jul 2009 11:56:50 +0000 Subject: [activeldap-commit] [ruby-activeldap commit] r1020 - * logger.warning -> logger.warn. Message-ID: <0016e6409b3436caa8046e306fd4@google.com> Author: koutou Date: Wed Jul 8 04:49:34 2009 New Revision: 1020 Modified: trunk/lib/active_ldap/configuration.rb trunk/lib/active_ldap/connection.rb trunk/lib/active_ldap/operations.rb Log: * logger.warning -> logger.warn. Modified: trunk/lib/active_ldap/configuration.rb ============================================================================== --- trunk/lib/active_ldap/configuration.rb (original) +++ trunk/lib/active_ldap/configuration.rb Wed Jul 8 04:49:34 2009 @@ -107,7 +107,7 @@ target.base = value.gsub(/['}{#]/, '') when :scope, :ldap_scope if key == :ldap_scope - logger.warning do + logger.warn do _(":ldap_scope configuration option is deprecated. " \ "Use :scope instead.") end Modified: trunk/lib/active_ldap/connection.rb ============================================================================== --- trunk/lib/active_ldap/connection.rb (original) +++ trunk/lib/active_ldap/connection.rb Wed Jul 8 04:49:34 2009 @@ -95,7 +95,7 @@ raise AdapterNotFound.new(adapter) end if config.has_key?(:ldap_scope) - logger.warning do + logger.warn do _(":ldap_scope connection option is deprecated. Use :scope instead.") end config[:scope] ||= config.delete(:ldap_scope) Modified: trunk/lib/active_ldap/operations.rb ============================================================================== --- trunk/lib/active_ldap/operations.rb (original) +++ trunk/lib/active_ldap/operations.rb Wed Jul 8 04:49:34 2009 @@ -46,7 +46,7 @@ _base = options[:base] ? [options[:base]] : [prefix, base] _base = prepare_search_base(_base) if options.has_key?(:ldap_scope) - logger.warning do + logger.warn do _(":ldap_scope search option is deprecated. Use :scope instead.") end options[:scope] ||= options[:ldap_scope] From codesite-noreply at google.com Wed Jul 8 08:08:52 2009 From: codesite-noreply at google.com (codesite-noreply at google.com) Date: Wed, 08 Jul 2009 12:08:52 +0000 Subject: [activeldap-commit] [ruby-activeldap commit] r1021 - * mean of :primary_key and :foreign_key has_many options is inverted. Message-ID: <0016e644de5e481309046e309ab8@google.com> Author: koutou Date: Wed Jul 8 05:08:27 2009 New Revision: 1021 Modified: trunk/lib/active_ldap/association/has_many.rb trunk/lib/active_ldap/associations.rb trunk/test/test_associations.rb Log: * mean of :primary_key and :foreign_key has_many options is inverted. Suggested by tashen. Thanks!!! Modified: trunk/lib/active_ldap/association/has_many.rb ============================================================================== --- trunk/lib/active_ldap/association/has_many.rb (original) +++ trunk/lib/active_ldap/association/has_many.rb Wed Jul 8 05:08:27 2009 @@ -8,17 +8,17 @@ private def insert_entry(entry) - entry[primary_key] = @owner[@options[:foreign_key_name]] + entry[@options[:foreign_key_name]] = @owner[primary_key] entry.save end def find_target - collect_targets(:foreign_key_name) + collect_targets(:primary_key_name) end def delete_entries(entries) - key = primary_key - components = @owner[@options[:foreign_key_name], true].reject do | value| + key = @options[:foreign_key_name] + components = @owner[primary_key, true].reject do |value| value.nil? end filter = [:and, Modified: trunk/lib/active_ldap/associations.rb ============================================================================== --- trunk/lib/active_ldap/associations.rb (original) +++ trunk/lib/active_ldap/associations.rb Wed Jul 8 05:08:27 2009 @@ -38,7 +38,8 @@ # belongs_to :groups, :class_name => "Group", # :many => "memberUid" # Group#memberUid # # :primary_key => "uid" # User#uid - # ## :foreign_key => "uid" # User#uid # deprecated since 1.1.0 + # ## deprecated since 1.1.0. Use :primary_key instead. + # ## :foreign_key => "uid" # User#uid # # dn attribute value is used by default # belongs_to :primary_group, :class_name => "Group", # :foreign_key => "gidNumber", # User#gidNumber @@ -101,8 +102,12 @@ # # Example: # has_many :primary_members, :class_name => "User", - # :primary_key => "gidNumber", # User#gidNumber - # :foreign_key => "gidNumber" # Group#gidNumber + # :primary_key => "gidNumber", # Group#gidNumber + # :foreign_key => "gidNumber" # User#gidNumber + # ## deprecated since 1.1.0. Those options + # ## are inverted. + # # :primary_key => "gidNumber", # User#gidNumber + # # :foreign_key => "gidNumber" # Group#gidNumber # has_many :members, :class_name => "User", # :wrap => "memberUid" # Group#memberUid def has_many(association_id, options = {}) @@ -124,6 +129,17 @@ association_class = Association::HasManyWrap else association_class = Association::HasMany + primary_key_name = opts[:primary_key_name] + foreign_key_name = opts[:foreign_key_name] + if primary_key_name != foreign_key_name and + !new.have_attribute?(primary_key_name) + logger.warn do + _(":primary_key and :foreign_key has_many options are " \ + "inverted their mean since 1.1.0. Please invert them.") + end + opts[:foreign_key_name] = primary_key_name + opts[:primary_key_name] = foreign_key_name + end end association_accessor(association_id) do |target| Modified: trunk/test/test_associations.rb ============================================================================== --- trunk/test/test_associations.rb (original) +++ trunk/test/test_associations.rb Wed Jul 8 05:08:27 2009 @@ -359,8 +359,8 @@ group_class.has_many :members, :class => @user_class, :wrap => "memberUid", :extend => mod group_class.has_many :primary_members, :class => @user_class, - :foreign_key => "gidNumber", :primary_key => "gidNumber", + :foreign_key => "gidNumber", :extend => mod end end From codesite-noreply at google.com Wed Jul 8 09:16:19 2009 From: codesite-noreply at google.com (codesite-noreply at google.com) Date: Wed, 08 Jul 2009 13:16:19 +0000 Subject: [activeldap-commit] [ruby-activeldap commit] r1022 - * cleanup dependencies. Message-ID: <00163616451b80a1e9046e318b62@google.com> Author: koutou Date: Wed Jul 8 06:15:47 2009 New Revision: 1022 Modified: trunk/Rakefile Log: * cleanup dependencies. Modified: trunk/Rakefile ============================================================================== --- trunk/Rakefile (original) +++ trunk/Rakefile Wed Jul 8 06:15:47 2009 @@ -62,11 +62,16 @@ self.url = 'http://rubyforge.org/projects/ruby-activeldap/' self.test_globs = ['test/test_*.rb'] self.changes = self.paragraphs_of('CHANGES', 0..1).join("\n\n") - self.extra_deps = ['activerecord'] + self.extra_deps = [ + 'ruby-ldap = 0.9.9', + 'activerecord = 2.3.2', + 'locale = 2.0.4', + 'gettext = 2.0.4', + 'gettext_activerecord = 2.0.4', + ] self.remote_rdoc_dir = "doc" self.rsync_args += " --chmod=Dg+ws,Fg+w" self.spec_extras = { - :requirements => ['ruby-ldap >= 0.8.2', '(Open)LDAP server'], :autorequire => 'active_ldap', :executables => [], } From codesite-noreply at google.com Wed Jul 8 09:37:27 2009 From: codesite-noreply at google.com (codesite-noreply at google.com) Date: Wed, 08 Jul 2009 13:37:27 +0000 Subject: [activeldap-commit] [ruby-activeldap commit] r1023 - * re-support GetText. Message-ID: <001485f91c000a9a6e046e31d711@google.com> Author: koutou Date: Wed Jul 8 06:20:23 2009 New Revision: 1023 Modified: trunk/lib/active_ldap.rb trunk/lib/active_ldap/base.rb Log: * re-support GetText. Modified: trunk/lib/active_ldap.rb ============================================================================== --- trunk/lib/active_ldap.rb (original) +++ trunk/lib/active_ldap.rb Wed Jul 8 06:20:23 2009 @@ -901,21 +901,11 @@ require 'active_ldap/timeout_stub' end -require_gem_if_need.call("active_record", "activerecord") +require_gem_if_need.call("active_record", "activerecord", "= 2.3.2") begin - raise LoadError, "GetText is disabled." - require_gem_if_need.call("locale") - require_gem_if_need.call("gettext") - - require 'active_record/version' - active_record_version = [ActiveRecord::VERSION::MAJOR, - ActiveRecord::VERSION::MINOR, - ActiveRecord::VERSION::TINY] - if (active_record_version <=> [2, 2, 0]) < 0 - require "gettext/active_record" - else - require_gem_if_need.call("gettext_activerecord") - end + require_gem_if_need.call("locale", nil, "= 2.0.4") + require_gem_if_need.call("gettext", nil, "= 2.0.4") + require_gem_if_need.call("gettext_activerecord", nil, "= 2.0.4") rescue LoadError end require 'active_ldap/get_text' Modified: trunk/lib/active_ldap/base.rb ============================================================================== --- trunk/lib/active_ldap/base.rb (original) +++ trunk/lib/active_ldap/base.rb Wed Jul 8 06:20:23 2009 @@ -678,7 +678,17 @@ # [ User.find("a"), User.find("b"), User.find("c") ] & # [ User.find("a"), User.find("d") ] # => [ User.find("a") ] def hash - dn.hash + return super if @_hashing # workaround for GetText :< + _dn = nil + begin + @_hashing = true + _dn = dn + rescue DistinguishedNameInvalid, DistinguishedNameNotSetError + return super + ensure + @_hashing = false + end + _dn.hash end def may @@ -1152,6 +1162,7 @@ @dn_is_base = false @dn_split_value = nil @connection ||= nil + @_hashing = false clear_connection_based_cache end @@ -1323,7 +1334,7 @@ ensure_update_dn dn_value = id if dn_value.nil? - format =_("%s's DN attribute (%s) isn't set") + format = _("%s's DN attribute (%s) isn't set") message = format % [self.inspect, dn_attribute] raise DistinguishedNameNotSetError.new, message end From codesite-noreply at google.com Wed Jul 8 10:16:55 2009 From: codesite-noreply at google.com (codesite-noreply at google.com) Date: Wed, 08 Jul 2009 14:16:55 +0000 Subject: [activeldap-commit] [ruby-activeldap commit] r1024 - * re-enable GetText. Message-ID: <0016361e892a360bdb046e326435@google.com> Author: koutou Date: Wed Jul 8 07:11:24 2009 New Revision: 1024 Modified: trunk/examples/al-admin/app/controllers/application_controller.rb trunk/examples/al-admin/config/environment.rb Log: * re-enable GetText. Modified: trunk/examples/al-admin/app/controllers/application_controller.rb ============================================================================== --- trunk/examples/al-admin/app/controllers/application_controller.rb (original) +++ trunk/examples/al-admin/app/controllers/application_controller.rb Wed Jul 8 07:11:24 2009 @@ -8,7 +8,10 @@ # Uncomment the :secret if you're not using the cookie session store protect_from_forgery # :secret => '5965eefc93d824a9c145fe8edb6d1a36' -# init_gettext "al-admin" + after_init_locale do |controller| + (Thread.current[:current_request] || {})[:accept_charset] = nil + end + init_gettext "al-admin" include ExceptionNotifiable Modified: trunk/examples/al-admin/config/environment.rb ============================================================================== --- trunk/examples/al-admin/config/environment.rb (original) +++ trunk/examples/al-admin/config/environment.rb Wed Jul 8 07:11:24 2009 @@ -27,9 +27,8 @@ # config.gem "hpricot", :version => '0.6', :source => "http://code.whytheluckystiff.net" # config.gem "sqlite3-ruby", :lib => "sqlite3" # config.gem "aws-s3", :lib => "aws/s3" -# config.gem "locale_rails" -# config.gem "gettext_activerecord" -# config.gem "gettext_rails" + config.gem "locale_rails", :version => "2.0.4" + config.gem "gettext_rails", :version => "2.0.4" # Only load the plugins named here, in the order given. By default, all plugins # in vendor/plugins are loaded in alphabetical order. From codesite-noreply at google.com Wed Jul 8 10:41:33 2009 From: codesite-noreply at google.com (codesite-noreply at google.com) Date: Wed, 08 Jul 2009 14:41:33 +0000 Subject: [activeldap-commit] [ruby-activeldap commit] r1025 - * really re-enable GetText. Message-ID: <0016361e891e5328be046e32bc28@google.com> Author: koutou Date: Wed Jul 8 07:32:36 2009 New Revision: 1025 Removed: trunk/examples/al-admin/config/initializers/gettext.rb Modified: trunk/examples/al-admin/app/controllers/application_controller.rb Log: * really re-enable GetText. Modified: trunk/examples/al-admin/app/controllers/application_controller.rb ============================================================================== --- trunk/examples/al-admin/app/controllers/application_controller.rb (original) +++ trunk/examples/al-admin/app/controllers/application_controller.rb Wed Jul 8 07:32:36 2009 @@ -8,9 +8,6 @@ # Uncomment the :secret if you're not using the cookie session store protect_from_forgery # :secret => '5965eefc93d824a9c145fe8edb6d1a36' - after_init_locale do |controller| - (Thread.current[:current_request] || {})[:accept_charset] = nil - end init_gettext "al-admin" include ExceptionNotifiable From codesite-noreply at google.com Wed Jul 8 10:46:38 2009 From: codesite-noreply at google.com (codesite-noreply at google.com) Date: Wed, 08 Jul 2009 14:46:38 +0000 Subject: [activeldap-commit] [ruby-activeldap commit] r1026 - * requires ActiveSupport 2.3.2. Message-ID: <0016e6409b3480c229046e32cec3@google.com> Author: koutou Date: Wed Jul 8 07:43:17 2009 New Revision: 1026 Modified: trunk/lib/active_ldap.rb Log: * requires ActiveSupport 2.3.2. Modified: trunk/lib/active_ldap.rb ============================================================================== --- trunk/lib/active_ldap.rb (original) +++ trunk/lib/active_ldap.rb Wed Jul 8 07:43:17 2009 @@ -879,7 +879,7 @@ end end -require_gem_if_need.call("active_support", "activesupport") +require_gem_if_need.call("active_support", "activesupport", "= 2.3.2") if ActiveSupport.const_defined?(:Dependencies) dependencies = ActiveSupport::Dependencies From codesite-noreply at google.com Thu Jul 9 09:28:07 2009 From: codesite-noreply at google.com (codesite-noreply at google.com) Date: Thu, 09 Jul 2009 13:28:07 +0000 Subject: [activeldap-commit] [ruby-activeldap commit] r1027 - * use ActiveSupport::Deprecation.warn instead of logger.warn for Message-ID: <000e0cd145868bdc11046e45d382@google.com> Author: koutou Date: Thu Jul 9 06:27:20 2009 New Revision: 1027 Modified: trunk/lib/active_ldap/associations.rb trunk/lib/active_ldap/configuration.rb trunk/lib/active_ldap/connection.rb trunk/lib/active_ldap/operations.rb Log: * use ActiveSupport::Deprecation.warn instead of logger.warn for deprecation warnings. Modified: trunk/lib/active_ldap/associations.rb ============================================================================== --- trunk/lib/active_ldap/associations.rb (original) +++ trunk/lib/active_ldap/associations.rb Thu Jul 9 06:27:20 2009 @@ -65,10 +65,9 @@ association_class = Association::BelongsToMany foreign_key_name = opts[:foreign_key_name] if foreign_key_name - logger.warn do - _(":foreign_key belongs_to(:many) option is " \ - "deprecated since 1.1.0. Use :primary_key instead.") - end + message = _(":foreign_key belongs_to(:many) option is " \ + "deprecated since 1.1.0. Use :primary_key instead.") + ActiveSupport::Deprecation.warn(message) opts[:primary_key_name] ||= foreign_key_name end opts[:primary_key_name] ||= dn_attribute @@ -133,10 +132,9 @@ foreign_key_name = opts[:foreign_key_name] if primary_key_name != foreign_key_name and !new.have_attribute?(primary_key_name) - logger.warn do - _(":primary_key and :foreign_key has_many options are " \ - "inverted their mean since 1.1.0. Please invert them.") - end + message = _(":primary_key and :foreign_key has_many options are " \ + "inverted their mean since 1.1.0. Please invert them.") + ActiveSupport::Deprecation.warn(message) opts[:foreign_key_name] = primary_key_name opts[:primary_key_name] = foreign_key_name end Modified: trunk/lib/active_ldap/configuration.rb ============================================================================== --- trunk/lib/active_ldap/configuration.rb (original) +++ trunk/lib/active_ldap/configuration.rb Thu Jul 9 06:27:20 2009 @@ -107,10 +107,9 @@ target.base = value.gsub(/['}{#]/, '') when :scope, :ldap_scope if key == :ldap_scope - logger.warn do - _(":ldap_scope configuration option is deprecated. " \ - "Use :scope instead.") - end + message = _(":ldap_scope configuration option is deprecated. " \ + "Use :scope instead.") + ActiveSupport::Deprecation.warn(message) end target.scope = value configuration[:scope] = value Modified: trunk/lib/active_ldap/connection.rb ============================================================================== --- trunk/lib/active_ldap/connection.rb (original) +++ trunk/lib/active_ldap/connection.rb Thu Jul 9 06:27:20 2009 @@ -95,9 +95,9 @@ raise AdapterNotFound.new(adapter) end if config.has_key?(:ldap_scope) - logger.warn do - _(":ldap_scope connection option is deprecated. Use :scope instead.") - end + message = _(":ldap_scope connection option is deprecated. " \ + "Use :scope instead.") + ActiveSupport::Deprecation.warn(message) config[:scope] ||= config.delete(:ldap_scope) end config = remove_connection_related_configuration(config) Modified: trunk/lib/active_ldap/operations.rb ============================================================================== --- trunk/lib/active_ldap/operations.rb (original) +++ trunk/lib/active_ldap/operations.rb Thu Jul 9 06:27:20 2009 @@ -46,9 +46,9 @@ _base = options[:base] ? [options[:base]] : [prefix, base] _base = prepare_search_base(_base) if options.has_key?(:ldap_scope) - logger.warn do - _(":ldap_scope search option is deprecated. Use :scope instead.") - end + message = _(":ldap_scope search option is deprecated. " \ + "Use :scope instead.") + ActiveSupport::Deprecation.warn(message) options[:scope] ||= options[:ldap_scope] end search_options = { From codesite-noreply at google.com Thu Jul 9 09:49:20 2009 From: codesite-noreply at google.com (codesite-noreply at google.com) Date: Thu, 09 Jul 2009 13:49:20 +0000 Subject: [activeldap-commit] [ruby-activeldap commit] r1028 - * use gettext/tools instead of gettext/utils. Message-ID: <000e0cd29d0c63d2f0046e461f63@google.com> Author: koutou Date: Thu Jul 9 06:48:07 2009 New Revision: 1028 Modified: trunk/Rakefile Log: * use gettext/tools instead of gettext/utils. Modified: trunk/Rakefile ============================================================================== --- trunk/Rakefile (original) +++ trunk/Rakefile Thu Jul 9 06:48:07 2009 @@ -120,7 +120,7 @@ namespace :gettext do desc "Setup environment for GetText" task :environment do - require "gettext/utils" + require "gettext/tools" end namespace :po do From codesite-noreply at google.com Thu Jul 9 09:53:21 2009 From: codesite-noreply at google.com (codesite-noreply at google.com) Date: Thu, 09 Jul 2009 13:53:21 +0000 Subject: [activeldap-commit] [ruby-activeldap commit] r1029 - * establish_connection -> setup_connection. Message-ID: <001636e1fd7bc315ef046e462daa@google.com> Author: koutou Date: Thu Jul 9 06:48:26 2009 New Revision: 1029 Modified: trunk/lib/active_ldap/get_text/parser.rb Log: * establish_connection -> setup_connection. Modified: trunk/lib/active_ldap/get_text/parser.rb ============================================================================== --- trunk/lib/active_ldap/get_text/parser.rb (original) +++ trunk/lib/active_ldap/get_text/parser.rb Thu Jul 9 06:48:26 2009 @@ -11,7 +11,7 @@ configuration = default_configuration.merge(configuration) configuration = extract_options(configuration) - ActiveLdap::Base.establish_connection(configuration) + ActiveLdap::Base.setup_connection(configuration) end def parse(file, targets=[]) From codesite-noreply at google.com Thu Jul 9 10:01:22 2009 From: codesite-noreply at google.com (codesite-noreply at google.com) Date: Thu, 09 Jul 2009 14:01:22 +0000 Subject: [activeldap-commit] [ruby-activeldap commit] r1031 - * use gettext/tools instead of gettext/utils. Message-ID: <000e0cd14836750806046e464a41@google.com> Author: koutou Date: Thu Jul 9 06:50:18 2009 New Revision: 1031 Modified: trunk/Rakefile Log: * use gettext/tools instead of gettext/utils. Modified: trunk/Rakefile ============================================================================== --- trunk/Rakefile (original) +++ trunk/Rakefile Thu Jul 9 06:50:18 2009 @@ -151,7 +151,7 @@ namespace :mo do desc "Create *.mo from *.po (GetText)" task :create => "gettext:environment" do - GetText.create_mofiles(false) + GetText.create_mofiles end end end From codesite-noreply at google.com Thu Jul 9 09:57:21 2009 From: codesite-noreply at google.com (codesite-noreply at google.com) Date: Thu, 09 Jul 2009 13:57:21 +0000 Subject: [activeldap-commit] [ruby-activeldap commit] r1030 - * update messages. Message-ID: <0016364c637518c149046e463cb8@google.com> Author: koutou Date: Thu Jul 9 06:48:43 2009 New Revision: 1030 Modified: trunk/po/en/active-ldap.po trunk/po/ja/active-ldap.po Log: * update messages. Modified: trunk/po/en/active-ldap.po ============================================================================== --- trunk/po/en/active-ldap.po (original) +++ trunk/po/en/active-ldap.po Thu Jul 9 06:48:43 2009 @@ -5,8 +5,8 @@ # msgid "" msgstr "" -"Project-Id-Version: ActiveLdap 1.1.0\n" -"POT-Creation-Date: 2008-06-17 21:42+0900\n" +"Project-Id-Version: Ruby/ActiveLdap 1.0.9\n" +"POT-Creation-Date: 2009-07-09 22:48+0900\n" "PO-Revision-Date: 2009-02-25 08:40+0900\n" "Last-Translator: Kouhei Sutou \n" "Language-Team: English\n" @@ -460,6 +460,10 @@ msgstr "" #: -:- +msgid "LDAP|Attribute|olcAddContentAcl" +msgstr "" + +#: -:- msgid "LDAP|Attribute|olcAllows" msgstr "" @@ -528,6 +532,10 @@ msgstr "" #: -:- +msgid "LDAP|Attribute|olcDbChecksum" +msgstr "" + +#: -:- msgid "LDAP|Attribute|olcDbConfig" msgstr "" @@ -576,6 +584,10 @@ msgstr "" #: -:- +msgid "LDAP|Attribute|olcDbPageSize" +msgstr "" + +#: -:- msgid "LDAP|Attribute|olcDbSearchStack" msgstr "" @@ -636,6 +648,10 @@ msgstr "" #: -:- +msgid "LDAP|Attribute|olcLdapSyntaxes" +msgstr "" + +#: -:- msgid "LDAP|Attribute|olcLimits" msgstr "" @@ -840,6 +856,10 @@ msgstr "" #: -:- +msgid "LDAP|Attribute|olcTLSProtocolMin" +msgstr "" + +#: -:- msgid "LDAP|Attribute|olcTLSRandFile" msgstr "" @@ -1764,6 +1784,12 @@ msgstr "" #: -:- +msgid "" +"LDAP|Description|Attribute|olcAddContentAcl|Check ACLs against content of " +"Add ops" +msgstr "" + +#: -:- msgid "LDAP|Description|Attribute|olcAllows|Allowed set of deprecated features" msgstr "" @@ -1816,6 +1842,11 @@ #: -:- msgid "" +"LDAP|Description|Attribute|olcDbChecksum|Enable database checksum validation" +msgstr "" + +#: -:- +msgid "" "LDAP|Description|Attribute|olcDbConfig|BerkeleyDB DB_CONFIG configuration " "directives" msgstr "" @@ -1872,6 +1903,11 @@ #: -:- msgid "" +"LDAP|Description|Attribute|olcDbPageSize|Page size of specified DB, in Kbytes" +msgstr "" + +#: -:- +msgid "" "LDAP|Description|Attribute|olcDbSearchStack|Depth of search stack in IDLs" msgstr "" @@ -1885,6 +1921,10 @@ msgstr "" #: -:- +msgid "LDAP|Description|Attribute|olcLdapSyntaxes|OpenLDAP ldapSyntax" +msgstr "" + +#: -:- msgid "LDAP|Description|Attribute|olcObjectClasses|OpenLDAP object classes" msgstr "" @@ -2891,6 +2931,12 @@ msgstr "" #: -:- +msgid "" +"LDAP|Description|Syntax|1.3.6.1.4.1.4203.666.11.10.2.1|X.509 " +"AttributeCertificate" +msgstr "" + +#: -:- msgid "LDAP|ObjectClass|LDAProotDSE" msgstr "" @@ -3370,6 +3416,10 @@ msgid "LDAP|Syntax|1.3.6.1.4.1.1466.115.121.1.9" msgstr "" +#: -:- +msgid "LDAP|Syntax|1.3.6.1.4.1.4203.666.11.10.2.1" +msgstr "" + #: lib/active_ldap/object_class.rb:53 msgid "Value in objectClass array is not a String: %s" msgstr "" @@ -3382,290 +3432,299 @@ msgid "Can't remove required objectClass: %s" msgstr "" -#: lib/active_ldap/adapter/jndi.rb:109 lib/active_ldap/adapter/ldap.rb:201 -#: lib/active_ldap/adapter/net_ldap.rb:158 +#: lib/active_ldap/adapter/jndi.rb:105 lib/active_ldap/adapter/ldap.rb:197 +#: lib/active_ldap/adapter/net_ldap.rb:155 msgid "%s is not one of the available connect methods: %s" msgstr "" -#: lib/active_ldap/adapter/jndi.rb:122 lib/active_ldap/adapter/ldap.rb:214 -#: lib/active_ldap/adapter/net_ldap.rb:171 +#: lib/active_ldap/adapter/jndi.rb:118 lib/active_ldap/adapter/ldap.rb:210 +#: lib/active_ldap/adapter/net_ldap.rb:168 msgid "%s is not one of the available LDAP scope: %s" msgstr "" -#: lib/active_ldap/adapter/jndi.rb:170 lib/active_ldap/adapter/ldap.rb:271 -#: lib/active_ldap/adapter/net_ldap.rb:295 +#: lib/active_ldap/adapter/jndi.rb:176 lib/active_ldap/adapter/ldap.rb:274 +#: lib/active_ldap/adapter/net_ldap.rb:290 msgid "unknown type: %s" msgstr "" -#: lib/active_ldap/adapter/ldap.rb:113 +#: lib/active_ldap/adapter/ldap.rb:108 msgid "No matches: filter: %s: attributes: %s" msgstr "" -#: lib/active_ldap/adapter/net_ldap.rb:215 +#: lib/active_ldap/adapter/net_ldap.rb:211 msgid "unsupported qops: %s" msgstr "" -#: lib/active_ldap/adapter/base.rb:77 +#: lib/active_ldap/adapter/base.rb:84 msgid "Bound to %s by SASL as %s" msgstr "" -#: lib/active_ldap/adapter/base.rb:79 +#: lib/active_ldap/adapter/base.rb:86 msgid "Bound to %s by simple as %s" msgstr "" -#: lib/active_ldap/adapter/base.rb:81 +#: lib/active_ldap/adapter/base.rb:88 msgid "Bound to %s as anonymous" msgstr "" -#: lib/active_ldap/adapter/base.rb:84 +#: lib/active_ldap/adapter/base.rb:91 msgid "All authentication methods for %s exhausted." msgstr "" -#: lib/active_ldap/adapter/base.rb:156 +#: lib/active_ldap/adapter/base.rb:171 msgid "Ignore error %s(%s): filter %s: attributes: %s" msgstr "" -#: lib/active_ldap/adapter/base.rb:174 lib/active_ldap/adapter/base.rb:184 -msgid "No such entry: %s" +#: lib/active_ldap/adapter/base.rb:187 lib/active_ldap/adapter/base.rb:206 +#: lib/active_ldap/adapter/base.rb:208 lib/active_ldap/adapter/base.rb:210 +#: lib/active_ldap/adapter/base.rb:212 lib/active_ldap/adapter/base.rb:222 +#: lib/active_ldap/adapter/base.rb:228 +msgid "%s: %s" msgstr "" -#: lib/active_ldap/adapter/base.rb:188 lib/active_ldap/adapter/base.rb:190 -#: lib/active_ldap/adapter/base.rb:192 lib/active_ldap/adapter/base.rb:194 -#: lib/active_ldap/adapter/base.rb:206 -msgid "%s: %s" +#: lib/active_ldap/adapter/base.rb:192 lib/active_ldap/adapter/base.rb:202 +msgid "No such entry: %s" msgstr "" -#: lib/active_ldap/adapter/base.rb:263 +#: lib/active_ldap/adapter/base.rb:293 msgid "password_block not nil or Proc object. Ignoring." msgstr "" -#: lib/active_ldap/adapter/base.rb:282 +#: lib/active_ldap/adapter/base.rb:314 msgid "Requested action timed out." msgstr "" -#: lib/active_ldap/adapter/base.rb:320 +#: lib/active_ldap/adapter/base.rb:355 msgid "Skip simple bind with empty password." msgstr "" -#: lib/active_ldap/adapter/base.rb:324 +#: lib/active_ldap/adapter/base.rb:359 msgid "Can't use empty password for simple bind." msgstr "" -#: lib/active_ldap/adapter/base.rb:515 +#: lib/active_ldap/adapter/base.rb:551 msgid "invalid logical operator: %s: available operators: %s" msgstr "" -#: lib/active_ldap/adapter/base.rb:532 -msgid "Giving up trying to reconnect to LDAP server." -msgstr "" - -#: lib/active_ldap/adapter/base.rb:535 +#: lib/active_ldap/adapter/base.rb:566 msgid "Attempting to reconnect" msgstr "" -#: lib/active_ldap/adapter/base.rb:546 +#: lib/active_ldap/adapter/base.rb:579 msgid "" "Reconnect to server failed: %s\n" "Reconnect to server failed backtrace:\n" "%s" msgstr "" +#: lib/active_ldap/adapter/base.rb:589 +msgid "Giving up trying to reconnect to LDAP server." +msgstr "" + #: lib/active_ldap/acts/tree.rb:66 msgid "parent must be an entry or parent DN: %s" msgstr "" -#: lib/active_ldap/operations.rb:46 +#: lib/active_ldap/operations.rb:49 msgid ":ldap_scope search option is deprecated. Use :scope instead." msgstr "" -#: lib/active_ldap/operations.rb:221 +#: lib/active_ldap/operations.rb:258 msgid "Invalid order: %s" msgstr "" -#: lib/active_ldap/operations.rb:257 +#: lib/active_ldap/operations.rb:294 msgid "Couldn't find %s without a DN" msgstr "" -#: lib/active_ldap/operations.rb:279 +#: lib/active_ldap/operations.rb:316 msgid "Couldn't find %s: DN: %s: filter: %s" msgstr "" -#: lib/active_ldap/operations.rb:282 +#: lib/active_ldap/operations.rb:319 msgid "Couldn't find %s: DN: %s" msgstr "" -#: lib/active_ldap/operations.rb:309 +#: lib/active_ldap/operations.rb:346 msgid "Couldn't find all %s: DNs (%s): filter: %s" msgstr "" -#: lib/active_ldap/operations.rb:312 +#: lib/active_ldap/operations.rb:349 msgid "Couldn't find all %s: DNs (%s)" msgstr "" -#: lib/active_ldap/ldif.rb:376 +#: lib/active_ldap/associations.rb:68 +msgid "" +":foreign_key belongs_to(:many) option is deprecated since 1.1.0. Use :" +"primary_key instead." +msgstr "" + +#: lib/active_ldap/associations.rb:135 +msgid "" +":primary_key and :foreign_key has_many options are inverted their mean since " +"1.1.0. Please invert them." +msgstr "" + +#: lib/active_ldap/ldif.rb:396 msgid "version spec is missing" msgstr "" -#: lib/active_ldap/ldif.rb:380 +#: lib/active_ldap/ldif.rb:400 msgid "version number is missing" msgstr "" -#: lib/active_ldap/ldif.rb:384 +#: lib/active_ldap/ldif.rb:404 msgid "unsupported version: %d" msgstr "" -#: lib/active_ldap/ldif.rb:388 +#: lib/active_ldap/ldif.rb:408 msgid "separator is missing" msgstr "" -#: lib/active_ldap/ldif.rb:392 +#: lib/active_ldap/ldif.rb:412 msgid "'dn:' is missing" msgstr "" -#: lib/active_ldap/ldif.rb:396 +#: lib/active_ldap/ldif.rb:416 msgid "DN is missing" msgstr "" -#: lib/active_ldap/ldif.rb:400 +#: lib/active_ldap/ldif.rb:420 msgid "DN is invalid: %s: %s" msgstr "" -#: lib/active_ldap/ldif.rb:404 +#: lib/active_ldap/ldif.rb:424 msgid "DN has an invalid character: %s" msgstr "" -#: lib/active_ldap/ldif.rb:408 lib/active_ldap/distinguished_name.rb:143 +#: lib/active_ldap/ldif.rb:428 lib/active_ldap/distinguished_name.rb:144 msgid "attribute type is missing" msgstr "" -#: lib/active_ldap/ldif.rb:412 +#: lib/active_ldap/ldif.rb:432 msgid "option is missing" msgstr "" -#: lib/active_ldap/ldif.rb:416 +#: lib/active_ldap/ldif.rb:436 msgid "':' is missing" msgstr "" -#: lib/active_ldap/ldif.rb:420 +#: lib/active_ldap/ldif.rb:440 msgid "URI is invalid: %s: %s" msgstr "" -#: lib/active_ldap/ldif.rb:424 +#: lib/active_ldap/ldif.rb:444 msgid "'-' is missing" msgstr "" -#: lib/active_ldap/ldif.rb:428 +#: lib/active_ldap/ldif.rb:448 msgid "unknown change type: %s" msgstr "" -#: lib/active_ldap/ldif.rb:432 +#: lib/active_ldap/ldif.rb:452 msgid "change type is missing" msgstr "" -#: lib/active_ldap/ldif.rb:436 +#: lib/active_ldap/ldif.rb:456 msgid "control type is missing" msgstr "" -#: lib/active_ldap/ldif.rb:440 +#: lib/active_ldap/ldif.rb:460 msgid "criticality is missing" msgstr "" -#: lib/active_ldap/ldif.rb:444 +#: lib/active_ldap/ldif.rb:464 msgid "change type value is missing" msgstr "" -#: lib/active_ldap/ldif.rb:448 +#: lib/active_ldap/ldif.rb:468 msgid "attribute spec is missing" msgstr "" -#: lib/active_ldap/ldif.rb:452 +#: lib/active_ldap/ldif.rb:472 msgid "'newrdn:' is missing" msgstr "" -#: lib/active_ldap/ldif.rb:456 +#: lib/active_ldap/ldif.rb:476 msgid "new RDN value is missing" msgstr "" -#: lib/active_ldap/ldif.rb:460 +#: lib/active_ldap/ldif.rb:480 msgid "'deleteoldrdn:' is missing" msgstr "" -#: lib/active_ldap/ldif.rb:464 +#: lib/active_ldap/ldif.rb:484 msgid "delete old RDN value is missing" msgstr "" -#: lib/active_ldap/ldif.rb:468 +#: lib/active_ldap/ldif.rb:488 msgid "new superior value is missing" msgstr "" -#: lib/active_ldap/ldif.rb:472 +#: lib/active_ldap/ldif.rb:492 msgid "unknown modify type: %s" msgstr "" -#: lib/active_ldap/ldif.rb:738 +#: lib/active_ldap/ldif.rb:765 msgid "invalid criticality value: %s" msgstr "" -#: lib/active_ldap/ldif.rb:781 +#: lib/active_ldap/ldif.rb:808 msgid "invalid deleteoldrdn value: %s" msgstr "" -#: lib/active_ldap/distinguished_name.rb:135 +#: lib/active_ldap/distinguished_name.rb:136 msgid "name component is missing" msgstr "" -#: lib/active_ldap/distinguished_name.rb:139 +#: lib/active_ldap/distinguished_name.rb:140 msgid "relative distinguished name (RDN) is missing" msgstr "" -#: lib/active_ldap/distinguished_name.rb:147 +#: lib/active_ldap/distinguished_name.rb:148 msgid "attribute value is missing" msgstr "" -#: lib/active_ldap/distinguished_name.rb:151 +#: lib/active_ldap/distinguished_name.rb:152 msgid "found unmatched quotation" msgstr "" -#: lib/active_ldap/distinguished_name.rb:187 +#: lib/active_ldap/distinguished_name.rb:188 msgid "%s isn't sub DN of %s" msgstr "" -#: lib/active_ldap/validations.rb:81 +#: lib/active_ldap/validations.rb:85 msgid "%{fn} is duplicated: %s" msgstr "" -#: lib/active_ldap/validations.rb:83 -msgid "is duplicated: %s" +#: lib/active_ldap/validations.rb:96 +msgid "%{fn} is invalid: %s" msgstr "" -#: lib/active_ldap/validations.rb:107 +#: lib/active_ldap/validations.rb:100 +msgid "%{fn} isn't set: %s" +msgstr "" + +#: lib/active_ldap/validations.rb:122 msgid "%{fn} has excluded value: %s" msgid_plural "%{fn} has excluded values: %s" msgstr[0] "" msgstr[1] "" -#: lib/active_ldap/validations.rb:142 +#: lib/active_ldap/validations.rb:152 msgid "%{fn} is required attribute by objectClass '%s'" msgstr "" -#: lib/active_ldap/validations.rb:144 +#: lib/active_ldap/validations.rb:154 msgid "%{fn} is required attribute by objectClass '%s': aliases: %s" msgstr "" -#: lib/active_ldap/validations.rb:177 -msgid "%{fn} (%s) has invalid format: %s: required syntax: %s: %s" -msgstr "" - -#: lib/active_ldap/validations.rb:179 -msgid "%{fn} has invalid format: %s: required syntax: %s: %s" +#: lib/active_ldap/validations.rb:181 +msgid "%{fn}(%s) has invalid format: %s: required syntax: %s: %s" msgstr "" #: lib/active_ldap/validations.rb:183 -msgid "(%s) has invalid format: %s: required syntax: %s: %s" -msgstr "" - -#: lib/active_ldap/validations.rb:185 -msgid "has invalid format: %s: required syntax: %s: %s" +msgid "%{fn} has invalid format: %s: required syntax: %s: %s" msgstr "" #: lib/active_ldap/command.rb:16 @@ -3684,88 +3743,110 @@ msgid "Show version" msgstr "" -#: lib/active_ldap/base.rb:112 +#: lib/active_ldap/base.rb:53 +msgid "" +"ActiveLdap::ConnectionNotEstablished has been deprecated since 1.1.0. Please " +"use ActiveLdap::ConnectionNotSetup instead." +msgstr "" + +#: lib/active_ldap/base.rb:131 msgid "invalid distinguished name (DN) to parse: %s" msgstr "" -#: lib/active_ldap/base.rb:122 +#: lib/active_ldap/base.rb:141 msgid "%s is invalid distinguished name (DN): %s" msgstr "" -#: lib/active_ldap/base.rb:124 +#: lib/active_ldap/base.rb:143 msgid "%s is invalid distinguished name (DN)" msgstr "" -#: lib/active_ldap/base.rb:142 +#: lib/active_ldap/base.rb:161 msgid "invalid LDIF: %s:" msgstr "" -#: lib/active_ldap/base.rb:144 +#: lib/active_ldap/base.rb:163 msgid "invalid LDIF:" msgstr "" -#: lib/active_ldap/base.rb:219 +#: lib/active_ldap/base.rb:241 msgid "LDAP configuration specifies nonexistent %s adapter" msgstr "" -#: lib/active_ldap/base.rb:227 +#: lib/active_ldap/base.rb:249 msgid "%s is unknown attribute" msgstr "" -#: lib/active_ldap/base.rb:423 +#: lib/active_ldap/base.rb:374 +msgid "" +"ActiveLdap::Base.establish_connection has been deprecated since 1.1.0. " +"Please use ActiveLdap::Base.setup_connection instead." +msgstr "" + +#: lib/active_ldap/base.rb:455 msgid "scope '%s' must be a Symbol" msgstr "" -#: lib/active_ldap/base.rb:577 +#: lib/active_ldap/base.rb:500 +msgid "%s doesn't belong in a hierarchy descending from ActiveLdap" +msgstr "" + +#: lib/active_ldap/base.rb:655 msgid "" "'%s' must be either nil, DN value as ActiveLdap::DN, String or Array or " "attributes as Hash" msgstr "" -#: lib/active_ldap/base.rb:682 +#: lib/active_ldap/base.rb:770 msgid "Failed to delete LDAP entry: %s" msgstr "" -#: lib/active_ldap/base.rb:701 +#: lib/active_ldap/base.rb:789 msgid "entry %s can't be saved" msgstr "" -#: lib/active_ldap/base.rb:720 lib/active_ldap/base.rb:731 +#: lib/active_ldap/base.rb:808 lib/active_ldap/base.rb:819 msgid "wrong number of arguments (%d for 1)" msgstr "" -#: lib/active_ldap/base.rb:854 +#: lib/active_ldap/base.rb:940 msgid "Can't find DN '%s' to reload" msgstr "" -#: lib/active_ldap/base.rb:1184 +#: lib/active_ldap/base.rb:1337 msgid "%s's DN attribute (%s) isn't set" msgstr "" -#: lib/active_ldap/base.rb:1298 -msgid "dn_attribute isn't set for this class: %s" -msgstr "" - -#: lib/active_ldap/attributes.rb:45 +#: lib/active_ldap/attributes.rb:76 msgid "The first argument, name, must not be nil. Please report this as a bug!" msgstr "" -#: lib/active_ldap/schema.rb:50 +#: lib/active_ldap/schema.rb:52 msgid "Unknown schema group: %s" msgstr "" -#: lib/active_ldap/schema.rb:513 +#: lib/active_ldap/schema.rb:547 msgid "Attribute %s can only have a single value: %s" msgstr "" -#: lib/active_ldap/schema.rb:532 +#: lib/active_ldap/schema.rb:566 msgid "Attribute %s: Hash must have one key-value pair only: %s" msgstr "" -#: lib/active_ldap/connection.rb:99 +#: lib/active_ldap/connection.rb:98 msgid ":ldap_scope connection option is deprecated. Use :scope instead." msgstr "" +#: lib/active_ldap/connection.rb:156 +msgid "" +"ActiveLdap::Connection.establish_connection has been deprecated since 1.1.0. " +"Please use ActiveLdap::Connection.setup_connection instead." +msgstr "" + +#: lib/active_ldap/connection.rb:229 +msgid "since 1.1.0. " +msgstr "" + #: lib/active_ldap/user_password.rb:10 msgid "Invalid hashed password: %s" msgstr "" @@ -3803,56 +3884,56 @@ msgstr "" #: lib/active_ldap/schema/syntaxes.rb:162 -#: lib/active_ldap/schema/syntaxes.rb:369 +#: lib/active_ldap/schema/syntaxes.rb:381 msgid "%s has invalid UTF-8 character" msgstr "" -#: lib/active_ldap/schema/syntaxes.rb:225 +#: lib/active_ldap/schema/syntaxes.rb:237 msgid "%s has missing components: %s" msgstr "" -#: lib/active_ldap/schema/syntaxes.rb:228 +#: lib/active_ldap/schema/syntaxes.rb:240 msgid "%s is invalid time format" msgstr "" -#: lib/active_ldap/schema/syntaxes.rb:258 +#: lib/active_ldap/schema/syntaxes.rb:270 msgid "%s is invalid integer format" msgstr "" -#: lib/active_ldap/schema/syntaxes.rb:270 +#: lib/active_ldap/schema/syntaxes.rb:282 msgid "invalid JPEG format" msgstr "" -#: lib/active_ldap/schema/syntaxes.rb:311 +#: lib/active_ldap/schema/syntaxes.rb:323 msgid "%s is invalid numeric format" msgstr "" -#: lib/active_ldap/schema/syntaxes.rb:326 +#: lib/active_ldap/schema/syntaxes.rb:338 msgid "%s is invalid OID format: %s" msgstr "" -#: lib/active_ldap/schema/syntaxes.rb:328 +#: lib/active_ldap/schema/syntaxes.rb:340 msgid "%s is invalid OID format" msgstr "" -#: lib/active_ldap/schema/syntaxes.rb:341 +#: lib/active_ldap/schema/syntaxes.rb:353 msgid "%s has no mailbox type" msgstr "" -#: lib/active_ldap/schema/syntaxes.rb:345 +#: lib/active_ldap/schema/syntaxes.rb:357 msgid "%s has unprintable character in mailbox type: '%s'" msgstr "" -#: lib/active_ldap/schema/syntaxes.rb:350 +#: lib/active_ldap/schema/syntaxes.rb:362 msgid "%s has no mailbox" msgstr "" -#: lib/active_ldap/schema/syntaxes.rb:363 -#: lib/active_ldap/schema/syntaxes.rb:382 +#: lib/active_ldap/schema/syntaxes.rb:375 +#: lib/active_ldap/schema/syntaxes.rb:394 msgid "empty string" msgstr "" -#: lib/active_ldap/schema/syntaxes.rb:386 +#: lib/active_ldap/schema/syntaxes.rb:398 msgid "%s has unprintable character: '%s'" msgstr "" @@ -3864,79 +3945,65 @@ msgid "%s connection is not configured" msgstr "" -#: lib/active_ldap/configuration.rb:111 +#: lib/active_ldap/configuration.rb:110 msgid ":ldap_scope configuration option is deprecated. Use :scope instead." msgstr "" -#: lib/active_ldap/configuration.rb:132 +#: lib/active_ldap/configuration.rb:131 msgid "invalid URI: %s" msgstr "" -#: lib/active_ldap/configuration.rb:135 +#: lib/active_ldap/configuration.rb:134 msgid "not a LDAP URI: %s" msgstr "" -#: rails/plugin/active_ldap/init.rb:7 +#: rails/init.rb:7 msgid "You need ActiveLdap %s or later" msgstr "" -#: rails/plugin/active_ldap/init.rb:19 +#: rails/init.rb:19 msgid "You should run 'script/generator scaffold_active_ldap' to make %s." msgstr "" -#: rails/plugin/active_ldap/generators/model_active_ldap/model_active_ldap_generator.rb:32 -msgid "Use ATTRIBUTE as default DN attribute for instances of this model" +#: benchmark/bench-al.rb:14 +msgid "Specify prefix for benchmarking" msgstr "" -#: rails/plugin/active_ldap/generators/model_active_ldap/model_active_ldap_generator.rb:34 -#: rails/plugin/active_ldap/generators/model_active_ldap/model_active_ldap_generator.rb:40 #: benchmark/bench-al.rb:15 msgid "(default: %s)" msgstr "" -#: rails/plugin/active_ldap/generators/model_active_ldap/model_active_ldap_generator.rb:39 -msgid "Use PREFIX as prefix for this model" -msgstr "" - -#: rails/plugin/active_ldap/generators/scaffold_al/scaffold_al_generator.rb:7 -msgid "scaffold_al is deprecated. Use scaffold_active_ldap instead." -msgstr "" - -#: benchmark/bench-al.rb:14 -msgid "Specify prefix for benchmarking" -msgstr "" - -#: benchmark/bench-al.rb:182 +#: benchmark/bench-al.rb:219 msgid "Populating..." msgstr "" -#: benchmark/bench-al.rb:239 +#: benchmark/bench-al.rb:276 msgid "Entries processed by Ruby/ActiveLdap + LDAP: %d" msgstr "" -#: benchmark/bench-al.rb:240 +#: benchmark/bench-al.rb:277 msgid "Entries processed by Ruby/ActiveLdap + Net::LDAP: %d" msgstr "" -#: benchmark/bench-al.rb:242 +#: benchmark/bench-al.rb:279 msgid "" "Entries processed by Ruby/ActiveLdap + LDAP: (without object creation): %d" msgstr "" -#: benchmark/bench-al.rb:245 +#: benchmark/bench-al.rb:282 msgid "" "Entries processed by Ruby/ActiveLdap + Net::LDAP: (without object creation): " "%d" msgstr "" -#: benchmark/bench-al.rb:248 +#: benchmark/bench-al.rb:285 msgid "Entries processed by Ruby/LDAP: %d" msgstr "" -#: benchmark/bench-al.rb:249 +#: benchmark/bench-al.rb:286 msgid "Entries processed by Net::LDAP: %d" msgstr "" -#: benchmark/bench-al.rb:253 +#: benchmark/bench-al.rb:290 msgid "Cleaning..." msgstr "" Modified: trunk/po/ja/active-ldap.po ============================================================================== --- trunk/po/ja/active-ldap.po (original) +++ trunk/po/ja/active-ldap.po Thu Jul 9 06:48:43 2009 @@ -5,9 +5,9 @@ # msgid "" msgstr "" -"Project-Id-Version: ActiveLdap 1.1.0\n" -"POT-Creation-Date: 2008-06-17 21:42+0900\n" -"PO-Revision-Date: 2009-02-25 08:40+0900\n" +"Project-Id-Version: Ruby/ActiveLdap 1.0.9\n" +"POT-Creation-Date: 2009-07-09 22:48+0900\n" +"PO-Revision-Date: 2009-07-09 22:48+0900\n" "Last-Translator: Kouhei Sutou \n" "Language-Team: Japanese\n" "MIME-Version: 1.0\n" @@ -460,6 +460,10 @@ msgstr "OpenLDAP??: ??????(olcAccess)" #: -:- +msgid "LDAP|Attribute|olcAddContentAcl" +msgstr "OpenLDAP??: ???????????(olcAddContentAcl)" + +#: -:- msgid "LDAP|Attribute|olcAllows" msgstr "OpenLDAP??: ??(olcAllows)" @@ -528,6 +532,10 @@ msgstr "OpenLDAP??: DB: ????????(olcDbCheckpoint)" #: -:- +msgid "LDAP|Attribute|olcDbChecksum" +msgstr "OpenLDAP??: DB: ??????(olcDbChecksum)" + +#: -:- msgid "LDAP|Attribute|olcDbConfig" msgstr "OpenLDAP??: DB: ??(olcDbConfig)" @@ -576,6 +584,10 @@ msgstr "OpenLDAP??: DB: ???(olcDbNoSync)" #: -:- +msgid "LDAP|Attribute|olcDbPageSize" +msgstr "OpenLDAP??: DB: ??????(olcDbPageSize)" + +#: -:- msgid "LDAP|Attribute|olcDbSearchStack" msgstr "OpenLDAP??: DB: ??????(olcDbSearchStack)" @@ -636,6 +648,10 @@ msgstr "OpenLDAP??: ??????(olcLastMod)" #: -:- +msgid "LDAP|Attribute|olcLdapSyntaxes" +msgstr "OpenLDAP??: LDAP??(olcLdapSyntaxes)" + +#: -:- msgid "LDAP|Attribute|olcLimits" msgstr "OpenLDAP??: ??(olcLimits)" @@ -841,6 +857,10 @@ msgstr "OpenLDAP??: TLS: DH????????(olcTLSDHParamFile)" #: -:- +msgid "LDAP|Attribute|olcTLSProtocolMin" +msgstr "OpenLDAP??: TLS: ????????????(olcTLSProtocolMin)" + +#: -:- msgid "LDAP|Attribute|olcTLSRandFile" msgstr "OpenLDAP??: TLS: ????????(olcTLSRandFile)" @@ -1765,6 +1785,12 @@ msgstr "?????????" #: -:- +msgid "" +"LDAP|Description|Attribute|olcAddContentAcl|Check ACLs against content of " +"Add ops" +msgstr "?????????????????????????" + +#: -:- msgid "LDAP|Description|Attribute|olcAllows|Allowed set of deprecated features" msgstr "????????????????" @@ -1817,6 +1843,11 @@ #: -:- msgid "" +"LDAP|Description|Attribute|olcDbChecksum|Enable database checksum validation" +msgstr "?????????????????????" + +#: -:- +msgid "" "LDAP|Description|Attribute|olcDbConfig|BerkeleyDB DB_CONFIG configuration " "directives" msgstr "?????DB(BDB)?DB_CONFIG?????????" @@ -1873,6 +1904,11 @@ #: -:- msgid "" +"LDAP|Description|Attribute|olcDbPageSize|Page size of specified DB, in Kbytes" +msgstr "??????????????????K???????" + +#: -:- +msgid "" "LDAP|Description|Attribute|olcDbSearchStack|Depth of search stack in IDLs" msgstr "IDL? Author: koutou Date: Thu Jul 9 07:14:19 2009 New Revision: 1032 Modified: trunk/lib/active_ldap/associations.rb trunk/test/test_associations.rb Log: * suppress warnings. Modified: trunk/lib/active_ldap/associations.rb ============================================================================== --- trunk/lib/active_ldap/associations.rb (original) +++ trunk/lib/active_ldap/associations.rb Thu Jul 9 07:14:19 2009 @@ -113,7 +113,7 @@ validate_has_many_options(options) klass = options[:class] klass ||= (options[:class_name] || association_id.to_s).classify - foreign_key = options[:foreign_key] || "#{association_id}_id" + foreign_key = options[:foreign_key] primary_key = options[:primary_key] set_associated_class(association_id, klass) @@ -125,6 +125,7 @@ :extend => options[:extend], } if opts[:wrap] + opts[:foreign_key_name] ||= "#{association_id}_id" association_class = Association::HasManyWrap else association_class = Association::HasMany Modified: trunk/test/test_associations.rb ============================================================================== --- trunk/test/test_associations.rb (original) +++ trunk/test/test_associations.rb Thu Jul 9 07:14:19 2009 @@ -70,8 +70,10 @@ end def test_belongs_to_foreign_key_before_1_1_0 - @group_class.belongs_to :related_users, :many => "seeAlso", - :foreign_key => "dn" + ActiveSupport::Deprecation.silence do + @group_class.belongs_to :related_users, :many => "seeAlso", + :foreign_key => "dn" + end @group_class.set_associated_class(:related_users, @user_class) make_temporary_user do |user,| make_temporary_group do |group| From codesite-noreply at google.com Thu Jul 9 10:21:32 2009 From: codesite-noreply at google.com (codesite-noreply at google.com) Date: Thu, 09 Jul 2009 14:21:32 +0000 Subject: [activeldap-commit] [ruby-activeldap commit] r1033 - * suppress needless attributes updating. Message-ID: <000e0cd20cd6890a44046e469222@google.com> Author: koutou Date: Thu Jul 9 07:20:34 2009 New Revision: 1033 Modified: trunk/lib/active_ldap/attributes.rb Log: * suppress needless attributes updating. Modified: trunk/lib/active_ldap/attributes.rb ============================================================================== --- trunk/lib/active_ldap/attributes.rb (original) +++ trunk/lib/active_ldap/attributes.rb Thu Jul 9 07:20:34 2009 @@ -40,8 +40,11 @@ when Hash result = {} value.each do |k, v| - result[k] = remove_blank_value(v) || [] + v = remove_blank_value(v) + next if v.nil? + result[k] = v end + result = nil if result.blank? result when Array result = [] @@ -50,6 +53,7 @@ next if v.nil? result << v end + result = nil if result.blank? result when String if /\A\s*\z/ =~ value From codesite-noreply at google.com Thu Jul 9 10:46:39 2009 From: codesite-noreply at google.com (codesite-noreply at google.com) Date: Thu, 09 Jul 2009 14:46:39 +0000 Subject: [activeldap-commit] [ruby-activeldap commit] r1034 - * remove needless conditions. Message-ID: <001636417c835f4ef8046e46ec0d@google.com> Author: koutou Date: Thu Jul 9 07:45:49 2009 New Revision: 1034 Modified: trunk/lib/active_ldap/base.rb Log: * remove needless conditions. Modified: trunk/lib/active_ldap/base.rb ============================================================================== --- trunk/lib/active_ldap/base.rb (original) +++ trunk/lib/active_ldap/base.rb Thu Jul 9 07:45:49 2009 @@ -1406,17 +1406,9 @@ value = self.class.remove_blank_value(value) || [] next if v == value - # Create mod entries - if self.class.blank_value?(value) - # Since some types do not have equality matching rules, - # delete doesn't work - # Replacing with nothing is equivalent. - if !data.has_key?(k) and schema.attribute(k).binary_required? - value = [{'binary' => []}] - end - else - # Ditched delete then replace because attribs with no equality - # match rules will fails + if self.class.blank_value?(value) and + schema.attribute(k).binary_required? + value = [{'binary' => []}] end attributes.push([:replace, k, value]) end From codesite-noreply at google.com Fri Jul 10 09:52:33 2009 From: codesite-noreply at google.com (codesite-noreply at google.com) Date: Fri, 10 Jul 2009 13:52:33 +0000 Subject: [activeldap-commit] [ruby-activeldap commit] r1035 - * add form helper method that supports LDAP option. Message-ID: <001636e8ffd2c3e477046e5a4830@google.com> Author: koutou Date: Fri Jul 10 06:51:42 2009 New Revision: 1035 Modified: trunk/examples/al-admin/app/views/_entry/_attributes_information.html.erb trunk/examples/al-admin/app/views/users/_attributes_update_form.html.erb trunk/lib/active_ldap/helper.rb Log: * add form helper method that supports LDAP option. Modified: trunk/examples/al-admin/app/views/_entry/_attributes_information.html.erb ============================================================================== --- trunk/examples/al-admin/app/views/_entry/_attributes_information.html.erb (original) +++ trunk/examples/al-admin/app/views/_entry/_attributes_information.html.erb Fri Jul 10 06:51:42 2009 @@ -13,7 +13,13 @@ <% (entry.attribute_names(true) - ["objectClass"]).sort.each do |name| -%> <%= link_to_attribute(name) %> - <%= h(entry[name, true].join(", ")) %> + + <%= + entry[name, true].collect do |value| + h(value.inspect) + end.join("
") + %> + <%= h(lad_(name)) %> <% end -%> Modified: trunk/examples/al-admin/app/views/users/_attributes_update_form.html.erb ============================================================================== --- trunk/examples/al-admin/app/views/users/_attributes_update_form.html.erb (original) +++ trunk/examples/al-admin/app/views/users/_attributes_update_form.html.erb Fri Jul 10 06:51:42 2009 @@ -23,7 +23,19 @@ * <% end -%> - <%= text_field("user", name) %> + + <%= + ldap_field(:text, :user, name, + :ldap_options => ["lang-en"]) do |field, info| + ldap_options = info[:options] + if ldap_options.empty? + "#{field}
" + else + "#{ldap_options.join(';')}: #{field}
" + end + end + -%> + <%= h lad_(name) %> <% end -%> Modified: trunk/lib/active_ldap/helper.rb ============================================================================== --- trunk/lib/active_ldap/helper.rb (original) +++ trunk/lib/active_ldap/helper.rb Fri Jul 10 06:51:42 2009 @@ -29,5 +29,62 @@ Base.human_syntax_description(syntax) end alias_method(:lsd_, :ldap_syntax_description_gettext) + + def ldap_field(type, object_name, method, options={}) + case type + when "radio_button", "check_box", "text_area" + form_method = type + else + form_method = "#{type}_field" + end + + object = options[:object] + if object.nil? + normalized_object_name = object_name.to_s.sub(/\[\](\])?$/, "\\1") + object = instance_variable_get("@#{normalized_object_name}") + end + values = object.nil? ? nil : object[method, true] + values = [nil] if values.blank? + required_ldap_options = options.delete(:ldap_options) || [] + required_ldap_options.each do |required_ldap_option| + found = false + values.each do |value| + next unless value.is_a?(Hash) + if Hash.to_a[0].to_s == required_ldap_option.to_s + found = true + break + end + end + values << {required_ldap_option => ""} unless found + end + + fields = [] + collect_values = Proc.new do |value, ldap_options| + case value + when Hash + value.each do |k, v| + collect_values.call(v, ldap_options + [k]) + end + when Array + value.each do |v| + collect_values.call(v, ldap_options) + end + else + name = "#{object_name}[#{method}][]" + ldap_options.collect.each do |ldap_option| + name << "[#{ldap_option}][]" + end + ldap_value_options = {:name => name, :value => value} + field = send(form_method, object_name, method, + ldap_value_options.merge(options)) + if block_given? + field = yield(field, {:options => ldap_options, :value => value}) + end + fields << field unless field.blank? + end + end + collect_values.call(values, []) + fields.join("\n") + end end end From codesite-noreply at google.com Fri Jul 10 10:04:37 2009 From: codesite-noreply at google.com (codesite-noreply at google.com) Date: Fri, 10 Jul 2009 14:04:37 +0000 Subject: [activeldap-commit] [ruby-activeldap commit] r1036 - * avoid duplicated ID. Message-ID: <001636417c83e380cc046e5a73bf@google.com> Author: koutou Date: Fri Jul 10 07:04:07 2009 New Revision: 1036 Modified: trunk/lib/active_ldap/helper.rb Log: * avoid duplicated ID. Modified: trunk/lib/active_ldap/helper.rb ============================================================================== --- trunk/lib/active_ldap/helper.rb (original) +++ trunk/lib/active_ldap/helper.rb Fri Jul 10 07:04:07 2009 @@ -70,11 +70,13 @@ collect_values.call(v, ldap_options) end else + id = "#{object_name}_#{method}" name = "#{object_name}[#{method}][]" ldap_options.collect.each do |ldap_option| + id << "_#{ldap_option}" name << "[#{ldap_option}][]" end - ldap_value_options = {:name => name, :value => value} + ldap_value_options = {:id => id, :name => name, :value => value} field = send(form_method, object_name, method, ldap_value_options.merge(options)) if block_given? From codesite-noreply at google.com Fri Jul 10 19:54:40 2009 From: codesite-noreply at google.com (codesite-noreply at google.com) Date: Fri, 10 Jul 2009 23:54:40 +0000 Subject: [activeldap-commit] [ruby-activeldap commit] r1037 - * 1.0.9 -> 1.1.0. Message-ID: <000e0cd329ca0f1912046e62b280@google.com> Author: koutou Date: Fri Jul 10 16:54:28 2009 New Revision: 1037 Modified: trunk/lib/active_ldap.rb Log: * 1.0.9 -> 1.1.0. Modified: trunk/lib/active_ldap.rb ============================================================================== --- trunk/lib/active_ldap.rb (original) +++ trunk/lib/active_ldap.rb Fri Jul 10 16:54:28 2009 @@ -1,8 +1,8 @@ #!/usr/bin/ruby # = ActiveLdap # -# "ActiveLdap" Copyright (C) 2004,2005 Will Drewry mailto:will at alum.bu.edu -# Copyright (C) 2006-2009 Kouhei Sutou +# Copyright (C) 2004,2005 Will Drewry mailto:will at alum.bu.edu +# Copyright (C) 2006-2009 Kouhei Sutou # # == Introduction # @@ -892,7 +892,7 @@ end module ActiveLdap - VERSION = "1.0.9" + VERSION = "1.1.0" end if RUBY_PLATFORM.match('linux') From codesite-noreply at google.com Fri Jul 10 19:58:40 2009 From: codesite-noreply at google.com (codesite-noreply at google.com) Date: Fri, 10 Jul 2009 23:58:40 +0000 Subject: [activeldap-commit] [ruby-activeldap commit] r1038 - * remove needless gem option. Message-ID: <001636e8ffd26bba85046e62c0bb@google.com> Author: koutou Date: Fri Jul 10 16:56:01 2009 New Revision: 1038 Modified: trunk/Rakefile Log: * remove needless gem option. Modified: trunk/Rakefile ============================================================================== --- trunk/Rakefile (original) +++ trunk/Rakefile Fri Jul 10 16:56:01 2009 @@ -71,10 +71,6 @@ ] self.remote_rdoc_dir = "doc" self.rsync_args += " --chmod=Dg+ws,Fg+w" - self.spec_extras = { - :autorequire => 'active_ldap', - :executables => [], - } self.description = String.new(<<-EOF) 'Ruby/ActiveLdap' is a ruby extension library which provides a clean objected oriented interface to the Ruby/LDAP library. It was inspired From codesite-noreply at google.com Fri Jul 10 20:02:44 2009 From: codesite-noreply at google.com (codesite-noreply at google.com) Date: Sat, 11 Jul 2009 00:02:44 +0000 Subject: [activeldap-commit] [ruby-activeldap commit] r1039 - * Ruby/LDAP isn't required package. Message-ID: <001636417c83ea216d046e62ce34@google.com> Author: koutou Date: Fri Jul 10 17:02:28 2009 New Revision: 1039 Modified: trunk/Rakefile Log: * Ruby/LDAP isn't required package. Modified: trunk/Rakefile ============================================================================== --- trunk/Rakefile (original) +++ trunk/Rakefile Fri Jul 10 17:02:28 2009 @@ -63,11 +63,11 @@ self.test_globs = ['test/test_*.rb'] self.changes = self.paragraphs_of('CHANGES', 0..1).join("\n\n") self.extra_deps = [ - 'ruby-ldap = 0.9.9', - 'activerecord = 2.3.2', - 'locale = 2.0.4', - 'gettext = 2.0.4', - 'gettext_activerecord = 2.0.4', + # ['ruby-ldap', '= 0.9.9'], + ['activerecord', '= 2.3.2'], + ['locale', '= 2.0.4'], + ['gettext', '= 2.0.4'], + ['gettext_activerecord', '= 2.0.4'], ] self.remote_rdoc_dir = "doc" self.rsync_args += " --chmod=Dg+ws,Fg+w" From codesite-noreply at google.com Sat Jul 11 22:48:18 2009 From: codesite-noreply at google.com (codesite-noreply at google.com) Date: Sun, 12 Jul 2009 02:48:18 +0000 Subject: [activeldap-commit] [ruby-activeldap commit] r1040 - * format with RDoc. Message-ID: <000e0cd2963ce61b03046e793cff@google.com> Author: koutou Date: Sat Jul 11 19:47:35 2009 New Revision: 1040 Modified: trunk/CHANGES trunk/README trunk/Rakefile Log: * format with RDoc. Modified: trunk/CHANGES ============================================================================== --- trunk/CHANGES (original) +++ trunk/CHANGES Sat Jul 11 19:47:35 2009 @@ -1,567 +1,632 @@ -1.0.9: - * Added documents in Japanese. [Kazuaki Takase] - * Supported Ruby 1.9.1. - * [#20] [Ruby 1.9 Support] :: Running Tests [Alexey.Chebotar] - * Supported Rails 2.3.2. - * [#18] [Rails 2.3 Support] :: Running WEBrick Hangs [Alexey.Chebotar] - * Bug fixes: - * Fixed blank values detection. [David Morton] - * [#22] Ruby 1.8.6 p287 :: Undefined methods [Alexey.Chebotar] - * Fixed gem loading. [Tiago Fernandes] - * Fixed DN change via #base=. [David Morton] - * Fixed infinite retry on timeout. - * Fixed needless reconnection. - * API improvements: - * Removed needless instance methods: #prefix=, - #dn_attribute=, #sort_by=, #order=, #required_classes=, - #recommended_classes= and #excluded_classes. [David Morton] - * Removed obsolete scafoold_al generator. - * Reduced default :retry_limit. - * Supported association as parameter. [Joe Francis] - * Normalized schema attribute name. [Tim Hermans] - * Suppressed AuthenticationError -> ConnectionError - conversion on reconnection. [Kazuaki Takase] - * Added ActiveLdap::Schema#dump. - * ActiveLdap::Base.establish_connection -> - ActiveLdap::Base.setup_connection. - * Supported ActiveLdap::Base.find(:last). - * Added convenient methods: - * ActiveLdap::Base.first - * ActiveLdap::Base.last - * ActiveLdap::Base.all - -1.0.2: - * Removed Base64 module use. - * Improved LDIF parser. - * Improved scheme parser. - * Supported Base64 in XML serialization. - * Supported TLS options. - * Supported ActiveRecord 2.2.2. - * Supported Ruby on Rails 2.2.2. - * Used rails/init.rb and rails_generators/ directory structure convention - for Rails and gem. rails/ directory will be removed after 1.0.2 is released. - * AL-Admin migrated to Ruby on Rails 2.2.2 form 2.0.2. - * Improved ActiveDirectory integration. - * Accepted :class_name for belong_to and has_many option. - * Improved default port guess. - * Bug fixes: - * [#4] ModifyRecord#load doesn't operate atomic. [gwarf12] - * [#5] to_xml supports :except option. [baptiste.grenier] - * [#6] to_xml uses ActiveResource format. [baptiste.grenier] - * Out of ranged GeneralizedTime uses Time.at(0) as fallback value. - [Richard Nicholas] - * ActiveLdap::Base#to_s uses #to_ldif. [Kazuhiro NISHIYAMA] - * Fixed excess prefix extraction. [Grzegorz Marsza?ek] - * Skiped read only attribute validation. [???????] - * Treated "" as empty value. [Ted Lepich] - * [#9][#16] Reduced raising when DN value is invalid. - [danger1986][Alexey.Chebotar] - * [#10][#12] Fixed needless ',' is appeared. [michael.j.konopka] - * [#11] Required missing 'active_ldap/user_password'. [michael.j.konopka] - * [#13] Returned entries if has_many :wrap has nonexistent entry. - [ingersoll] - * [#15] Fixed type error on computing DN. [ery.lee] - * ">=" filter operator doesn't work. [id:dicdak] - * [#17] ActiveLdap::Base.create doesn't raise exception. [Alexey.Chebotar] - -1.0.1: - * Fixed GetText integration. - * Fixed ActiveLdap::Base.find with ActiveLdap::DN. (Reported by Jeremy Pruitt) - * Fixed associated bugs. (Reported by CultureSpy) - * Supported ActiveLdap::Base#attribute_present? with nonexistence attribute. - (Reported by Matt Mencel) - * Added ActiveLdap::Base#.to_ldif_record. - * Improved inspect. - * Supported ActiveSupport 2.1.0. - -1.0.0: - * Fixed GSSAPI auth failure. [#18764] (Reported by Lennon Day-Reynolds) - * Supported Symbol as :dn_attribute_value. [#18921] (Requested by Nobody) - * Improved DN attribute detection. (Reported by Iain Pople) - * Avoided unnecesally modify operation. (Reported by Tilo) - -0.10.0: - * Implemented LDIF parser. - * Improved validation: - * Added some validations. - * Fixed SINGLE-VALUE validation. [#17763] - (Reported by Naoto Morishima) - * Supported JNDI as backend. - * Improved auto reconnection. - * Supported Rails 2.0.2. - * Improved performance. (4x) - * [API CHANGE]: removed "'binary' =>" from getter result. - e.g., before: - user.user_certificate # => {"binary" => "..."} - now: - user.user_certificate # => "..." - * Added :excluded_classed ldap_mapping option. - * Logged operation time used for LDAP operation. - * Improved API: - * Accepted non String value for find(:value => XXX). - (Suggested by Marc Dequ?n) - * Accepted DN as ActiveLdap::Base.new(XXX). - (Reported by Jeremy Pruitt) - * Treated empty password for smiple bind as anonymous bind. - (Suggested by Bodaniel Jeans) - * Ensured adding "objectClass" for find's :attribute value. [#16946] - (Suggested by Nobody) - * Fixed a GeneralizedTime type casting bug. - (Reported by Bodaniel Jeanes) - * Supported :base and :prefix search/find option value escaping. - (Suggested by David Morton) - -0.9.0: - * Improved DN handling. - * Supported attribute value validation by LDAP schema. - * Changed RubyGems name: ruby-activeldap -> activeldap. - * Removed Log4r dependency. - * Supported lazy connection establishing. - * [API CHANGE]: establish_connection doesn't connect LDAP server. - * [API CHANGE]: Removed ActiveLdap::Base#establish_connection. - * Added ActiveLdap::Base#bind. (use this instead of #establish_connection) - * Supported implicit acts_as_tree. - * [API CHANGE]: Supported type casting. - * Supported :uri option in configuration. - * Improved Rails integration: - * Followed Rails 2.0 changes. - * AL-Admin: - * Supported lang parameter in URL. - * Improved design a bit. (Please someone help us!) - * Supported schema inspection. - * Supported objectClass modifiation. - * Rails plugin: - * Added ActiveLdap::VERSION check. - * Added model_active_ldap generator. - * Renamed scaffold_al generator to scaffold_active_ldap. - -0.8.3: - * Added AL-Admin Sample Rails app - * Added Ruby-GetText-Package support - * Added a Rails plugin - * Improved schema handling - * Improved performance - * Many bug fixes - -0.8.2: - * Added Net::LDAP support! - * supported SASL Digest-MD5 authentication with Net::LDAP. - * improved LDAP server support: - * improved Sun DS support. - * improved ActiveDirectory support. Thanks to Ernie Miller! - * improved Fedora-DS support. Thanks to Daniel Pfile! - * improved existing functions: - * improved DN handling. Thanks to James Hughes! - * improved SASL bind. - * improved old API check. - * improved schema handling. Thanks to Christoph Lipp! - * improved filter notification. - * updated documents: - * updated Rails realted documenation. Thanks to James Hughes! - * updated documentation for the changes between 0.7.1 and 0.8.0. - Thanks to Buzz Chopra! - * added new features: - * added scaffold_al generator for Rails. - * added required_classes to default filter value. Thanks to Jeff Hall! - * added :recommended_classes option to ldap_mapping. - * added :sort_by and :order options to find. - * added ActiveLdap::Base#to_param for ActionController. - * fixed some bugs: - * fixed rake install/uninstall. - * fixed typos. Thanks to Nobody! - * fixed required_classes initialization. Thanks to James Hughes! - -0.8.1: - * used Dependencies.load_paths. - * check whether attribute name is available or not. - * added test for find(:first, :attribute => 'xxx', :value => 'yyy'). - * supported ActiveSupport 1.4.0. - * make the dual licensing of ruby-activeldap clear in the README. - * followed edge Rails: don't use Reloadable::Subclasses if doesn't need. - * added examples/. - * removed debug code. - * normalized attribute name to support wrong attribute names in MUST/MAY. - * supported getting dn value by Base#[]. - * test/test_userls.rb: followed userls changes. - * update the doc href. - * provide a dumb example of how to use the old association(return_objects) style API with the new awesome API. - * followed new API. - * removed a finished task: support Reloadable::Subclasses. - -0.8.0: - * Makefile/gemspec system replaced with Rakefile + Hoe - * Bugfix: Allow base to be empty - * Add support for Date, DateTime, and Time objects (patch from Patrick Cole) - * Add support for a :filter argument to override the default attr=val LDAP search filter in find_all() and find() (patch from Patrick Cole) - * Add Base#update_attributes(hash) method which does bulk updates to attributes (patch from Patrick Cole) and saves immediately - * API CHANGE: #attributes now returns a Hash of attribute_name => clone(attribute_val) - * API CHANGE: #attribute_names now returns an alphabetically sorted list of attribute names - * API CHANGE; - * Added attributes=() as the implementation for update_attributes(hash) (without autosave) - * API TRANSITION: Base#write is now deprecated. Please use Base#save - * API TRANSITION: Added SaveError exception (which is a subclass of WriteError for now) - * API TRANSITION: Base.connect() is now deprecated. Please use Base.establish_connection() - * API TRANSITION: Base.close() is now deprecated. Please use Base.remove_connection() - * API TRANSITION: :bind_format and :user of Base.establish_connection() are now deprecated. Please use :bind_dn - * Added update_attribute(name, value) to update one attribute and save immediately - * #delete -> #destroy - * Base.destroy_all - * Base.delete(id) & Base.delete_all(filter) - * add Base.exists?(dnattr_val) - * attr_protected - * Base.update(dnattr_val, attributes_hash) - instantiate, update, save, return - * Base.update_all(updates_hash, filter) - * attribute_present?(attribute) - if not empty/nil - * has_attribute?(attr_name) - if in hash - * reload() (refetch from LDAP) - * make save() return false on fail - * make save!() raise EntryNotSaved exception - * to_xml() - * clear_active_connections!() -- Conn per class - - make @@active_connections and name them by - * base_class() (just return the ancestor) - * Separate ObjectClass changes to live in ActiveLDAP::ObjectClass - - add_objectclass - - remove_objectclass - - replace_objectclass - - disallow direct objectclass access? - # - e.g. Person.reset_column_information - # - this would mean cleaner loading I think - * support ActiveRecord::Validations. - * support ActiveRecord::Callbacks. - * rename to ActiveLdap from ActiveLDAP to integrate RoR easily and enforce - many API changes. - -0.7.4: - * Bugfix: do not base LDAP::PrettyError on RuntimeError due to rescue evaluation. - * Bugfix: :return_objects was overriding :objects in find and find_all - * Rollup exception code into smaller space reusing similar code. - -0.7.3: - * Made has_many and belongs_to use :return_objects value - * Force generation of LDAP constants on import - currently broken - -0.7.2: - * Stopped overriding Conn.schema in ldap/schema - now use schema2 - * Fix attributes being deleted when changing between objectclasses with shared attributes - * Added schema attribute case insensitivity - * Added case insensitivity to the attribute methods. - * Added LDAP scope override support to ldap_mapping via :scope argument. (ldap_mapping :scope => LDAP::LDAP_SCOPE_SUBTREE, ...) - * Fixed the bug where Klass.find() return nil (default arg for find/find_all now '*') - * Added :return_objects to Base.connect()/configuration.rb -- When true, sets the default behavior in Base.find/find_all to return objects instead of just the dnattr string. - * Hid away several exposed private class methods (do_bind, etc) - * Undefined dnattr for a class now raises a ConfigurationError - * Centralized all connection management code where possible - * Added Base.can_reconnect? which returns true if never connected or below the :retries limit - * Added block support to Base.connection to ensure "safe" connection usage. This is not just for internal library use. If you need to do something fancy with the connection object, use Base.connection do | conn| ... - * Fixed object instantiation in Base#initialize when using full DNs - * Added :parent_class option to ldap_mapping which allows for object.parent() to return an instantiated object using the parent DN. (ldap_mapping :parent_class => String, ...) - * Fixed reconnect bug in Base#initialize (didn't respect infinite retries) - * Added(*) :timeout argument to allow timeouts on hanging LDAP connections - * Added(*) :retry_on_timeout boolean option to allow disabling retries on timeouts - * Added TimeoutError - * Added(*) a forking timeout using SIGALRM to interrupt handling. - * (*) Only works when RUBY_PLATFORM has "linux" in it - -0.7.1: - * Fix broken -W0 arg in activeldap.rb - * attribute_method=: '' and nil converted to ldap-pleasing [] values - * Added checks in write and search for connection down (to reconnect) - * Fixed broken idea of LDAP::err2string exceptions. Instead took errcodes from ldap.c in Ruby/LDAP. - -0.7.0: - * ConnectionError thrown from #initialize when there is no connection and retry limit was exceeded - * ConnectionError thrown when retries exceeded when no connection was created - * Separated connection types: SSL, TLS, and plain using :method - * Localized reconnect logic into Base.reconnect(force=false) - * Fixed password_block evaluation bug in do_bind() which broke SIMPLE re-binds and broke reconnect - * Add support for config[:sasl_quiet] in Base.connect - * (Delayed a case sensitivity patch for object classes and attributes due to weird errors) - * Add :retry_wait to Base.connect to determine the timeout before retrying a connection - * Fixed ActiveLDAP::Base.create_object() - classes were enclosed in quotes - * Added :ldap_scope Base.connect() argument to allow risk-seeking users to change the LDAP scope to something other than ONELEVEL. - * Cleaned up Configuration.rb to supply all default values for ActiveLDAP::Base.connect() and to use a constant instead of overriding class variables for no good reason. - * Added scrubbing for :base argument into Base.connect() to make sure a ' doesn't get evaluated. - * Refactored Base.connect(). It is now much cleaner and easier to follow. - * Moved schema retrieval to after bind in case a server requires privileges to access it. - * Reworked the bind process to be a little prettier. A lot of work to do here still. - * Added LDAP::err2exception(errno) which is the groundwork of a coming overhaul in user friendly error handling. - * Added support for Base::connect(.., :password => String, ...) to avoid stupid Proc.new {'foo'} crap - * Add :store_password option. When this is set, :password is not cleared and :password_block is not re-evaluated on each rebind. - -0.6.0: - * Disallow blank DN attribute values on initialization - * Fix bug reported by Maik Schmidt regarding object creation - * Added error checking to disallow DN attribute value changes - * Added AttributeAssignmentError (for above) - * Import() and initialize() no longer call attribute_method=() - * Added error condition if connection fails inside initialize() - * Changes examples and tests to use "dc=localdomain" - * has_many() entries no longer return nil when empty - -0.5.9: - * Change default base to dc=localdomain (as per Debian default). - * schema2.rb:attr() now returns [] instead of '' when empty. - * Lookup of new objects does not put dnattr()=value into the Base on lookup. - * Scope is now use ONELEVEL instead of SUBTREE as it broke object boundaries. - * Fixed @max_retries misuse. - * Added do_connect retries. - * Fixed find and find_all for the case - find_all('*'). - * Fixed broken creation of objects from anonymous classes. - * Fixed broken use of ldap_mapping with anonymous classes. - -0.5.8: Bugfix galore - * Allow nil "prefix" - * Fixed the dup bug with Anonymous patch. - * (maybe) Fixed stale connection problems by attempting reconn/bind. - * Hiding redefine warnings (for now) - -0.5.7: - * Fixed the @data.default = [] bug that daniel at nightrunner.com pointed out - (and partially patched). - -0.5.6: - * Added support for foreign_key => 'dn' in has_many. - -0.5.5: - * Remove @@logger.debug entries during build - * Building -debug and regular gems and tarballs - -0.5.4: - * Added Base#import to streamline the Base.find and Base.find_all methods - - Speeds up find and find_all by not accessing LDAP multiple times - for data we already have. - * Added tests/benchmark which is a slightly modified version of excellent - benchmarking code contributed by - Ollivier Robert . - -0.5.3: - * Changed attribute_method to send in associations - - fixes belongs_to (with local_kay) and inheritance around that - -0.5.2: - * Make sure values are .dup'd when they come from LDAP - -0.5.1: - * Changed Schema2#class_attributes to return {:must => [], :may => []} - * Fixed Base#must and Base#may to return with full SUPerclass requirements - -0.5.0: - * API CHANGE (as with all 0.x.0 changes) (towards ActiveRecord duck typing) - - Base#ldapattribute now always returns an array - - Base#ldapattribute(true) now returns a dup of an array, string, etc - when appropriate (old default) - This is just for convenience - - Base#ldapattribute returns the stored value, not just a .dup - - Associations methods return objects by default instead of just names. - Group.new('foo').members(false) will return names only. - - Base.connect returns true as one might expect - * Value validation and changing (binary, etc) occur prior to write, and - not immediately on attribute_method=(value). - * Attribute method validity is now determined /on-the-fly/. - * Default log level set to OFF speeds up 'speedtest' by 3 seconds! - (counters last point which added some slowness :) - * Added Schema2#class_attributes which caches and fully supertype expands - attribute lists. - * Integrated Schema2#class_attributes with apply_objectclass which automagically - does SUP traversal and automagically updates available methods on calls to - #attributes, #method_missing, #validate, and #write - * Added 'attributes' to 'methods' allowing for irb autocompletion and other - normal rubyisms - * Moved almost all validation to Base#validate to avoid unexpected exceptions - being raised in seemingly unrelated method calls. This means that invalid - objectClasses may be specified. This will only be caught on #write or - a pre-emptive #validate. This goes for all attribute errors though. - This also makes it possible to "break" objects by removing the 'top' - objectclass and therefore the #objectClass method... - -0.4.4: - * Fixed binary subtype forcing: - - was setting data as subtype ;binary even when not required - * Added first set of unit tests. - - These will be cleaned up in later releases as more tests are added. - * Fixed subtype clobber non-subtype (unittest!) - - cn and cn;lang-blah: the last loaded won - * Fixed multivalued subtypes from being shoved into a string (unittest!) - - an error with attribute_input_value - -0.4.3: - * Fixed write (add) bugs introduced with last change - - only bug fixes until unittests are in place - -0.4.2: - * Added ruby-activeldap.gemspec - * Integrated building a gem of 'ruby-activeldap' into Makefile.package - * Added attr parsing cache to speed up repetitive calls: approx 13x speedup - = 100 usermod-binary-add calls - - Without attr parsing cache: - real 13m53.129s - user 13m11.350s - sys 0m7.030s - - With attr parsing cache: - real 1m0.416s - user 0m28.390s - sys 0m2.380s - -0.4.1: - * Schema2 was not correctly parsing objectClass entries. - - This is fixed for now but must be revisited. - -0.4.0: - * Added #(arrays) argument which when true - always returns arrays. e.g. - irb> user.cn(true) - => ['My Common Name'] - This makes things easier for larger programming tasks. - * Added subtype support: - - Uses Hash objects to specify the subtype - e.g. user.userCertificate = {'binary' => File.read('mycert.der')} - - Added recursive type enforcement along with the subtype handling - - This required overhauling the #write method. - - Please report any problems ASAP! :^) - * Added automagic binary support - - subtype wrapping done automatically - - relies on X-NOT-HUMAN-READABLE flag - * Added LDAP::Schema2 which is an extension of Ruby/LDAP::Schema - - made Schema#attr generic for easy type dereferencing - * Updated rdoc in activeldap.rb - * Updated examples (poorly) to reflect new functionality - * Added several private helper functions - -0.3.6: - * Fixed dn attribute value extraction on find and find_all - - these may have grabbed the wrong value if a DN attr has - multiple values. - * Fixed Base.search to return all values as arrays and update - multivalued ones correctly - * Lowered the amount of default logging to FATAL only - -0.3.5: - * Moved to rubyforge.org! - -0.3.4: - * Changed license to Ruby's - -0.3.3: - * Changed Base.search to return an array instead of a hash of hashes - * Change Base.search to take in a hash as its arguments - -0.3.2: - * Bug fix - fixed support for module'd extension classes (again!) - -0.3.1: - * Updated the documentation - * Fixed ignoring of attrs argument in Base.search - * Fixed mistake in groupls (using dnattr directly) - * Fixed a mistake with overzealous dup'ing - -0.3.0: - * MORE API CHANGES (configuration.rb, etc) - * Major overhaul to the internals! - - removed @@BLAH[@klass] in lieu of defining - class methods which contain the required values. This - allows for clean inheritance of Base subclasses! Whew! - - Added @@config to store the options currently in use - after a Base.connect - - Now cache passwords for doing reconnects - - dnattr now accessible to the outside as a class method only - * Added Base.search to wrap normal LDAP search for convenience. - - This returns a hash of hashes with the results indexed first by - full dn, then by attribute. - -0.2.0: - * API CHANGES: - - Extension classes must be defined using map_to_ldap instead of setting - random values in initialize - - Base#find is now Base.find_all and is a class method - - Base.find returns the first match a la Array#find - - force_reload is gone in belongs_to and has_many created methods - - hiding Base.new, Base.find, and Base.find_all from direct access - * added uniq to setting objectClass to avoid stupid errors - * fixed new object creation bug where attributes were added before the - objectclass resulting in a violation (Base#write) - * fixed attribute dereferencing in Base#write - * fixed bug with .dup on Fixnums - * methods created by has_many/belongs_to and find and find_all now take an - optional argument dnattr_only which will return the value of dnattr for - each result instead of a full object. - * Base.connection=(conn) added for multiplexing connections - * Added a manual to activeldap.rb which covers most usage of Ruby/ActiveLDAP - * Base.connect(:try_sasl => true) should now work with GSSAPI if you are - using OpenLDAP >= 2.1.29 - -0.1.8: - * .dup all returned attribute values to avoid weirdness - * .dup all assigned values to avoid weirdness - * Changed default configuration.rb to use example.com - -0.1.7: - * Added support for non-unique DN attributes - * Added authoritative DN retrieval with 'object.dn' - -0.1.6: - * Added Base.close method for clearing the existing connection (despite Ruby/LDAP's lack of .close) - -0.1.5: - * Fixed incorrect usage of @klass in .find (should .find be a class method?) - -0.1.4: - * Change WARN to INFO in associations.rb for has_many - -0.1.3: - * Fixed class name mangling - * Added support for classes to take DNs as the initialization value - -0.1.2: - * Patch from Dick Davies: Try SSL before TLS - * Log4r support - * Better packaging (automated) - * Work-around for SSL stupidity - - SSLConn doesn't check if the port it connected to is really using SSL! - -0.1.1: - * Dynamic table class creation - * SASL/GSSAPI disabled by default - doesn't work consistently - -0.1.0: - * Added foreign_key to has_many - * Added local_key to belongs_to - * Added primary_members to Group example - * Added "nil" filtering to has_many - * Packaged up with setup.rb - * Added RDocs and better comments - -0.0.9: - * Separated extension classes from ActiveLDAP module - * Cleaned up examples with new requires - -0.0.8: - * Added user and group scripting examples - - usermod, userls, useradd, userdel - - groupmod, groupls - -0.0.7: - * Cleaner authentication loop: - - SASL (GSSAPI only), simple, anonymous - * Added allow_anonymous option added (default: false) - -0.0.6: - * Write support cleaned up - * Exception classes added - -0.0.5: - * LDAP write support added - -0.0.4: - * MUST and MAY data validation against schema using objectClasses - -0.0.3: - * LDAP attributes alias resolution and data mapping += CHANGES -0.0.2: - * Associations: has_many and belongs_to Class methods added for Base +== 1.1.0: 2009-07-18 -0.0.1: - * Extension approach in place with example User and Group classes +* ... -0.0.0: - * Basic LDAP read support in place with hard-coded OUs +== 1.0.9 + +* Added documents in Japanese. [Kazuaki Takase] +* Supported Ruby 1.9.1. + * [#20] [Ruby 1.9 Support] :: Running Tests [Alexey.Chebotar] +* Supported Rails 2.3.2. + * [#18] [Rails 2.3 Support] :: Running WEBrick Hangs [Alexey.Chebotar] +* Bug fixes: + * Fixed blank values detection. [David Morton] + * [#22] Ruby 1.8.6 p287 :: Undefined methods [Alexey.Chebotar] + * Fixed gem loading. [Tiago Fernandes] + * Fixed DN change via #base=. [David Morton] + * Fixed infinite retry on timeout. + * Fixed needless reconnection. +* API improvements: + * Removed needless instance methods: #prefix=, + #dn_attribute=, #sort_by=, #order=, #required_classes=, + #recommended_classes= and #excluded_classes. [David Morton] + * Removed obsolete scafoold_al generator. + * Reduced default :retry_limit. + * Supported association as parameter. [Joe Francis] + * Normalized schema attribute name. [Tim Hermans] + * Suppressed AuthenticationError -> ConnectionError + conversion on reconnection. [Kazuaki Takase] + * Added ActiveLdap::Schema#dump. + * ActiveLdap::Base.establish_connection -> + ActiveLdap::Base.setup_connection. + * Supported ActiveLdap::Base.find(:last). + * Added convenient methods: + * ActiveLdap::Base.first + * ActiveLdap::Base.last + * ActiveLdap::Base.all + +== 1.0.2 + +* Removed Base64 module use. +* Improved LDIF parser. +* Improved scheme parser. +* Supported Base64 in XML serialization. +* Supported TLS options. +* Supported ActiveRecord 2.2.2. +* Supported Ruby on Rails 2.2.2. +* Used rails/init.rb and rails_generators/ directory structure convention + for Rails and gem. rails/ directory will be removed after 1.0.2 is released. +* AL-Admin migrated to Ruby on Rails 2.2.2 form 2.0.2. +* Improved ActiveDirectory integration. +* Accepted :class_name for belong_to and has_many option. +* Improved default port guess. +* Bug fixes: + * [#4] ModifyRecord#load doesn't operate atomic. [gwarf12] + * [#5] to_xml supports :except option. [baptiste.grenier] + * [#6] to_xml uses ActiveResource format. [baptiste.grenier] + * Out of ranged GeneralizedTime uses Time.at(0) as fallback value. + [Richard Nicholas] + * ActiveLdap::Base#to_s uses #to_ldif. [Kazuhiro NISHIYAMA] + * Fixed excess prefix extraction. [Grzegorz Marsza?ek] + * Skiped read only attribute validation. [???????] + * Treated "" as empty value. [Ted Lepich] + * [#9][#16] Reduced raising when DN value is invalid. + [danger1986][Alexey.Chebotar] + * [#10][#12] Fixed needless ',' is appeared. [michael.j.konopka] + * [#11] Required missing 'active_ldap/user_password'. [michael.j.konopka] + * [#13] Returned entries if has_many :wrap has nonexistent entry. + [ingersoll] + * [#15] Fixed type error on computing DN. [ery.lee] + * ">=" filter operator doesn't work. [id:dicdak] + * [#17] ActiveLdap::Base.create doesn't raise exception. [Alexey.Chebotar] + +== 1.0.1 + +* Fixed GetText integration. +* Fixed ActiveLdap::Base.find with ActiveLdap::DN. (Reported by Jeremy Pruitt) +* Fixed associated bugs. (Reported by CultureSpy) +* Supported ActiveLdap::Base#attribute_present? with nonexistence attribute. + (Reported by Matt Mencel) +* Added ActiveLdap::Base#.to_ldif_record. +* Improved inspect. +* Supported ActiveSupport 2.1.0. + +== 1.0.0 + +* Fixed GSSAPI auth failure. [#18764] (Reported by Lennon Day-Reynolds) +* Supported Symbol as :dn_attribute_value. [#18921] (Requested by Nobody) +* Improved DN attribute detection. (Reported by Iain Pople) +* Avoided unnecesally modify operation. (Reported by Tilo) + +== 0.10.0 + +* Implemented LDIF parser. +* Improved validation: + * Added some validations. + * Fixed SINGLE-VALUE validation. [#17763] + (Reported by Naoto Morishima) +* Supported JNDI as backend. +* Improved auto reconnection. +* Supported Rails 2.0.2. +* Improved performance. (4x) +* [API CHANGE]: removed "'binary' =>" from getter result. + + e.g.: + before: + user.user_certificate # => {"binary" => "..."} + now: + user.user_certificate # => "..." +* Added :excluded_classed ldap_mapping option. +* Logged operation time used for LDAP operation. +* Improved API: + * Accepted non String value for find(:value => XXX). + (Suggested by Marc Dequ?n) + * Accepted DN as ActiveLdap::Base.new(XXX). + (Reported by Jeremy Pruitt) + * Treated empty password for smiple bind as anonymous bind. + (Suggested by Bodaniel Jeans) + * Ensured adding "objectClass" for find's :attribute value. [#16946] + (Suggested by Nobody) + * Fixed a GeneralizedTime type casting bug. + (Reported by Bodaniel Jeanes) + * Supported :base and :prefix search/find option value escaping. + (Suggested by David Morton) + +== 0.9.0 + +* Improved DN handling. +* Supported attribute value validation by LDAP schema. +* Changed RubyGems name: ruby-activeldap -> activeldap. +* Removed Log4r dependency. +* Supported lazy connection establishing. + * [API CHANGE]: establish_connection doesn't connect LDAP server. +* [API CHANGE]: Removed ActiveLdap::Base#establish_connection. +* Added ActiveLdap::Base#bind. (use this instead of #establish_connection) +* Supported implicit acts_as_tree. +* [API CHANGE]: Supported type casting. +* Supported :uri option in configuration. +* Improved Rails integration: + * Followed Rails 2.0 changes. + * AL-Admin: + * Supported lang parameter in URL. + * Improved design a bit. (Please someone help us!) + * Supported schema inspection. + * Supported objectClass modifiation. + * Rails plugin: + * Added ActiveLdap::VERSION check. + * Added model_active_ldap generator. + * Renamed scaffold_al generator to scaffold_active_ldap. + +== 0.8.3 + +* Added AL-Admin Sample Rails app +* Added Ruby-GetText-Package support +* Added a Rails plugin +* Improved schema handling +* Improved performance +* Many bug fixes + +== 0.8.2 + +* Added Net::LDAP support! + * supported SASL Digest-MD5 authentication with Net::LDAP. +* improved LDAP server support: + * improved Sun DS support. + * improved ActiveDirectory support. Thanks to Ernie Miller! + * improved Fedora-DS support. Thanks to Daniel Pfile! +* improved existing functions: + * improved DN handling. Thanks to James Hughes! + * improved SASL bind. + * improved old API check. + * improved schema handling. Thanks to Christoph Lipp! + * improved filter notification. +* updated documents: + * updated Rails realted documenation. Thanks to James Hughes! + * updated documentation for the changes between 0.7.1 and 0.8.0. + Thanks to Buzz Chopra! +* added new features: + * added scaffold_al generator for Rails. + * added required_classes to default filter value. Thanks to Jeff Hall! + * added :recommended_classes option to ldap_mapping. + * added :sort_by and :order options to find. + * added ActiveLdap::Base#to_param for ActionController. +* fixed some bugs: + * fixed rake install/uninstall. + * fixed typos. Thanks to Nobody! + * fixed required_classes initialization. Thanks to James Hughes! + +== 0.8.1 + +* used Dependencies.load_paths. +* check whether attribute name is available or not. +* added test for find(:first, :attribute => 'xxx', :value => 'yyy'). +* supported ActiveSupport 1.4.0. +* make the dual licensing of ruby-activeldap clear in the README. +* followed edge Rails: don't use Reloadable::Subclasses if doesn't need. +* added examples/. +* removed debug code. +* normalized attribute name to support wrong attribute names in MUST/MAY. +* supported getting dn value by Base#[]. +* test/test_userls.rb: followed userls changes. +* update the doc href. +* provide a dumb example of how to use the old association(return_objects) style API with the new awesome API. +* followed new API. +* removed a finished task: support Reloadable::Subclasses. + +== 0.8.0 + +* Makefile/gemspec system replaced with Rakefile + Hoe +* Bugfix: Allow base to be empty +* Add support for Date, DateTime, and Time objects (patch from Patrick Cole) +* Add support for a :filter argument to override the default attr=val LDAP search filter in find_all() and find() (patch from Patrick Cole) +* Add Base#update_attributes(hash) method which does bulk updates to attributes (patch from Patrick Cole) and saves immediately +* API CHANGE: #attributes now returns a Hash of attribute_name => clone(attribute_val) +* API CHANGE: #attribute_names now returns an alphabetically sorted list of attribute names +* API CHANGE; +* Added attributes=() as the implementation for update_attributes(hash) (without autosave) +* API TRANSITION: Base#write is now deprecated. Please use Base#save +* API TRANSITION: Added SaveError exception (which is a subclass of WriteError for now) +* API TRANSITION: Base.connect() is now deprecated. Please use Base.establish_connection() +* API TRANSITION: Base.close() is now deprecated. Please use Base.remove_connection() +* API TRANSITION: :bind_format and :user of Base.establish_connection() are now deprecated. Please use :bind_dn +* Added update_attribute(name, value) to update one attribute and save immediately +* #delete -> #destroy +* Base.destroy_all +* Base.delete(id) & Base.delete_all(filter) +* add Base.exists?(dnattr_val) +* attr_protected +* Base.update(dnattr_val, attributes_hash) - instantiate, update, save, return +* Base.update_all(updates_hash, filter) +* attribute_present?(attribute) - if not empty/nil +* has_attribute?(attr_name) - if in hash +* reload() (refetch from LDAP) +* make save() return false on fail +* make save!() raise EntryNotSaved exception +* to_xml() +* clear_active_connections!() -- Conn per class + - make @@active_connections and name them by +* base_class() (just return the ancestor) +* Separate ObjectClass changes to live in ActiveLDAP::ObjectClass + - add_objectclass + - remove_objectclass + - replace_objectclass + - disallow direct objectclass access? +* support ActiveRecord::Validations. +* support ActiveRecord::Callbacks. +* rename to ActiveLdap from ActiveLDAP to integrate RoR easily and enforce + many API changes. + +== 0.7.4 + +* Bugfix: do not base LDAP::PrettyError on RuntimeError due to rescue evaluation. +* Bugfix: :return_objects was overriding :objects in find and find_all +* Rollup exception code into smaller space reusing similar code. + +== 0.7.3 + +* Made has_many and belongs_to use :return_objects value +* Force generation of LDAP constants on import - currently broken + +== 0.7.2 + +* Stopped overriding Conn.schema in ldap/schema - now use schema2 +* Fix attributes being deleted when changing between objectclasses with shared attributes +* Added schema attribute case insensitivity +* Added case insensitivity to the attribute methods. +* Added LDAP scope override support to ldap_mapping via :scope argument. (ldap_mapping :scope => LDAP::LDAP_SCOPE_SUBTREE, ...) +* Fixed the bug where Klass.find() return nil (default arg for find/find_all now '*') +* Added :return_objects to Base.connect()/configuration.rb -- When true, sets the default behavior in Base.find/find_all to return objects instead of just the dnattr string. +* Hid away several exposed private class methods (do_bind, etc) +* Undefined dnattr for a class now raises a ConfigurationError +* Centralized all connection management code where possible +* Added Base.can_reconnect? which returns true if never connected or below the :retries limit +* Added block support to Base.connection to ensure "safe" connection usage. This is not just for internal library use. If you need to do something fancy with the connection object, use Base.connection do | conn| ... +* Fixed object instantiation in Base#initialize when using full DNs +* Added :parent_class option to ldap_mapping which allows for object.parent() to return an instantiated object using the parent DN. (ldap_mapping :parent_class => String, ...) +* Fixed reconnect bug in Base#initialize (didn't respect infinite retries) +* Added(*) :timeout argument to allow timeouts on hanging LDAP connections +* Added(*) :retry_on_timeout boolean option to allow disabling retries on timeouts +* Added TimeoutError +* Added(*) a forking timeout using SIGALRM to interrupt handling. +* (*) Only works when RUBY_PLATFORM has "linux" in it + +== 0.7.1 + +* Fix broken -W0 arg in activeldap.rb +* attribute_method=: '' and nil converted to ldap-pleasing [] values +* Added checks in write and search for connection down (to reconnect) +* Fixed broken idea of LDAP::err2string exceptions. Instead took errcodes from ldap.c in Ruby/LDAP. + +== 0.7.0 + +* ConnectionError thrown from #initialize when there is no connection and retry limit was exceeded +* ConnectionError thrown when retries exceeded when no connection was created +* Separated connection types: SSL, TLS, and plain using :method +* Localized reconnect logic into Base.reconnect(force=false) +* Fixed password_block evaluation bug in do_bind() which broke SIMPLE re-binds and broke reconnect +* Add support for config[:sasl_quiet] in Base.connect +* (Delayed a case sensitivity patch for object classes and attributes due to weird errors) +* Add :retry_wait to Base.connect to determine the timeout before retrying a connection +* Fixed ActiveLDAP::Base.create_object() - classes were enclosed in quotes +* Added :ldap_scope Base.connect() argument to allow risk-seeking users to change the LDAP scope to something other than ONELEVEL. +* Cleaned up Configuration.rb to supply all default values for ActiveLDAP::Base.connect() and to use a constant instead of overriding class variables for no good reason. +* Added scrubbing for :base argument into Base.connect() to make sure a ' doesn't get evaluated. +* Refactored Base.connect(). It is now much cleaner and easier to follow. +* Moved schema retrieval to after bind in case a server requires privileges to access it. +* Reworked the bind process to be a little prettier. A lot of work to do here still. +* Added LDAP::err2exception(errno) which is the groundwork of a coming overhaul in user friendly error handling. +* Added support for Base::connect(.., :password => String, ...) to avoid stupid Proc.new {'foo'} crap +* Add :store_password option. When this is set, :password is not cleared and :password_block is not re-evaluated on each rebind. + +== 0.6.0 + +* Disallow blank DN attribute values on initialization +* Fix bug reported by Maik Schmidt regarding object creation +* Added error checking to disallow DN attribute value changes +* Added AttributeAssignmentError (for above) +* Import() and initialize() no longer call attribute_method=() +* Added error condition if connection fails inside initialize() +* Changes examples and tests to use "dc=localdomain" +* has_many() entries no longer return nil when empty + +== 0.5.9 + +* Change default base to dc=localdomain (as per Debian default). +* schema2.rb:attr() now returns [] instead of '' when empty. +* Lookup of new objects does not put dnattr()=value into the Base on lookup. +* Scope is now use ONELEVEL instead of SUBTREE as it broke object boundaries. +* Fixed @max_retries misuse. +* Added do_connect retries. +* Fixed find and find_all for the case - find_all('*'). +* Fixed broken creation of objects from anonymous classes. +* Fixed broken use of ldap_mapping with anonymous classes. + +== 0.5.8: Bugfix galore + +* Allow nil "prefix" +* Fixed the dup bug with Anonymous patch. +* (maybe) Fixed stale connection problems by attempting reconn/bind. +* Hiding redefine warnings (for now) + +== 0.5.7 + +* Fixed the @data.default = [] bug that daniel at nightrunner.com pointed out + (and partially patched). + +== 0.5.6 + +* Added support for foreign_key => 'dn' in has_many. + +== 0.5.5 + +* Remove @@logger.debug entries during build +* Building -debug and regular gems and tarballs + +== 0.5.4 + +* Added Base#import to streamline the Base.find and Base.find_all methods + - Speeds up find and find_all by not accessing LDAP multiple times + for data we already have. +* Added tests/benchmark which is a slightly modified version of excellent + benchmarking code contributed by + Ollivier Robert . + +== 0.5.3 + +* Changed attribute_method to send in associations + - fixes belongs_to (with local_kay) and inheritance around that + +== 0.5.2 + +* Make sure values are .dup'd when they come from LDAP + +== 0.5.1 + +* Changed Schema2#class_attributes to return {:must => [], :may => []} +* Fixed Base#must and Base#may to return with full SUPerclass requirements + +== 0.5.0 + +* API CHANGE (as with all 0.x.0 changes) (towards ActiveRecord duck typing) + - Base#ldapattribute now always returns an array + - Base#ldapattribute(true) now returns a dup of an array, string, etc + when appropriate (old default) - This is just for convenience + - Base#ldapattribute returns the stored value, not just a .dup + - Associations methods return objects by default instead of just names. + Group.new('foo').members(false) will return names only. + - Base.connect returns true as one might expect +* Value validation and changing (binary, etc) occur prior to write, and + not immediately on attribute_method=(value). +* Attribute method validity is now determined /on-the-fly/. +* Default log level set to OFF speeds up 'speedtest' by 3 seconds! + (counters last point which added some slowness :) +* Added Schema2#class_attributes which caches and fully supertype expands + attribute lists. +* Integrated Schema2#class_attributes with apply_objectclass which automagically + does SUP traversal and automagically updates available methods on calls to + #attributes, #method_missing, #validate, and #write +* Added 'attributes' to 'methods' allowing for irb autocompletion and other + normal rubyisms +* Moved almost all validation to Base#validate to avoid unexpected exceptions + being raised in seemingly unrelated method calls. This means that invalid + objectClasses may be specified. This will only be caught on #write or + a pre-emptive #validate. This goes for all attribute errors though. + This also makes it possible to "break" objects by removing the 'top' + objectclass and therefore the #objectClass method... + +== 0.4.4 + +* Fixed binary subtype forcing: + - was setting data as subtype ;binary even when not required +* Added first set of unit tests. + - These will be cleaned up in later releases as more tests are added. +* Fixed subtype clobber non-subtype (unittest!) + - cn and cn;lang-blah: the last loaded won +* Fixed multivalued subtypes from being shoved into a string (unittest!) + - an error with attribute_input_value + +== 0.4.3 + +* Fixed write (add) bugs introduced with last change + - only bug fixes until unittests are in place + +== 0.4.2 + +* Added ruby-activeldap.gemspec +* Integrated building a gem of 'ruby-activeldap' into Makefile.package +* Added attr parsing cache to speed up repetitive calls: approx 13x speedup + - 100 usermod-binary-add calls + + Without attr parsing cache: + real 13m53.129s + user 13m11.350s + sys 0m7.030s + With attr parsing cache: + real 1m0.416s + user 0m28.390s + sys 0m2.380s + +== 0.4.1: + +* Schema2 was not correctly parsing objectClass entries. + - This is fixed for now but must be revisited. + +== 0.4.0 + +* Added #(arrays) argument which when true + always returns arrays. e.g. + irb> user.cn(true) + => ['My Common Name'] + This makes things easier for larger programming tasks. +* Added subtype support: + - Uses Hash objects to specify the subtype + e.g. user.userCertificate = {'binary' => File.read('mycert.der')} + - Added recursive type enforcement along with the subtype handling + - This required overhauling the #write method. + - Please report any problems ASAP! :^) +* Added automagic binary support + - subtype wrapping done automatically + - relies on X-NOT-HUMAN-READABLE flag +* Added LDAP::Schema2 which is an extension of Ruby/LDAP::Schema + - made Schema#attr generic for easy type dereferencing +* Updated rdoc in activeldap.rb +* Updated examples (poorly) to reflect new functionality +* Added several private helper functions + +== 0.3.6 + +* Fixed dn attribute value extraction on find and find_all + - these may have grabbed the wrong value if a DN attr has + multiple values. +* Fixed Base.search to return all values as arrays and update + multivalued ones correctly +* Lowered the amount of default logging to FATAL only + +== 0.3.5 + +* Moved to rubyforge.org! + +== 0.3.4 + +* Changed license to Ruby's + +== 0.3.3 + +* Changed Base.search to return an array instead of a hash of hashes +* Change Base.search to take in a hash as its arguments + +== 0.3.2 + +* Bug fix - fixed support for module'd extension classes (again!) + +== 0.3.1 + +* Updated the documentation +* Fixed ignoring of attrs argument in Base.search +* Fixed mistake in groupls (using dnattr directly) +* Fixed a mistake with overzealous dup'ing + +== 0.3.0 + +* MORE API CHANGES (configuration.rb, etc) +* Major overhaul to the internals! + - removed @@BLAH[@klass] in lieu of defining + class methods which contain the required values. This + allows for clean inheritance of Base subclasses! Whew! + - Added @@config to store the options currently in use + after a Base.connect + - Now cache passwords for doing reconnects + - dnattr now accessible to the outside as a class method only +* Added Base.search to wrap normal LDAP search for convenience. + - This returns a hash of hashes with the results indexed first by + full dn, then by attribute. + +== 0.2.0 + +* API CHANGES: + - Extension classes must be defined using map_to_ldap instead of setting + random values in initialize + - Base#find is now Base.find_all and is a class method + - Base.find returns the first match a la Array#find + - force_reload is gone in belongs_to and has_many created methods + - hiding Base.new, Base.find, and Base.find_all from direct access +* added uniq to setting objectClass to avoid stupid errors +* fixed new object creation bug where attributes were added before the + objectclass resulting in a violation (Base#write) +* fixed attribute dereferencing in Base#write +* fixed bug with .dup on Fixnums +* methods created by has_many/belongs_to and find and find_all now take an + optional argument dnattr_only which will return the value of dnattr for + each result instead of a full object. +* Base.connection=(conn) added for multiplexing connections +* Added a manual to activeldap.rb which covers most usage of Ruby/ActiveLDAP +* Base.connect(:try_sasl => true) should now work with GSSAPI if you are + using OpenLDAP >= 2.1.29 + +== 0.1.8 + +* .dup all returned attribute values to avoid weirdness +* .dup all assigned values to avoid weirdness +* Changed default configuration.rb to use example.com + +== 0.1.7 + +* Added support for non-unique DN attributes +* Added authoritative DN retrieval with 'object.dn' + +== 0.1.6 + +* Added Base.close method for clearing the existing connection (despite Ruby/LDAP's lack of .close) + +== 0.1.5 + +* Fixed incorrect usage of @klass in .find (should .find be a class method?) + +== 0.1.4 + +* Change WARN to INFO in associations.rb for has_many + +== 0.1.3 + +* Fixed class name mangling +* Added support for classes to take DNs as the initialization value + +== 0.1.2 + +* Patch from Dick Davies: Try SSL before TLS +* Log4r support +* Better packaging (automated) +* Work-around for SSL stupidity + - SSLConn doesn't check if the port it connected to is really using SSL! + +== 0.1.1 + +* Dynamic table class creation +* SASL/GSSAPI disabled by default - doesn't work consistently + +== 0.1.0 + +* Added foreign_key to has_many +* Added local_key to belongs_to +* Added primary_members to Group example +* Added "nil" filtering to has_many +* Packaged up with setup.rb +* Added RDocs and better comments + +== 0.0.9 + +* Separated extension classes from ActiveLDAP module +* Cleaned up examples with new requires + +== 0.0.8 + +* Added user and group scripting examples + - usermod, userls, useradd, userdel + - groupmod, groupls + +== 0.0.7 + +* Cleaner authentication loop: + - SASL (GSSAPI only), simple, anonymous +* Added allow_anonymous option added (default: false) + +== 0.0.6 + +* Write support cleaned up +* Exception classes added + +== 0.0.5 + +* LDAP write support added + +== 0.0.4 + +* MUST and MAY data validation against schema using objectClasses + +== 0.0.3 + +* LDAP attributes alias resolution and data mapping + +== 0.0.2 + +* Associations: has_many and belongs_to Class methods added for Base + +== 0.0.1 + +* Extension approach in place with example User and Group classes + +== 0.0.0 + +* Basic LDAP read support in place with hard-coded OUs Modified: trunk/README ============================================================================== --- trunk/README (original) +++ trunk/README Sat Jul 11 19:47:35 2009 @@ -1,12 +1,18 @@ -Ruby/ActiveLdap -- ruby library for object-oriented LDAP interction -Copyright (C) 2004-2006 Will Drewry , Kouhei Sutou -Contributors: - * Dick Davies - * Nathan Kinder - * Patrick Cole - * Google Inc. += Ruby/ActiveLdap + +ruby library for object-oriented LDAP interction + +* Copyright (C) 2004-2006 Will Drewry +* Copyright (C) 2006-2009 Kouhei Sutou + +Contributors:: + * Dick Davies + * Nathan Kinder + * Patrick Cole + * Google Inc. + +== DESCRIPTION -DESCRIPTION 'Ruby/ActiveLdap' is a ruby extension library which provides a clean objected oriented interface to the Ruby/LDAP[0] library. It was inspired by ActivRecord[3]. This is not nearly as clean or as flexible as ActiveRecord, but @@ -18,49 +24,56 @@ http://ruby-activeldap.rubyforge.org/ -PREREQUISITES +== PREREQUISITES - * Ruby 1.8.x [2] - * Ruby/LDAP [0] or Net::LDAP [1] - * ActiveRecord [3] - * An LDAP server compatible with Ruby/LDAP: OpenLDAP, etc +[Ruby intepreter] + One of them: + * Ruby[http://www.ruby-lang.org] (1.8.x or 1.9.1) + * JRuby[http://jruby.codehaus.org/] +[LDAP client] + JRuby doesn't need to install new library because JRuby + has builtin LDAP support. Ruby users need one of them: + * Ruby/LDAP[http://rubyforge.org/projects/ruby-ldap/] + * Net::LDAP[http://rubyforge.org/projects/net-ldap/] -NOTES +* ActiveRecord[http://activerecord.rubyonrails.org] - * Only GSSAPI SASL support exists due to Ruby/LDAP limitations +== NOTES +* Only GSSAPI SASL support exists due to Ruby/LDAP limitations -INSTALL +== INSTALL - - Edit active_ldap/configuration.rb with your LDAP preferences - - Run - - sudo rake install + % sudo gem install activeldap -RAILS +== RAILS -There is a small rails plugin included that allows the use of a file named -'ldap.yml' in the config directory of your rails app. This file has a similar -function to the 'database.yml' file that allows you to set your database -connection settings per environment. Similarly, the ldap.yml file allows -settings to be set for development, test, and production environments. For -instance, the development entry would look something like the following: +There is a small rails plugin included that allows the use +of a file named 'config/ldap.yml' in the config directory of +your rails app. This file has a similar function to the +'database.yml' file that allows you to set your database +connection settings per environment. Similarly, the ldap.yml +file allows settings to be set for development, test, and +production environments. For instance, the development entry +would look something like the following: - development: - host: 127.0.0.1 - port: 389 - base: dc=localhost - bind_dn: cn=admin,dc=localhost - password: secret + development: + host: 127.0.0.1 + port: 389 + base: dc=localhost + bind_dn: cn=admin,dc=localhost + password: secret +To install, simply add the following codes to you config/environment.rb: -To install, simply copy the rails/plugin/active_ldap folder into the -vendor/plugins directory of your rails application and create config/ldap.yml. -When your application starts up, the plugin will call #establish_connection -using the parameters specified for your current environment. + config.gem "activeldap", :lib => "active_ldap" +When your application starts up, the plugin will call +ActiveLdap::Base.setup_connection using the parameters +specified for your current environment. -LICENCE +== LICENCE This program is free software; you can redistribute it and/or modify it. It is dual licensed under Ruby's license and under the terms of the GNU General @@ -69,16 +82,7 @@ Please see the file LICENSE for the terms of the licence. - -REFERENCES - -[0] - http://ruby-ldap.sourceforge.net -[1] - http://rubyforge.org/projects/net-ldap/ -[2] - http://www.ruby-lang.org -[3] - http://activerecord.rubyonrails.org - - -THANKS +== THANKS This list may not be correct. If you notice mistakes of this list, please point out. Modified: trunk/Rakefile ============================================================================== --- trunk/Rakefile (original) +++ trunk/Rakefile Sat Jul 11 19:47:35 2009 @@ -61,7 +61,7 @@ self.summary = 'Ruby/ActiveLdap is a object-oriented API to LDAP' self.url = 'http://rubyforge.org/projects/ruby-activeldap/' self.test_globs = ['test/test_*.rb'] - self.changes = self.paragraphs_of('CHANGES', 0..1).join("\n\n") + self.changes = self.paragraphs_of('CHANGES', 1..2).join("\n\n") self.extra_deps = [ # ['ruby-ldap', '= 0.9.9'], ['activerecord', '= 2.3.2'], From codesite-noreply at google.com Sat Jul 11 22:52:19 2009 From: codesite-noreply at google.com (codesite-noreply at google.com) Date: Sun, 12 Jul 2009 02:52:19 +0000 Subject: [activeldap-commit] [ruby-activeldap commit] r1041 - * set filename. Message-ID: <00163646ccde3bfab7046e794b01@google.com> Author: koutou Date: Sat Jul 11 19:49:47 2009 New Revision: 1041 Modified: trunk/test/al-test-utils.rb Log: * set filename. Modified: trunk/test/al-test-utils.rb ============================================================================== --- trunk/test/al-test-utils.rb (original) +++ trunk/test/al-test-utils.rb Sat Jul 11 19:49:47 2009 @@ -58,7 +58,9 @@ unless File.exist?(@config_file) raise "config file for testing doesn't exist: #{@config_file}" end - config = YAML.load(ERB.new(File.read(@config_file)).result) + erb = ERB.new(File.read(@config_file)) + erb.filename = @config_file + config = YAML.load(erb.result) _adapter = adapter config.each do |key, value| value[:adapter] = _adapter if _adapter From codesite-noreply at google.com Sat Jul 11 23:06:21 2009 From: codesite-noreply at google.com (codesite-noreply at google.com) Date: Sun, 12 Jul 2009 03:06:21 +0000 Subject: [activeldap-commit] [ruby-activeldap commit] r1042 - * set filename. Message-ID: <000e0cd211626e1369046e797d8c@google.com> Author: koutou Date: Sat Jul 11 20:05:52 2009 New Revision: 1042 Modified: trunk/lib/active_ldap/get_text/parser.rb Log: * set filename. Modified: trunk/lib/active_ldap/get_text/parser.rb ============================================================================== --- trunk/lib/active_ldap/get_text/parser.rb (original) +++ trunk/lib/active_ldap/get_text/parser.rb Sat Jul 11 20:05:52 2009 @@ -72,7 +72,9 @@ if File.exists?(configuration) require 'erb' require 'yaml' - configuration = YAML.load(ERB.new(File.read(configuration)).result) + erb = ERB.new(File.read(configuration)) + erb.filename = configuration + configuration = YAML.load(erb.result) else ENV["RAILS_ENV"] = configuration require 'config/environment' From codesite-noreply at google.com Sat Jul 11 23:10:23 2009 From: codesite-noreply at google.com (codesite-noreply at google.com) Date: Sun, 12 Jul 2009 03:10:23 +0000 Subject: [activeldap-commit] [ruby-activeldap commit] r1043 - * add a 1.1.0 entry. Message-ID: <001636417937e49eb2046e798bd1@google.com> Author: koutou Date: Sat Jul 11 20:07:25 2009 New Revision: 1043 Modified: trunk/CHANGES Log: * add a 1.1.0 entry. Modified: trunk/CHANGES ============================================================================== --- trunk/CHANGES (original) +++ trunk/CHANGES Sat Jul 11 20:07:25 2009 @@ -2,7 +2,23 @@ == 1.1.0: 2009-07-18 -* ... +* Improved tutorial. [Kazuaki Takase] +* Improvements: + * API: + * [#26] Supported to_xml for associations. [achemze] + * ActiveLdap::Base.delete_all(filter=nil, options={}) -> + ActiveLdap::Base.delete_all(filter_or_options={}). + Sure, old method signature is also still supported. + * belongs_to(:many) with :foreign_key is deprecated. + Use :primary_key instead of :foreign_key. [Kazuaki Takase] + * Means of has_many's :primary_key and :foreign_key are inverted. + [Kazuaki Takase] + * [experimental] Added ldap_field ActionView helper to + generate form fileds for a LDAP entry. + * Suppressed needless attributes updating. +* Dependencies: + * Re-supported GetText. + * ActiveRecord 2.3.2 is only supported. == 1.0.9 From codesite-noreply at google.com Tue Jul 14 11:11:00 2009 From: codesite-noreply at google.com (codesite-noreply at google.com) Date: Tue, 14 Jul 2009 15:11:00 +0000 Subject: [activeldap-commit] [ruby-activeldap commit] r1044 - fix a typo Message-ID: <0016364574acae9ef8046eabd8cc@google.com> Author: tashen.hatena Date: Tue Jul 14 08:09:56 2009 New Revision: 1044 Modified: trunk/lib/active_ldap.rb Log: fix a typo Modified: trunk/lib/active_ldap.rb ============================================================================== --- trunk/lib/active_ldap.rb (original) +++ trunk/lib/active_ldap.rb Tue Jul 14 08:09:56 2009 @@ -162,7 +162,7 @@ # # class Group < ActiveLdap::Base # ldap_mapping :dn_attribute => 'cn', -# :prefix => 'ou=Groups', :classes => ['top', 'posixGroup'] +# :prefix => 'ou=Groups', :classes => ['top', 'posixGroup'], # :scope => :one # end # From codesite-noreply at google.com Tue Jul 14 11:55:41 2009 From: codesite-noreply at google.com (codesite-noreply at google.com) Date: Tue, 14 Jul 2009 15:55:41 +0000 Subject: [activeldap-commit] [ruby-activeldap commit] r1045 - fix wrong description Message-ID: <000e0cd329ca772e73046eac7806@google.com> Author: tashen.hatena Date: Tue Jul 14 08:55:19 2009 New Revision: 1045 Modified: trunk/lib/active_ldap.rb Log: fix wrong description Modified: trunk/lib/active_ldap.rb ============================================================================== --- trunk/lib/active_ldap.rb (original) +++ trunk/lib/active_ldap.rb Tue Jul 14 08:55:19 2009 @@ -172,7 +172,7 @@ # * dc=dataspill,dc=org # |- ou=People,dc=dataspill,dc=org # |+ ou=Groups,dc=dataspill,dc=org -# \ +# \ # |- cn=develop,ou=Groups,dc=dataspill,dc=org # |- cn=root,ou=Groups,dc=dataspill,dc=org # |- ... @@ -243,7 +243,7 @@ # group 'develop'. In order to remedy that, we can use belongs_to # # irb> class User < ActiveLdap::Base -# irb* ldap_mapping :dn_attribute => 'uid', :prefix => 'People', :classes => ['top','account'] +# irb* ldap_mapping :dn_attribute => 'uid', :prefix => 'ou=People', :classes => ['top','account'] # irb* belongs_to :groups, :class_name => 'Group', :many => 'memberUid', :foreign_key => 'uid' # irb* end # @@ -252,7 +252,7 @@ # # irb> me = User.find('drewry') # irb> me.groups -# => [#, #, ...] +# => # # Enumerable object # irb> me.groups.each { |group| p group.cn };nil # "cdrom" # "audio" @@ -282,7 +282,7 @@ # mind, the above definition could become: # # irb> class User < ActiveLdap::Base -# irb* ldap_mapping :dn_attribute => 'uid', :prefix => 'People', :classes => ['top','account'] +# irb* ldap_mapping :dn_attribute => 'uid', :prefix => 'ou=People', :classes => ['top','account'] # irb* belongs_to :groups, :class_name => 'Group', :many => 'memberUid' # irb* end # From codesite-noreply at google.com Tue Jul 14 12:23:01 2009 From: codesite-noreply at google.com (codesite-noreply at google.com) Date: Tue, 14 Jul 2009 16:23:01 +0000 Subject: [activeldap-commit] [ruby-activeldap commit] r1046 - fix code on "has_many" Message-ID: <001636e911ae3af5ef046eacda5e@google.com> Author: tashen.hatena Date: Tue Jul 14 09:22:33 2009 New Revision: 1046 Modified: trunk/lib/active_ldap.rb Log: fix code on "has_many" Modified: trunk/lib/active_ldap.rb ============================================================================== --- trunk/lib/active_ldap.rb (original) +++ trunk/lib/active_ldap.rb Tue Jul 14 09:22:33 2009 @@ -311,8 +311,9 @@ # irb> develop = Group.find('develop') # => ... # irb> develop.members -# => [#, #] -# +# => # # Enumerable object +# irb> develop.members.map{|member| member.id} +# => ["drewry", "builder"] # # The arguments for has_many follow the exact same idea that belongs_to's # arguments followed. :wrap's contents are used to search for matching From codesite-noreply at google.com Tue Jul 14 12:27:05 2009 From: codesite-noreply at google.com (codesite-noreply at google.com) Date: Tue, 14 Jul 2009 16:27:05 +0000 Subject: [activeldap-commit] [ruby-activeldap commit] r1047 - fix indent level Message-ID: <000e0cd254eac017fb046eace881@google.com> Author: tashen.hatena Date: Tue Jul 14 09:26:24 2009 New Revision: 1047 Modified: trunk/lib/active_ldap.rb Log: fix indent level Modified: trunk/lib/active_ldap.rb ============================================================================== --- trunk/lib/active_ldap.rb (original) +++ trunk/lib/active_ldap.rb Tue Jul 14 09:26:24 2009 @@ -368,10 +368,10 @@ # :scope => :sub, :attributes => ['uid', 'cn']) # => [["uid=root,ou=People,dc=dataspill,dc=org",{"cn"=>["root"], "uidNumber"=>["0"]}] # You can specify the :filter, :base, :scope, and :attributes, but they all have defaults -- -# * :filter defaults to objectClass=* - usually this isn't what you want -# * :base defaults to the base of the class this is executed from (as set in ldap_mapping) -# * :scope defaults to :sub. Usually you won't need to change it (You can choose value also from between :one and :base) -# * :attributes defaults to [] and is the list of attributes you want back. Empty means all of them. +# * :filter defaults to objectClass=* - usually this isn't what you want +# * :base defaults to the base of the class this is executed from (as set in ldap_mapping) +# * :scope defaults to :sub. Usually you won't need to change it (You can choose value also from between :one and :base) +# * :attributes defaults to [] and is the list of attributes you want back. Empty means all of them. # # ==== #valid? # From codesite-noreply at google.com Tue Jul 14 12:58:35 2009 From: codesite-noreply at google.com (codesite-noreply at google.com) Date: Tue, 14 Jul 2009 16:58:35 +0000 Subject: [activeldap-commit] [ruby-activeldap commit] r1048 - delete code what is not required. And fix typos. Message-ID: <0016e64af60c649904046ead59d7@google.com> Author: tashen.hatena Date: Tue Jul 14 09:57:23 2009 New Revision: 1048 Modified: trunk/lib/active_ldap.rb Log: delete code what is not required. And fix typos. Modified: trunk/lib/active_ldap.rb ============================================================================== --- trunk/lib/active_ldap.rb (original) +++ trunk/lib/active_ldap.rb Tue Jul 14 09:57:23 2009 @@ -537,21 +537,19 @@ # ==== Setting up lib/ # # In ldapadmin/lib/ create the file user.rb: -# cat < 'uid', :prefix => 'ou=People', :classes => ['top', 'account', 'posixAccount'] # belongs_to :groups, :class_name => 'Group', :wrap => 'memberUid' # end -# EOF # # In ldapadmin/lib/ create the file group.rb: -# cat < ['top', 'posixGroup'], :prefix => 'ou=Group' +# ldap_mapping :classes => ['top', 'posixGroup'], :prefix => 'ou=Groups' # has_many :members, :class_name => "User", :many => "memberUid" # has_many :primary_members, :class_name => 'User', :foreign_key => 'gidNumber', :primary_key => 'gidNumber' -# end # Group -# EOF +# end # # Now, we can write some small scripts to do simple management tasks. # @@ -731,7 +729,7 @@ # ./myldap/group.rb: # module MyLDAP # class Group < ActiveLdap::Base -# ldap_mapping :classes => ['top', 'posixGroup'], :prefix => 'ou=Group' +# ldap_mapping :classes => ['top', 'posixGroup'], :prefix => 'ou=Groups' # has_many :members, :class_name => 'MyLDAP::User', :wrap => 'memberUid' # has_many :primary_members, :class_name => 'MyLDAP::User', :foreign_key => 'gidNumber', :primary_key => 'gidNumber' # end From codesite-noreply at google.com Tue Jul 14 13:59:04 2009 From: codesite-noreply at google.com (codesite-noreply at google.com) Date: Tue, 14 Jul 2009 17:59:04 +0000 Subject: [activeldap-commit] [ruby-activeldap commit] r1049 - add require "rubygems", and remove unnecessary comment. Message-ID: <001636456e38bde482046eae314a@google.com> Author: tashen.hatena Date: Tue Jul 14 10:57:24 2009 New Revision: 1049 Modified: wiki/TutorialJa.wiki Log: add require "rubygems", and remove unnecessary comment. Modified: wiki/TutorialJa.wiki ============================================================================== --- wiki/TutorialJa.wiki (original) +++ wiki/TutorialJa.wiki Tue Jul 14 10:57:24 2009 @@ -1203,161 +1203,61 @@ ??????????????????????????????????? - - Creating LDAP entries - - === LDAP ??????? === - - Now let's create a really dumb script for adding users - - ldapadmin/useradd: - ????????????? ldapadmin/useradd ?????????????? +{{{ +#!/usr/bin/ruby -W0 - - #!/usr/bin/ruby -W0 +base = File.expand_path(File.join(File.dirname(__FILE__), "..")) +$LOAD_PATH << File.join(base, "lib") +$LOAD_PATH << File.join(base, "examples") - require 'active_ldap' - require 'lib/user' - require 'lib/group' - require 'password' - - argv, opts, options = ActiveLdap::Command.parse_options do |opts, options| - opts.banner += " USER_NAME CN UID" - end - - if argv.size == 3 - name, cn, uid = argv - else - $stderr.puts opts - exit 1 - end - - pwb = Proc.new do |user| - ActiveLdap::Command.read_password("[#{user}] Password: ") - end - - ActiveLdap::Base.setup_connection(:password_block => pwb, - :allow_anonymous => false) - - if User.exists?(name) - $stderr.puts("User #{name} already exists.") - exit 1 - end - - user = User.new(name) - user.add_class('shadowAccount') - user.cn = cn - user.uid_number = uid - user.gid_number = uid - user.home_directory = "/home/#{name}" - user.sn = "somesn" - unless user.save - puts "failed" - puts user.errors.full_messages - exit 1 - end - -{{{ - #!/usr/bin/ruby -W0 +require 'rubygems' +require 'active_ldap' +require 'objects/user' +require 'objects/group' + +argv, opts, options = ActiveLdap::Command.parse_options do |opts, options| + opts.banner += " USER_NAME CN UID" +end + +if argv.size == 3 + name, cn, uid = argv +else + $stderr.puts opts + exit 1 +end + +pwb = Proc.new do |user| + ActiveLdap::Command.read_password("[#{user}] Password: ") +end + +ActiveLdap::Base.setup_connection(:password_block => pwb, + :allow_anonymous => false) - base = File.expand_path(File.join(File.dirname(__FILE__), "..")) - $LOAD_PATH << File.join(base, "lib") - $LOAD_PATH << File.join(base, "examples") - - require 'active_ldap' - require 'objects/user' - require 'objects/group' - - argv, opts, options = ActiveLdap::Command.parse_options do |opts, options| - opts.banner += " USER_NAME CN UID" - end - - if argv.size == 3 - name, cn, uid = argv - else - $stderr.puts opts - exit 1 - end - - pwb = Proc.new do |user| - ActiveLdap::Command.read_password("[#{user}] Password: ") - end - - ActiveLdap::Base.setup_connection(:password_block => pwb, - :allow_anonymous => false) - - if User.exists?(name) - $stderr.puts("User #{name} already exists.") - exit 1 - end - - user = User.new(name) - user.add_class('shadowAccount') - user.cn = cn - user.uid_number = uid - user.gid_number = uid - user.home_directory = "/home/#{name}" - user.sn = "somesn" - unless user.save - puts "failed" - puts user.errors.full_messages - exit 1 - end +if User.exists?(name) + $stderr.puts("User #{name} already exists.") + exit 1 +end + +user = User.new(name) +user.add_class('shadowAccount') +user.cn = cn +user.uid_number = uid +user.gid_number = uid +user.home_directory = "/home/#{name}" +user.sn = "somesn" +unless user.save + puts "failed" + puts user.errors.full_messages + exit 1 +end }}} - - Managing LDAP entries - === LDAP ??????? === - - Now let's create another dumb script for modifying users - - ldapadmin/usermod: - ???????????????? ldapadmin/usermod ??????? - - - #!/usr/bin/ruby -W0 - - require 'active_ldap' - require 'lib/user' - require 'lib/group' - - argv, opts, options = ActiveLdap::Command.parse_options do |opts, options| - opts.banner += " USER_NAME CN UID" - end - - if argv.size == 3 - name, cn, uid = argv - else - $stderr.puts opts - exit 1 - end - - pwb = Proc.new do |user| - ActiveLdap::Command.read_password("[#{user}] Password: ") - end - - ActiveLdap::Base.setup_connection(:password_block => pwb, - :allow_anonymous => false) - - unless User.exists?(name) - $stderr.puts("User #{name} doesn't exist.") - exit 1 - end - - user = User.find(name) - user.cn = cn - user.uid_number = uid - user.gid_number = uid - unless user.save - puts "failed" - puts user.errors.full_messages - exit 1 - end - {{{ #!/usr/bin/ruby -W0 @@ -1365,6 +1265,7 @@ $LOAD_PATH << File.join(base, "lib") $LOAD_PATH << File.join(base, "examples") +require 'rubygems' require 'active_ldap' require 'objects/user' require 'objects/group' @@ -1403,48 +1304,9 @@ end }}} - - Removing LDAP entries - === LDAP ??????? === - - - And finally, a dumb script for removing user - ldapadmin/userdel: - ?????????????????? ldapadmin/userdel ??????? - - #!/usr/bin/ruby -W0 - - require 'active_ldap' - require 'lib/user' - require 'lib/group' - - argv, opts, options = ActiveLdap::Command.parse_options do |opts, options| - opts.banner += " USER_NAME" - end - - if argv.size == 1 - name = argv.shift - else - $stderr.puts opts - exit 1 - end - - pwb = Proc.new do |user| - ActiveLdap::Command.read_password("[#{user}] Password: ") - end - - ActiveLdap::Base.setup_connection(:password_block => pwb, - :allow_anonymous => false) - - unless User.exists?(name) - $stderr.puts("User #{name} doesn't exist.") - exit 1 - end - - User.destroy(name) - {{{ #!/usr/bin/ruby -W0 @@ -1452,6 +1314,7 @@ $LOAD_PATH << File.join(base, "lib") $LOAD_PATH << File.join(base, "examples") +require 'rubygems' require 'active_ldap' require 'objects/user' require 'objects/group' From codesite-noreply at google.com Tue Jul 14 14:28:21 2009 From: codesite-noreply at google.com (codesite-noreply at google.com) Date: Tue, 14 Jul 2009 18:28:21 +0000 Subject: [activeldap-commit] [ruby-activeldap commit] r1050 - remove section "Customizations", fix code of models, and add script for deleting. Message-ID: <001636e909e979d68e046eae9abf@google.com> Author: tashen.hatena Date: Tue Jul 14 11:27:46 2009 New Revision: 1050 Modified: trunk/lib/active_ldap.rb Log: remove section "Customizations", fix code of models, and add script for deleting. Modified: trunk/lib/active_ldap.rb ============================================================================== --- trunk/lib/active_ldap.rb (original) +++ trunk/lib/active_ldap.rb Tue Jul 14 11:27:46 2009 @@ -73,32 +73,6 @@ # problem with the installation. You may need to customize what setup.rb does on # install. # -# === Customizations -# -# Now that ActiveLdap is installed and working, we still have a few more -# steps to make it useful for programming. -# -# Let's say that you are writing a Ruby program for managing user and group -# accounts in LDAP. I will use this as the running example throughout the -# document. -# -# You will want to make a directory called 'ldapadmin' wherever is convenient. Under this directory, -# you'll want to make sure you have a 'lib' directory. -# -# $ cd ~ -# $ mkdir ldapadmin -# $ cd ldapadmin -# $ mkdir lib -# $ cd lib -# -# The lib directory is where we'll be making customizations. You can, of course, -# make this changes somewhere in Ruby's default search path to make this -# accessible to every Ruby scripts. Enough of my babbling, I'm sure you'd like to -# know what we're going to put in lib/. -# -# We're going to put extension classes in there. What are extension classes you say . . . -# -# # == Usage # # This section covers using ActiveLdap from writing extension classes to @@ -534,22 +508,28 @@ # # All of the scripts here are in the package's examples/ directory. # -# ==== Setting up lib/ +# ==== Setting up # -# In ldapadmin/lib/ create the file user.rb: +# Create directory for scripts. # +# mkdir -p ldapadmin/objects +# +# In ldapadmin/objects/ create the file user.rb: +# +# require 'objects/group' +# # class User < ActiveLdap::Base -# ldap_mapping :dn_attribute => 'uid', :prefix => 'ou=People', :classes => ['top', 'account', 'posixAccount'] -# belongs_to :groups, :class_name => 'Group', :wrap => 'memberUid' +# ldap_mapping :dn_attribute => 'uid', :prefix => 'ou=People', :classes => ['person', 'posixAccount'] +# belongs_to :groups, :class_name => 'Group', :many => 'memberUid' # end # -# In ldapadmin/lib/ create the file group.rb: +# In ldapadmin/objects/ create the file group.rb: # # class Group < ActiveLdap::Base # ldap_mapping :classes => ['top', 'posixGroup'], :prefix => 'ou=Groups' -# has_many :members, :class_name => "User", :many => "memberUid" +# has_many :members, :class_name => "User", :wrap => "memberUid" # has_many :primary_members, :class_name => 'User', :foreign_key => 'gidNumber', :primary_key => 'gidNumber' -# end +# end # # Now, we can write some small scripts to do simple management tasks. # @@ -557,10 +537,13 @@ # # Now let's create a really dumb script for adding users - ldapadmin/useradd: # +# #!/usr/bin/ruby -W0 +# # base = File.expand_path(File.join(File.dirname(__FILE__), "..")) # $LOAD_PATH << File.join(base, "lib") # $LOAD_PATH << File.join(base, "examples") # +# require 'rubygems' # require 'active_ldap' # require 'objects/user' # require 'objects/group' @@ -611,6 +594,7 @@ # $LOAD_PATH << File.join(base, "lib") # $LOAD_PATH << File.join(base, "examples") # +# require 'rubygems' # require 'active_ldap' # require 'objects/user' # require 'objects/group' @@ -647,6 +631,45 @@ # puts user.errors.full_messages # exit 1 # end +# +# ==== Removing LDAP entries +# Now let's create more one for deleting users - ldapadmin/userdel: +# +# #!/usr/bin/ruby -W0 +# +# base = File.expand_path(File.join(File.dirname(__FILE__), "..")) +# $LOAD_PATH << File.join(base, "lib") +# $LOAD_PATH << File.join(base, "examples") +# +# require 'rubygems' +# require 'active_ldap' +# require 'objects/user' +# require 'objects/group' +# +# argv, opts, options = ActiveLdap::Command.parse_options do |opts, options| +# opts.banner += " USER_NAME" +# end +# +# if argv.size == 1 +# name = argv.shift +# else +# $stderr.puts opts +# exit 1 +# end +# +# pwb = Proc.new do |user| +# ActiveLdap::Command.read_password("[#{user}] Password: ") +# end +# +# ActiveLdap::Base.setup_connection(:password_block => pwb, +# :allow_anonymous => false) +# +# unless User.exists?(name) +# $stderr.puts("User #{name} doesn't exist.") +# exit 1 +# end +# +# User.destroy(name) # # === Advanced Topics # From codesite-noreply at google.com Thu Jul 16 02:03:08 2009 From: codesite-noreply at google.com (codesite-noreply at google.com) Date: Thu, 16 Jul 2009 06:03:08 +0000 Subject: [activeldap-commit] [ruby-activeldap commit] r1051 - * don't use environment dependency value. Message-ID: <000e0cd146d40bd043046ecc6dde@google.com> Author: koutou Date: Wed Jul 15 23:02:28 2009 New Revision: 1051 Modified: trunk/test/test_associations.rb Log: * don't use environment dependency value. Modified: trunk/test/test_associations.rb ============================================================================== --- trunk/test/test_associations.rb (original) +++ trunk/test/test_associations.rb Wed Jul 15 23:02:28 2009 @@ -25,26 +25,26 @@ - cn=temp-group1,ou=Groups,dc=temp,dc=test,dc=local,dc=net + #{group1.dn} - temp-group1 + #{group1.cn} - 100001 + #{group1.gid_number} - temp-user1 + #{user.cn} posixGroup - cn=temp-group2,ou=Groups,dc=temp,dc=test,dc=local,dc=net + #{group2.dn} - temp-group2 + #{group2.cn} - 100002 + #{group2.gid_number} - temp-user1 + #{user.cn} posixGroup From codesite-noreply at google.com Fri Jul 17 18:18:00 2009 From: codesite-noreply at google.com (codesite-noreply at google.com) Date: Fri, 17 Jul 2009 22:18:00 +0000 Subject: [activeldap-commit] [ruby-activeldap commit] r1052 - * set ENV["VERSION"]. Message-ID: <000e0cd14d443dc413046eee2910@google.com> Author: koutou Date: Fri Jul 17 15:16:55 2009 New Revision: 1052 Modified: trunk/Rakefile Log: * set ENV["VERSION"]. Modified: trunk/Rakefile ============================================================================== --- trunk/Rakefile (original) +++ trunk/Rakefile Fri Jul 17 15:16:55 2009 @@ -53,6 +53,7 @@ FileUtils.rm_f("History.txt") end +ENV["VERSION"] = ActiveLdap::VERSION project = Hoe.spec('activeldap') do self.version = ActiveLdap::VERSION self.rubyforge_name = 'ruby-activeldap' From codesite-noreply at google.com Fri Jul 17 19:06:23 2009 From: codesite-noreply at google.com (codesite-noreply at google.com) Date: Fri, 17 Jul 2009 23:06:23 +0000 Subject: [activeldap-commit] [ruby-activeldap commit] r1053 - New release tag Message-ID: <000e0cd30bd4480f58046eeed669@google.com> Author: koutou Date: Fri Jul 17 16:02:19 2009 New Revision: 1053 Added: tags/r1.1.0/ - copied from r1052, /trunk/ Log: New release tag From codesite-noreply at google.com Wed Jul 22 07:51:56 2009 From: codesite-noreply at google.com (codesite-noreply at google.com) Date: Wed, 22 Jul 2009 11:51:56 +0000 Subject: [activeldap-commit] [ruby-activeldap] r1054 commited - * [#26686] Supported Rails 2.3.3.... Message-ID: <001636456e387c62d8046f49ffb1@google.com> Revision: 1054 Author: koutou Date: Wed Jul 22 04:50:54 2009 Log: * [#26686] Supported Rails 2.3.3. Suggested by George Montana Harkin. Thanks!!! http://code.google.com/p/ruby-activeldap/source/detail?r=1054 Modified: /trunk/CHANGES /trunk/README /trunk/Rakefile /trunk/lib/active_ldap.rb ======================================= --- /trunk/CHANGES Sat Jul 11 20:07:25 2009 +++ /trunk/CHANGES Wed Jul 22 04:50:54 2009 @@ -1,5 +1,9 @@ = CHANGES +== 1.1.1: 20XX-XX-XX + +* [#26686] Supported Rails 2.3.3. [George Montana Harkin] + == 1.1.0: 2009-07-18 * Improved tutorial. [Kazuaki Takase] ======================================= --- /trunk/README Sat Jul 11 19:47:35 2009 +++ /trunk/README Wed Jul 22 04:50:54 2009 @@ -133,4 +133,5 @@ * Tim Hermans: A bug report. * Joe Francis: A suggestion. * Tiago Fernandes: Bug reports. -* achemze. A suggestion. +* achemze: A suggestion. +* George Montana Harkin: A suggestion. ======================================= --- /trunk/Rakefile Fri Jul 17 15:16:55 2009 +++ /trunk/Rakefile Wed Jul 22 04:50:54 2009 @@ -65,7 +65,7 @@ self.changes = self.paragraphs_of('CHANGES', 1..2).join("\n\n") self.extra_deps = [ # ['ruby-ldap', '= 0.9.9'], - ['activerecord', '= 2.3.2'], + ['activerecord', '= 2.3.3'], ['locale', '= 2.0.4'], ['gettext', '= 2.0.4'], ['gettext_activerecord', '= 2.0.4'], ======================================= --- /trunk/lib/active_ldap.rb Tue Jul 14 11:27:46 2009 +++ /trunk/lib/active_ldap.rb Wed Jul 22 04:50:54 2009 @@ -901,7 +901,7 @@ end end -require_gem_if_need.call("active_support", "activesupport", "= 2.3.2") +require_gem_if_need.call("active_support", "activesupport", "= 2.3.3") if ActiveSupport.const_defined?(:Dependencies) dependencies = ActiveSupport::Dependencies @@ -923,7 +923,7 @@ require 'active_ldap/timeout_stub' end -require_gem_if_need.call("active_record", "activerecord", "= 2.3.2") +require_gem_if_need.call("active_record", "activerecord", "= 2.3.3") begin require_gem_if_need.call("locale", nil, "= 2.0.4") require_gem_if_need.call("gettext", nil, "= 2.0.4") From codesite-noreply at google.com Wed Jul 22 07:55:59 2009 From: codesite-noreply at google.com (codesite-noreply at google.com) Date: Wed, 22 Jul 2009 11:55:59 +0000 Subject: [activeldap-commit] [ruby-activeldap] r1055 commited - * 1.1.0 -> 1.1.1. Message-ID: <00163646c04af5b13d046f4a0d68@google.com> Revision: 1055 Author: koutou Date: Wed Jul 22 04:54:22 2009 Log: * 1.1.0 -> 1.1.1. http://code.google.com/p/ruby-activeldap/source/detail?r=1055 Modified: /trunk/lib/active_ldap.rb ======================================= --- /trunk/lib/active_ldap.rb Wed Jul 22 04:50:54 2009 +++ /trunk/lib/active_ldap.rb Wed Jul 22 04:54:22 2009 @@ -914,7 +914,7 @@ end module ActiveLdap - VERSION = "1.1.0" + VERSION = "1.1.1" end if RUBY_PLATFORM.match('linux') From codesite-noreply at google.com Wed Jul 22 08:00:00 2009 From: codesite-noreply at google.com (codesite-noreply at google.com) Date: Wed, 22 Jul 2009 12:00:00 +0000 Subject: [activeldap-commit] [ruby-activeldap] r1056 commited - * increase required Rails version: 2.3.2 -> 2.3.3. Message-ID: <000e0cd30bd44f7c15046f4a1cb2@google.com> Revision: 1056 Author: koutou Date: Wed Jul 22 04:54:59 2009 Log: * increase required Rails version: 2.3.2 -> 2.3.3. http://code.google.com/p/ruby-activeldap/source/detail?r=1056 Modified: /trunk/examples/al-admin/config/environment.rb ======================================= --- /trunk/examples/al-admin/config/environment.rb Wed Jul 8 07:11:24 2009 +++ /trunk/examples/al-admin/config/environment.rb Wed Jul 22 04:54:59 2009 @@ -5,7 +5,7 @@ # ENV['RAILS_ENV'] ||= 'production' # Specifies gem version of Rails to use when vendor/rails is not present -RAILS_GEM_VERSION = '2.3.2' unless defined? RAILS_GEM_VERSION +RAILS_GEM_VERSION = '2.3.3' unless defined? RAILS_GEM_VERSION # Bootstrap the Rails environment, frameworks, and default configuration require File.join(File.dirname(__FILE__), 'boot') From codesite-noreply at google.com Sat Jul 25 21:47:19 2009 From: codesite-noreply at google.com (codesite-noreply at google.com) Date: Sun, 26 Jul 2009 01:47:19 +0000 Subject: [activeldap-commit] [ruby-activeldap] r1057 commited - * support auto-detection of Ruby/LDAP gem. Message-ID: <000e0cd20b20905c94046f92041a@google.com> Revision: 1057 Author: koutou Date: Sat Jul 25 18:46:43 2009 Log: * support auto-detection of Ruby/LDAP gem. http://code.google.com/p/ruby-activeldap/source/detail?r=1057 Modified: /trunk/lib/active_ldap/connection.rb ======================================= --- /trunk/lib/active_ldap/connection.rb Thu Jul 9 06:27:20 2009 +++ /trunk/lib/active_ldap/connection.rb Sat Jul 25 18:46:43 2009 @@ -203,10 +203,17 @@ if Object.respond_to?(:java) "jndi" else - ldap_ldif_path = $LOAD_PATH.find do |path| - File.exist?(File.join(path, "ldap", "ldif.rb")) + ruby_ldap_available = false + $LOAD_PATH.each do |path| + if File.exist?(File.join(path, "ldap", "ldif.rb")) + ruby_ldap_available = true + break + end end - if ldap_ldif_path + if !ruby_ldap_available and Object.const_defined?(:Gem) + ruby_ldap_available = Gem.available?("ruby-ldap") + end + if ruby_ldap_available "ldap" else "net-ldap" From codesite-noreply at google.com Sat Jul 25 22:23:26 2009 From: codesite-noreply at google.com (codesite-noreply at google.com) Date: Sun, 26 Jul 2009 02:23:26 +0000 Subject: [activeldap-commit] [ruby-activeldap] r1058 commited - * extract convenience process as a method and use it in test. Message-ID: <000e0cd14844c07154046f9285ac@google.com> Revision: 1058 Author: koutou Date: Sat Jul 25 19:22:56 2009 Log: * extract convenience process as a method and use it in test. http://code.google.com/p/ruby-activeldap/source/detail?r=1058 Modified: /trunk/lib/active_ldap/populate.rb /trunk/test/al-test-utils.rb ======================================= --- /trunk/lib/active_ldap/populate.rb Sun Aug 26 01:10:12 2007 +++ /trunk/lib/active_ldap/populate.rb Sat Jul 25 19:22:56 2009 @@ -13,17 +13,8 @@ prefix = suffixes.join(",") suffixes.unshift("#{name}=#{value}") next unless name == "dc" - dc_class = Class.new(base_class) - dc_class.ldap_mapping :dn_attribute => "dc", - :prefix => "", - :scope => :base, - :classes => ["top", "dcObject", "organization"] - dc_class.base = prefix - next if dc_class.exist?(value) - dc = dc_class.new(value) - dc.o = dc.dc begin - dc.save + ensure_dc(value, prefix, base_class) rescue ActiveLdap::OperationNotPermitted end end @@ -31,7 +22,7 @@ def ensure_ou(name, base_class=nil) base_class ||= Base - name = name.gsub(/\Aou\s*=\s*/, '') + name = name.gsub(/\Aou\s*=\s*/i, '') ou_class = Class.new(base_class) ou_class.ldap_mapping(:dn_attribute => "ou", @@ -40,5 +31,21 @@ return if ou_class.exist?(name) ou_class.new(name).save end + + def ensure_dc(name, prefix, base_class=nil) + base_class ||= Base + name = name.gsub(/\Adc\s*=\s*/i, '') + + dc_class = Class.new(base_class) + dc_class.ldap_mapping(:dn_attribute => "dc", + :prefix => "", + :scope => :base, + :classes => ["top", "dcObject", "organization"]) + dc_class.base = prefix + return if dc_class.exist?(name) + dc = dc_class.new(name) + dc.o = dc.dc + dc.save + end end end ======================================= --- /trunk/test/al-test-utils.rb Sat Jul 11 19:49:47 2009 +++ /trunk/test/al-test-utils.rb Sat Jul 25 19:22:56 2009 @@ -183,12 +183,29 @@ def ou_class(prefix="") ou_class = Class.new(ActiveLdap::Base) - ou_class.ldap_mapping :dn_attribute => "ou", + ou_class.ldap_mapping(:dn_attribute => "ou", :prefix => prefix, - :classes => ["top", "organizationalUnit"] + :classes => ["top", "organizationalUnit"]) ou_class end + def dc_class(prefix="") + dc_class = Class.new(ActiveLdap::Base) + dc_class.ldap_mapping(:dn_attribute => "dc", + :prefix => prefix, + :classes => ["top", "dcObject", "organization"]) + dc_class + end + + def entry_class(prefix="") + entry_class = Class.new(ActiveLdap::Base) + entry_class.ldap_mapping(:prefix => prefix, + :scope => :sub, + :classes => ["top"]) + entry_class.dn_attribute = nil + entry_class + end + def populate_ou %w(Users Groups).each do |name| make_ou(name) @@ -199,6 +216,10 @@ ActiveLdap::Populate.ensure_ou(name) end + def make_dc(name) + ActiveLdap::Populate.ensure_dc(name) + end + def populate_user_class @user_class = Class.new(ActiveLdap::Base) @user_class_classes = ["posixAccount", "person"] From codesite-noreply at google.com Sat Jul 25 22:27:26 2009 From: codesite-noreply at google.com (codesite-noreply at google.com) Date: Sun, 26 Jul 2009 02:27:26 +0000 Subject: [activeldap-commit] [ruby-activeldap] r1059 commited - * add a test for a case that mixed tree is deleted by instance. Message-ID: <001636e0b159107cd3046f92943e@google.com> Revision: 1059 Author: koutou Date: Sat Jul 25 19:23:37 2009 Log: * add a test for a case that mixed tree is deleted by instance. http://code.google.com/p/ruby-activeldap/source/detail?r=1059 Modified: /trunk/lib/active_ldap/base.rb /trunk/test/test_base.rb ======================================= --- /trunk/lib/active_ldap/base.rb Thu Jul 9 07:45:49 2009 +++ /trunk/lib/active_ldap/base.rb Sat Jul 25 19:23:37 2009 @@ -1030,6 +1030,10 @@ @scope = scope end + def delete_all(options={}) + super({:base => dn}.merge(options || {})) + end + def inspect object_classes = entry_attribute.object_classes inspected_object_classes = object_classes.collect do |object_class| ======================================= --- /trunk/test/test_base.rb Mon Jun 22 05:54:22 2009 +++ /trunk/test/test_base.rb Sat Jul 25 19:23:37 2009 @@ -6,6 +6,30 @@ include AlTestUtils priority :must + def test_delete_mixed_tree_by_instance + make_ou("base") + _entry_class = entry_class("ou=base") + _ou_class = ou_class("ou=base") + _dc_class = dc_class("ou=base") + + root1 = _ou_class.create("root1") + child1 = _ou_class.create(:ou => "child1", :parent => root1) + child2 = _ou_class.create(:ou => "child2", :parent => root1) + domain = _dc_class.create(:dc => "domain", :o => "domain", :parent => root1) + child3 = _ou_class.create(:ou => "child3", :parent => root1) + root2 = _ou_class.create("root2") + assert_equal(["base", + "root1", "child1", "child2", "domain", "child3", + "root2"], + _entry_class.find(:all).collect(&:id)) + assert_raise(ActiveLdap::LdapError::NotAllowedOnNonleaf) do + root1.delete_all + end + assert_equal(["base", "root1", "domain", "root2"], + _entry_class.find(:all).collect(&:id)) + end + + priority :normal def test_delete_tree make_ou("base") _ou_class = ou_class("ou=base") @@ -48,7 +72,6 @@ entry_class.find(:all).collect(&:id)) end - priority :normal def test_first make_temporary_user(:simple => true) do |user1,| make_temporary_user(:simple => true) do |user2,| From codesite-noreply at google.com Sat Jul 25 22:31:27 2009 From: codesite-noreply at google.com (codesite-noreply at google.com) Date: Sun, 26 Jul 2009 02:31:27 +0000 Subject: [activeldap-commit] [ruby-activeldap] r1060 commited - * ensure raises DeleteError on delete error.... Message-ID: <000e0cd20b20616910046f92a2cf@google.com> Revision: 1060 Author: koutou Date: Sat Jul 25 19:30:45 2009 Log: * ensure raises DeleteError on delete error. * make destroy_all the same signature of delete_all. http://code.google.com/p/ruby-activeldap/source/detail?r=1060 Modified: /trunk/lib/active_ldap/base.rb /trunk/lib/active_ldap/operations.rb /trunk/test/test_base.rb ======================================= --- /trunk/lib/active_ldap/base.rb Sat Jul 25 19:23:37 2009 +++ /trunk/lib/active_ldap/base.rb Sat Jul 25 19:30:45 2009 @@ -763,12 +763,8 @@ # # Delete this entry from LDAP def destroy - begin - self.class.delete(dn) - @new_entry = true - rescue Error - raise DeleteError.new(_("Failed to delete LDAP entry: %s") % dn) - end + self.class.delete(dn) + @new_entry = true end def delete(options={}) @@ -1034,6 +1030,10 @@ super({:base => dn}.merge(options || {})) end + def destroy_all(options={}) + super({:base => dn}.merge(options || {})) + end + def inspect object_classes = entry_attribute.object_classes inspected_object_classes = object_classes.collect do |object_class| ======================================= --- /trunk/lib/active_ldap/operations.rb Thu Jul 9 06:27:20 2009 +++ /trunk/lib/active_ldap/operations.rb Sat Jul 25 19:30:45 2009 @@ -470,13 +470,17 @@ end end - def destroy_all(filter=nil, options={}) - targets = [] - if filter.is_a?(Hash) - options = options.merge(filter) - filter = nil + def destroy_all(options_or_filter=nil, deprecated_options=nil) + if deprecated_options.nil? + if options_or_filter.is_a?(String) + options = {:filter => options_or_filter} + else + options = (options_or_filter || {}).dup + end + else + options = deprecated_options.merge(:filter => options_or_filter) end - options = options.merge(:filter => filter) if filter + find(:all, options).sort_by do |target| target.dn.reverse end.reverse.each do |target| @@ -494,7 +498,12 @@ def delete_entry(dn, options={}) options[:connection] ||= connection - options[:connection].delete(dn, options) + begin + options[:connection].delete(dn, options) + rescue Error + format = _("Failed to delete LDAP entry: <%s>: %s") + raise DeleteError.new(format % [dn.inspect, $!.message]) + end end def delete_all(options_or_filter=nil, deprecated_options=nil) @@ -513,7 +522,7 @@ dn.upcase.reverse end.reverse - options[:connection].delete(targets) + delete_entry(targets, options) end end ======================================= --- /trunk/test/test_base.rb Sat Jul 25 19:23:37 2009 +++ /trunk/test/test_base.rb Sat Jul 25 19:30:45 2009 @@ -6,6 +6,30 @@ include AlTestUtils priority :must + def test_destroy_mixed_tree_by_instance + make_ou("base") + _entry_class = entry_class("ou=base") + _ou_class = ou_class("ou=base") + _dc_class = dc_class("ou=base") + + root1 = _ou_class.create("root1") + child1 = _ou_class.create(:ou => "child1", :parent => root1) + child2 = _ou_class.create(:ou => "child2", :parent => root1) + domain = _dc_class.create(:dc => "domain", :o => "domain", :parent => root1) + child3 = _ou_class.create(:ou => "child3", :parent => root1) + root2 = _ou_class.create("root2") + assert_equal(["base", + "root1", "child1", "child2", "domain", "child3", + "root2"], + _entry_class.find(:all).collect(&:id)) + assert_raise(ActiveLdap::DeleteError) do + root1.destroy_all + end + assert_equal(["base", "root1", "domain", "root2"], + _entry_class.find(:all).collect(&:id)) + end + + priority :normal def test_delete_mixed_tree_by_instance make_ou("base") _entry_class = entry_class("ou=base") @@ -22,14 +46,13 @@ "root1", "child1", "child2", "domain", "child3", "root2"], _entry_class.find(:all).collect(&:id)) - assert_raise(ActiveLdap::LdapError::NotAllowedOnNonleaf) do + assert_raise(ActiveLdap::DeleteError) do root1.delete_all end assert_equal(["base", "root1", "domain", "root2"], _entry_class.find(:all).collect(&:id)) end - priority :normal def test_delete_tree make_ou("base") _ou_class = ou_class("ou=base") From codesite-noreply at google.com Fri Jul 31 21:30:02 2009 From: codesite-noreply at google.com (codesite-noreply at google.com) Date: Sat, 01 Aug 2009 01:30:02 +0000 Subject: [activeldap-commit] [ruby-activeldap] r1061 committed - * ActiveLdap::Base can be inspected even if a connection is not set.... Message-ID: <000e0cd151f8d71d2804700a7927@google.com> Revision: 1061 Author: koutou Date: Fri Jul 31 18:29:49 2009 Log: * ActiveLdap::Base can be inspected even if a connection is not set. Suggested by Kazuhiro NISHIYAMA. Thanks!!! http://code.google.com/p/ruby-activeldap/source/detail?r=1061 Modified: /trunk/lib/active_ldap/base.rb ======================================= --- /trunk/lib/active_ldap/base.rb Sat Jul 25 19:30:45 2009 +++ /trunk/lib/active_ldap/base.rb Fri Jul 31 18:29:49 2009 @@ -473,17 +473,23 @@ elsif abstract_class? "#{super}(abstract)" else - class_names = [] - must = [] - may = [] - class_names = classes.collect do |object_class| - must.concat(object_class.must) - may.concat(object_class.may) - object_class.name + detail = nil + begin + must = [] + may = [] + class_names = classes.collect do |object_class| + must.concat(object_class.must) + may.concat(object_class.may) + object_class.name + end + detail = ["objectClass:<#{class_names.join(', ')}>", + "must:<#{inspect_attributes(must)}>", + "may:<#{inspect_attributes(may)}>"].join(", ") + rescue ActiveLdap::ConnectionNotSetup + detail = "not-connected" + rescue ActiveLdap::Error + detail = "connection-failure" end - detail = ["objectClass:<#{class_names.join(', ')}>", - "must:<#{inspect_attributes(must)}>", - "may:<#{inspect_attributes(may)}>"].join(", ") "#{super}(#{detail})" end end