active_directory_login 0.1.7 → 0.1.8

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: 2f372c1224af276b1408eea08fe1a6a363df35a7
4
- data.tar.gz: 270a0f4d03a14e50e6c92fe7597bb95ebd7a9302
3
+ metadata.gz: 63b9cf4eecc7eaf6e94dc82d3b6dd506ce6e9b02
4
+ data.tar.gz: 039ab17cd271f16b8ce4ac32d0b0c9fca292b3a4
5
5
  SHA512:
6
- metadata.gz: fd69338bb3db4393900f8d642b81f698af5f6644e2b6181ea4d697b169029d66589d6607b3f6b3bf3e69113a26c3b96c9249ac46766d634b02de8cc76c5525dc
7
- data.tar.gz: cb0bdae8e08b77978043cb73016a0c6b1f032b5b96cb1e627c671d0cd29c734e92a96ebc86a3ea47351a06f619fb725f5123afdfd5cc743d8dbddf52e48c5a72
6
+ metadata.gz: 71891b137ac6431cb7622dd5a79a8b7cc86ab22e880607e58148f27a332150b5a99d6ef439e95b6ccc61cc26865d2ec399f99806630c6ca0c77a5fafb683f0d3
7
+ data.tar.gz: 471b431e92ff88b5caad28cdc840c1ad5ffc97acf3fc55e04bb508f09e6cd37477c1fbdea59ac7f438f456793764e247cd9c60ad950f86c0a90c37f1f6a39eaf
@@ -172,7 +172,7 @@ module ActiveDirectoryLogin
172
172
 
173
173
  # update staff
174
174
  staff_group = find_group(staff_dn)
175
- staff_member_names = staff_group.member.map { |u| u.sAMAccountName.downcase }
175
+ staff_member_names = (staff_group[:member] || []).map { |u| u.sAMAccountName.downcase }
176
176
 
177
177
  # users not flagged as staff in docgenie but in AD staff group
178
178
  allowed = User.where(staff: false).where("lower(username) IN (:names)", { names: staff_member_names })
@@ -196,9 +196,10 @@ module ActiveDirectoryLogin
196
196
  staff_created_names = pending
197
197
 
198
198
 
199
+
199
200
  ## update superuser
200
201
  superuser_group = find_group(superuser_dn)
201
- superuser_member_names = superuser_group.member.map { |u| u.sAMAccountName.downcase } - staff_member_names
202
+ superuser_member_names = (superuser_group[:member] || []).map { |u| u.sAMAccountName.downcase } - staff_member_names
202
203
 
203
204
  allowed = User.where(staff: false).where("lower(username) IN (:names)", { names: superuser_member_names })
204
205
  allowed.update_all(superuser: true)
@@ -223,7 +224,7 @@ module ActiveDirectoryLogin
223
224
 
224
225
  ## update users
225
226
  user_group = find_group(user_dn)
226
- member_names = user_group.member.map { |u| u.sAMAccountName.downcase }
227
+ member_names = (user_group[:member] || []).map { |u| u.sAMAccountName.downcase }
227
228
  member_names = member_names - superuser_member_names - staff_member_names
228
229
 
229
230
  allowed = User.where(staff: false, superuser: false).where.not(locked_at: nil).where("lower(username) IN (:names)", { names: member_names })
@@ -1,3 +1,3 @@
1
1
  module ActiveDirectoryLogin
2
- VERSION = "0.1.7"
2
+ VERSION = "0.1.8"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_directory_login
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brad Murray
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-03 00:00:00.000000000 Z
11
+ date: 2014-09-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler