cratus 0.2.4 → 0.2.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cratus/user.rb +17 -1
- data/lib/cratus/version.rb +1 -1
- 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: 95854c5b9a4fc245547081d9a0b87b59c68262d8
|
4
|
+
data.tar.gz: 2a74ec2d2bc5078a22217315b55c7c6679109023
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: db3ae770253d2b97fbb5dacf1b75d63c4fe886fba393bf03e8639e059b0a0a30daaef64f9251827a912bd2d11c3a0c4c28493b3e004ccd92e9efe6cbcca283b4
|
7
|
+
data.tar.gz: c6c2563ed6498dbb4dd6f495d79c4863d2910a6d7a1d3e9480c03d17732cb3ccc8bba248ef4b58fe27a0e81bde50f9392848e697c6d1c0808c851571bca2ee83
|
data/lib/cratus/user.rb
CHANGED
@@ -34,8 +34,24 @@ module Cratus
|
|
34
34
|
@raw_ldap_data[Cratus.config.user_lockout_attribute].last
|
35
35
|
end
|
36
36
|
|
37
|
+
# https://fossies.org/linux/web2ldap/pylib/w2lapp/schema/plugins/activedirectory.py
|
38
|
+
# https://msdn.microsoft.com/en-us/library/windows/desktop/ms676843(v=vs.85).aspx
|
39
|
+
#
|
37
40
|
def locked?
|
38
|
-
lockouttime
|
41
|
+
return false if lockouttime == '0'
|
42
|
+
epoch = 116_444_736_000_000_000
|
43
|
+
current = Time.now.to_i * 10_000_000
|
44
|
+
current - (lockouttime - epoch) < lockoutduration
|
45
|
+
end
|
46
|
+
|
47
|
+
def lockoutduration
|
48
|
+
raw_results = Cratus::LDAP.search(
|
49
|
+
'(objectClass=domain)',
|
50
|
+
basedn: Cratus.config.basedn,
|
51
|
+
attrs: 'lockoutDuration',
|
52
|
+
scope: 'object'
|
53
|
+
).last
|
54
|
+
Integer(raw_results[:lockoutduration].last) * -1
|
39
55
|
end
|
40
56
|
|
41
57
|
def member_of
|
data/lib/cratus/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cratus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonathan Gnagy
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-11-
|
12
|
+
date: 2016-11-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: colorize
|