Module ActiveLdap::Operations::Delete
In: lib/active_ldap/operations.rb
Error AttributeAssignmentError AdapterNotSpecified OperationNotPermitted RequiredObjectClassMissed ConnectionError RequiredAttributeMissed LdifInvalid LdapError DistinguishedNameNotSetError EntryNotFound SaveError StrongAuthenticationRequired NotImplemented 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] Base DistinguishedName Reloadable::Deprecated Reloadable::Subclasses Enumerable Ldif Collection EntryAttribute StandardError Children HasMany HasManyWrap BelongsToMany Proxy BelongsTo Normalizable Common Find LDIF Delete Update 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 LdapBenchmarking ActionController ClassMethods Associations Compatible ClassMethods Tree Acts 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 Populate Command ClassMethods Normalizable Attributes Escape GetTextSupport Update Common ModifyNameRecordLoadable AddOperationModifiable DeleteOperationModifiable ReplaceOperationModifiable ModifyRecordLoadable DeleteRecordLoadable AddRecordLoadable ContentRecordLoadable LDIF Delete Find Operations ClassMethods Configuration lib/active_ldap/get_text/parser.rb GetText ClassMethods Callbacks ClassMethods ObjectClass 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/base.rb lib/active_ldap/adapter/jndi.rb Adapter Helper GetTextFallback ClassMethods HumanReadable Salt UserPassword ClassMethods Connection ActiveLdap dot/m_45_0.png

Methods

Public Instance methods

[Source]

     # File lib/active_ldap/operations.rb, line 506
506:       def delete(targets, options={})
507:         targets = [targets] unless targets.is_a?(Array)
508:         targets = targets.collect do |target|
509:           ensure_dn_attribute(ensure_base(target))
510:         end
511:         delete_entry(targets, options)
512:       end

[Source]

     # File lib/active_ldap/operations.rb, line 524
524:       def delete_all(options_or_filter=nil, deprecated_options=nil)
525:         if deprecated_options.nil?
526:           if options_or_filter.is_a?(String)
527:             options = {:filter => options_or_filter}
528:           else
529:             options = (options_or_filter || {}).dup
530:           end
531:         else
532:           options = deprecated_options.merge(:filter => options_or_filter)
533:         end
534:         targets = search(options).collect do |dn, attributes|
535:           dn
536:         end.sort_by do |dn|
537:           dn.upcase.reverse
538:         end.reverse
539: 
540:         delete_entry(targets, options)
541:       end

[Source]

     # File lib/active_ldap/operations.rb, line 514
514:       def delete_entry(dn, options={})
515:         options[:connection] ||= connection
516:         begin
517:           options[:connection].delete(dn, options)
518:         rescue Error
519:           format = _("Failed to delete LDAP entry: <%s>: %s")
520:           raise DeleteError.new(format % [dn.inspect, $!.message])
521:         end
522:       end

[Source]

     # File lib/active_ldap/operations.rb, line 481
481:       def destroy(targets, options={})
482:         targets = [targets] unless targets.is_a?(Array)
483:         targets.each do |target|
484:           find(target, options).destroy
485:         end
486:       end

[Source]

     # File lib/active_ldap/operations.rb, line 488
488:       def destroy_all(options_or_filter=nil, deprecated_options=nil)
489:         if deprecated_options.nil?
490:           if options_or_filter.is_a?(String)
491:             options = {:filter => options_or_filter}
492:           else
493:             options = (options_or_filter || {}).dup
494:           end
495:         else
496:           options = deprecated_options.merge(:filter => options_or_filter)
497:         end
498: 
499:         find(:all, options).sort_by do |target|
500:           target.dn
501:         end.each do |target|
502:           target.destroy
503:         end
504:       end

[Validate]