Revision 020c18fe
Added by Marc Dequènes about 15 years ago
- ID 020c18fef17a781c2687cf73c9fcf02865432fb0
bin/shadowwalker | ||
---|---|---|
|
||
require 'ldap_shadows'
|
||
require 'ldap_shadows/display_helper'
|
||
require 'ldap_shadows/manipulation_helper'
|
||
require 'cmdparse2'
|
||
|
||
include LdapShadows
|
||
... | ... | |
raise SyntaxError, _("no %s given") % name if args.empty?
|
||
|
||
full_handle = args.shift
|
||
m = LdapShadows::Elements::LdapObject.looks_like_full_handle?(full_handle)
|
||
m = LdapShadows::Manipulation.looks_like_full_handle?(full_handle)
|
||
raise SyntaxError, _("bad %s") % name unless m
|
||
obj_hdl = m[1].downcase
|
||
obj_hdl = m[1]
|
||
item_hdl = m[2]
|
||
|
||
split_args = [obj_hdl, item_hdl]
|
||
obj_klass = params_shift_object_handle(split_args)
|
||
if fetch_item
|
||
item = params_shift_item_handle(obj_klass, split_args)
|
||
[obj_klass, item]
|
||
item = LdapShadows::Manipulation.find_item_by_full_handle($shadow, full_handle)
|
||
[item.class, item]
|
||
else
|
||
obj_klass = params_shift_object_handle([obj_hdl])
|
||
[obj_klass, item_hdl]
|
||
end
|
||
end
|
Also available in: Unified diff
[fix/cleanup] handle the 'root' element better (even if ActiveLdap seems not to behave properly with the root DSA)