ucb_confluence 0.0.9 → 0.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Gemfile.lock +1 -1
- data/lib/confluence/jobs/disable_expired_users.rb +18 -3
- data/lib/confluence/version.rb +1 -1
- metadata +4 -4
data/Gemfile.lock
CHANGED
@@ -2,10 +2,14 @@
|
|
2
2
|
##
|
3
3
|
# Disables a user's Confluence account if they are considered expired.
|
4
4
|
#
|
5
|
+
# UCB ldap uids are stored as confluence username.
|
6
|
+
#
|
5
7
|
module Confluence
|
6
8
|
module Jobs
|
7
9
|
class DisableExpiredUsers
|
8
|
-
|
10
|
+
|
11
|
+
MIN_GUEST_ACCOUNT_LDAP_UID = 11000000
|
12
|
+
|
9
13
|
def initialize()
|
10
14
|
@disabled_users = []
|
11
15
|
end
|
@@ -18,13 +22,24 @@ module Confluence
|
|
18
22
|
disable_expired_users()
|
19
23
|
log_job()
|
20
24
|
end
|
21
|
-
|
25
|
+
|
26
|
+
def confluence_admin?(username)
|
27
|
+
username == "conflusa"
|
28
|
+
end
|
29
|
+
|
30
|
+
def guest_account_user?(username)
|
31
|
+
username.to_i > MIN_GUEST_ACCOUNT_LDAP_UID
|
32
|
+
end
|
33
|
+
|
22
34
|
##
|
23
35
|
# Disables any users that are expired in LDAP or are no longer in LDAP.
|
24
36
|
#
|
25
37
|
def disable_expired_users()
|
26
38
|
confluence_user_names.each do |name|
|
27
|
-
|
39
|
+
|
40
|
+
next if confluence_admin?(name)
|
41
|
+
next if guest_account_user?(name)
|
42
|
+
|
28
43
|
ldap_person = find_in_ldap(name)
|
29
44
|
|
30
45
|
if ldap_person.nil? || !eligible_for_confluence?(ldap_person)
|
data/lib/confluence/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ucb_confluence
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 11
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 10
|
10
|
+
version: 0.0.10
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Steven Hansen
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-
|
18
|
+
date: 2012-09-26 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: rake
|