Skip to content
Snippets Groups Projects
Unverified Commit 89796335 authored by Pavel Vyskočil's avatar Pavel Vyskočil
Browse files

Fixed some bugs in counting isCesnetElibile

* Fixed some bugs in counting isCesnetElibile for sponsored accounts:
** Show warning in case of one attributes has not been defined
** Log info in case of one of the received values from Perun has an empty value
parent 6c7e9a7f
Branches
Tags
No related merge requests found
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
## [Unreleased] ## [Unreleased]
#### Fixed
* Fixed some bugs in counting isCesnetElibile for sponsored accounts
## [v2.5.1] ## [v2.5.1]
#### Fixed #### Fixed
......
...@@ -78,6 +78,13 @@ class IsCesnetEligible extends ProcessingFilter ...@@ -78,6 +78,13 @@ class IsCesnetEligible extends ProcessingFilter
); );
} }
if (isset($this->userAffiliationsAttrName, $this->userSponsoringOrganizationsAttrName)) {
Logger::warning(
'cesnet:IsCesnetEligible - One of attributes [' . $this->userAffiliationsAttrName . ', ' .
$this->userSponsoringOrganizationsAttrName . '] wasn\'t set!'
);
}
$this->rpcAttrName = $config[self::RPC_ATTRIBUTE_NAME]; $this->rpcAttrName = $config[self::RPC_ATTRIBUTE_NAME];
$this->cesnetLdapConnector = (new AdapterLdap(self::CONFIG_FILE_NAME))->getConnector(); $this->cesnetLdapConnector = (new AdapterLdap(self::CONFIG_FILE_NAME))->getConnector();
...@@ -203,6 +210,11 @@ class IsCesnetEligible extends ProcessingFilter ...@@ -203,6 +210,11 @@ class IsCesnetEligible extends ProcessingFilter
$perunUserSponsoringOrganizations = $userAttributes[$this->userSponsoringOrganizationsAttrName] ?? []; $perunUserSponsoringOrganizations = $userAttributes[$this->userSponsoringOrganizationsAttrName] ?? [];
if (empty($perunUserAffiliations) || empty($perunUserSponsoringOrganizations)) { if (empty($perunUserAffiliations) || empty($perunUserSponsoringOrganizations)) {
Logger::debug(
'cesnet:IsCesnetEligible - One of attributes [' . $this->userAffiliationsAttrName . ':' .
$perunUserAffiliations . ', ' . print_r($this->userSponsoringOrganizationsAttrName, true).
':' . print_r($perunUserSponsoringOrganizations, true) . '] has empty value!'
);
return false; return false;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment