Project

General

Profile

« Previous | Next » 

Revision f341a0de

Added by Marc Dequènes over 13 years ago

  • ID f341a0dedf880c7d60dde40f1f58db11a77b9665

[fix] correct 'root' search error handling

View differences:

lib/ldap_shadows/manipulation_helper.rb
obj_klass = shadow.get_object(obj_hdl)
item = obj_klass.find(is_root ? :first : raw_item.dn)
if item.dn == raw_item.dn
if item and item.dn == raw_item.dn
name = item.full_handle
name = "root|" + name if is_root
return {:full_handle => item.full_handle, :name => name, :item => item, :object => obj_klass, :is_root => is_root}
......
if full_handle == "root"
raw_item_dn = ActiveLdap::Base.base
raw_item = ActiveLdap::Base.find(:first, :base => raw_item_dn, :scope => :base)
raise PreProcessingError, _("Root item does not exist (even if the rest of the tree may)") unless raw_item
info = raw_item_info(shadow, raw_item, raw_item_dn)
if info.nil?
raise PreProcessingError, _("No such item 'root'")
elsif info[:object].nil?
if info[:object].nil?
raise PreProcessingError, _("Root item found, but no corresponding object defined")
else
full_handle = info[:full_handle]

Also available in: Unified diff