Revision a4aeb5ee
Added by Marc Dequènes about 15 years ago
- ID a4aeb5ee7441c8f850025b32570dc258ee298ee8
bin/shadowwalker | ||
---|---|---|
raise SyntaxError, _("no search arguments") if args.empty?
|
||
|
||
res = LdapObject.items_search_from_strings(args)
|
||
res2 = Hash[res]
|
||
puts res2.keys.sort.join("\n")
|
||
unless res.empty?
|
||
display_lines = []
|
||
Hash[res].each_pair do |item_dn, item_data|
|
||
obj_hdl = LdapObject.find_raw_item_object(item_data)
|
||
if obj_hdl
|
||
obj_klass = $ldapctl.find_klass(obj_hdl)
|
||
item = obj_klass.new(item_dn)
|
||
display_lines << "#{obj_hdl}/#{item.name}"
|
||
else
|
||
display_lines << "unknown/#{item_dn}"
|
||
end
|
||
end
|
||
puts display_lines.join("\n")
|
||
end
|
||
end
|
||
end
|
||
cmdparser.add_command(SearchCommand.new)
|
lib/ldap_shadows/object.rb | ||
---|---|---|
"(&" + ldap_search_parts.join + ")"
|
||
end
|
||
|
||
def self.find_raw_item_object(raw_item)
|
||
self.mapper.objects.each do |obj_hdl|
|
||
obj_klass = $ldapctl.find_klass(obj_hdl)
|
||
ldap_classes = obj_klass.required_classes
|
||
return obj_hdl if raw_item['objectClass'] & ldap_classes == ldap_classes
|
||
end
|
||
nil
|
||
end
|
||
|
||
def family_parent_dn
|
||
pdn = self.dn_obj.dup
|
||
pdn.shift
|
Also available in: Unified diff
[evol] recognize objects out of search result, and display them properly