Module ActiveLdap::Helper
In: lib/active_ldap/helper.rb
Error AttributeAssignmentError AdapterNotSpecified OperationNotPermitted RequiredObjectClassMissed ConnectionError RequiredAttributeMissed LdifInvalid DistinguishedNameNotSetError EntryNotFound LdapError 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 HasManyWrap HasMany BelongsToMany Proxy BelongsTo Normalizable Common Find LDIF Delete Update ActiveRecord::Callbacks GetText Parser 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 ActiveRecord::Validations 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 ClassMethods Normalizable Attributes Update Common ModifyNameRecordLoadable AddOperationModifiable DeleteOperationModifiable ReplaceOperationModifiable ModifyRecordLoadable DeleteRecordLoadable AddRecordLoadable ContentRecordLoadable LDIF Delete Find Operations GetTextSupport Escape ClassMethods Configuration ClassMethods ObjectClass ClassMethods Callbacks lib/active_ldap/get_text/parser.rb GetText 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 Validations GetTextFallback Helper ClassMethods HumanReadable Salt UserPassword ClassMethods Connection ActiveLdap dot/m_46_0.png

Methods

Public Instance methods

la_(attribute)
lad_(attribute)

[Source]

    # File lib/active_ldap/helper.rb, line 8
 8:     def ldap_attribute_description_gettext(attribute)
 9:       Base.human_attribute_description(attribute)
10:     end

[Source]

   # File lib/active_ldap/helper.rb, line 3
3:     def ldap_attribute_name_gettext(attribute)
4:       Base.human_attribute_name(attribute)
5:     end

[Source]

    # File lib/active_ldap/helper.rb, line 33
33:     def ldap_field(type, object_name, method, options={})
34:       case type
35:       when "radio_button", "check_box", "text_area"
36:         form_method = type
37:       else
38:         form_method = "#{type}_field"
39:       end
40: 
41:       object = options[:object]
42:       if object.nil?
43:         normalized_object_name = object_name.to_s.sub(/\[\](\])?$/, "\\1")
44:         object = instance_variable_get("@#{normalized_object_name}")
45:       end
46:       values = object.nil? ? nil : object[method, true]
47:       values = [nil] if values.blank?
48:       required_ldap_options = options.delete(:ldap_options) || []
49:       required_ldap_options.each do |required_ldap_option|
50:         found = false
51:         values.each do |value|
52:           next unless value.is_a?(Hash)
53:           if Hash.to_a[0].to_s == required_ldap_option.to_s
54:             found = true
55:             break
56:           end
57:         end
58:         values << {required_ldap_option => ""} unless found
59:       end
60: 
61:       fields = []
62:       collect_values = Proc.new do |value, ldap_options|
63:         case value
64:         when Hash
65:           value.each do |k, v|
66:             collect_values.call(v, ldap_options + [k])
67:           end
68:         when Array
69:           value.each do |v|
70:             collect_values.call(v, ldap_options)
71:           end
72:         else
73:           id = "#{object_name}_#{method}"
74:           name = "#{object_name}[#{method}][]"
75:           ldap_options.collect.each do |ldap_option|
76:             id << "_#{ldap_option}"
77:             name << "[#{ldap_option}][]"
78:           end
79:           ldap_value_options = {:id => id, :name => name, :value => value}
80:           field = send(form_method, object_name, method,
81:                        ldap_value_options.merge(options))
82:            if block_given?
83:              field = yield(field, {:options => ldap_options, :value => value})
84:            end
85:           fields << field unless field.blank?
86:         end
87:       end
88:       collect_values.call(values, [])
89:       fields.join("\n")
90:     end

[Source]

    # File lib/active_ldap/helper.rb, line 18
18:     def ldap_object_class_description_gettext(object_class)
19:       Base.human_object_class_description(object_class)
20:     end

[Source]

    # File lib/active_ldap/helper.rb, line 13
13:     def ldap_object_class_name_gettext(object_class)
14:       Base.human_object_class_name(object_class)
15:     end

[Source]

    # File lib/active_ldap/helper.rb, line 28
28:     def ldap_syntax_description_gettext(syntax)
29:       Base.human_syntax_description(syntax)
30:     end

[Source]

    # File lib/active_ldap/helper.rb, line 23
23:     def ldap_syntax_name_gettext(syntax)
24:       Base.human_syntax_name(syntax)
25:     end
loc_(object_class)
locd_(object_class)
ls_(syntax)
lsd_(syntax)

[Validate]