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

Merge pull request #44 from vyskocilpavel/fix_iscesneteligible

fix: fix duplicate or unused consts
parents 762e5468 ef595e0a
No related branches found
No related tags found
No related merge requests found
...@@ -7,14 +7,10 @@ namespace SimpleSAML\Module\cesnet\Auth\Process; ...@@ -7,14 +7,10 @@ namespace SimpleSAML\Module\cesnet\Auth\Process;
use SimpleSAML\Auth\ProcessingFilter; use SimpleSAML\Auth\ProcessingFilter;
use SimpleSAML\Configuration; use SimpleSAML\Configuration;
use SimpleSAML\Error\Exception; use SimpleSAML\Error\Exception;
use SimpleSAML\Error\Exception;
use SimpleSAML\Logger;
use SimpleSAML\Logger; use SimpleSAML\Logger;
use SimpleSAML\Module; use SimpleSAML\Module;
use SimpleSAML\Module\perun\Adapter; use SimpleSAML\Module\perun\Adapter;
use SimpleSAML\Module\perun\AdapterLdap; use SimpleSAML\Module\perun\AdapterLdap;
use SimpleSAML\Module\perun\AdapterLdap;
use SimpleSAML\Module\perun\AdapterRpc;
use SimpleSAML\Module\perun\AdapterRpc; use SimpleSAML\Module\perun\AdapterRpc;
use SimpleSAML\Module\perun\ChallengeManager; use SimpleSAML\Module\perun\ChallengeManager;
use SimpleSAML\Module\perun\LdapConnector; use SimpleSAML\Module\perun\LdapConnector;
...@@ -48,26 +44,6 @@ class IsCesnetEligible extends ProcessingFilter ...@@ -48,26 +44,6 @@ class IsCesnetEligible extends ProcessingFilter
public const SCRIPT_NAME = 'updateIsCesnetEligible'; public const SCRIPT_NAME = 'updateIsCesnetEligible';
public const INTERFACE_PROPNAME = 'interface';
public const ATTR_NAME = 'attrName';
public const RPC_ATTRIBUTE_NAME = 'RPC.attributeName';
public const LDAP_ATTRIBUTE_NAME = 'LDAP.attributeName';
public const DEFAULT_ATTR_NAME = 'isCesnetEligibleLastSeen';
public const LDAP = 'LDAP';
public const RPC = 'RPC';
public const SCRIPT_NAME = 'updateIsCesnetEligible';
public const PATH_TO_KEY = 'pathToKey';
public const SIGNATURE_ALG = 'signatureAlg';
public const PERUN_USER_AFFILIATIONS_ATTR_NAME = 'perunUserAffiliationsAttrName'; public const PERUN_USER_AFFILIATIONS_ATTR_NAME = 'perunUserAffiliationsAttrName';
public const PERUN_USER_SPONSORING_ORGANIZATIONS_ATTR_NAME = 'perunUserSponsoringOrganizationsAttrName'; public const PERUN_USER_SPONSORING_ORGANIZATIONS_ATTR_NAME = 'perunUserSponsoringOrganizationsAttrName';
...@@ -173,15 +149,6 @@ class IsCesnetEligible extends ProcessingFilter ...@@ -173,15 +149,6 @@ class IsCesnetEligible extends ProcessingFilter
); );
} }
$isHostelVerified = false;
if ($request['saml:sp:IdP'] === self::HOSTEL_ENTITY_ID &&
isset($request['Attributes']['loa'])
&& (int) $request['Attributes']['loa'][0] === 2
) {
$isHostelVerified = true;
Logger::debug('cesnet:IsCesnetEligible - The user was verified by Hostel.');
}
if (! empty($user)) { if (! empty($user)) {
if ($this->interface === self::LDAP) { if ($this->interface === self::LDAP) {
$attrs = $this->adapter->getUserAttributes($user, [$this->ldapAttrName]); $attrs = $this->adapter->getUserAttributes($user, [$this->ldapAttrName]);
...@@ -196,7 +163,7 @@ class IsCesnetEligible extends ProcessingFilter ...@@ -196,7 +163,7 @@ class IsCesnetEligible extends ProcessingFilter
} }
} }
if ($isHostelVerified || (! empty($this->eduPersonScopedAffiliation) && $this->isCesnetEligible($user))) { if (! empty($this->eduPersonScopedAffiliation) && $this->isCesnetEligible($user)) {
$this->cesnetEligibleLastSeenValue = date('Y-m-d H:i:s'); $this->cesnetEligibleLastSeenValue = date('Y-m-d H:i:s');
if (! empty($user)) { if (! empty($user)) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment