Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • perun/perun-proxyidp/v1/simplesamlphp-module-cesnet
1 result
Show changes
Commits on Source (11)
Showing
with 490 additions and 12156 deletions
# [4.1.0](https://gitlab.ics.muni.cz/perun-proxy-aai/simplesamlphp/simplesamlphp-module-cesnet/compare/v4.0.3...v4.1.0) (2022-11-29)
### Features
* new logo for CERIT-SC ([eca5bc8](https://gitlab.ics.muni.cz/perun-proxy-aai/simplesamlphp/simplesamlphp-module-cesnet/commit/eca5bc88d092c3b0431d590c8e8d3d33b950383e))
## [4.0.3](https://gitlab.ics.muni.cz/perun-proxy-aai/simplesamlphp/simplesamlphp-module-cesnet/compare/v4.0.2...v4.0.3) (2022-09-24)
......
# einfra-aai-proxy-idp-template
[![Latest Stable Version](https://poser.pugx.org/cesnet/simplesamlphp-module-cesnet/v/stable)](https://packagist.org/packages/cesnet/simplesamlphp-module-cesnet)
[![Latest Unstable Version](https://poser.pugx.org/cesnet/simplesamlphp-module-cesnet/v/unstable)](https://packagist.org/packages/cesnet/simplesamlphp-module-cesnet)
[![Build and CI](https://github.com/cesnet/einfra-aai-proxy-idp-template/actions/workflows/build_and_check.yml/badge.svg)](https://github.com/cesnet/einfra-aai-proxy-idp-template/actions/workflows/build_and_check.yml)
[![License](https://poser.pugx.org/cesnet/simplesamlphp-module-cesnet/license)](https://packagist.org/packages/cesnet/simplesamlphp-module-cesnet)
Template for CESNET eInfra Proxy IdP component
## Contribution
......
This diff is collapsed.
<?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.
......
......@@ -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;
}
}
......
......@@ -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.');
}
......
This diff is collapsed.
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["local>perun-proxy-aai/renovate-config"]
}
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
use SimpleSAML\Module;
......
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
use SimpleSAML\Module;
use SimpleSAML\Utils\HTTP;
......
......@@ -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');
<?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>
......
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
use SimpleSAML\Module;
......
<?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' => [],
......
......@@ -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');
<?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>
......
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
use SimpleSAML\Module;
......
<?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' => [],
......
......@@ -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');