activeldap/activeldap@4a54dd4 [master] Add :include_operational_attributes convenient option

0 views
Skip to first unread message

Kouhei Sutou

unread,
Jan 16, 2018, 10:17:43 AM1/16/18
to activeld...@googlegroups.com
Author
Kouhei Sutou <k...@clear-code.com>
Date
2018-01-17 00:15:47 +0900 (Wed, 17 Jan 2018)
New Revision
4a54dd4a8392b5c23a5772f80dad441f9366a0bd
Message
Add :include_operational_attributes convenient option

GitHub: fix #150

Reported by jas01. Thanks!!!
Modified files
  Modified: lib/active_ldap/operations.rb (+3 -0)
===================================================================
...
291
292
293
 
 
 
294
295
296
...
291
292
293
294
295
296
297
298
299
@@ -291,6 +291,9 @@ module ActiveLdap
         offset = options.delete(:offset) || offset
         options[:attributes] = options.delete(:attributes) || ['*']
         options[:attributes] |= ['objectClass']
+        if options.delete(:include_operational_attributes)
+          options[:attributes] |= ["+"]
+        end
         results = search(options).collect do |dn, attrs|
           instantiate([dn, attrs, {:connection => options[:connection]}])
         end
  Modified: test/test_find.rb (+2 -1)
===================================================================
...
63
64
65
66
 
 
67
68
69
...
63
64
65
 
66
67
68
69
70
@@ -63,7 +63,8 @@ class TestFind < Test::Unit::TestCase
 
   def test_find_operational_attributes
     make_temporary_user do |user, password|
-      found_user = @user_class.find(user.uid, :attributes => ["*", "+"])
+      found_user = @user_class.find(user.uid,
+                                    :include_operational_attributes => true)
       assert_equal(Time.now.utc.iso8601,
                    found_user.modify_timestamp.utc.iso8601)
     end
Reply all
Reply to author
Forward
0 new messages