ucb_confluence 0.0.9 → 0.0.10

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ucb_confluence (0.0.8)
4
+ ucb_confluence (0.0.10)
5
5
  rake (= 0.8.7)
6
6
  ucb_ldap (>= 1.4.2)
7
7
 
@@ -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
- next if name == "conflusa"
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)
@@ -1,3 +1,3 @@
1
1
  module Confluence
2
- VERSION = "0.0.9"
2
+ VERSION = "0.0.10"
3
3
  end
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: 13
4
+ hash: 11
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 9
10
- version: 0.0.9
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-04-25 00:00:00 Z
18
+ date: 2012-09-26 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: rake