whimsy-asf 0.0.55 → 0.0.56
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/asf.version +1 -1
- data/lib/whimsy/asf/ldap.rb +17 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 961e38d7670aa8de1653fc6426211ee309711744
|
4
|
+
data.tar.gz: a8ee1c7363c5354af325aa2976931479314ac4d3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ab5f7223a0e79078549f894851a21c83b7687bf5d6b008783b87b68ec2e61769284f0949e823bcfafa72b5e5fcf4eb814b9e09159350f6410f6e56ae9845eb7f
|
7
|
+
data.tar.gz: 541009a8ea27f5f469c900f6d246abdf17eaab3e762714d9dcb9aa330de8d4caff9d96380d2f69a209a3693da18ecb951d5b235e14326383940472b7ea4f144b
|
data/asf.version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.56
|
data/lib/whimsy/asf/ldap.rb
CHANGED
@@ -287,10 +287,26 @@ module ASF
|
|
287
287
|
ASF.search_one(base, filter, 'cn').flatten
|
288
288
|
end
|
289
289
|
|
290
|
+
def dn
|
291
|
+
"cn=#{id},#{self.class.base}"
|
292
|
+
end
|
293
|
+
|
290
294
|
def members
|
291
295
|
ASF.search_one(base, "cn=#{name}", 'member').flatten.
|
292
296
|
map {|uid| Person.find uid[/uid=(.*?),/,1]}
|
293
297
|
end
|
298
|
+
|
299
|
+
def remove(people)
|
300
|
+
people = Array(people).map(&:dn)
|
301
|
+
mod = ::LDAP::Mod.new(::LDAP::LDAP_MOD_DELETE, 'member', people)
|
302
|
+
ASF.ldap.modify(self.dn, [mod])
|
303
|
+
end
|
304
|
+
|
305
|
+
def add(people)
|
306
|
+
people = Array(people).map(&:dn)
|
307
|
+
mod = ::LDAP::Mod.new(::LDAP::LDAP_MOD_ADD, 'member', people)
|
308
|
+
ASF.ldap.modify(self.dn, [mod])
|
309
|
+
end
|
294
310
|
end
|
295
311
|
|
296
312
|
module LDAP
|
@@ -301,6 +317,7 @@ module ASF
|
|
301
317
|
else
|
302
318
|
ASF.ldap.bind(dn, password)
|
303
319
|
end
|
320
|
+
ASF.init_ldap
|
304
321
|
end
|
305
322
|
|
306
323
|
# select LDAP host
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: whimsy-asf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.56
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sam Ruby
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-09-
|
11
|
+
date: 2015-09-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|