From 165438c0b46cb765a8930a313b47eba670ff143b Mon Sep 17 00:00:00 2001 From: Wolfgang Knopki <wolfgang.knopki@hft-stuttgart.de> Date: Fri, 12 Nov 2021 13:35:20 +0100 Subject: [PATCH] removed nonessential files --- mymodule/templates/.gitkeep | 0 mymodule/templates/selectsource.tpl.php | 28 ---- .../themes/fancytheme/core/loginuserpass.php | 82 ------------ .../fancytheme/default/includes/footer.php | 23 ---- .../fancytheme/default/includes/header.php | 124 ------------------ .../fancytheme/multiauth/selectsource.php | 85 ------------ 6 files changed, 342 deletions(-) delete mode 100644 mymodule/templates/.gitkeep delete mode 100644 mymodule/templates/selectsource.tpl.php delete mode 100644 mymodule/themes/fancytheme/core/loginuserpass.php delete mode 100644 mymodule/themes/fancytheme/default/includes/footer.php delete mode 100644 mymodule/themes/fancytheme/default/includes/header.php delete mode 100644 mymodule/themes/fancytheme/multiauth/selectsource.php diff --git a/mymodule/templates/.gitkeep b/mymodule/templates/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/mymodule/templates/selectsource.tpl.php b/mymodule/templates/selectsource.tpl.php deleted file mode 100644 index f520ef8..0000000 --- a/mymodule/templates/selectsource.tpl.php +++ /dev/null @@ -1,28 +0,0 @@ -<?php -$this->data['header'] = $this->t('{multiauth:multiauth:select_source_header}'); -$this->includeAtTemplateBase('includes/header.php'); -?> - -<h2><?php echo 'Benutzerkonto auswählen' ?></h2> - -<p><?php echo 'Bitte wählen Sie ein Benutzerkonto aus, mit dem Sie sich authentifizieren wollen:' ?></p> - -<form action="/idp/module.php/multiauth/selectsource.php" method="get"> - <input type="hidden" name="AuthState" value="<?php echo htmlspecialchars($this->data['authstate']); ?>" /> -<?php -echo '<div>'; -foreach ($this->data['sources'] as $source) { - if ($source['source'] === $this->data['preferred']) { - $autofocus = ' autofocus="autofocus"'; - } else { - $autofocus = ''; - } - $name = 'src-'.base64_encode($source['source']); - echo '<input type="submit" class="'.htmlspecialchars($source['css_class']).'" name="'.htmlspecialchars($name).'"'.$autofocus.' '. - 'id="button-'.htmlspecialchars($source['source']).'" '. - 'value="'.htmlspecialchars($source['text']).'" ></input>'; -} -echo '</div>'; -?> -</form> -<?php $this->includeAtTemplateBase('includes/footer.php'); diff --git a/mymodule/themes/fancytheme/core/loginuserpass.php b/mymodule/themes/fancytheme/core/loginuserpass.php deleted file mode 100644 index 0e4b87f..0000000 --- a/mymodule/themes/fancytheme/core/loginuserpass.php +++ /dev/null @@ -1,82 +0,0 @@ -<?php -$this->data['header'] = $this->t('{login:user_pass_header}'); - -if (strlen($this->data['username']) > 0) { - $this->data['autofocus'] = 'password'; -} else { - $this->data['autofocus'] = 'username'; -} -$this->includeAtTemplateBase('includes/header.php'); -?> - <div> - <div class="container"> - <div class="row"> - <div class="col-md-12" style="margin-bottom: 40px;"><img class="mx-auto" src="/img/Anmelden.png" width="100%"></div> - </div> - </div> - -<?php -if ($this->data['errorcode'] !== null) { -?> - <div style="border-left: 1px solid #e8e8e8; border-bottom: 1px solid #e8e8e8; background: #f5f5f5"> - <img src="/<?php echo $this->data['baseurlpath']; ?>resources/icons/experience/gtk-dialog-error.48x48.png" - class="float-l erroricon" style="margin: 15px" alt=""/> - - <h2><?php echo $this->t('{login:error_header}'); ?></h2> - - <p><strong> - <?php - echo htmlspecialchars( - $this->t( - $this->data['errorcodes']['title'][$this->data['errorcode']], - $this->data['errorparams'] - ) - ); - ?> - </strong></p> - <p> - <?php - echo htmlspecialchars( - $this->t( - $this->data['errorcodes']['descr'][$this->data['errorcode']], - $this->data['errorparams'] - ) - ); - ?> - </p> - </div> -<?php -} -?> - - <div class="login-clean" style="background-color: rgb(234,234,234);"> - <form method="post"> - <h2 class="sr-only">Login Form</h2> - <div class="illustration"><img src="/img/M4_LAB_LOGO.png" width="130"></div> - <?php if (strpos($_GET['AuthState'], 'admin') !== false) : ?> - <div class="form-group"><input id="username" class="form-control" type="text" name="username" placeholder="Administrator"></div> - <?php else : ?> - <div class="form-group"><input id="username" class="form-control" type="email" name="username" placeholder="E-Mail-Adresse"></div> - <?php endif; ?> - <div class="form-group"><input id="password" class="form-control" type="password" name="password" placeholder="Passwort"></div><a class="text-right forgot" href="/account/forgotPwd">Passwort vergessen?</a> - <div class="form-group"><button class="btn btn-primary btn-block" type="submit" style="background-color: #8a348b;"><strong>Anmelden</strong></button><a class="btn btn-primary btn-block" type="" style="background-color: rgb(234,234,234);color: rgb(0,0,0);" href="/account/registration"><strong>Neues Benutzerkonto anlegen</strong></a></div> - <input type="hidden" id="processing_trans" value="<?php echo $this->t('{login:processing}'); ?>" /> - <?php - foreach ($this->data['stateparams'] as $name => $value) { - echo '<input type="hidden" name="'.htmlspecialchars($name).'" value="'.htmlspecialchars($value).'" />'; - } - ?> - </form> - </div> - </div> -<?php -if (!empty($this->data['links'])) { - echo '<ul class="links" style="margin-top: 2em">'; - foreach ($this->data['links'] as $l) { - echo '<li><a href="'.htmlspecialchars($l['href']).'">'.htmlspecialchars($this->t($l['text'])).'</a></li>'; - } - echo '</ul>'; -} - -$this->includeAtTemplateBase('includes/footer.php'); - diff --git a/mymodule/themes/fancytheme/default/includes/footer.php b/mymodule/themes/fancytheme/default/includes/footer.php deleted file mode 100644 index f9da9a2..0000000 --- a/mymodule/themes/fancytheme/default/includes/footer.php +++ /dev/null @@ -1,23 +0,0 @@ -<?php -if (!empty($this->data['htmlinject']['htmlContentPost'])) { - foreach ($this->data['htmlinject']['htmlContentPost'] as $c) { - echo $c; - } -} -?> - - <script src="/js/headfoot.js"></script> - - - </div><!-- #content --> - <div id="footer"> - <hr /> - <img src="/<?php echo $this->data['baseurlpath']; ?>resources/icons/ssplogo-fish-small.png" alt="Small fish logo" style="float: right" /> - simplesamlphp Copyright © 2007-2019 <a href="http://uninett.no/">UNINETT AS</a> - - <br style="clear: right" /> - - </div><!-- #footer --> - </div><!-- #wrap --> - </body> -</html> diff --git a/mymodule/themes/fancytheme/default/includes/header.php b/mymodule/themes/fancytheme/default/includes/header.php deleted file mode 100644 index 150b0ff..0000000 --- a/mymodule/themes/fancytheme/default/includes/header.php +++ /dev/null @@ -1,124 +0,0 @@ -<?php - -/** - * Support the htmlinject hook, which allows modules to change header, pre and post body on all pages. - */ -$this->data['htmlinject'] = [ - 'htmlContentPre' => [], - 'htmlContentPost' => [], - 'htmlContentHead' => [], -]; - -$jquery = []; -if (array_key_exists('jquery', $this->data)) { - $jquery = $this->data['jquery']; -} - -if (array_key_exists('pageid', $this->data)) { - $hookinfo = [ - 'pre' => &$this->data['htmlinject']['htmlContentPre'], - 'post' => &$this->data['htmlinject']['htmlContentPost'], - 'head' => &$this->data['htmlinject']['htmlContentHead'], - 'jquery' => &$jquery, - 'page' => $this->data['pageid'] - ]; - - SimpleSAML\Module::callHooks('htmlinject', $hookinfo); -} -// - o - o - o - o - o - o - o - o - o - o - o - o - - -/** - * Do not allow to frame SimpleSAMLphp pages from another location. - * This prevents clickjacking attacks in modern browsers. - * - * If you don't want any framing at all you can even change this to - * 'DENY', or comment it out if you actually want to allow foreign - * sites to put SimpleSAMLphp in a frame. The latter is however - * probably not a good security practice. - */ -header('X-Frame-Options: SAMEORIGIN'); - -?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> -<head> -<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> -<script type="text/javascript" src="/<?php echo $this->data['baseurlpath']; ?>resources/script.js"></script> -<!-- <link rel="stylesheet" type="text/css" href="/<?php echo $this->data['baseurlpath']; ?>resources/default.css" /> --> -<link rel="icon" type="image/icon" href="/<?php echo $this->data['baseurlpath']; ?>resources/icons/favicon.ico" /> -<title>M4_LAB: User Login</title> -<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" /> -<link rel="stylesheet" type="text/css" href="/css/bootstrap.css"/> -<link rel="stylesheet" type="text/css" href="/css/Login-Form-Clean.css"/> -<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.2/css/all.css" integrity="sha384-oS3vJWv+0UjzBfQzYUhtDYW+Pj2yciDJxpsK1OYPAYjqT085Qq/1cq5FLXAZQ7Ay" crossorigin="anonymous"> -<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script> -<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script> - -<?php - -if (!empty($jquery)) { - $version = '1.8'; - if (array_key_exists('version', $jquery)) { - $version = $jquery['version']; - } - - if ($version == '1.8') { - if (isset($jquery['core']) && $jquery['core']) { - echo '<script type="text/javascript" src="/'.$this->data['baseurlpath'].'resources/jquery-1.8.js"></script>'."\n"; - } - - if (isset($jquery['ui']) && $jquery['ui']) { - echo '<script type="text/javascript" src="/'.$this->data['baseurlpath'].'resources/jquery-ui-1.8.js"></script>'."\n"; - } - - if (isset($jquery['css']) && $jquery['css']) { - echo '<link rel="stylesheet" media="screen" type="text/css" href="/'.$this->data['baseurlpath']. - 'resources/uitheme1.8/jquery-ui.css" />'."\n"; - } - } -} - -if (isset($this->data['clipboard.js'])) { - echo '<script type="text/javascript" src="/'.$this->data['baseurlpath'].'resources/clipboard.min.js"></script>'."\n"; -} - -if (!empty($this->data['htmlinject']['htmlContentHead'])) { - foreach ($this->data['htmlinject']['htmlContentHead'] as $c) { - echo $c; - } -} - -if ($this->isLanguageRTL()) { - ?> - <link rel="stylesheet" type="text/css" href="/<?php echo $this->data['baseurlpath']; ?>resources/default-rtl.css" /> -<?php -} -?> - <meta name="robots" content="noindex, nofollow" /> - -<?php -if (array_key_exists('head', $this->data)) { - echo '<!-- head -->'.$this->data['head'].'<!-- /head -->'; -} -?> -</head> -<?php -$onLoad = ''; -if (array_key_exists('autofocus', $this->data)) { - $onLoad .= ' onload="SimpleSAML_focus(\''.$this->data['autofocus'].'\');"'; -} -?> -<body class="text-center" <?php echo $onLoad; ?>> - - <div id="content"> - -<?php - -if (!empty($this->data['htmlinject']['htmlContentPre'])) { - foreach ($this->data['htmlinject']['htmlContentPre'] as $c) { - echo $c; - } -} -$config = \SimpleSAML\Configuration::getInstance(); -if(! $config->getBoolean('production', true)) { - echo '<div class="caution">' . $this->t('{preprodwarning:warning:warning}'). '</div>'; -} diff --git a/mymodule/themes/fancytheme/multiauth/selectsource.php b/mymodule/themes/fancytheme/multiauth/selectsource.php deleted file mode 100644 index e695206..0000000 --- a/mymodule/themes/fancytheme/multiauth/selectsource.php +++ /dev/null @@ -1,85 +0,0 @@ -<?php - -/** - * This page shows a list of authentication sources. When the user selects - * one of them if pass this information to the - * \SimpleSAML\Module\multiauth\Auth\Source\MultiAuth class and call the - * delegateAuthentication method on it. - * - * @author Lorenzo Gil, Yaco Sistemas S.L. - * @package SimpleSAMLphp - */ - -// Retrieve the authentication state -if (!array_key_exists('AuthState', $_REQUEST)) { - throw new \SimpleSAML\Error\BadRequest('Missing AuthState parameter.'); -} -$authStateId = $_REQUEST['AuthState']; - -/** @var array $state */ -$state = \SimpleSAML\Auth\State::loadState($authStateId, \SimpleSAML\Module\multiauth\Auth\Source\MultiAuth::STAGEID); - -if (array_key_exists("\SimpleSAML\Auth\Source.id", $state)) { - $authId = $state["\SimpleSAML\Auth\Source.id"]; - /** @var \SimpleSAML\Module\multiauth\Auth\Source\MultiAuth $as */ - $as = \SimpleSAML\Auth\Source::getById($authId); -} else { - $as = null; -} - -$source = null; -if (array_key_exists('source', $_REQUEST)) { - $source = $_REQUEST['source']; -} else { - foreach ($_REQUEST as $k => $v) { - $k = explode('-', $k, 2); - if (count($k) === 2 && $k[0] === 'src') { - $source = base64_decode($k[1]); - } - } -} -if ($source !== null) { - if ($as !== null) { - $as->setPreviousSource($source); - } - \SimpleSAML\Module\multiauth\Auth\Source\MultiAuth::delegateAuthentication($source, $state); -} - -if (array_key_exists('multiauth:preselect', $state)) { - $source = $state['multiauth:preselect']; - \SimpleSAML\Module\multiauth\Auth\Source\MultiAuth::delegateAuthentication($source, $state); -} - -$globalConfig = \SimpleSAML\Configuration::getInstance(); -$t = new \SimpleSAML\XHTML\Template($globalConfig, 'mymodule:selectsource.tpl.php'); - -$defaultLanguage = $globalConfig->getString('language.default', 'en'); -$language = $t->getTranslator()->getLanguage()->getLanguage(); - -$sources = $state[\SimpleSAML\Module\multiauth\Auth\Source\MultiAuth::SOURCESID]; -foreach ($sources as $key => $source) { - $sources[$key]['source64'] = base64_encode($sources[$key]['source']); - if (isset($sources[$key]['text'][$language])) { - $sources[$key]['text'] = $sources[$key]['text'][$language]; - } else { - $sources[$key]['text'] = $sources[$key]['text'][$defaultLanguage]; - } - - if (isset($sources[$key]['help'][$language])) { - $sources[$key]['help'] = $sources[$key]['help'][$language]; - } else { - $sources[$key]['help'] = $sources[$key]['help'][$defaultLanguage]; - } -} - -$t->data['authstate'] = $authStateId; -$t->data['sources'] = $sources; -$t->data['selfUrl'] = $_SERVER['PHP_SELF']; - -if ($as !== null) { - $t->data['preferred'] = $as->getPreviousSource(); -} else { - $t->data['preferred'] = null; -} -$t->show(); -exit(); -- GitLab