Project

General

Profile

« Previous | Next » 

Revision 70b17bfa

Added by Marc Dequènes over 14 years ago

  • ID 70b17bfae38dcac0b3ddd3c0b19b1ee5496b166c

[evol] apply password hash if requested

View differences:

lib/ldap_shadows/elements/object.rb
self.family_siblings.collect {|obj| obj.dn }
end
def modified_attributes
def modified_attributes(op_types = nil, att_only = false)
list = []
prepare_data_for_saving do |data, ldap_data|
list = collect_modified_attributes(ldap_data, data)
false
end
unless op_types.nil?
list.reject! do |mod_info|
op_type, att, new_val = mod_info
not op_types.include? op_type
end
end
if att_only
list.collect! do |mod_info|
op_type, att, new_val = mod_info
att
end
end
list
end
......
def before_save_jobs
check_hooks_before(:save)
check_missing_attributes
check_password
end
def before_delete_jobs
......
end
end
def check_password
return unless self.modified_attributes([:replace], true).include? 'userPassword'
hash_func = self.class.config.global_config[:password_hash]
return if hash_func.nil?
self.userPassword = ActiveLdap::UserPassword.send(hash_func, self.userPassword)
end
def after_save_jobs
check_hooks_after(:save)
end

Also available in: Unified diff