activeldap 1.2.1 → 1.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +17 -0
- data/README +7 -1
- data/Rakefile +2 -1
- data/benchmark/bench-al.rb +3 -3
- data/examples/al-admin/app/helpers/users_helper.rb +1 -1
- data/examples/al-admin/config/environment.rb +4 -3
- data/examples/al-admin/config/initializers/gettext.rb +1 -0
- data/examples/al-admin/config/session_secret.txt +1 -1
- data/examples/al-admin/po/al-admin.pot +344 -0
- data/examples/al-admin/public/images/active-ldap.png +0 -0
- data/examples/al-admin/vendor/locale_rails/.gitignore +6 -0
- data/examples/al-admin/vendor/locale_rails/COPYING +56 -0
- data/examples/al-admin/vendor/locale_rails/ChangeLog +35 -0
- data/examples/al-admin/vendor/locale_rails/README.rdoc +62 -0
- data/examples/al-admin/vendor/locale_rails/Rakefile +73 -0
- data/examples/al-admin/vendor/locale_rails/lib/locale_rails.rb +18 -0
- data/examples/al-admin/vendor/locale_rails/lib/locale_rails/action_controller.rb +15 -0
- data/examples/al-admin/vendor/locale_rails/lib/locale_rails/action_controller/base.rb +82 -0
- data/examples/al-admin/vendor/locale_rails/lib/locale_rails/action_controller/caching.rb +51 -0
- data/examples/al-admin/vendor/locale_rails/lib/locale_rails/action_controller/test_process.rb +44 -0
- data/examples/al-admin/vendor/locale_rails/lib/locale_rails/action_view.rb +53 -0
- data/examples/al-admin/vendor/locale_rails/lib/locale_rails/i18n.rb +67 -0
- data/examples/al-admin/vendor/locale_rails/lib/locale_rails/version.rb +4 -0
- data/examples/al-admin/vendor/locale_rails/sample/README +22 -0
- data/examples/al-admin/vendor/locale_rails/sample/Rakefile +10 -0
- data/examples/al-admin/vendor/locale_rails/sample/app/controllers/application.rb +42 -0
- data/examples/al-admin/vendor/locale_rails/sample/app/controllers/samples_controller.rb +30 -0
- data/examples/al-admin/vendor/locale_rails/sample/app/helpers/application_helper.rb +3 -0
- data/examples/al-admin/vendor/locale_rails/sample/app/views/layouts/samples.html.erb +20 -0
- data/examples/al-admin/vendor/locale_rails/sample/app/views/samples/_part.html.erb +68 -0
- data/examples/al-admin/vendor/locale_rails/sample/app/views/samples/_part_nl.html.erb +2 -0
- data/examples/al-admin/vendor/locale_rails/sample/app/views/samples/cached_action.html.erb +6 -0
- data/examples/al-admin/vendor/locale_rails/sample/app/views/samples/index.html.erb +33 -0
- data/examples/al-admin/vendor/locale_rails/sample/app/views/samples/index.pt.html.erb +16 -0
- data/examples/al-admin/vendor/locale_rails/sample/app/views/samples/index_uz_UZ.html.erb +16 -0
- data/examples/al-admin/vendor/locale_rails/sample/config/boot.rb +109 -0
- data/examples/al-admin/vendor/locale_rails/sample/config/environment.rb +25 -0
- data/examples/al-admin/vendor/locale_rails/sample/config/environments/development.rb +17 -0
- data/examples/al-admin/vendor/locale_rails/sample/config/environments/production.rb +24 -0
- data/examples/al-admin/vendor/locale_rails/sample/config/environments/test.rb +22 -0
- data/examples/al-admin/vendor/locale_rails/sample/config/initializers/inflections.rb +10 -0
- data/examples/al-admin/vendor/locale_rails/sample/config/initializers/mime_types.rb +5 -0
- data/examples/al-admin/vendor/locale_rails/sample/config/initializers/new_rails_defaults.rb +17 -0
- data/examples/al-admin/vendor/locale_rails/sample/config/locales/en.yml +2 -0
- data/examples/al-admin/vendor/locale_rails/sample/config/locales/ja.yml +2 -0
- data/examples/al-admin/vendor/locale_rails/sample/config/routes.rb +13 -0
- data/examples/al-admin/vendor/locale_rails/sample/db/schema.rb +10 -0
- data/examples/al-admin/vendor/locale_rails/sample/public/404.html +30 -0
- data/examples/al-admin/vendor/locale_rails/sample/public/422.html +30 -0
- data/examples/al-admin/vendor/locale_rails/sample/public/500.html +33 -0
- data/examples/al-admin/vendor/locale_rails/sample/public/dispatch.cgi +10 -0
- data/examples/al-admin/vendor/locale_rails/sample/public/dispatch.fcgi +24 -0
- data/examples/al-admin/vendor/locale_rails/sample/public/dispatch.rb +10 -0
- data/examples/al-admin/vendor/locale_rails/sample/public/favicon.ico +0 -0
- data/examples/al-admin/vendor/locale_rails/sample/public/images/rails.png +0 -0
- data/examples/al-admin/vendor/locale_rails/sample/public/javascripts/application.js +2 -0
- data/examples/al-admin/vendor/locale_rails/sample/public/javascripts/controls.js +963 -0
- data/examples/al-admin/vendor/locale_rails/sample/public/javascripts/dragdrop.js +972 -0
- data/examples/al-admin/vendor/locale_rails/sample/public/javascripts/effects.js +1120 -0
- data/examples/al-admin/vendor/locale_rails/sample/public/javascripts/prototype.js +4221 -0
- data/examples/al-admin/vendor/locale_rails/sample/public/robots.txt +5 -0
- data/examples/al-admin/vendor/locale_rails/sample/public/stylesheets/locale.css +81 -0
- data/examples/al-admin/vendor/locale_rails/sample/public/stylesheets/scaffold.css +74 -0
- data/examples/al-admin/vendor/locale_rails/sample/script/about +4 -0
- data/examples/al-admin/vendor/locale_rails/sample/script/console +3 -0
- data/examples/al-admin/vendor/locale_rails/sample/script/dbconsole +3 -0
- data/examples/al-admin/vendor/locale_rails/sample/script/destroy +3 -0
- data/examples/al-admin/vendor/locale_rails/sample/script/generate +3 -0
- data/examples/al-admin/vendor/locale_rails/sample/script/performance/benchmarker +3 -0
- data/examples/al-admin/vendor/locale_rails/sample/script/performance/profiler +3 -0
- data/examples/al-admin/vendor/locale_rails/sample/script/performance/request +3 -0
- data/examples/al-admin/vendor/locale_rails/sample/script/plugin +3 -0
- data/examples/al-admin/vendor/locale_rails/sample/script/process/inspector +3 -0
- data/examples/al-admin/vendor/locale_rails/sample/script/process/reaper +3 -0
- data/examples/al-admin/vendor/locale_rails/sample/script/process/spawner +3 -0
- data/examples/al-admin/vendor/locale_rails/sample/script/runner +3 -0
- data/examples/al-admin/vendor/locale_rails/sample/script/server +3 -0
- data/examples/al-admin/vendor/locale_rails/sample/test/performance/browsing_test.rb +9 -0
- data/examples/al-admin/vendor/locale_rails/sample/test/test_helper.rb +38 -0
- data/examples/al-admin/vendor/locale_rails/test/README +243 -0
- data/examples/al-admin/vendor/locale_rails/test/Rakefile +10 -0
- data/examples/al-admin/vendor/locale_rails/test/app/controllers/application_controller.rb +10 -0
- data/examples/al-admin/vendor/locale_rails/test/app/controllers/articles_controller.rb +17 -0
- data/examples/al-admin/vendor/locale_rails/test/app/helpers/application_helper.rb +3 -0
- data/examples/al-admin/vendor/locale_rails/test/app/views/articles/index.html.erb +1 -0
- data/examples/al-admin/vendor/locale_rails/test/app/views/articles/index_de.html.erb +1 -0
- data/examples/al-admin/vendor/locale_rails/test/app/views/articles/index_fr_FR.html.erb +1 -0
- data/examples/al-admin/vendor/locale_rails/test/app/views/articles/index_ja.html.erb +1 -0
- data/examples/al-admin/vendor/locale_rails/test/app/views/articles/list.html.erb +1 -0
- data/examples/al-admin/vendor/locale_rails/test/app/views/articles/show.html.erb +0 -0
- data/examples/al-admin/vendor/locale_rails/test/app/views/articles/show.js.rjs +0 -0
- data/examples/al-admin/vendor/locale_rails/test/config/boot.rb +110 -0
- data/examples/al-admin/vendor/locale_rails/test/config/environment.rb +42 -0
- data/examples/al-admin/vendor/locale_rails/test/config/environments/development.rb +17 -0
- data/examples/al-admin/vendor/locale_rails/test/config/environments/production.rb +28 -0
- data/examples/al-admin/vendor/locale_rails/test/config/environments/test.rb +35 -0
- data/examples/al-admin/vendor/locale_rails/test/config/initializers/backtrace_silencers.rb +7 -0
- data/examples/al-admin/vendor/locale_rails/test/config/initializers/inflections.rb +10 -0
- data/examples/al-admin/vendor/locale_rails/test/config/initializers/mime_types.rb +5 -0
- data/examples/al-admin/vendor/locale_rails/test/config/initializers/new_rails_defaults.rb +19 -0
- data/examples/al-admin/vendor/locale_rails/test/config/initializers/session_store.rb +15 -0
- data/examples/al-admin/vendor/locale_rails/test/config/locales/en.yml +5 -0
- data/examples/al-admin/vendor/locale_rails/test/config/routes.rb +46 -0
- data/examples/al-admin/vendor/locale_rails/test/db/schema.rb +0 -0
- data/examples/al-admin/vendor/locale_rails/test/public/404.html +30 -0
- data/examples/al-admin/vendor/locale_rails/test/public/422.html +30 -0
- data/examples/al-admin/vendor/locale_rails/test/public/500.html +30 -0
- data/examples/al-admin/vendor/locale_rails/test/public/favicon.ico +0 -0
- data/examples/al-admin/vendor/locale_rails/test/public/images/rails.png +0 -0
- data/examples/al-admin/vendor/locale_rails/test/public/index.html +275 -0
- data/examples/al-admin/vendor/locale_rails/test/public/javascripts/application.js +2 -0
- data/examples/al-admin/vendor/locale_rails/test/public/javascripts/controls.js +963 -0
- data/examples/al-admin/vendor/locale_rails/test/public/javascripts/dragdrop.js +973 -0
- data/examples/al-admin/vendor/locale_rails/test/public/javascripts/effects.js +1128 -0
- data/examples/al-admin/vendor/locale_rails/test/public/javascripts/prototype.js +4320 -0
- data/examples/al-admin/vendor/locale_rails/test/public/robots.txt +5 -0
- data/examples/al-admin/vendor/locale_rails/test/script/about +4 -0
- data/examples/al-admin/vendor/locale_rails/test/script/console +3 -0
- data/examples/al-admin/vendor/locale_rails/test/script/dbconsole +3 -0
- data/examples/al-admin/vendor/locale_rails/test/script/destroy +3 -0
- data/examples/al-admin/vendor/locale_rails/test/script/generate +3 -0
- data/examples/al-admin/vendor/locale_rails/test/script/performance/benchmarker +3 -0
- data/examples/al-admin/vendor/locale_rails/test/script/performance/profiler +3 -0
- data/examples/al-admin/vendor/locale_rails/test/script/plugin +3 -0
- data/examples/al-admin/vendor/locale_rails/test/script/runner +3 -0
- data/examples/al-admin/vendor/locale_rails/test/script/server +3 -0
- data/examples/al-admin/vendor/locale_rails/test/test/functional/articles_controller_test.rb +161 -0
- data/examples/al-admin/vendor/locale_rails/test/test/performance/browsing_test.rb +9 -0
- data/examples/al-admin/vendor/locale_rails/test/test/test_helper.rb +38 -0
- data/lib/active_ldap.rb +9 -4
- data/lib/active_ldap/adapter/base.rb +3 -3
- data/lib/active_ldap/adapter/jndi.rb +1 -1
- data/lib/active_ldap/adapter/jndi_connection.rb +1 -3
- data/lib/active_ldap/adapter/ldap.rb +11 -11
- data/lib/active_ldap/adapter/ldap_ext.rb +25 -3
- data/lib/active_ldap/adapter/net_ldap.rb +9 -2
- data/lib/active_ldap/association/collection.rb +14 -2
- data/lib/active_ldap/base.rb +13 -5
- data/lib/active_ldap/configuration.rb +1 -0
- data/lib/active_ldap/ldap_error.rb +3 -3
- data/lib/active_ldap/ldif.rb +1 -1
- data/lib/active_ldap/operations.rb +2 -0
- data/lib/active_ldap/schema/syntaxes.rb +2 -2
- data/lib/active_ldap/validations.rb +37 -26
- data/lib/active_ldap/xml.rb +2 -0
- data/po/active-ldap.pot +38 -58
- data/test-unit/COPYING +56 -0
- data/test-unit/GPL +340 -0
- data/test-unit/History.txt +65 -3
- data/test-unit/Manifest.txt +5 -0
- data/test-unit/PSFL +271 -0
- data/test-unit/README.txt +6 -1
- data/test-unit/lib/test/unit.rb +6 -1
- data/test-unit/lib/test/unit/assertions.rb +129 -13
- data/test-unit/lib/test/unit/autorunner.rb +21 -16
- data/test-unit/lib/test/unit/collector.rb +1 -8
- data/test-unit/lib/test/unit/collector/dir.rb +1 -1
- data/test-unit/lib/test/unit/collector/load.rb +15 -7
- data/test-unit/lib/test/unit/color-scheme.rb +6 -2
- data/test-unit/lib/test/unit/diff.rb +17 -1
- data/test-unit/lib/test/unit/error.rb +4 -0
- data/test-unit/lib/test/unit/failure.rb +4 -0
- data/test-unit/lib/test/unit/notification.rb +8 -4
- data/test-unit/lib/test/unit/omission.rb +4 -0
- data/test-unit/lib/test/unit/pending.rb +4 -0
- data/test-unit/lib/test/unit/priority.rb +2 -3
- data/test-unit/lib/test/unit/testcase.rb +18 -7
- data/test-unit/lib/test/unit/ui/console/testrunner.rb +5 -3
- data/test-unit/lib/test/unit/util/backtracefilter.rb +1 -0
- data/test-unit/lib/test/unit/util/output.rb +31 -0
- data/test-unit/lib/test/unit/version.rb +1 -1
- data/test-unit/test/collector/test-descendant.rb +2 -4
- data/test-unit/test/collector/test-load.rb +121 -8
- data/test-unit/test/collector/test_objectspace.rb +7 -5
- data/test-unit/test/test-color-scheme.rb +4 -2
- data/test-unit/test/test-testcase.rb +48 -38
- data/test-unit/test/test_assertions.rb +87 -5
- data/test-unit/test/util/test-output.rb +11 -0
- data/test/al-test-utils.rb +6 -1
- data/test/fixtures/lower_case_object_class_schema.rb +802 -0
- data/test/test_associations.rb +20 -1
- data/test/test_base.rb +50 -3
- data/test/test_ldif.rb +10 -1
- data/test/test_syntax.rb +12 -0
- data/test/test_validation.rb +0 -2
- metadata +225 -56
@@ -73,7 +73,7 @@ module ActiveLdap
|
|
73
73
|
}
|
74
74
|
info = {
|
75
75
|
:base => base, :scope => scope_name(scope),
|
76
|
-
:filter => filter, :attributes => attrs,
|
76
|
+
:filter => filter, :attributes => attrs, :limit => limit
|
77
77
|
}
|
78
78
|
execute(:search, info, args) do |entry|
|
79
79
|
attributes = {}
|
@@ -138,7 +138,13 @@ module ActiveLdap
|
|
138
138
|
private
|
139
139
|
def execute(method, info=nil, *args, &block)
|
140
140
|
name = (info || {}).delete(:name) || method
|
141
|
-
result = log(name, info)
|
141
|
+
result = log(name, info) do
|
142
|
+
begin
|
143
|
+
@connection.send(method, *args, &block)
|
144
|
+
rescue Errno::EPIPE
|
145
|
+
raise ConnectionError, "#{$!.class}: #{$!.message}"
|
146
|
+
end
|
147
|
+
end
|
142
148
|
message = nil
|
143
149
|
if result.is_a?(Hash)
|
144
150
|
message = result[:errorMessage]
|
@@ -147,6 +153,7 @@ module ActiveLdap
|
|
147
153
|
unless result.zero?
|
148
154
|
klass = LdapError::ERRORS[result]
|
149
155
|
klass ||= LdapError
|
156
|
+
return if klass == LdapError::SizeLimitExceeded
|
150
157
|
message = [Net::LDAP.result2string(result), message].compact.join(": ")
|
151
158
|
raise klass, message
|
152
159
|
end
|
@@ -40,8 +40,20 @@ module ActiveLdap
|
|
40
40
|
|
41
41
|
def replace(others)
|
42
42
|
load_target
|
43
|
-
|
44
|
-
|
43
|
+
|
44
|
+
entry = @target.first
|
45
|
+
if entry.nil?
|
46
|
+
deleted_entries = []
|
47
|
+
added_entries = others
|
48
|
+
else
|
49
|
+
base_class = entry.class
|
50
|
+
others = others.collect do |other|
|
51
|
+
other = base_class.find(other) unless other.is_a?(base_class)
|
52
|
+
other
|
53
|
+
end
|
54
|
+
deleted_entries = @target - others
|
55
|
+
added_entries = others - @target
|
56
|
+
end
|
45
57
|
|
46
58
|
delete(deleted_entries)
|
47
59
|
concat(added_entries)
|
data/lib/active_ldap/base.rb
CHANGED
@@ -588,7 +588,7 @@ module ActiveLdap
|
|
588
588
|
require 'logger'
|
589
589
|
@@logger = Logger.new(STDERR)
|
590
590
|
@@logger.progname = 'ActiveLdap'
|
591
|
-
@@logger.level = Logger::
|
591
|
+
@@logger.level = Logger::ERROR
|
592
592
|
end
|
593
593
|
configuration[:logger] ||= @@logger
|
594
594
|
end
|
@@ -1109,12 +1109,17 @@ module ActiveLdap
|
|
1109
1109
|
"#{name}: #{values.inspect}"
|
1110
1110
|
end
|
1111
1111
|
|
1112
|
+
def find_object_class_values(data)
|
1113
|
+
data["objectClass"] || data["objectclass"]
|
1114
|
+
end
|
1115
|
+
|
1112
1116
|
def attribute_name_resolvable_without_connection?
|
1113
1117
|
@entry_attribute and @local_entry_attribute
|
1114
1118
|
end
|
1115
1119
|
|
1116
1120
|
def entry_attribute
|
1117
|
-
@entry_attribute ||=
|
1121
|
+
@entry_attribute ||=
|
1122
|
+
connection.entry_attribute(find_object_class_values(@data) || [])
|
1118
1123
|
end
|
1119
1124
|
|
1120
1125
|
def local_entry_attribute
|
@@ -1240,7 +1245,8 @@ module ActiveLdap
|
|
1240
1245
|
def get_attribute_before_type_cast(name, force_array=false)
|
1241
1246
|
name = to_real_attribute_name(name)
|
1242
1247
|
|
1243
|
-
value = @data[name]
|
1248
|
+
value = @data[name]
|
1249
|
+
value = [] if value.nil?
|
1244
1250
|
[name, array_of(value, force_array)]
|
1245
1251
|
end
|
1246
1252
|
|
@@ -1510,8 +1516,9 @@ module ActiveLdap
|
|
1510
1516
|
|
1511
1517
|
oc_value = data['objectClass']
|
1512
1518
|
attributes.push(['objectClass', oc_value])
|
1519
|
+
except_keys = ['objectClass', dn_attr].collect(&:downcase)
|
1513
1520
|
data.each do |key, value|
|
1514
|
-
next if key
|
1521
|
+
next if except_keys.include?(key.downcase)
|
1515
1522
|
value = self.class.remove_blank_value(value)
|
1516
1523
|
next if self.class.blank_value?(value)
|
1517
1524
|
|
@@ -1532,8 +1539,9 @@ module ActiveLdap
|
|
1532
1539
|
ldap_data = normalize_data(@ldap_data)
|
1533
1540
|
|
1534
1541
|
# Expand subtypes to real data attributes, but leave @data alone
|
1542
|
+
object_classes = find_object_class_values(@ldap_data) || []
|
1535
1543
|
original_attributes =
|
1536
|
-
connection.entry_attribute(
|
1544
|
+
connection.entry_attribute(object_classes).names
|
1537
1545
|
bad_attrs = original_attributes - entry_attribute.names
|
1538
1546
|
data = normalize_data(@data, bad_attrs)
|
1539
1547
|
|
@@ -33,6 +33,7 @@ module ActiveLdap
|
|
33
33
|
DEFAULT_CONFIG[:allow_anonymous] = true
|
34
34
|
DEFAULT_CONFIG[:sasl_quiet] = true
|
35
35
|
DEFAULT_CONFIG[:try_sasl] = false
|
36
|
+
DEFAULT_CONFIG[:sasl_options] = nil
|
36
37
|
# See http://www.iana.org/assignments/sasl-mechanisms
|
37
38
|
DEFAULT_CONFIG[:sasl_mechanisms] = ["GSSAPI", "DIGEST-MD5",
|
38
39
|
"CRAM-MD5", "EXTERNAL"]
|
@@ -20,8 +20,8 @@ EOC
|
|
20
20
|
0x00 => "SUCCESS",
|
21
21
|
0x01 => "OPERATIONS_ERROR",
|
22
22
|
0x02 => "PROTOCOL_ERROR",
|
23
|
-
0x03 => "
|
24
|
-
0x04 => "
|
23
|
+
0x03 => "TIME_LIMIT_EXCEEDED",
|
24
|
+
0x04 => "SIZE_LIMIT_EXCEEDED",
|
25
25
|
0x05 => "COMPARE_FALSE",
|
26
26
|
0x06 => "COMPARE_TRUE",
|
27
27
|
0x07 => "AUTH_METHOD_NOT_SUPPORTED",
|
@@ -29,7 +29,7 @@ EOC
|
|
29
29
|
0x09 => "PARTIAL_RESULTS", # LDAPv2+ (not LDAPv3)
|
30
30
|
|
31
31
|
0x0a => "REFERRAL",
|
32
|
-
0x0b => "
|
32
|
+
0x0b => "ADMIN_LIMIT_EXCEEDED",
|
33
33
|
0x0c => "UNAVAILABLE_CRITICAL_EXTENSION",
|
34
34
|
0x0d => "CONFIDENTIALITY_REQUIRED",
|
35
35
|
0x0e => "LDAP_SASL_BIND_IN_PROGRESS",
|
data/lib/active_ldap/ldif.rb
CHANGED
@@ -46,7 +46,7 @@ module ActiveLdap
|
|
46
46
|
return "#{name}:\n" if value.blank?
|
47
47
|
result = "#{name}:"
|
48
48
|
|
49
|
-
value = value.to_s
|
49
|
+
value = value.to_s unless value.is_a?(String)
|
50
50
|
if value[-1, 1] == ' ' or binary_value?(value)
|
51
51
|
result << ":"
|
52
52
|
value = [value].pack("m").gsub(/\n/, '')
|
@@ -83,6 +83,7 @@ module ActiveLdap
|
|
83
83
|
:attribute => attr,
|
84
84
|
:value => value,
|
85
85
|
:prefix => prefix,
|
86
|
+
:limit => 1,
|
86
87
|
}
|
87
88
|
|
88
89
|
attribute = attr || ensure_search_attribute
|
@@ -90,6 +91,7 @@ module ActiveLdap
|
|
90
91
|
:attribute => attr,
|
91
92
|
:value => value,
|
92
93
|
:prefix => ["#{attribute}=#{value}", prefix].compact.join(","),
|
94
|
+
:limit => 1,
|
93
95
|
:scope => :base,
|
94
96
|
}
|
95
97
|
|
@@ -87,6 +87,20 @@ module ActiveLdap
|
|
87
87
|
end
|
88
88
|
|
89
89
|
private
|
90
|
+
def format_validation_message(format, parameters)
|
91
|
+
if ActiveLdap.get_text_supported?
|
92
|
+
if /\A(%\{fn\})/ =~ format
|
93
|
+
place_holder = $1
|
94
|
+
format = $POSTMATCH
|
95
|
+
else
|
96
|
+
place_holder = ""
|
97
|
+
end
|
98
|
+
"#{place_holder}#{format % parameters}"
|
99
|
+
else
|
100
|
+
format.sub(/\A%\{fn\} ?/, '') % parameters
|
101
|
+
end
|
102
|
+
end
|
103
|
+
|
90
104
|
def validate_duplicated_dn_creation
|
91
105
|
_dn = nil
|
92
106
|
begin
|
@@ -96,10 +110,8 @@ module ActiveLdap
|
|
96
110
|
end
|
97
111
|
if _dn and exist?
|
98
112
|
format = _("%{fn} is duplicated: %s")
|
99
|
-
|
100
|
-
|
101
|
-
end
|
102
|
-
errors.add("distinguishedName", format % _dn)
|
113
|
+
message = format_validation_message(format, _dn)
|
114
|
+
errors.add("distinguishedName", message)
|
103
115
|
end
|
104
116
|
end
|
105
117
|
|
@@ -118,10 +130,8 @@ module ActiveLdap
|
|
118
130
|
end
|
119
131
|
if _dn and exist?
|
120
132
|
format = _("%{fn} is duplicated: %s")
|
121
|
-
|
122
|
-
|
123
|
-
end
|
124
|
-
errors.add("distinguishedName", format % _dn)
|
133
|
+
message = format_validation_message(format, _dn)
|
134
|
+
errors.add("distinguishedName", message)
|
125
135
|
end
|
126
136
|
end
|
127
137
|
|
@@ -129,23 +139,28 @@ module ActiveLdap
|
|
129
139
|
dn
|
130
140
|
rescue DistinguishedNameInvalid
|
131
141
|
format = _("%{fn} is invalid: %s")
|
132
|
-
|
133
|
-
errors.add("distinguishedName",
|
142
|
+
message = format_validation_message(format, $!.message)
|
143
|
+
errors.add("distinguishedName", message)
|
134
144
|
rescue DistinguishedNameNotSetError
|
135
145
|
format = _("%{fn} isn't set: %s")
|
136
|
-
|
137
|
-
errors.add("distinguishedName",
|
146
|
+
message = format_validation_message(format, $!.message)
|
147
|
+
errors.add("distinguishedName", message)
|
138
148
|
end
|
139
149
|
|
140
150
|
def validate_excluded_classes
|
141
|
-
|
151
|
+
excluded_classes = self.class.excluded_classes
|
152
|
+
return if excluded_classes.empty?
|
142
153
|
|
143
154
|
_schema = schema
|
144
|
-
|
155
|
+
_classes = classes.collect do |name|
|
145
156
|
_schema.object_class(name)
|
146
157
|
end
|
147
|
-
unexpected_classes
|
148
|
-
_schema.object_class(name)
|
158
|
+
unexpected_classes = excluded_classes.inject([]) do |classes, name|
|
159
|
+
excluded_class = _schema.object_class(name)
|
160
|
+
if _classes.include?(excluded_class)
|
161
|
+
classes << excluded_class
|
162
|
+
end
|
163
|
+
classes
|
149
164
|
end
|
150
165
|
return if unexpected_classes.empty?
|
151
166
|
|
@@ -155,8 +170,8 @@ module ActiveLdap
|
|
155
170
|
format = n_("%{fn} has excluded value: %s",
|
156
171
|
"%{fn} has excluded values: %s",
|
157
172
|
names.size)
|
158
|
-
|
159
|
-
errors.add("objectClass",
|
173
|
+
message = format_validation_message(format, names.join(", "))
|
174
|
+
errors.add("objectClass", message)
|
160
175
|
end
|
161
176
|
|
162
177
|
# validate_required_ldap_values
|
@@ -195,10 +210,8 @@ module ActiveLdap
|
|
195
210
|
"'%s': aliases: %s")
|
196
211
|
args << aliases.join(', ')
|
197
212
|
end
|
198
|
-
|
199
|
-
|
200
|
-
end
|
201
|
-
errors.add(real_name, format % args)
|
213
|
+
message = format_validation_message(format, args)
|
214
|
+
errors.add(real_name, message)
|
202
215
|
end
|
203
216
|
end
|
204
217
|
end
|
@@ -228,10 +241,8 @@ module ActiveLdap
|
|
228
241
|
format = _("%{fn} has invalid format: %s: required syntax: %s: %s")
|
229
242
|
end
|
230
243
|
params.unshift(option) if option
|
231
|
-
|
232
|
-
|
233
|
-
end
|
234
|
-
errors.add(name, format % params)
|
244
|
+
message = format_validation_message(format, params)
|
245
|
+
errors.add(name, message)
|
235
246
|
end
|
236
247
|
end
|
237
248
|
end
|
data/lib/active_ldap/xml.rb
CHANGED
data/po/active-ldap.pot
CHANGED
@@ -6,9 +6,9 @@
|
|
6
6
|
#, fuzzy
|
7
7
|
msgid ""
|
8
8
|
msgstr ""
|
9
|
-
"Project-Id-Version: Ruby/ActiveLdap 1.
|
10
|
-
"POT-Creation-Date: 2009-
|
11
|
-
"PO-Revision-Date:
|
9
|
+
"Project-Id-Version: Ruby/ActiveLdap 1.0.9\n"
|
10
|
+
"POT-Creation-Date: 2009-07-09 22:48+0900\n"
|
11
|
+
"PO-Revision-Date: 2007-08-12 18:02+0900\n"
|
12
12
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
13
13
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
14
14
|
"MIME-Version: 1.0\n"
|
@@ -772,10 +772,6 @@ msgstr ""
|
|
772
772
|
msgid "LDAP|Attribute|olcRootPW"
|
773
773
|
msgstr ""
|
774
774
|
|
775
|
-
#: -:-
|
776
|
-
msgid "LDAP|Attribute|olcSaslAuxprops"
|
777
|
-
msgstr ""
|
778
|
-
|
779
775
|
#: -:-
|
780
776
|
msgid "LDAP|Attribute|olcSaslHost"
|
781
777
|
msgstr ""
|
@@ -892,10 +888,6 @@ msgstr ""
|
|
892
888
|
msgid "LDAP|Attribute|olcUpdateRef"
|
893
889
|
msgstr ""
|
894
890
|
|
895
|
-
#: -:-
|
896
|
-
msgid "LDAP|Attribute|olcWriteTimeout"
|
897
|
-
msgstr ""
|
898
|
-
|
899
891
|
#: -:-
|
900
892
|
msgid "LDAP|Attribute|oncRpcNumber"
|
901
893
|
msgstr ""
|
@@ -3441,17 +3433,17 @@ msgstr ""
|
|
3441
3433
|
msgid "Can't remove required objectClass: %s"
|
3442
3434
|
msgstr ""
|
3443
3435
|
|
3444
|
-
#: lib/active_ldap/adapter/jndi.rb:105 lib/active_ldap/adapter/ldap.rb:
|
3436
|
+
#: lib/active_ldap/adapter/jndi.rb:105 lib/active_ldap/adapter/ldap.rb:197
|
3445
3437
|
#: lib/active_ldap/adapter/net_ldap.rb:155
|
3446
3438
|
msgid "%s is not one of the available connect methods: %s"
|
3447
3439
|
msgstr ""
|
3448
3440
|
|
3449
|
-
#: lib/active_ldap/adapter/jndi.rb:118 lib/active_ldap/adapter/ldap.rb:
|
3441
|
+
#: lib/active_ldap/adapter/jndi.rb:118 lib/active_ldap/adapter/ldap.rb:210
|
3450
3442
|
#: lib/active_ldap/adapter/net_ldap.rb:168
|
3451
3443
|
msgid "%s is not one of the available LDAP scope: %s"
|
3452
3444
|
msgstr ""
|
3453
3445
|
|
3454
|
-
#: lib/active_ldap/adapter/jndi.rb:176 lib/active_ldap/adapter/ldap.rb:
|
3446
|
+
#: lib/active_ldap/adapter/jndi.rb:176 lib/active_ldap/adapter/ldap.rb:274
|
3455
3447
|
#: lib/active_ldap/adapter/net_ldap.rb:290
|
3456
3448
|
msgid "unknown type: %s"
|
3457
3449
|
msgstr ""
|
@@ -3460,10 +3452,6 @@ msgstr ""
|
|
3460
3452
|
msgid "No matches: filter: %s: attributes: %s"
|
3461
3453
|
msgstr ""
|
3462
3454
|
|
3463
|
-
#: lib/active_ldap/adapter/ldap.rb:162
|
3464
|
-
msgid "modify RDN with new superior"
|
3465
|
-
msgstr ""
|
3466
|
-
|
3467
3455
|
#: lib/active_ldap/adapter/net_ldap.rb:211
|
3468
3456
|
msgid "unsupported qops: %s"
|
3469
3457
|
msgstr ""
|
@@ -3566,17 +3554,13 @@ msgstr ""
|
|
3566
3554
|
msgid "Couldn't find all %s: DNs (%s)"
|
3567
3555
|
msgstr ""
|
3568
3556
|
|
3569
|
-
#: lib/active_ldap/operations.rb:504
|
3570
|
-
msgid "Failed to delete LDAP entry: <%s>: %s"
|
3571
|
-
msgstr ""
|
3572
|
-
|
3573
3557
|
#: lib/active_ldap/associations.rb:68
|
3574
3558
|
msgid ""
|
3575
3559
|
":foreign_key belongs_to(:many) option is deprecated since 1.1.0. Use :"
|
3576
3560
|
"primary_key instead."
|
3577
3561
|
msgstr ""
|
3578
3562
|
|
3579
|
-
#: lib/active_ldap/associations.rb:
|
3563
|
+
#: lib/active_ldap/associations.rb:135
|
3580
3564
|
msgid ""
|
3581
3565
|
":primary_key and :foreign_key has_many options are inverted their mean since "
|
3582
3566
|
"1.1.0. Please invert them."
|
@@ -3710,41 +3694,37 @@ msgstr ""
|
|
3710
3694
|
msgid "%s isn't sub DN of %s"
|
3711
3695
|
msgstr ""
|
3712
3696
|
|
3713
|
-
#: lib/active_ldap/validations.rb:
|
3697
|
+
#: lib/active_ldap/validations.rb:85
|
3714
3698
|
msgid "%{fn} is duplicated: %s"
|
3715
3699
|
msgstr ""
|
3716
3700
|
|
3717
|
-
#: lib/active_ldap/validations.rb:
|
3701
|
+
#: lib/active_ldap/validations.rb:96
|
3718
3702
|
msgid "%{fn} is invalid: %s"
|
3719
3703
|
msgstr ""
|
3720
3704
|
|
3721
|
-
#: lib/active_ldap/validations.rb:
|
3705
|
+
#: lib/active_ldap/validations.rb:100
|
3722
3706
|
msgid "%{fn} isn't set: %s"
|
3723
3707
|
msgstr ""
|
3724
3708
|
|
3725
|
-
#: lib/active_ldap/validations.rb:
|
3709
|
+
#: lib/active_ldap/validations.rb:122
|
3726
3710
|
msgid "%{fn} has excluded value: %s"
|
3727
3711
|
msgid_plural "%{fn} has excluded values: %s"
|
3728
3712
|
msgstr[0] ""
|
3729
3713
|
msgstr[1] ""
|
3730
3714
|
|
3731
|
-
#: lib/active_ldap/validations.rb:
|
3715
|
+
#: lib/active_ldap/validations.rb:152
|
3732
3716
|
msgid "%{fn} is required attribute by objectClass '%s'"
|
3733
3717
|
msgstr ""
|
3734
3718
|
|
3735
|
-
#: lib/active_ldap/validations.rb:
|
3719
|
+
#: lib/active_ldap/validations.rb:154
|
3736
3720
|
msgid "%{fn} is required attribute by objectClass '%s': aliases: %s"
|
3737
3721
|
msgstr ""
|
3738
3722
|
|
3739
|
-
#: lib/active_ldap/validations.rb:
|
3740
|
-
msgid "<binary-value>"
|
3741
|
-
msgstr ""
|
3742
|
-
|
3743
|
-
#: lib/active_ldap/validations.rb:203
|
3723
|
+
#: lib/active_ldap/validations.rb:181
|
3744
3724
|
msgid "%{fn}(%s) has invalid format: %s: required syntax: %s: %s"
|
3745
3725
|
msgstr ""
|
3746
3726
|
|
3747
|
-
#: lib/active_ldap/validations.rb:
|
3727
|
+
#: lib/active_ldap/validations.rb:183
|
3748
3728
|
msgid "%{fn} has invalid format: %s: required syntax: %s: %s"
|
3749
3729
|
msgstr ""
|
3750
3730
|
|
@@ -3798,47 +3778,47 @@ msgstr ""
|
|
3798
3778
|
msgid "%s is unknown attribute"
|
3799
3779
|
msgstr ""
|
3800
3780
|
|
3801
|
-
#: lib/active_ldap/base.rb:
|
3802
|
-
msgid "not implemented: %s"
|
3803
|
-
msgstr ""
|
3804
|
-
|
3805
|
-
#: lib/active_ldap/base.rb:382
|
3781
|
+
#: lib/active_ldap/base.rb:374
|
3806
3782
|
msgid ""
|
3807
3783
|
"ActiveLdap::Base.establish_connection has been deprecated since 1.1.0. "
|
3808
3784
|
"Please use ActiveLdap::Base.setup_connection instead."
|
3809
3785
|
msgstr ""
|
3810
3786
|
|
3811
|
-
#: lib/active_ldap/base.rb:
|
3787
|
+
#: lib/active_ldap/base.rb:455
|
3812
3788
|
msgid "scope '%s' must be a Symbol"
|
3813
3789
|
msgstr ""
|
3814
3790
|
|
3815
|
-
#: lib/active_ldap/base.rb:
|
3791
|
+
#: lib/active_ldap/base.rb:500
|
3816
3792
|
msgid "%s doesn't belong in a hierarchy descending from ActiveLdap"
|
3817
3793
|
msgstr ""
|
3818
3794
|
|
3819
|
-
#: lib/active_ldap/base.rb:
|
3795
|
+
#: lib/active_ldap/base.rb:655
|
3820
3796
|
msgid ""
|
3821
3797
|
"'%s' must be either nil, DN value as ActiveLdap::DN, String or Array or "
|
3822
3798
|
"attributes as Hash"
|
3823
3799
|
msgstr ""
|
3824
3800
|
|
3825
|
-
#: lib/active_ldap/base.rb:
|
3801
|
+
#: lib/active_ldap/base.rb:770
|
3802
|
+
msgid "Failed to delete LDAP entry: %s"
|
3803
|
+
msgstr ""
|
3804
|
+
|
3805
|
+
#: lib/active_ldap/base.rb:789
|
3826
3806
|
msgid "entry %s can't be saved"
|
3827
3807
|
msgstr ""
|
3828
3808
|
|
3829
|
-
#: lib/active_ldap/base.rb:
|
3809
|
+
#: lib/active_ldap/base.rb:808 lib/active_ldap/base.rb:819
|
3830
3810
|
msgid "wrong number of arguments (%d for 1)"
|
3831
3811
|
msgstr ""
|
3832
3812
|
|
3833
|
-
#: lib/active_ldap/base.rb:
|
3813
|
+
#: lib/active_ldap/base.rb:940
|
3834
3814
|
msgid "Can't find DN '%s' to reload"
|
3835
3815
|
msgstr ""
|
3836
3816
|
|
3837
|
-
#: lib/active_ldap/base.rb:
|
3817
|
+
#: lib/active_ldap/base.rb:1337
|
3838
3818
|
msgid "%s's DN attribute (%s) isn't set"
|
3839
3819
|
msgstr ""
|
3840
3820
|
|
3841
|
-
#: lib/active_ldap/attributes.rb:
|
3821
|
+
#: lib/active_ldap/attributes.rb:76
|
3842
3822
|
msgid "The first argument, name, must not be nil. Please report this as a bug!"
|
3843
3823
|
msgstr ""
|
3844
3824
|
|
@@ -3864,7 +3844,7 @@ msgid ""
|
|
3864
3844
|
"Please use ActiveLdap::Connection.setup_connection instead."
|
3865
3845
|
msgstr ""
|
3866
3846
|
|
3867
|
-
#: lib/active_ldap/connection.rb:
|
3847
|
+
#: lib/active_ldap/connection.rb:229
|
3868
3848
|
msgid "since 1.1.0. "
|
3869
3849
|
msgstr ""
|
3870
3850
|
|
@@ -3958,7 +3938,7 @@ msgstr ""
|
|
3958
3938
|
msgid "%s has unprintable character: '%s'"
|
3959
3939
|
msgstr ""
|
3960
3940
|
|
3961
|
-
#: lib/active_ldap/get_text/parser.rb:
|
3941
|
+
#: lib/active_ldap/get_text/parser.rb:94
|
3962
3942
|
msgid "Ignored '%{file}'. Solve dependencies first."
|
3963
3943
|
msgstr ""
|
3964
3944
|
|
@@ -3994,37 +3974,37 @@ msgstr ""
|
|
3994
3974
|
msgid "(default: %s)"
|
3995
3975
|
msgstr ""
|
3996
3976
|
|
3997
|
-
#: benchmark/bench-al.rb:
|
3977
|
+
#: benchmark/bench-al.rb:219
|
3998
3978
|
msgid "Populating..."
|
3999
3979
|
msgstr ""
|
4000
3980
|
|
4001
|
-
#: benchmark/bench-al.rb:
|
3981
|
+
#: benchmark/bench-al.rb:276
|
4002
3982
|
msgid "Entries processed by Ruby/ActiveLdap + LDAP: %d"
|
4003
3983
|
msgstr ""
|
4004
3984
|
|
4005
|
-
#: benchmark/bench-al.rb:
|
3985
|
+
#: benchmark/bench-al.rb:277
|
4006
3986
|
msgid "Entries processed by Ruby/ActiveLdap + Net::LDAP: %d"
|
4007
3987
|
msgstr ""
|
4008
3988
|
|
4009
|
-
#: benchmark/bench-al.rb:
|
3989
|
+
#: benchmark/bench-al.rb:279
|
4010
3990
|
msgid ""
|
4011
3991
|
"Entries processed by Ruby/ActiveLdap + LDAP: (without object creation): %d"
|
4012
3992
|
msgstr ""
|
4013
3993
|
|
4014
|
-
#: benchmark/bench-al.rb:
|
3994
|
+
#: benchmark/bench-al.rb:282
|
4015
3995
|
msgid ""
|
4016
3996
|
"Entries processed by Ruby/ActiveLdap + Net::LDAP: (without object creation): "
|
4017
3997
|
"%d"
|
4018
3998
|
msgstr ""
|
4019
3999
|
|
4020
|
-
#: benchmark/bench-al.rb:
|
4000
|
+
#: benchmark/bench-al.rb:285
|
4021
4001
|
msgid "Entries processed by Ruby/LDAP: %d"
|
4022
4002
|
msgstr ""
|
4023
4003
|
|
4024
|
-
#: benchmark/bench-al.rb:
|
4004
|
+
#: benchmark/bench-al.rb:286
|
4025
4005
|
msgid "Entries processed by Net::LDAP: %d"
|
4026
4006
|
msgstr ""
|
4027
4007
|
|
4028
|
-
#: benchmark/bench-al.rb:
|
4008
|
+
#: benchmark/bench-al.rb:290
|
4029
4009
|
msgid "Cleaning..."
|
4030
4010
|
msgstr ""
|