ruby-activeldap 0.5.5 → 0.5.7
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/activeldap/associations.rb +9 -1
- data/lib/activeldap/base.rb +7 -5
- data/lib/activeldap.rb +1 -1
- metadata +3 -3
@@ -107,8 +107,16 @@ module ActiveLDAP
|
|
107
107
|
end
|
108
108
|
results = []
|
109
109
|
@data["#{key}"].each do |item|
|
110
|
+
fkey = ""
|
111
|
+
if foreign_key == "dn" and not item.empty?
|
112
|
+
fkey = item.split(',')[0].split('=')[0]
|
113
|
+
item = item.split(',')[0].split('=')[1]
|
114
|
+
end
|
110
115
|
# This will even yield entries that don't necessarily exist
|
111
|
-
|
116
|
+
if foreign_key != "dn"
|
117
|
+
fkey = foreign_key
|
118
|
+
end
|
119
|
+
#{klass}.find_all(:attribute => fkey, :value => item, :objects => objects).each do |match|
|
112
120
|
results << match
|
113
121
|
end
|
114
122
|
end
|
data/lib/activeldap/base.rb
CHANGED
@@ -497,9 +497,7 @@ module ActiveLDAP
|
|
497
497
|
end
|
498
498
|
|
499
499
|
@data = {} # where the r/w entry data is stored
|
500
|
-
@data.default = []
|
501
500
|
@ldap_data = {} # original ldap entry data
|
502
|
-
@ldap_data.default = []
|
503
501
|
@attr_methods = {} # list of valid method calls for attributes used for dereferencing
|
504
502
|
|
505
503
|
# Break val apart if it is a dn
|
@@ -624,7 +622,10 @@ module ActiveLDAP
|
|
624
622
|
@data['objectClass'].each do |objc|
|
625
623
|
@must.each do |req_attr|
|
626
624
|
deref = @attr_methods[req_attr]
|
627
|
-
if
|
625
|
+
# Set default if it wasn't yet set.
|
626
|
+
@data[deref] = [] if @data[deref].nil?
|
627
|
+
# Check for missing requirements.
|
628
|
+
if @data[deref].empty?
|
628
629
|
raise AttributeEmpty,
|
629
630
|
"objectClass '#{objc}' requires attribute '#{Base.schema.attribute_aliases(req_attr).join(', ')}'"
|
630
631
|
end
|
@@ -867,9 +868,7 @@ module ActiveLDAP
|
|
867
868
|
end
|
868
869
|
|
869
870
|
@data = {} # where the r/w entry data is stored
|
870
|
-
@data.default = []
|
871
871
|
@ldap_data = {} # original ldap entry data
|
872
|
-
@ldap_data.default = []
|
873
872
|
@attr_methods = {} # list of valid method calls for attributes used for dereferencing
|
874
873
|
|
875
874
|
# Get some attributes
|
@@ -1165,6 +1164,9 @@ module ActiveLDAP
|
|
1165
1164
|
|
1166
1165
|
attr = @attr_methods[method]
|
1167
1166
|
|
1167
|
+
# Set the default value to empty if attr is not set.
|
1168
|
+
@data[attr] = [] if @data[attr].nil?
|
1169
|
+
|
1168
1170
|
# Return a copy of the stored data
|
1169
1171
|
return array_of(@data[attr].dup, false) if not_array
|
1170
1172
|
return @data[attr]
|
data/lib/activeldap.rb
CHANGED
metadata
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
|
-
rubygems_version: 0.8.
|
2
|
+
rubygems_version: 0.8.10
|
3
3
|
specification_version: 1
|
4
4
|
name: ruby-activeldap
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.5.
|
7
|
-
date: 2005-
|
6
|
+
version: 0.5.7
|
7
|
+
date: 2005-05-24
|
8
8
|
summary: Ruby/ActiveLDAP is a object-oriented API to LDAP
|
9
9
|
require_paths:
|
10
10
|
- lib
|