From 7da7a1e54785f3d30b0d58646c4bb998b30c13ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20B=C5=99ou=C5=A1ek?= <brousek@ics.muni.cz> Date: Wed, 28 Sep 2022 22:31:24 +0200 Subject: [PATCH] style: PSR12 --- .../module_cesnet_IsCesnetEligible.php | 5 +- lib/Auth/Process/ComputeLoA.php | 22 ++-- lib/Auth/Process/IsCesnetEligible.php | 16 +-- themes/cesnet/default/includes/footer.php | 4 +- themes/cesnet/default/includes/header.php | 4 +- themes/cesnet/perun/disco-tpl.php | 100 +++++++++--------- themes/einfra/core/loginuserpass.php | 26 ++--- themes/einfra/default/includes/footer.php | 4 +- themes/einfra/default/includes/header.php | 7 +- themes/einfra/perun/disco-tpl.php | 100 +++++++++--------- themes/einfra_idp/core/loginuserpass.php | 26 ++--- themes/einfra_idp/default/includes/footer.php | 4 +- themes/einfra_idp/default/includes/header.php | 7 +- themes/einfra_idp/perun/disco-tpl.php | 100 +++++++++--------- www/updateIsCesnetEligible.php | 4 +- 15 files changed, 233 insertions(+), 196 deletions(-) diff --git a/config-templates/module_cesnet_IsCesnetEligible.php b/config-templates/module_cesnet_IsCesnetEligible.php index cd07a6b..f4b9014 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 8103bb9..1b11164 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 9c5dae2..f7d0124 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 fd99bb0..363fff6 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 9675720..deb5048 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 56c8b39..be69fa8 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 8372ced..3944e69 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 debb0e4..f85005f 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 c9d421a..52a5a56 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 56c8b39..be69fa8 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 8372ced..3944e69 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 5789191..af56762 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 9991a2f..5d2ed59 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 56c8b39..be69fa8 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 8f82917..1193d1f 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; -- GitLab