whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject [whimsy] branch master updated: Can be useful to obtain ids without full details
Date Wed, 11 Jul 2018 23:28:53 GMT
This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git


The following commit(s) were added to refs/heads/master by this push:
     new fd0b5bf  Can be useful to obtain ids without full details
fd0b5bf is described below

commit fd0b5bf7b83593fbe1ae163d3ce667305cad3920
Author: Sebb <sebb@apache.org>
AuthorDate: Thu Jul 12 00:28:51 2018 +0100

    Can be useful to obtain ids without full details
---
 lib/whimsy/asf/ldap.rb | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/lib/whimsy/asf/ldap.rb b/lib/whimsy/asf/ldap.rb
index cd1a7c8..a541300 100644
--- a/lib/whimsy/asf/ldap.rb
+++ b/lib/whimsy/asf/ldap.rb
@@ -661,6 +661,12 @@ module ASF
       ASF.search_one(base, filter, 'uid').flatten.map {|uid| find(uid)}
     end
 
+    # Obtain a list of people (ids) known to LDAP.  LDAP filters may be used
+    # to retrieve only a subset. Result is returned as a list of ids only.
+    def self.listids(filter='uid=*')
+      ASF.search_one(base, filter, 'uid').flatten
+    end
+
     # pre-fetch a given set of attributes, for a given list of people
     def self.preload(attributes, people=[])
       list = Hash.new {|hash, name| hash[name] = find(name)}


Mime
View raw message