lita-activedirectory 0.2.3 → 0.2.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8de315c678f7820e8cb6191fa6879d8039d6b98f
4
- data.tar.gz: 217e82c55ddb9258aefaa348bf25995bfd568b5c
3
+ metadata.gz: 08485dbe161fadc4b33a407554004bef9abdaaa6
4
+ data.tar.gz: eef09887231db2d23732984911374d6045efc453
5
5
  SHA512:
6
- metadata.gz: 758c3742af13a513eb65d6e0a8f1f7f0e90c2bd187ad44e167a2968567b096131768bf43bd70be06a82b45adcb57b56ca4ff5044a1539d7e1c00ae521d13eee7
7
- data.tar.gz: 53a6ad9ee77b474447769f2e163134e3c616bd721f1ff5eb354f70e95206f49a05a329d4783f2178f81cecd9841e4da2211096d906f1b355c19a64edf440668c
6
+ metadata.gz: f4f758acc794da870b4a9a6038ea826c8e254fca42e1e32fda16b0b98d1b5747d0cc227b0a4bed609b2c6480a9780a267dc6b470c90807ac2b35643bc20ed94d
7
+ data.tar.gz: eebbe685f1433fdd77886369fac3c02f7ec64c3265ab27abd1ceaa6d89646e2d77a227729c34a40fe1c307c3c337d9e762426a44454e874c6883687610ed8988
@@ -6,6 +6,7 @@ module Lita
6
6
  config :port, required: true, type: Integer, default: 389
7
7
  config :basedn, required: true, type: String
8
8
  config :user_basedn, required: true, type: String
9
+ config :group_basedn, required: true, type: String
9
10
  config :username, required: true, type: String
10
11
  config :password, required: true, type: String
11
12
 
@@ -53,7 +54,13 @@ module Lita
53
54
  user = response.matches[0][0]
54
55
  response.reply_with_mention(t('replies.user_groups.working'))
55
56
  group_results = user_groups_query(user)
56
- handle_user_group_query(response, user, group_results)
57
+ if group_results.nil?
58
+ response.reply_with_mention(
59
+ t('replies.user_groups.error', user: user)
60
+ )
61
+ else
62
+ response.reply group_results
63
+ end
57
64
  end
58
65
 
59
66
  private
@@ -75,23 +82,6 @@ module Lita
75
82
  end
76
83
  end
77
84
 
78
- def handle_user_query(response, user, result)
79
- case result
80
- when true
81
- response.reply_with_mention(
82
- t('replies.user_locked?.locked', user: user)
83
- )
84
- when false
85
- response.reply_with_mention(
86
- t('replies.user_locked?.notlocked', user: user)
87
- )
88
- when nil
89
- response.reply_with_mention(
90
- t('replies.user_locked?.error', user: user)
91
- )
92
- end
93
- end
94
-
95
85
  def handle_unlock_query(response, user, result)
96
86
  case result
97
87
  when true
@@ -32,7 +32,7 @@ module Utils
32
32
  nil
33
33
  end
34
34
  groups = user.member_of
35
- groups.each(&:name)
35
+ groups.map(&:name).join("\n")
36
36
  end
37
37
 
38
38
  def unlock_user(username)
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = 'lita-activedirectory'
3
- spec.version = '0.2.3'
3
+ spec.version = '0.2.4'
4
4
  spec.authors = ['Daniel Schaaff']
5
5
  spec.email = ['dschaaff@knuedge.com']
6
6
  spec.description = 'ldap/active directory instructions for Lita'
data/locales/en.yml CHANGED
@@ -10,7 +10,7 @@ en:
10
10
  syntax: unlock <username>
11
11
  desc: unlocks an active directory user account
12
12
  user_groups:
13
- syntax: <username> user_groups
13
+ syntax: <username> groups
14
14
  desc: lists all group memberships for the given username
15
15
  replies:
16
16
  user_locked?:
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lita-activedirectory
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Schaaff