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

Harden www-scripts

parent 4b3f0cf4
No related branches found
No related tags found
No related merge requests found
<?php <?php
declare(strict_types=1);
// initialize the autoloader // initialize the autoloader
require_once(dirname(dirname(__FILE__)) . '/src/_autoload.php'); require_once(dirname(dirname(__FILE__)) . '/src/_autoload.php');
......
<?php <?php
declare(strict_types=1);
namespace SimpleSAML;
require_once('_include.php'); require_once('_include.php');
$config = \SimpleSAML\Configuration::getInstance(); $config = Configuration::getInstance();
$httpUtils = new \SimpleSAML\Utils\HTTP(); $httpUtils = new Utils\HTTP();
$redirect = $config->getOptionalString('frontpage.redirect', SimpleSAML\Module::getModuleURL('core/welcome')); $redirect = $config->getOptionalString('frontpage.redirect', Module::getModuleURL('core/welcome'));
$httpUtils->redirectTrustedURL($redirect); $httpUtils->redirectTrustedURL($redirect);
<?php <?php
declare(strict_types=1);
namespace SimpleSAML;
use SimpleSAML\XHTML\Template;
use function array_key_exists;
require_once('_include.php'); require_once('_include.php');
$config = \SimpleSAML\Configuration::getInstance(); $config = Configuration::getInstance();
$httpUtils = new \SimpleSAML\Utils\HTTP(); $httpUtils = new Utils\HTTP();
if (array_key_exists('link_href', $_REQUEST)) { if (array_key_exists('link_href', $_REQUEST)) {
$link = $httpUtils->checkURLAllowed($_REQUEST['link_href']); $link = $httpUtils->checkURLAllowed($_REQUEST['link_href']);
...@@ -17,8 +25,7 @@ if (array_key_exists('link_text', $_REQUEST)) { ...@@ -17,8 +25,7 @@ if (array_key_exists('link_text', $_REQUEST)) {
$text = '{logout:default_link_text}'; $text = '{logout:default_link_text}';
} }
$t = new \SimpleSAML\XHTML\Template($config, 'logout.twig'); $t = new Template($config, 'logout.twig');
$t->data['link'] = $link; $t->data['link'] = $link;
$t->data['text'] = $text; $t->data['text'] = $text;
$t->send(); $t->send();
exit();
...@@ -5,6 +5,10 @@ ...@@ -5,6 +5,10 @@
* the process() handler in the Module class. * the process() handler in the Module class.
*/ */
declare(strict_types=1);
namespace SimpleSAML;
require_once('_include.php'); require_once('_include.php');
\SimpleSAML\Module::process()->send(); Module::process()->send();
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment