lib/activeldap.rb in ruby-activeldap-0.5.4 vs lib/activeldap.rb in ruby-activeldap-0.5.5

- old
+ new

@@ -6,11 +6,11 @@ # == Introduction # # Ruby/ActiveLDAP is a novel way of interacting with LDAP. Most interaction with # LDAP is done using clunky LDIFs, web interfaces, or with painful APIs that # required a thick reference manual nearby. Ruby/ActiveLDAP aims to fix that. -# Inspired by ActiveRecord[http://activerecord.rubyonrails.org], Ruby/ActiveLDAP provides an +# Inspired by ActiveRecord[http://activerecord.rubyonrails.com], Ruby/ActiveLDAP provides an # object oriented interface to LDAP entries. # # The target audience is system administrators and LDAP users everywhere that # need quick, clean access to LDAP in Ruby. # @@ -24,12 +24,12 @@ # assume some familiarity with using LDAP as a centralized authentication and # authorization server for Unix systems. (Unfortunately, I've yet to try this # against Microsoft's ActiveDirectory, despite what the name implies.) # # Further reading: -# * RFC1777[http://www.faqs.org/rfcs/rfc1777.html] - Lightweight Directory Access Protocol -# * OpenLDAP[http://www.openldap.org] +# * RFC1777[http://www.faqs.com/rfcs/rfc1777.html] - Lightweight Directory Access Protocol +# * OpenLDAP[http://www.openldap.com] # # === So why use Ruby/ActiveLDAP? # # Well if you like to fumble around in the dark, dank innards of LDAP, you can # quit reading now. However, if you'd like a cleaner way to integrate LDAP in to @@ -48,22 +48,22 @@ # only install the package and all of it's requirements, but you must also make # customizations that will let it work in your environment. # # === Requirements # -# * Ruby[http://www.ruby-lang.org] 1.8.x -# * Ruby/LDAP[http://ruby-ldap.sourceforge.net] -# * Log4r[http://log4r.sourceforge.net] -# * (Optional) Ruby/LDAP+GSSAPI[http://caliban.org/files/redhat/RPMS/i386/ruby-ldap-0.8.2-4.i386.rpm] -# * An LDAP server compatible with Ruby/LDAP: OpenLDAP[http://www.openldap.org], etc +# * Ruby[http://www.ruby-lang.com] 1.8.x +# * Ruby/LDAP[http://ruby-ldap.sourcefcome.net] +# * Log4r[http://log4r.sourcefcome.net] +# * (Optional) Ruby/LDAP+GSSAPI[http://caliban.com/files/redhat/RPMS/i386/ruby-ldap-0.8.2-4.i386.rpm] +# * An LDAP server compatible with Ruby/LDAP: OpenLDAP[http://www.openldap.com], etc # - Your LDAP server must allow root_dse queries to allow for schema queries -# * Examples also require: Ruby/Password[http://raa.ruby-lang.org/project/ruby-password/] +# * Examples also require: Ruby/Password[http://raa.ruby-lang.com/project/ruby-password/] # # === Installation # # Assuming all the requirements are installed, you can install by grabbing the latest tgz file from -# the download site[http://projects.dataspill.org/libraries/ruby/activeldap/download.html]. +# the download site[http://projects.example.com/libraries/ruby/activeldap/download.html]. # # The following steps will get the Ruby/ActiveLDAP installed in no time! # # $ tar -xzvf ruby-activeldap-current.tgz # $ cd ruby-activeldap-VERSION @@ -181,27 +181,27 @@ # end # # As you can see, this method is used for defining how this class maps in to LDAP. Let's say that # my LDAP tree looks something like this: # -# * dc=dataspill,dc=org -# |- ou=People,dc=dataspill,dc=org -# |+ ou=Groups,dc=dataspill,dc=org +# * dc=example,dc=com +# |- ou=People,dc=example,dc=com +# |+ ou=Groups,dc=example,dc=com # \ -# |- cn=develop,ou=Groups,dc=dataspill,dc=org -# |- cn=root,ou=Groups,dc=dataspill,dc=org +# |- cn=develop,ou=Groups,dc=example,dc=com +# |- cn=root,ou=Groups,dc=example,dc=com # |- ... # # Under ou=People I store user objects, and under ou=Groups, I store group # objects. What |ldap_mapping| has done is mapped the class in to the LDAP tree # abstractly. With the given :dnattr and :prefix, it will only work for entries -# under ou=Groups,dc=dataspill,dc=org using the primary attribute 'cn' as the +# under ou=Groups,dc=example,dc=com using the primary attribute 'cn' as the # beginning of the distinguished name. # # Just for clarity, here's how the arguments map out: # -# cn=develop,ou=Groups,dc=dataspill,dc=org +# cn=develop,ou=Groups,dc=example,dc=com # ^^ ^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^ # :dnattr | | # :prefix | # :base from configuration.rb # @@ -231,15 +231,15 @@ # # This method allows an extension class to make use of other extension classes # tying objects together across the LDAP tree. Often, user objects will be # members of, or belong_to, Group objects. # -# * dc=dataspill,dc=org -# |+ ou=People,dc=dataspill,dc=org +# * dc=example,dc=com +# |+ ou=People,dc=example,dc=com # \ -# |- uid=drewry,ou=People,dc=dataspill,dc=org -# |- ou=Groups,dc=dataspill,dc=org +# |- uid=drewry,ou=People,dc=example,dc=com +# |- ou=Groups,dc=example,dc=com # # # In the above tree, one such example would be user 'drewry' who is a part of the # group 'develop'. You can see this by looking at the 'memberUid' field of 'develop'. # @@ -383,11 +383,11 @@ # irrespetive of LDAP mapping data. This is meant to be useful as a utility method # to cover 80% of the cases where a user would want to use Base.connection directly. # # irb> Base.search(:base => 'dc=example,dc=com', :filter => '(uid=roo*)', # :scope => LDAP::LDAP_SCOPE_SUBTREE, :attrs => ['uid', 'cn']) -# => [{"dn"=>"uid=root,ou=People,dc=dataspill,dc=org","cn"=>["root"], "uidNumber"=>["0"]}] +# => [{"dn"=>"uid=root,ou=People,dc=example,dc=com","cn"=>["root"], "uidNumber"=>["0"]}] # You can specify the :filter, :base, :scope, and :attrs, but they all have defaults -- # * :filter defaults to objectClass=* - usually this isn't what you want # * :base defaults to the base of the class this is executed from (as set in ldap_mapping) # * :scope defaults to LDAP::LDAP_SCOPE_SUBTREE. Usually you won't need to change it # * :attrs defaults to [] and is the list of attrs you want back. Empty means all of them. @@ -441,14 +441,14 @@ # Base.connect() if these is no active LDAP connection. If your server allows # anonymous binding, and you only want to access data in a read-only fashion, you # won't need to call Base.connect. Here is a fully parameterized call: # # Base.connect( -# :host => 'ldap.dataspill.org', +# :host => 'ldap.example.com', # :port => 389, -# :base => 'dc=dataspill,dc=org', -# :bind_format => "uid=%s,ou=People,dc=dataspill,dc=org", +# :base => 'dc=example,dc=com', +# :bind_format => "uid=%s,ou=People,dc=example,dc=com", # :logger => log4r_obj, # :user => 'drewry', # :password_block => Proc.new { 'password12345' }, # :allow_anonymous => false, # :try_sasl => false @@ -905,10 +905,10 @@ require 'activeldap/associations' require 'activeldap/configuration' require 'activeldap/schema2' module ActiveLDAP - VERSION = "0.5.4" + VERSION = "0.5.5" end ActiveLDAP::Base.class_eval do include ActiveLDAP::Configuration include ActiveLDAP::Associations