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

Methods

Public Instance methods

[Source]

     # File lib/active_ldap/operations.rb, line 516
516:       def add_entry(dn, attributes, options={})
517:         unnormalized_attributes = attributes.collect do |key, value|
518:           [:add, key, unnormalize_attribute(key, value)]
519:         end
520:         options[:connection] ||= connection
521:         options[:connection].add(dn, unnormalized_attributes, options)
522:       end

[Source]

     # File lib/active_ldap/operations.rb, line 524
524:       def modify_entry(dn, attributes, options={})
525:         return if attributes.empty?
526:         unnormalized_attributes = attributes.collect do |type, key, value|
527:           [type, key, unnormalize_attribute(key, value)]
528:         end
529:         options[:connection] ||= connection
530:         options[:connection].modify(dn, unnormalized_attributes, options)
531:       end

[Source]

     # File lib/active_ldap/operations.rb, line 533
533:       def modify_rdn_entry(dn, new_rdn, delete_old_rdn, new_superior, options={})
534:         options[:connection] ||= connection
535:         options[:connection].modify_rdn(dn, new_rdn, delete_old_rdn,
536:                                         new_superior, options)
537:       end

[Source]

     # File lib/active_ldap/operations.rb, line 539
539:       def update(dn, attributes, options={})
540:         if dn.is_a?(Array)
541:           i = -1
542:           dns = dn
543:           dns.collect do |_dn|
544:             i += 1
545:             update(_dn, attributes[i], options)
546:           end
547:         else
548:           object = find(dn, options)
549:           object.update_attributes(attributes)
550:           object
551:         end
552:       end

[Source]

     # File lib/active_ldap/operations.rb, line 554
554:       def update_all(attributes, filter=nil, options={})
555:         search_options = options.dup
556:         if filter
557:           if filter.is_a?(String) and /[=\(\)&\|]/ !~ filter
558:             search_options = search_options.merge(:value => filter)
559:           else
560:             search_options = search_options.merge(:filter => filter)
561:           end
562:         end
563:         targets = search(search_options).collect do |dn, attrs|
564:           dn
565:         end
566: 
567:         unnormalized_attributes = attributes.collect do |name, value|
568:           normalized_name, normalized_value = normalize_attribute(name, value)
569:           [:replace, normalized_name,
570:            unnormalize_attribute(normalized_name, normalized_value)]
571:         end
572:         options[:connection] ||= connection
573:         conn = options[:connection]
574:         targets.each do |dn|
575:           conn.modify(dn, unnormalized_attributes, options)
576:         end
577:       end

[Validate]