Module ActiveLdap::Operations::Update
In: lib/active_ldap/operations.rb
Error DeleteError LdapError AdapterNotSpecified OperationNotPermitted RequiredAttributeMissed LdifInvalid AttributeAssignmentError RequiredObjectClassMissed DistinguishedNameNotSetError StrongAuthenticationRequired ConnectionError SaveError EntryNotFound AuthenticationError EntryNotSaved UnknownAttribute ConnectionNotEstablished TimeoutError ConfigurationError AdapterNotFound DistinguishedNameInvalid ObjectClassError EntryInvalid EntryAlreadyExist Base DistinguishedName Ldif Reloadable::Deprecated Reloadable::Subclasses Enumerable Collection StandardError Children HasMany HasManyWrap BelongsToMany Proxy BelongsTo Common Find LDIF Delete Update GetText Parser GetTextSupport Base\n[lib/active_ldap/adapter/base.rb\nlib/active_ldap/adapter/ldap.rb\nlib/active_ldap/adapter/net_ldap.rb] Ldap NetLdap Normalize ActiveRecord::Callbacks ActiveRecord::Validations Schema\n[lib/active_ldap/schema.rb\nlib/active_ldap/schema/syntaxes.rb] lib/active_ldap/base.rb lib/active_ldap/schema.rb lib/active_ldap/ldif.rb lib/active_ldap/distinguished_name.rb lib/active_ldap/ldap_error.rb ClassMethods Associations ClassMethods HumanReadable lib/active_ldap/association/has_many_wrap.rb lib/active_ldap/association/has_many.rb lib/active_ldap/association/proxy.rb lib/active_ldap/association/children.rb lib/active_ldap/association/collection.rb lib/active_ldap/association/belongs_to_many.rb lib/active_ldap/association/belongs_to.rb HasManyUtils Association ClassMethods Tree Acts Common LDIF Delete Find Update Operations lib/active_ldap/get_text/parser.rb GetText ClassMethods Configuration Command lib/active_ldap/adapter/net_ldap.rb lib/active_ldap/adapter/ldap.rb Adapter GetTextSupport Normalize ClassMethods Attributes Escape Callbacks ClassMethods ObjectClass Helper Validations ClassMethods Connection GetTextFallback Populate Salt UserPassword ActiveLdap dot/m_40_0.png

Methods

Public Instance methods

[Source]

     # File lib/active_ldap/operations.rb, line 372
372:       def add_entry(dn, attributes, options={})
373:         unnormalized_attributes = attributes.collect do |type, key, value|
374:           [type, key, unnormalize_attribute(key, value)]
375:         end
376:         options[:connection] ||= connection
377:         options[:connection].add(dn, unnormalized_attributes, options)
378:       end

[Source]

     # File lib/active_ldap/operations.rb, line 380
380:       def modify_entry(dn, attributes, options={})
381:         unnormalized_attributes = attributes.collect do |type, key, value|
382:           [type, key, unnormalize_attribute(key, value)]
383:         end
384:         options[:connection] ||= connection
385:         options[:connection].modify(dn, unnormalized_attributes, options)
386:       end

[Source]

     # File lib/active_ldap/operations.rb, line 388
388:       def update(dn, attributes, options={})
389:         if dn.is_a?(Array)
390:           i = -1
391:           dns = dn
392:           dns.collect do |dn|
393:             i += 1
394:             update(dn, attributes[i], options)
395:           end
396:         else
397:           object = find(dn, options)
398:           object.update_attributes(attributes)
399:           object
400:         end
401:       end

[Source]

     # File lib/active_ldap/operations.rb, line 403
403:       def update_all(attributes, filter=nil, options={})
404:         search_options = options.dup
405:         if filter
406:           if filter.is_a?(String) and /[=\(\)&\|]/ !~ filter
407:             search_options = search_options.merge(:value => filter)
408:           else
409:             search_options = search_options.merge(:filter => filter)
410:           end
411:         end
412:         targets = search(search_options).collect do |dn, attrs|
413:           dn
414:         end
415: 
416:         unnormalized_attributes = attributes.collect do |name, value|
417:           normalized_name, normalized_value = normalize_attribute(name, value)
418:           [:replace, normalized_name,
419:            unnormalize_attribute(normalized_name, normalized_value)]
420:         end
421:         options[:connection] ||= connection
422:         conn = options[:connection]
423:         targets.each do |dn|
424:           conn.modify(dn, unnormalized_attributes, options)
425:         end
426:       end

[Validate]