This repository was archived by the owner on Sep 19, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change 2
2
All notable changes to this project will be documented in this file.
3
3
4
4
## [ Unreleased]
5
+ #### Fixed
6
+ - Log error when CESNET LDAP return more than one item in getAllowedAffiliations() in IsCesnetEligible.php
5
7
6
8
## [ v2.3.0]
7
9
#### Changed
Original file line number Diff line number Diff line change @@ -193,16 +193,20 @@ private function getAllowedAffiliations($idpEntityId)
193
193
$ allowedAffiliations = [];
194
194
195
195
try {
196
- $ affiliations = $ this ->cesnetLdapConnector ->searchForEntity (
196
+ $ organization = $ this ->cesnetLdapConnector ->searchForEntity (
197
197
self ::ORGANIZATION_LDAP_BASE ,
198
198
'(entityIDofIdP= ' . $ idpEntityId . ') ' ,
199
199
['cesnetcustomeraffiliation ' ]
200
- )[ ' cesnetcustomeraffiliation ' ] ;
200
+ );
201
201
202
- if (empty ($ affiliations )) {
202
+ if (empty ($ organization )) {
203
203
Logger::debug ('cesnet:IsCesnetEligible - Received empty response from LDAP, entityId '
204
204
. $ idpEntityId . ' was probably not found. ' );
205
+ } elseif (count ($ organization ) > 1 ) {
206
+ Logger::error ('cesnet:IsCesnetEligible - Received more record from LDAP with entityId '
207
+ . $ idpEntityId . '. ' );
205
208
} else {
209
+ $ affiliations = $ organization ['cesnetcustomeraffiliation ' ];
206
210
foreach ($ affiliations as $ affiliation ) {
207
211
array_push ($ allowedAffiliations , $ affiliation );
208
212
}
You can’t perform that action at this time.
0 commit comments