Revision 2bd92292
Added by Marc Dequènes about 15 years ago
- ID 2bd92292f8692c53b98ab68897904f9eb244ca01
bin/shadowwalker | ||
---|---|---|
locale = ENV['LANGUAGE'] || ENV['LC_ALL'] || ENV['LC_MESSAGES'] || ENV['LANG']
|
||
|
||
require 'ldap_shadows'
|
||
require 'ldap_shadows/display_utils'
|
||
require 'ldap_shadows/display_helper'
|
||
require 'ldap_shadows/manipulation_helper'
|
||
require 'cmdparse2'
|
||
|
||
include LdapShadows
|
||
... | ... | |
|
||
obj_klass, item = params_shift_item_handle_full_handle(args)
|
||
|
||
modification_done = false
|
||
args.each do |mod_info|
|
||
mod_done = item.item_modify_from_string(mod_info)
|
||
modification_done ||= mod_done
|
||
end
|
||
modification_done = LdapShadows::Manipulation.item_modify_from_strings(item, args)
|
||
|
||
if modification_done
|
||
item.save!
|
||
... | ... | |
item = obj_klass.new(item_hdl)
|
||
item.base = loc_item.dn_obj - obj_klass.base_obj
|
||
|
||
|
||
modification_done = false
|
||
args.each do |mod_info|
|
||
mod_done = item.item_modify_from_string(mod_info)
|
||
modification_done ||= mod_done
|
||
end
|
||
modification_done = LdapShadows::Manipulation.item_modify_from_strings(item, args)
|
||
|
||
item.save!
|
||
puts "Creation done."
|
||
... | ... | |
|
||
raise SyntaxError, _("no search arguments") if args.empty?
|
||
|
||
res = Elements::LdapObject.items_find_from_strings($shadow, args)
|
||
res = LdapShadows::Manipulation.items_find_from_strings($shadow, args)
|
||
unless res.empty?
|
||
display_lines = []
|
||
res.each do |raw_item|
|
||
display_lines << Elements::LdapObject.raw_item_info($shadow, raw_item)[:name]
|
||
display_lines << LdapShadows::Manipulation.raw_item_info($shadow, raw_item)[:name]
|
||
end
|
||
puts display_lines.join("\n")
|
||
end
|
Also available in: Unified diff
[cleanup] moved helper things out of LdapObject in Manipulation and began sweeping dust