Class Index [+]

Quicksearch

ActiveSambaLdap::GroupEntry::ClassMethods

Public Instance Methods

find_by_gid_number(number) click to toggle source

(Not documented)

# File lib/active_samba_ldap/group_entry.rb, line 32
      def find_by_gid_number(number)
        find(:first, :filter => ["gidNumber", Integer(number)])
      end
find_by_name_or_gid_number(key) click to toggle source

(Not documented)

# File lib/active_samba_ldap/group_entry.rb, line 19
      def find_by_name_or_gid_number(key)
        group = nil
        begin
          gid_number = Integer(key)
          group = find_by_gid_number(gid_number)
          raise GidNumberDoesNotExist.new(gid_number) if group.nil?
        rescue ArgumentError
          raise GroupDoesNotExist.new(key) unless exists?(key)
          group = find(key)
        end
        group
      end
ldap_mapping(options={}) click to toggle source

(Not documented)

# File lib/active_samba_ldap/group_entry.rb, line 13
      def ldap_mapping(options={})
        options = default_options.merge(options)
        super(extract_ldap_mapping_options(options))
        init_associations(options)
      end
unix_object_classes() click to toggle source

(Not documented)

# File lib/active_samba_ldap/group_entry.rb, line 36
      def unix_object_classes
        if samba4?
          samba_object_classes
        else
          ["posixGroup"]
        end
      end

Private Instance Methods

default_computer_class() click to toggle source

(Not documented)

# File lib/active_samba_ldap/group_entry.rb, line 67
      def default_computer_class
        "Computer"
      end
default_options() click to toggle source

(Not documented)

# File lib/active_samba_ldap/group_entry.rb, line 45
      def default_options
        {
          :dn_attribute => "cn",
          :prefix => configuration[:groups_suffix],
          :classes => default_classes,
          :recommended_classes => default_recommended_classes,

          :members_wrap => "memberUid",
          :users_class => default_user_class,
          :computers_class => default_computer_class,

          :primary_members_foreign_key => "gidNumber",
          :primary_members_primary_key => "gidNumber",
          :primary_users_class => default_user_class,
          :primary_computers_class => default_computer_class,
        }
      end
default_user_class() click to toggle source

(Not documented)

# File lib/active_samba_ldap/group_entry.rb, line 63
      def default_user_class
        "User"
      end
init_associations(options) click to toggle source

(Not documented)

# File lib/active_samba_ldap/group_entry.rb, line 71
      def init_associations(options)
        association_options = {}
        options.each do |key, value|
          case key.to_s
          when /^((?:primary_)?(?:(?:user|computer|member)s))_/
            association_options[$1] ||= {}
            association_options[$1][$POSTMATCH.to_sym] = value
          end
        end

        members_opts = association_options["members"] || {}
        user_members_opts = association_options["users"] || {}
        computer_members_opts = association_options["computers"] || {}
        has_many :users, members_opts.merge(user_members_opts)
        has_many :computers, members_opts.merge(computer_members_opts)

        primary_members_opts = association_options["primary_members"] || {}
        primary_user_members_opts =
          association_options["primary_users"] || {}
        primary_computer_members_opts =
          association_options["primary_computers"] || {}
        has_many :primary_users,
                 primary_members_opts.merge(primary_user_members_opts)
        has_many :primary_computers,
                 primary_members_opts.merge(primary_computer_members_opts)
      end
prepare_create_options(group, options) click to toggle source

(Not documented)

# File lib/active_samba_ldap/group_entry.rb, line 98
      def prepare_create_options(group, options)
        prepare_create_options_for_number("gid_number", group, options)
      end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.