ldapmapper 1.2 → 1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/ldapmapper.rb +22 -8
- metadata +1 -1
data/lib/ldapmapper.rb
CHANGED
@@ -4,12 +4,23 @@
|
|
4
4
|
#
|
5
5
|
# == Copyright Ultragreen (c) 2005-2007
|
6
6
|
#
|
7
|
+
# * Version : 1.3
|
8
|
+
#
|
7
9
|
# == About :
|
8
10
|
#
|
9
11
|
# * Author:: Romain GEORGES
|
10
12
|
# * type:: class definition Ruby
|
11
13
|
# * obj:: Generic LDAP class
|
12
14
|
#
|
15
|
+
# == Source :
|
16
|
+
#
|
17
|
+
# * http://www.ultragreen.net
|
18
|
+
# * Projetc : http://www.ultragreen.net/projects/show/27
|
19
|
+
# * Wiki : http://www.ultragreen.net/wiki/27
|
20
|
+
# * Downloads : http://www.ultragreen.net/projects/list_files/27
|
21
|
+
# * Forum : http://www.ultragreen.net/projects/27/boards
|
22
|
+
#
|
23
|
+
#
|
13
24
|
# == Exemples :
|
14
25
|
#
|
15
26
|
# #!/usr/local/bin/ruby
|
@@ -93,7 +104,7 @@ module Ldapmapper
|
|
93
104
|
|
94
105
|
# identity lib
|
95
106
|
# version of the library
|
96
|
-
LIB_VERSION='1.
|
107
|
+
LIB_VERSION='1.3'
|
97
108
|
# name of the author
|
98
109
|
AUTHOR='Romain GEORGES'
|
99
110
|
# date of creation
|
@@ -271,11 +282,11 @@ module Ldapmapper
|
|
271
282
|
#
|
272
283
|
# return an Array
|
273
284
|
def may
|
274
|
-
|
285
|
+
_may_list = Array::new
|
275
286
|
self.list_attributs_type.each{|_key,_value|
|
276
|
-
|
287
|
+
_may_list.push(_key) if _value == 'MAY'
|
277
288
|
}
|
278
|
-
return
|
289
|
+
return _may_list
|
279
290
|
end
|
280
291
|
|
281
292
|
# return true if the must attributes is completed in record before commit!
|
@@ -431,17 +442,20 @@ module Ldapmapper
|
|
431
442
|
_schema = _conn.schema()
|
432
443
|
_list_objectclass.each{|objectclass|
|
433
444
|
if objectclass != 'top' then
|
434
|
-
|
435
|
-
_schema.
|
445
|
+
|
446
|
+
_prov_may = _schema.must(objectclass)
|
447
|
+
_prov_must = _schema.may(objectclass)
|
448
|
+
_prov_must.each{|attributs| _my_list_attributs[attributs] = 'MUST'} unless _prov_must.nil? or _prov_must.empty?
|
449
|
+
_prov_may.each{|attributs| _my_list_attributs[attributs] = 'MAY'} unless _prov_may.nil? or _prov_may.empty?
|
436
450
|
end
|
437
451
|
}
|
438
452
|
}
|
439
|
-
|
453
|
+
ensure
|
440
454
|
_my_list_attributs["dn"] = "MUST"
|
441
455
|
_my_list_attributs["objectClass"] = "MUST"
|
442
456
|
return _my_list_attributs
|
443
457
|
|
444
|
-
|
458
|
+
end
|
445
459
|
end
|
446
460
|
|
447
461
|
# map the attributs of class at run time for the current LDAP Object at precise DN
|