Sha256: 26462cd692e14635169bffafec633fd741ff0dd4d66c67e4e546ea7155eb8cf8

Contents?: true

Size: 1.3 KB

Versions: 10

Compression:

Stored size: 1.3 KB

Contents

= ActiveLdap plugin for Ruby on Rails

== Setup

You need to write RAILS_ROOT/config/ldap.yml like the following:

  development:
    host: 127.0.0.1
    port: 389
    base: dc=devel,dc=local,dc=net
    bind_dn: cn=admin,dc=local,dc=net
    password: secret

  test:
    host: 127.0.0.1
    port: 389
    base: dc=test,dc=local,dc=net
    bind_dn: cn=admin,dc=local,dc=net
    password: secret

  production:
    host: 127.0.0.1
    port: 389
    base: dc=production,dc=local,dc=net
    bind_dn: cn=admin,dc=local,dc=net
    password: secret

== Model

Here is some examples.

app/model/member.rb:
  class Member < ActiveLdap::Base
    ldap_mapping :dn_attribute => 'uid',
                  :classes => ['person', 'posixAccount']
    belongs_to :primary_group, :class => "Group",
               :foreign_key => "gidNumber", :primary_key => "gidNumber"
    belongs_to :groups, :many => 'memberUid'
  end

app/model/group.rb:
  class Group < ActiveLdap::Base
    ldap_mapping :dn_attribute => "cn", :classes => ['posixGroup']
    has_many :members, :wrap => "memberUid"
    has_many :primary_members,
             :foreign_key => 'gidNumber',
             :primary_key => 'gidNumber'
  end

app/model/ou.rb:
  class Ou < ActiveLdap::Base
    ldap_mapping :prefix => "",
                 :classes => ["top", "organizationalUnit"]
  end

Version data entries

10 entries across 9 versions & 2 rubygems

Version Path
activeldap-1.0.0 rails/plugin/active_ldap/README
activeldap-0.9.0 rails/plugin/active_ldap/README
activeldap-0.10.0 rails/plugin/active_ldap/README
activeldap-1.0.1 rails/plugin/active_ldap/README
activeldap-1.0.2 rails/README
activeldap-1.0.2 rails/plugin/active_ldap/README
ruby-activeldap-0.8.2 rails/plugin/active_ldap/README
ruby-activeldap-0.8.3.1 rails/plugin/active_ldap/README
ruby-activeldap-0.8.1 rails/plugin/active_ldap/README
ruby-activeldap-0.8.0 rails/plugin/active_ldap/README