Revision a38e7f81
Added by Marc Dequènes over 14 years ago
- ID a38e7f811dbe45defce4076bd244c3a13504e81d
lib/ldap_shadows/activeldap_fixes.rb | ||
---|---|---|
# unfinished workaround for activeldap#26720 (not sure it would work in all cases)
|
||
def validate_required_ldap_values
|
||
_schema = nil
|
||
@validation_skip_attributes ||= []
|
||
_validation_skip_attributes =
|
||
@validation_skip_attributes +
|
||
(self.class.validation_skip_attributes || [])
|
||
# Make sure all MUST attributes have a value
|
||
entry_attribute.object_classes.each do |object_class|
|
||
object_class.must.each do |required_attribute|
|
||
... | ... | |
raise UnknownAttribute.new(required_attribute) if real_name.nil?
|
||
|
||
next if required_attribute.read_only?
|
||
next if _validation_skip_attributes.include?(real_name)
|
||
|
||
value = @data[real_name] || []
|
||
next unless self.class.blank_value?(value)
|
||
... | ... | |
format = _("%{fn} is required attribute by objectClass '%s'")
|
||
else
|
||
format = _("%{fn} is required attribute by objectClass " \
|
||
"'%s': aliases: %s")
|
||
"'%s': aliases: %s")
|
||
args << aliases.join(', ')
|
||
end
|
||
unless ActiveLdap.get_text_supported?
|
||
format = format.sub(/^%\{fn\} /, '')
|
||
end
|
||
errors.add(real_name, format % args)
|
||
end
|
||
end
|
||
end
|
||
end
|
||
end
|
||
|
||
# Duck: quick fix for #27429
|
Also available in: Unified diff
[evol] updated workaround for activeldap#26720