openaccess-apc 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/openaccess/apc/version.rb +1 -1
- data/lib/openaccess/apc.rb +3 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c7586d3504dbc05753219a917ddfb3a5bb291cee
|
4
|
+
data.tar.gz: acfdfc03743136f6abdbedd5a16d106fd835e325
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f72b1e5f906952088bcae00e6e51df2b1bc0a250e2ad75bbf5a6d8ff89afc34734c0c39a81bfa1a79cec9c980eb4e859558cee6a8c043a8d3e761fb74952dd9d
|
7
|
+
data.tar.gz: 20f41df5cce18bc86912289f35bf5841943de3324b28883cfa4509d98afb1740af07d33294d594b5a809b31bf2a05c929fc17471a809a2c8d4672b5a1f86e774
|
data/lib/openaccess/apc.rb
CHANGED
@@ -172,8 +172,8 @@ module OpenAccess
|
|
172
172
|
# Returns the Pure person UUID given a network username
|
173
173
|
# @param username [String] the network username
|
174
174
|
# @return [String] the Pure UUID of the corresponding person
|
175
|
-
def self.person(username = nil)
|
176
|
-
employee_id
|
175
|
+
def self.person(username = nil, employee_id: nil)
|
176
|
+
employee_id ||= person_employee_id(username)
|
177
177
|
person = @person_extractor.find_by_id(employee_id: employee_id)
|
178
178
|
return person.uuid unless person.nil?
|
179
179
|
raise UserNotFound, 'No user for employee ID: ' \
|
@@ -203,6 +203,7 @@ module OpenAccess
|
|
203
203
|
# @return [Net::LDAP] the LDAP instance
|
204
204
|
def self.configure_ldap
|
205
205
|
conf = @config[:ldap]
|
206
|
+
return nil unless conf
|
206
207
|
Net::LDAP.new(host: conf[:host], port: conf[:port], auth: conf[:auth])
|
207
208
|
end
|
208
209
|
private_class_method :configure_ldap
|