diff --git a/config-templates/module_cesnet_IsCesnetEligible.php b/config-templates/module_cesnet_IsCesnetEligible.php index cd07a6b86f64fc29eba105597cac352dda4bc6d5..f4b90141a304391a3ca6bfa70b4596511d1efc19 100644 --- a/config-templates/module_cesnet_IsCesnetEligible.php +++ b/config-templates/module_cesnet_IsCesnetEligible.php @@ -1,13 +1,14 @@ <?php -declare(strict_types=1); - /** * This is example configuration of SimpleSAMLphp cesnet module IsCecsnetEligible. Copy this file to default config * directory and edit the properties. * * copy command (from SimpleSAML base dir) cp modules/perun/module_cesnet_IsCesnetEligible.php config/ */ + +declare(strict_types=1); + $config = [ /* * hostname of CESNET ldap with ldap(s):// at the beginning. diff --git a/lib/Auth/Process/ComputeLoA.php b/lib/Auth/Process/ComputeLoA.php index 8103bb9b65494a361411b26f80b2e31c64267848..1b1116474c278e7dc67d8c58c65375bab377ae4a 100644 --- a/lib/Auth/Process/ComputeLoA.php +++ b/lib/Auth/Process/ComputeLoA.php @@ -102,16 +102,18 @@ class ComputeLoA extends \SimpleSAML\Auth\ProcessingFilter } if ($this->entityCategory === self::UNIVERSITY) { foreach ($this->eduPersonScopedAffiliation as $affiliation) { - if (preg_match( - '/(^employee@.+\.cz$)|' . - '(^faculty@.+\.cz$)|' . - '(^member@.+\.cz$)|' . - '(^student@.+\.cz$)|' . - '(^staff@.+\.cz$)|' . - '(^alum@.+\.cz$)/', - $affiliation, - $matches - )) { + if ( + preg_match( + '/(^employee@.+\.cz$)|' . + '(^faculty@.+\.cz$)|' . + '(^member@.+\.cz$)|' . + '(^student@.+\.cz$)|' . + '(^staff@.+\.cz$)|' . + '(^alum@.+\.cz$)/', + $affiliation, + $matches + ) + ) { return 2; } } diff --git a/lib/Auth/Process/IsCesnetEligible.php b/lib/Auth/Process/IsCesnetEligible.php index 9c5dae2da7ce866ac6087233b46ac3b3151327d5..f7d0124d943b6baf2d1bc16b1aabb75fb54b7017 100644 --- a/lib/Auth/Process/IsCesnetEligible.php +++ b/lib/Auth/Process/IsCesnetEligible.php @@ -100,8 +100,10 @@ class IsCesnetEligible extends ProcessingFilter $this->returnAttrName = $config['attrName']; } - if (isset($config[self::INTERFACE_PROPNAME], $config[self::LDAP_ATTRIBUTE_NAME]) && - $config[self::INTERFACE_PROPNAME] === self::LDAP && !empty($config[self::LDAP_ATTRIBUTE_NAME])) { + if ( + isset($config[self::INTERFACE_PROPNAME], $config[self::LDAP_ATTRIBUTE_NAME]) && + $config[self::INTERFACE_PROPNAME] === self::LDAP && !empty($config[self::LDAP_ATTRIBUTE_NAME]) + ) { $this->interface = $config[self::INTERFACE_PROPNAME]; $this->ldapAttrName = $config[self::LDAP_ATTRIBUTE_NAME]; $this->adapter = Adapter::getInstance(Adapter::LDAP); @@ -196,10 +198,12 @@ class IsCesnetEligible extends ProcessingFilter } $request['Attributes']['isCesnetEligible'] = ['false']; - if (($this->cesnetEligibleLastSeenValue !== null) && $this->cesnetEligibleLastSeenValue > date( - 'Y-m-d H:i:s', - strtotime('-1 year') - )) { + if ( + ($this->cesnetEligibleLastSeenValue !== null) && $this->cesnetEligibleLastSeenValue > date( + 'Y-m-d H:i:s', + strtotime('-1 year') + ) + ) { $request['Attributes']['isCesnetEligible'] = ['true']; Logger::debug('cesnet:IsCesnetEligible - Attribute isCesnetEligible was set to true.'); } diff --git a/themes/cesnet/default/includes/footer.php b/themes/cesnet/default/includes/footer.php index fd99bb039242ec2d7757b4898c7ab00e8d22899c..363fff6a67d33bb8790aadb47117fb2b706791f3 100644 --- a/themes/cesnet/default/includes/footer.php +++ b/themes/cesnet/default/includes/footer.php @@ -1,4 +1,6 @@ -<?php declare(strict_types=1); +<?php + +declare(strict_types=1); use SimpleSAML\Module; diff --git a/themes/cesnet/default/includes/header.php b/themes/cesnet/default/includes/header.php index 9675720ec7ce3a043639cd7b65a93c9030550fa7..deb504821488c1652d84a781f123b54fa8957e74 100644 --- a/themes/cesnet/default/includes/header.php +++ b/themes/cesnet/default/includes/header.php @@ -1,4 +1,6 @@ -<?php declare(strict_types=1); +<?php + +declare(strict_types=1); use SimpleSAML\Module; use SimpleSAML\Utils\HTTP; diff --git a/themes/cesnet/perun/disco-tpl.php b/themes/cesnet/perun/disco-tpl.php index 56c8b39856f70a1704a009ddc05b48e98cab5e7b..be69fa83c3059a32c649b55188614d3b0be66d25 100644 --- a/themes/cesnet/perun/disco-tpl.php +++ b/themes/cesnet/perun/disco-tpl.php @@ -82,31 +82,34 @@ if ($idpEntityId !== null) { } $url = $this->getContinueUrlWithoutIdPEntityId(); - if ($warningAttributes->isEnabled()) { - if ($warningAttributes->getType() === WarningConfiguration::WARNING_TYPE_INFO) { - echo '<div class="alert alert-info">'; - } elseif ($warningAttributes->getType() === WarningConfiguration::WARNING_TYPE_WARNING) { - echo '<div class="alert alert-warning">'; - } elseif ($warningAttributes->getType() === WarningConfiguration::WARNING_TYPE_ERROR) { - echo '<div class="alert alert-danger">'; - } - echo '<h4> <strong>' . $warningAttributes->getTitle() . '</strong> </h4>'; - echo $warningAttributes->getText(); - echo '</div>'; - if (in_array( +if ($warningAttributes->isEnabled()) { + if ($warningAttributes->getType() === WarningConfiguration::WARNING_TYPE_INFO) { + echo '<div class="alert alert-info">'; + } elseif ($warningAttributes->getType() === WarningConfiguration::WARNING_TYPE_WARNING) { + echo '<div class="alert alert-warning">'; + } elseif ($warningAttributes->getType() === WarningConfiguration::WARNING_TYPE_ERROR) { + echo '<div class="alert alert-danger">'; + } + echo '<h4> <strong>' . $warningAttributes->getTitle() . '</strong> </h4>'; + echo $warningAttributes->getText(); + echo '</div>'; + if ( + in_array( $warningAttributes->getType(), [WarningConfiguration::WARNING_TYPE_INFO, WarningConfiguration::WARNING_TYPE_WARNING], true - )) { - echo '<form method="POST">'; - echo '<input class="btn btn-lg btn-primary btn-block" type="submit" name="continue" value="Continue" />'; - echo '</form>'; - } - } else { - $canContinue = true; + ) + ) { + echo '<form method="POST">'; + echo '<input class="btn btn-lg btn-primary btn-block" type="submit" name="continue" value="Continue" />'; + echo '</form>'; } +} else { + $canContinue = true; +} - if ($canContinue && +if ( + $canContinue && ( !$warningAttributes->isEnabled() || in_array( @@ -114,34 +117,35 @@ if ($idpEntityId !== null) { [WarningConfiguration::WARNING_TYPE_INFO, WarningConfiguration::WARNING_TYPE_WARNING], true ) - )) { - if ($efilter !== null) { - header('Location: https://ds.eduid.cz/wayf.php' . $url . '&efilter=' . $efilter); - exit; - } - if ($filter !== null) { - header('Location: https://ds.eduid.cz/wayf.php' . $url . '&filter=' . $filter); - exit; - } - if (isset($this->data['originalsp']['efilter'])) { - $efilter = $this->data['originalsp']['efilter']; - header('Location: https://ds.eduid.cz/wayf.php' . $url . '&efilter=' . $efilter); - exit; - } - if (isset($this->data['originalsp']['filter'])) { - $filter = $this->data['originalsp']['filter']; - header('Location: https://ds.eduid.cz/wayf.php' . $url . '&filter=' . $filter); - exit; - } - if ($defaultEFilter !== null) { - header('Location: https://ds.eduid.cz/wayf.php' . $url . '&efilter=' . $defaultEFilter); - exit; - } - if ($defaultFilter !== null) { - header('Location: https://ds.eduid.cz/wayf.php' . $url . '&filter=' . $defaultFilter); - exit; - } - throw new Exception('cesnet:disco-tpl: Filter did not set. '); + ) +) { + if ($efilter !== null) { + header('Location: https://ds.eduid.cz/wayf.php' . $url . '&efilter=' . $efilter); + exit; + } + if ($filter !== null) { + header('Location: https://ds.eduid.cz/wayf.php' . $url . '&filter=' . $filter); + exit; + } + if (isset($this->data['originalsp']['efilter'])) { + $efilter = $this->data['originalsp']['efilter']; + header('Location: https://ds.eduid.cz/wayf.php' . $url . '&efilter=' . $efilter); + exit; } + if (isset($this->data['originalsp']['filter'])) { + $filter = $this->data['originalsp']['filter']; + header('Location: https://ds.eduid.cz/wayf.php' . $url . '&filter=' . $filter); + exit; + } + if ($defaultEFilter !== null) { + header('Location: https://ds.eduid.cz/wayf.php' . $url . '&efilter=' . $defaultEFilter); + exit; + } + if ($defaultFilter !== null) { + header('Location: https://ds.eduid.cz/wayf.php' . $url . '&filter=' . $defaultFilter); + exit; + } + throw new Exception('cesnet:disco-tpl: Filter did not set. '); +} $this->includeAtTemplateBase('includes/footer.php'); diff --git a/themes/einfra/core/loginuserpass.php b/themes/einfra/core/loginuserpass.php index 8372ced71fc72ea475dbaeb16a76fe77d45ee50d..3944e69c9b1ba475cfda0c1ff4d3ede76a9f4b88 100644 --- a/themes/einfra/core/loginuserpass.php +++ b/themes/einfra/core/loginuserpass.php @@ -1,4 +1,6 @@ -<?php declare(strict_types=1); +<?php + +declare(strict_types=1); $this->data['header'] = $this->t('{cesnet:einfra:user_pass_header}'); @@ -112,21 +114,21 @@ if ($this->data['errorcode'] !== null) { $selectedOrg = null; } - foreach ($this->data['organizations'] as $orgId => $orgDesc) { - if (is_array($orgDesc)) { - $orgDesc = $this->t($orgDesc); - } + foreach ($this->data['organizations'] as $orgId => $orgDesc) { + if (is_array($orgDesc)) { + $orgDesc = $this->t($orgDesc); + } - if ($orgId === $selectedOrg) { - $selected = 'selected="selected" '; - } else { - $selected = ''; - } + if ($orgId === $selectedOrg) { + $selected = 'selected="selected" '; + } else { + $selected = ''; + } - echo '<option ' . + echo '<option ' . $selected . 'value="' . htmlspecialchars($orgId) . '">' . htmlspecialchars($orgDesc) . '</option>'; - } ?> + } ?> </select> </div> </div> diff --git a/themes/einfra/default/includes/footer.php b/themes/einfra/default/includes/footer.php index debb0e45e09626169dd8c79e88e90e4d5ae28a6f..f85005ff3792d740704a14dfd4014de2c04180c1 100644 --- a/themes/einfra/default/includes/footer.php +++ b/themes/einfra/default/includes/footer.php @@ -1,4 +1,6 @@ -<?php declare(strict_types=1); +<?php + +declare(strict_types=1); use SimpleSAML\Module; diff --git a/themes/einfra/default/includes/header.php b/themes/einfra/default/includes/header.php index c9d421af3eb103d47c07ffd3bcbe6f2c1b54ae7b..52a5a563259d2762e18b0e34ff422c76f8726fd2 100644 --- a/themes/einfra/default/includes/header.php +++ b/themes/einfra/default/includes/header.php @@ -1,11 +1,14 @@ -<?php declare(strict_types=1); +<?php + +declare(strict_types=1); use SimpleSAML\Module; use SimpleSAML\Utils\HTTP; -/** +/* * Support the htmlinject hook, which allows modules to change header, pre and post body on all pages. */ + $this->data['htmlinject'] = [ 'htmlContentPre' => [], 'htmlContentPost' => [], diff --git a/themes/einfra/perun/disco-tpl.php b/themes/einfra/perun/disco-tpl.php index 56c8b39856f70a1704a009ddc05b48e98cab5e7b..be69fa83c3059a32c649b55188614d3b0be66d25 100644 --- a/themes/einfra/perun/disco-tpl.php +++ b/themes/einfra/perun/disco-tpl.php @@ -82,31 +82,34 @@ if ($idpEntityId !== null) { } $url = $this->getContinueUrlWithoutIdPEntityId(); - if ($warningAttributes->isEnabled()) { - if ($warningAttributes->getType() === WarningConfiguration::WARNING_TYPE_INFO) { - echo '<div class="alert alert-info">'; - } elseif ($warningAttributes->getType() === WarningConfiguration::WARNING_TYPE_WARNING) { - echo '<div class="alert alert-warning">'; - } elseif ($warningAttributes->getType() === WarningConfiguration::WARNING_TYPE_ERROR) { - echo '<div class="alert alert-danger">'; - } - echo '<h4> <strong>' . $warningAttributes->getTitle() . '</strong> </h4>'; - echo $warningAttributes->getText(); - echo '</div>'; - if (in_array( +if ($warningAttributes->isEnabled()) { + if ($warningAttributes->getType() === WarningConfiguration::WARNING_TYPE_INFO) { + echo '<div class="alert alert-info">'; + } elseif ($warningAttributes->getType() === WarningConfiguration::WARNING_TYPE_WARNING) { + echo '<div class="alert alert-warning">'; + } elseif ($warningAttributes->getType() === WarningConfiguration::WARNING_TYPE_ERROR) { + echo '<div class="alert alert-danger">'; + } + echo '<h4> <strong>' . $warningAttributes->getTitle() . '</strong> </h4>'; + echo $warningAttributes->getText(); + echo '</div>'; + if ( + in_array( $warningAttributes->getType(), [WarningConfiguration::WARNING_TYPE_INFO, WarningConfiguration::WARNING_TYPE_WARNING], true - )) { - echo '<form method="POST">'; - echo '<input class="btn btn-lg btn-primary btn-block" type="submit" name="continue" value="Continue" />'; - echo '</form>'; - } - } else { - $canContinue = true; + ) + ) { + echo '<form method="POST">'; + echo '<input class="btn btn-lg btn-primary btn-block" type="submit" name="continue" value="Continue" />'; + echo '</form>'; } +} else { + $canContinue = true; +} - if ($canContinue && +if ( + $canContinue && ( !$warningAttributes->isEnabled() || in_array( @@ -114,34 +117,35 @@ if ($idpEntityId !== null) { [WarningConfiguration::WARNING_TYPE_INFO, WarningConfiguration::WARNING_TYPE_WARNING], true ) - )) { - if ($efilter !== null) { - header('Location: https://ds.eduid.cz/wayf.php' . $url . '&efilter=' . $efilter); - exit; - } - if ($filter !== null) { - header('Location: https://ds.eduid.cz/wayf.php' . $url . '&filter=' . $filter); - exit; - } - if (isset($this->data['originalsp']['efilter'])) { - $efilter = $this->data['originalsp']['efilter']; - header('Location: https://ds.eduid.cz/wayf.php' . $url . '&efilter=' . $efilter); - exit; - } - if (isset($this->data['originalsp']['filter'])) { - $filter = $this->data['originalsp']['filter']; - header('Location: https://ds.eduid.cz/wayf.php' . $url . '&filter=' . $filter); - exit; - } - if ($defaultEFilter !== null) { - header('Location: https://ds.eduid.cz/wayf.php' . $url . '&efilter=' . $defaultEFilter); - exit; - } - if ($defaultFilter !== null) { - header('Location: https://ds.eduid.cz/wayf.php' . $url . '&filter=' . $defaultFilter); - exit; - } - throw new Exception('cesnet:disco-tpl: Filter did not set. '); + ) +) { + if ($efilter !== null) { + header('Location: https://ds.eduid.cz/wayf.php' . $url . '&efilter=' . $efilter); + exit; + } + if ($filter !== null) { + header('Location: https://ds.eduid.cz/wayf.php' . $url . '&filter=' . $filter); + exit; + } + if (isset($this->data['originalsp']['efilter'])) { + $efilter = $this->data['originalsp']['efilter']; + header('Location: https://ds.eduid.cz/wayf.php' . $url . '&efilter=' . $efilter); + exit; } + if (isset($this->data['originalsp']['filter'])) { + $filter = $this->data['originalsp']['filter']; + header('Location: https://ds.eduid.cz/wayf.php' . $url . '&filter=' . $filter); + exit; + } + if ($defaultEFilter !== null) { + header('Location: https://ds.eduid.cz/wayf.php' . $url . '&efilter=' . $defaultEFilter); + exit; + } + if ($defaultFilter !== null) { + header('Location: https://ds.eduid.cz/wayf.php' . $url . '&filter=' . $defaultFilter); + exit; + } + throw new Exception('cesnet:disco-tpl: Filter did not set. '); +} $this->includeAtTemplateBase('includes/footer.php'); diff --git a/themes/einfra_idp/core/loginuserpass.php b/themes/einfra_idp/core/loginuserpass.php index 8372ced71fc72ea475dbaeb16a76fe77d45ee50d..3944e69c9b1ba475cfda0c1ff4d3ede76a9f4b88 100644 --- a/themes/einfra_idp/core/loginuserpass.php +++ b/themes/einfra_idp/core/loginuserpass.php @@ -1,4 +1,6 @@ -<?php declare(strict_types=1); +<?php + +declare(strict_types=1); $this->data['header'] = $this->t('{cesnet:einfra:user_pass_header}'); @@ -112,21 +114,21 @@ if ($this->data['errorcode'] !== null) { $selectedOrg = null; } - foreach ($this->data['organizations'] as $orgId => $orgDesc) { - if (is_array($orgDesc)) { - $orgDesc = $this->t($orgDesc); - } + foreach ($this->data['organizations'] as $orgId => $orgDesc) { + if (is_array($orgDesc)) { + $orgDesc = $this->t($orgDesc); + } - if ($orgId === $selectedOrg) { - $selected = 'selected="selected" '; - } else { - $selected = ''; - } + if ($orgId === $selectedOrg) { + $selected = 'selected="selected" '; + } else { + $selected = ''; + } - echo '<option ' . + echo '<option ' . $selected . 'value="' . htmlspecialchars($orgId) . '">' . htmlspecialchars($orgDesc) . '</option>'; - } ?> + } ?> </select> </div> </div> diff --git a/themes/einfra_idp/default/includes/footer.php b/themes/einfra_idp/default/includes/footer.php index 5789191645df6f70e3ce56d49ead2900d1654d1c..af56762809c5674d24fbb9bbcb3747db0204cf86 100644 --- a/themes/einfra_idp/default/includes/footer.php +++ b/themes/einfra_idp/default/includes/footer.php @@ -1,4 +1,6 @@ -<?php declare(strict_types=1); +<?php + +declare(strict_types=1); use SimpleSAML\Module; diff --git a/themes/einfra_idp/default/includes/header.php b/themes/einfra_idp/default/includes/header.php index 9991a2f92d36913166ee5a6973481cf0df6cce35..5d2ed59ad90cb1f8d11af5e413f86b6a925bb0c1 100644 --- a/themes/einfra_idp/default/includes/header.php +++ b/themes/einfra_idp/default/includes/header.php @@ -1,11 +1,14 @@ -<?php declare(strict_types=1); +<?php + +declare(strict_types=1); use SimpleSAML\Module; use SimpleSAML\Utils\HTTP; -/** +/* * Support the htmlinject hook, which allows modules to change header, pre and post body on all pages. */ + $this->data['htmlinject'] = [ 'htmlContentPre' => [], 'htmlContentPost' => [], diff --git a/themes/einfra_idp/perun/disco-tpl.php b/themes/einfra_idp/perun/disco-tpl.php index 56c8b39856f70a1704a009ddc05b48e98cab5e7b..be69fa83c3059a32c649b55188614d3b0be66d25 100644 --- a/themes/einfra_idp/perun/disco-tpl.php +++ b/themes/einfra_idp/perun/disco-tpl.php @@ -82,31 +82,34 @@ if ($idpEntityId !== null) { } $url = $this->getContinueUrlWithoutIdPEntityId(); - if ($warningAttributes->isEnabled()) { - if ($warningAttributes->getType() === WarningConfiguration::WARNING_TYPE_INFO) { - echo '<div class="alert alert-info">'; - } elseif ($warningAttributes->getType() === WarningConfiguration::WARNING_TYPE_WARNING) { - echo '<div class="alert alert-warning">'; - } elseif ($warningAttributes->getType() === WarningConfiguration::WARNING_TYPE_ERROR) { - echo '<div class="alert alert-danger">'; - } - echo '<h4> <strong>' . $warningAttributes->getTitle() . '</strong> </h4>'; - echo $warningAttributes->getText(); - echo '</div>'; - if (in_array( +if ($warningAttributes->isEnabled()) { + if ($warningAttributes->getType() === WarningConfiguration::WARNING_TYPE_INFO) { + echo '<div class="alert alert-info">'; + } elseif ($warningAttributes->getType() === WarningConfiguration::WARNING_TYPE_WARNING) { + echo '<div class="alert alert-warning">'; + } elseif ($warningAttributes->getType() === WarningConfiguration::WARNING_TYPE_ERROR) { + echo '<div class="alert alert-danger">'; + } + echo '<h4> <strong>' . $warningAttributes->getTitle() . '</strong> </h4>'; + echo $warningAttributes->getText(); + echo '</div>'; + if ( + in_array( $warningAttributes->getType(), [WarningConfiguration::WARNING_TYPE_INFO, WarningConfiguration::WARNING_TYPE_WARNING], true - )) { - echo '<form method="POST">'; - echo '<input class="btn btn-lg btn-primary btn-block" type="submit" name="continue" value="Continue" />'; - echo '</form>'; - } - } else { - $canContinue = true; + ) + ) { + echo '<form method="POST">'; + echo '<input class="btn btn-lg btn-primary btn-block" type="submit" name="continue" value="Continue" />'; + echo '</form>'; } +} else { + $canContinue = true; +} - if ($canContinue && +if ( + $canContinue && ( !$warningAttributes->isEnabled() || in_array( @@ -114,34 +117,35 @@ if ($idpEntityId !== null) { [WarningConfiguration::WARNING_TYPE_INFO, WarningConfiguration::WARNING_TYPE_WARNING], true ) - )) { - if ($efilter !== null) { - header('Location: https://ds.eduid.cz/wayf.php' . $url . '&efilter=' . $efilter); - exit; - } - if ($filter !== null) { - header('Location: https://ds.eduid.cz/wayf.php' . $url . '&filter=' . $filter); - exit; - } - if (isset($this->data['originalsp']['efilter'])) { - $efilter = $this->data['originalsp']['efilter']; - header('Location: https://ds.eduid.cz/wayf.php' . $url . '&efilter=' . $efilter); - exit; - } - if (isset($this->data['originalsp']['filter'])) { - $filter = $this->data['originalsp']['filter']; - header('Location: https://ds.eduid.cz/wayf.php' . $url . '&filter=' . $filter); - exit; - } - if ($defaultEFilter !== null) { - header('Location: https://ds.eduid.cz/wayf.php' . $url . '&efilter=' . $defaultEFilter); - exit; - } - if ($defaultFilter !== null) { - header('Location: https://ds.eduid.cz/wayf.php' . $url . '&filter=' . $defaultFilter); - exit; - } - throw new Exception('cesnet:disco-tpl: Filter did not set. '); + ) +) { + if ($efilter !== null) { + header('Location: https://ds.eduid.cz/wayf.php' . $url . '&efilter=' . $efilter); + exit; + } + if ($filter !== null) { + header('Location: https://ds.eduid.cz/wayf.php' . $url . '&filter=' . $filter); + exit; + } + if (isset($this->data['originalsp']['efilter'])) { + $efilter = $this->data['originalsp']['efilter']; + header('Location: https://ds.eduid.cz/wayf.php' . $url . '&efilter=' . $efilter); + exit; } + if (isset($this->data['originalsp']['filter'])) { + $filter = $this->data['originalsp']['filter']; + header('Location: https://ds.eduid.cz/wayf.php' . $url . '&filter=' . $filter); + exit; + } + if ($defaultEFilter !== null) { + header('Location: https://ds.eduid.cz/wayf.php' . $url . '&efilter=' . $defaultEFilter); + exit; + } + if ($defaultFilter !== null) { + header('Location: https://ds.eduid.cz/wayf.php' . $url . '&filter=' . $defaultFilter); + exit; + } + throw new Exception('cesnet:disco-tpl: Filter did not set. '); +} $this->includeAtTemplateBase('includes/footer.php'); diff --git a/www/updateIsCesnetEligible.php b/www/updateIsCesnetEligible.php index 8f82917d768f1b1286dd8770392a996f1d3843a4..1193d1fd5c3294c587e673b5b8a0cf64d7f87c09 100644 --- a/www/updateIsCesnetEligible.php +++ b/www/updateIsCesnetEligible.php @@ -1,11 +1,11 @@ <?php -declare(strict_types=1); - /** * Script for updating IsCesnetEligible in Perun asynchronously. */ +declare(strict_types=1); + use SimpleSAML\Error\Exception; use SimpleSAML\Logger; use SimpleSAML\Module\perun\AdapterRpc;