Project

General

Profile

Enhancement #22 » activeldap_rename_partial.patch

Marc Dequènes, 2010-08-13 12:36

View differences:

./base.rb 2010-08-13 12:11:13.000000000 +0200
prepare_data_for_saving do |data, ldap_data|
new_dn_value, attributes = collect_modified_attributes(ldap_data, data)
modify_entry(@original_dn, attributes)
if new_dn_value
if new_dn_value or @dn.to_s != @original_dn
old_dn_base = DN.parse(@original_dn).parent
new_dn_base = dn.clone.parent
if new_dn_value
rdn = "#{dn_attribute}=#{DN.escape_value(new_dn_value)}"
else
rdn = DistinguishedName.new(@dn.rdns.first).to_s
end
if old_dn_base == new_dn_base
new_superior = nil
else
new_superior = new_dn_base
end
modify_rdn_entry(@original_dn,
"#{dn_attribute}=#{DN.escape_value(new_dn_value)}",
rdn,
true,
new_superior)
end
    (1-1/1)