Skip to content
Snippets Groups Projects
Commit 14b85995 authored by Tim van Dijen's avatar Tim van Dijen
Browse files

Remove old pages that have already been converted to controllers

parent e3b1abbc
No related branches found
No related tags found
No related merge requests found
...@@ -22,15 +22,3 @@ core-warning-shortssointerval: ...@@ -22,15 +22,3 @@ core-warning-shortssointerval:
core-post-redirect: core-post-redirect:
path: /postredirect path: /postredirect
defaults: { _controller: 'SimpleSAML\Module\core\Controller\Redirection:postredirect' } defaults: { _controller: 'SimpleSAML\Module\core\Controller\Redirection:postredirect' }
core-legacy-welcome:
path: /frontpage_welcome.php
defaults: { _controller: 'Symfony\Bundle\FrameworkBundle\Controller\RedirectController::urlRedirectAction', path: /admin/, permanent: true }
core-legacy-config:
path: /frontpage_config.php
defaults: { _controller: 'Symfony\Bundle\FrameworkBundle\Controller\RedirectController::urlRedirectAction', path: /admin/, permanent: true }
core-legacy-auth:
path: /frontpage_auth.php
defaults: { _controller: 'Symfony\Bundle\FrameworkBundle\Controller\RedirectController::urlRedirectAction', path: /admin/test, permanent: true }
core-legacy-federation:
path: /frontpage_federation.php
defaults: { _controller: 'Symfony\Bundle\FrameworkBundle\Controller\RedirectController::urlRedirectAction', path: /admin/federation, permanent: true }
<?php
/**
* Endpoint for logging in with an authentication source.
*
* @package SimpleSAMLphp
*/
if (!isset($_REQUEST['ReturnTo'])) {
throw new \SimpleSAML\Error\BadRequest('Missing ReturnTo parameter.');
}
if (!isset($_REQUEST['AuthId'])) {
throw new \SimpleSAML\Error\BadRequest('Missing AuthId parameter.');
}
/*
* Setting up the options for the requireAuth() call later..
*/
$options = [
'ReturnTo' => \SimpleSAML\Utils\HTTP::checkURLAllowed($_REQUEST['ReturnTo']),
];
/*
* Allows a saml:idp query string parameter specify the IdP entity ID to be used
* as used by the DiscoJuice embedded client.
*/
if (!empty($_REQUEST['saml:idp'])) {
$options['saml:idp'] = $_REQUEST['saml:idp'];
}
$as = new \SimpleSAML\Auth\Simple($_REQUEST['AuthId']);
$as->requireAuth($options);
\SimpleSAML\Utils\HTTP::redirectTrustedURL($options['ReturnTo']);
<?php
/**
* Endpoint for logging out in with an authentication source.
*
* @package SimpleSAMLphp
*/
if (!isset($_REQUEST['ReturnTo']) || !is_string($_REQUEST['ReturnTo'])) {
throw new \SimpleSAML\Error\BadRequest('Missing ReturnTo parameter.');
}
if (!isset($_REQUEST['AuthId']) || !is_string($_REQUEST['AuthId'])) {
throw new \SimpleSAML\Error\BadRequest('Missing AuthId parameter.');
}
$as = new \SimpleSAML\Auth\Simple($_REQUEST['AuthId']);
$as->logout(\SimpleSAML\Utils\HTTP::checkURLAllowed($_REQUEST['ReturnTo']));
<?php
/**
* Show a 403 Forbidden page when an attribute violates a cardinality rule
*
* @package SimpleSAMLphp
*/
if (!array_key_exists('StateId', $_REQUEST)) {
throw new \SimpleSAML\Error\BadRequest('Missing required StateId query parameter.');
}
$id = $_REQUEST['StateId'];
/** @var array $state */
$state = \SimpleSAML\Auth\State::loadState($id, 'core:cardinality');
$session = \SimpleSAML\Session::getSessionFromRequest();
\SimpleSAML\Logger::stats('core:cardinality:error ' . $state['Destination']['entityid']
. ' ' . $state['saml:sp:IdP'] . ' ' . implode(',', array_keys($state['core:cardinality:errorAttributes'])));
$globalConfig = \SimpleSAML\Configuration::getInstance();
$t = new \SimpleSAML\XHTML\Template($globalConfig, 'core:cardinality_error.twig');
$t->data['cardinalityErrorAttributes'] = $state['core:cardinality:errorAttributes'];
if (isset($state['Source']['auth'])) {
$t->data['LogoutURL'] = \SimpleSAML\Module::getModuleURL(
'core/authenticate.php',
['as' => $state['Source']['auth']]
) . "&logout";
}
header('HTTP/1.0 403 Forbidden');
$t->send();
<?php
require_once('_include.php');
/**
* This page clears the user's IdP discovery choices.
*/
// The base path for cookies. This should be the installation directory for SimpleSAMLphp.
$config = \SimpleSAML\Configuration::getInstance();
$cookiePath = $config->getBasePath();
// We delete all cookies which starts with 'idpdisco_'
foreach ($_COOKIE as $cookieName => $value) {
if (substr($cookieName, 0, 9) !== 'idpdisco_') {
// Not a idpdisco cookie.
continue;
}
/* Delete the cookie. We delete it once without the secure flag and once with the secure flag. This
* ensures that the cookie will be deleted in any case.
*/
\SimpleSAML\Utils\HTTP::setCookie($cookieName, null, ['path' => $cookiePath, 'httponly' => false], false);
}
// Find where we should go now.
if (array_key_exists('ReturnTo', $_REQUEST)) {
$returnTo = \SimpleSAML\Utils\HTTP::checkURLAllowed($_REQUEST['ReturnTo']);
} else {
// Return to the front page if no other destination is given. This is the same as the base cookie path.
$returnTo = $cookiePath;
}
// Redirect to destination.
\SimpleSAML\Utils\HTTP::redirectTrustedURL($returnTo);
<?php
if (isset($_REQUEST['retryURL'])) {
$retryURL = strval($_REQUEST['retryURL']);
$retryURL = \SimpleSAML\Utils\HTTP::checkURLAllowed($retryURL);
} else {
$retryURL = null;
}
$globalConfig = \SimpleSAML\Configuration::getInstance();
$t = new \SimpleSAML\XHTML\Template($globalConfig, 'core:no_cookie.twig');
$t->data['retryURL'] = $retryURL;
$t->send();
<?php
/**
* This page provides a way to create a redirect to a POST request.
*
* @package SimpleSAMLphp
*/
use Exception;
use SimpleSAML\Assert\Assert;
use SimpleSAML\Configuration;
use SimpleSAML\Error;
use SimpleSAML\Session;
use SimpleSAML\Utils;
use SimpleSAML\XHTML\Template;
if (array_key_exists('RedirId', $_REQUEST)) {
$postId = $_REQUEST['RedirId'];
$session = Session::getSessionFromRequest();
} elseif (array_key_exists('RedirInfo', $_REQUEST)) {
$encData = base64_decode($_REQUEST['RedirInfo']);
if (empty($encData)) {
throw new Error\BadRequest('Invalid RedirInfo data.');
}
list($sessionId, $postId) = explode(':', Utils\Crypto::aesDecrypt($encData));
if (empty($sessionId) || empty($postId)) {
throw new Error\BadRequest('Invalid session info data.');
}
$session = Session::getSession($sessionId);
} else {
throw new Error\BadRequest('Missing redirection info parameter.');
}
if ($session === null) {
throw new Exception('Unable to load session.');
}
$postData = $session->getData('core_postdatalink', $postId);
if ($postData === null) {
// The post data is missing, probably because it timed out
throw new Exception('The POST data we should restore was lost.');
}
$session->deleteData('core_postdatalink', $postId);
Assert::isArray($postData);
Assert::keyExists($postData, 'url');
Assert::keyExists($postData, 'post');
if (!Utils\HTTP::isValidURL($postData['url'])) {
throw new Error\Exception('Invalid destination URL.');
}
$config = Configuration::getInstance();
$template = new Template($config, 'post.php');
$template->data['destination'] = $postData['url'];
$template->data['post'] = $postData['post'];
$template->send();
exit(0);
<?php
/**
* Show a warning to an user about the SP requesting SSO a short time after
* doing it previously.
*
* @package SimpleSAMLphp
*/
if (!array_key_exists('StateId', $_REQUEST)) {
throw new \SimpleSAML\Error\BadRequest('Missing required StateId query parameter.');
}
$id = $_REQUEST['StateId'];
/** @var array $state */
$state = \SimpleSAML\Auth\State::loadState($id, 'core:short_sso_interval');
$session = \SimpleSAML\Session::getSessionFromRequest();
if (array_key_exists('continue', $_REQUEST)) {
// The user has pressed the continue/retry-button
\SimpleSAML\Auth\ProcessingChain::resumeProcessing($state);
}
$globalConfig = \SimpleSAML\Configuration::getInstance();
$t = new \SimpleSAML\XHTML\Template($globalConfig, 'core:short_sso_interval.twig');
$t->data['target'] = \SimpleSAML\Module::getModuleURL('core/short_sso_interval.php');
$t->data['params'] = ['StateId' => $id];
$t->data['trackId'] = $session->getTrackID();
$t->data['autofocus'] = 'contbutton';
$t->send();
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