README.txt in dm-ldap-adapter-0.2.0 vs README.txt in dm-ldap-adapter-0.3.0
- old
+ new
@@ -20,11 +20,11 @@
=== examples
see 'example/posix.rb' for user/group setup works with default installation of openldap on ubuntu (just change your password as needed in the code)
-the 'example/identity_maps.rb' shows the usage of identity maps, see also below.
+the 'example/identity_map.rb' shows the usage of identity maps, see also below.
== FEATURES/PROBLEMS:
* the net-ldap has some issues with not closing the connections when an exception/error got raised
@@ -86,10 +86,12 @@
select * from users where name != 'sd';
gives the same result when *all* names are `NULL` !!!
+OR conditions can be done with :conditions option but only of the form "<property_name> <comparator> <value> [or <property_name> <comparator> <value>]*" where the comparator is one of "=", "like"
+
=== multiple repositories
most probably you have to work with ldap as one repository and a database as a second repository. for me it worked best to define the `default_repository` for each model in the model itself:
class User
@@ -147,9 +149,27 @@
{:cn=>"#{group_user.group.name}", :objectclass => "posixGroup"}
end
multivalue_field :memberuid
+ end
+
+=== ldap attributes with many values
+
+let's say your LDAP has multiple email values for a users then you can define your resource class like that using the type LdapArray for such multivalue fields
+
+ class User
+ include DataMapper::Resource
+ property :id, Serial, :field => "uidnumber"
+ property :login, String, :field => "uid", :unique_index => true
+ property :mail, LdapArray
+
+ dn_prefix { |user| "uid=#{user.login}"}
+ treebase "ou=people"
+ ldap_properties do |user|
+ properties = { :objectclass => ["inetOrgPerson", "posixAccount", "shadowAccount"], :loginshell => "/bin/bash", :gidnumber => "10000" }
+ properties
+ end
end
== REQUIREMENTS:
* slf4r the logging facade