diff --git a/CHANGELOG.md b/CHANGELOG.md index c187151054e0c6063be2af5a86e7772816a69b8d..125b711c8e9978b20a316e780598c6d7ef67e736 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ All notable changes to this project will be documented in this file. ## [Unreleased] +#### Fixed +* Fixed some bugs in counting isCesnetElibile for sponsored accounts ## [v2.5.1] #### Fixed diff --git a/lib/Auth/Process/IsCesnetEligible.php b/lib/Auth/Process/IsCesnetEligible.php index 103a1fb819156979f4168e24bbc3fdab9da478d5..8bed5a8dd5e8d37541e6b492a7a3912f7b6f85f8 100644 --- a/lib/Auth/Process/IsCesnetEligible.php +++ b/lib/Auth/Process/IsCesnetEligible.php @@ -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->cesnetLdapConnector = (new AdapterLdap(self::CONFIG_FILE_NAME))->getConnector(); @@ -203,6 +210,11 @@ class IsCesnetEligible extends ProcessingFilter $perunUserSponsoringOrganizations = $userAttributes[$this->userSponsoringOrganizationsAttrName] ?? []; 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; }