Skip to content
Snippets Groups Projects
Verified Commit 2ef33bd8 authored by Dominik Frantisek Bucik's avatar Dominik Frantisek Bucik
Browse files

refactor: :bulb: Rename LS Hostel to LS Username Login

Also update all references

BREAKING CHANGE: :firecracker: modified config options - see example config. Also renamed directory
under "themes"
parent 13b8dbf1
No related branches found
No related tags found
1 merge request!10refactor: 💡remove old hostel, rename references to LS Username Login
Pipeline #296325 passed
Showing
with 45 additions and 31 deletions
<?php <?php
/** /**
* This is example configuration fot lsaai module. Copy this file to default config directory and edit the properties. * This is example configuration for the LS AAI module.
* Copy this file to default config directory and edit the properties.
* *
* copy command (from SimpleSAML base dir) cp modules/lsaai/module_lsaai.php config/ * copy command (from SimpleSAML base dir) cp modules/lsaai/config-templates/module_lsaai.php config/.
*/ */
declare(strict_types=1); declare(strict_types=1);
...@@ -12,8 +13,8 @@ $config = [ ...@@ -12,8 +13,8 @@ $config = [
'register_link' => '', 'register_link' => '',
'pwd_reset' => [ 'pwd_reset' => [
'lsaai_entity_id' => '', 'ls_username_login_entity_id' => '',
'lsaai_scope' => '', 'ls_username_login_scope' => '',
'vo_short_name' => '', 'vo_short_name' => '',
'perun_namespace' => '', 'perun_namespace' => '',
'perun_url' => '', 'perun_url' => '',
......
...@@ -3,18 +3,18 @@ ...@@ -3,18 +3,18 @@
"en": "Please provide your mail so that we can contact you for further information or let you know the issue was fixed." "en": "Please provide your mail so that we can contact you for further information or let you know the issue was fixed."
}, },
"user_pass_header": { "user_pass_header": {
"en": "Life Science Hostel Login" "en": "LS Username Login"
}, },
"user_pass_text": { "user_pass_text": {
"en": "Enter your username and password" "en": "Enter your username and password"
}, },
"register_acc_hostel": { "login_button_register": {
"en": "Sign up" "en": "Sign up"
}, },
"email": { "email": {
"en": "Email" "en": "Email"
}, },
"forgot_password": { "login_button_forgotten_password": {
"en": "Forgotten password" "en": "Forgotten password"
}, },
"title_WRONGUSERPASS": { "title_WRONGUSERPASS": {
......
...@@ -13,8 +13,8 @@ class TemplateHelper ...@@ -13,8 +13,8 @@ class TemplateHelper
{ {
public const LANG_EN = 'en'; public const LANG_EN = 'en';
public const PWD_RESET = 'pwd_reset'; public const PWD_RESET = 'pwd_reset';
public const PWDRESET_LSHOSTEL_ENTITY_ID = 'lshostel_entity_id'; public const PWDRESET_LS_USERNAME_LOGIN_ENTITY_ID = 'ls_username_login_entity_id';
public const PWDRESET_LSHOSTEL_SCOPE = 'lshostel_scope'; public const PWDRESET_LS_USERNAME_LOGIN_SCOPE = 'ls_username_login_scope';
public const PWDRESET_VO_SHORT_NAME = 'vo_short_name'; public const PWDRESET_VO_SHORT_NAME = 'vo_short_name';
public const PWDRESET_PERUN_NAMESPACE = 'perun_namespace'; public const PWDRESET_PERUN_NAMESPACE = 'perun_namespace';
public const PWDRESET_PERUN_URL = 'perun_url'; public const PWDRESET_PERUN_URL = 'perun_url';
...@@ -27,8 +27,8 @@ class TemplateHelper ...@@ -27,8 +27,8 @@ class TemplateHelper
$conf = Configuration::getConfig(TemplateHelper::CONFIG_FILE_NAME); $conf = Configuration::getConfig(TemplateHelper::CONFIG_FILE_NAME);
$pwdConf = $conf->getConfigItem(TemplateHelper::PWD_RESET); $pwdConf = $conf->getConfigItem(TemplateHelper::PWD_RESET);
$lshostelEntityId = $pwdConf->getString(TemplateHelper::PWDRESET_LSHOSTEL_ENTITY_ID); $lsUsernameLoginEntityId = $pwdConf->getString(TemplateHelper::PWDRESET_LS_USERNAME_LOGIN_ENTITY_ID);
$lshostelScope = $pwdConf->getString(TemplateHelper::PWDRESET_LSHOSTEL_SCOPE); $lsUsernameLoginScope = $pwdConf->getString(TemplateHelper::PWDRESET_LS_USERNAME_LOGIN_SCOPE);
$voShortName = $pwdConf->getString(TemplateHelper::PWDRESET_VO_SHORT_NAME); $voShortName = $pwdConf->getString(TemplateHelper::PWDRESET_VO_SHORT_NAME);
$perunNamespace = $pwdConf->getString(TemplateHelper::PWDRESET_PERUN_NAMESPACE); $perunNamespace = $pwdConf->getString(TemplateHelper::PWDRESET_PERUN_NAMESPACE);
$perunUrl = $pwdConf->getString(TemplateHelper::PWDRESET_PERUN_URL); $perunUrl = $pwdConf->getString(TemplateHelper::PWDRESET_PERUN_URL);
...@@ -37,19 +37,15 @@ class TemplateHelper ...@@ -37,19 +37,15 @@ class TemplateHelper
$userName = trim($userName); $userName = trim($userName);
Logger::debug(print_r($userName, true)); Logger::debug(print_r($userName, true));
// $userNameParts = explode('@', $userName, 2); $uid = [$userName . $lsUsernameLoginScope];
// $userName = $userNameParts[0] . '_' . strtolower($userNameParts[1]);
$uid = [$userName . $lshostelScope];
$user = null;
try { try {
$user = $rpcAdapter->getPerunUser($lshostelEntityId, $uid); $user = $rpcAdapter->getPerunUser($lsUsernameLoginEntityId, $uid);
Logger::debug(print_r($user, true)); Logger::debug(print_r($user, true));
} catch (Exception $ex) { } catch (Exception $ex) {
throw new Exception($ex); throw new Exception($ex);
} }
if (null === $user) { if (null === $user) {
throw new Exception('There are no LifeScience Hostel user with username: ' . $userName); throw new Exception('There is no Lifescience RI user with username: ' . $userName);
} }
$vo = $rpcAdapter->getVoByShortName($voShortName); $vo = $rpcAdapter->getVoByShortName($voShortName);
......
...@@ -46,7 +46,7 @@ header('X-Frame-Options: SAMEORIGIN'); ...@@ -46,7 +46,7 @@ header('X-Frame-Options: SAMEORIGIN');
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0"/> <meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0"/>
<script type="text/javascript" src="/<?php <script type="text/javascript" src="/<?php
echo $this->data['baseurlpath']; ?>resources/script.js"></script> echo $this->data['baseurlpath']; ?>resources/script.js"></script>
<title>LS Hostel</title> <title>LS Username Login</title>
<link rel="stylesheet" type="text/css" href="/<?php <link rel="stylesheet" type="text/css" href="/<?php
echo $this->data['baseurlpath']; ?>resources/default.css"/> echo $this->data['baseurlpath']; ?>resources/default.css"/>
...@@ -106,7 +106,7 @@ echo $onLoad; ?>> ...@@ -106,7 +106,7 @@ echo $onLoad; ?>>
<div class="row pl-0 pr-0"> <div class="row pl-0 pr-0">
<div class="col-md-6 col-md-offset-3 logo-wrap col-align--center"> <div class="col-md-6 col-md-offset-3 logo-wrap col-align--center">
<img src="<?php <img src="<?php
echo SimpleSAML\Module::getModuleUrl('lsaai/res/img/ls_logo.png'); ?>" alt="Life Science Hostel logo"> echo SimpleSAML\Module::getModuleUrl('lsaai/res/img/ls_logo.png'); ?>" alt="LS Username Login Logo">
</div> </div>
<div class="col-md-6 col-md-offset-3"> <div class="col-md-6 col-md-offset-3">
<?php <?php
......
...@@ -5,7 +5,6 @@ declare(strict_types=1); ...@@ -5,7 +5,6 @@ declare(strict_types=1);
use SimpleSAML\Configuration; use SimpleSAML\Configuration;
use SimpleSAML\Module\lsaai\TemplateHelper; use SimpleSAML\Module\lsaai\TemplateHelper;
const CONFIG_FILE_NAME = 'module_lsaai.php';
const REGISTER_LINK = 'register_link'; const REGISTER_LINK = 'register_link';
$conf = Configuration::getConfig(TemplateHelper::CONFIG_FILE_NAME); $conf = Configuration::getConfig(TemplateHelper::CONFIG_FILE_NAME);
...@@ -52,7 +51,7 @@ header('X-Frame-Options: SAMEORIGIN'); ...@@ -52,7 +51,7 @@ header('X-Frame-Options: SAMEORIGIN');
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0"/> <meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0"/>
<script type="text/javascript" src="/<?php <script type="text/javascript" src="/<?php
echo $this->data['baseurlpath']; ?>resources/script.js"></script> echo $this->data['baseurlpath']; ?>resources/script.js"></script>
<title>LS Hostel</title> <title>LS Username Login</title>
<link rel="stylesheet" type="text/css" href="/<?php <link rel="stylesheet" type="text/css" href="/<?php
echo $this->data['baseurlpath']; ?>resources/default.css"/> echo $this->data['baseurlpath']; ?>resources/default.css"/>
...@@ -113,7 +112,7 @@ echo $onLoad; ?>> ...@@ -113,7 +112,7 @@ echo $onLoad; ?>>
<div class="row pl-0 pr-0"> <div class="row pl-0 pr-0">
<div class="col-md-6 col-md-offset-3 logo-wrap"> <div class="col-md-6 col-md-offset-3 logo-wrap">
<img src="<?php <img src="<?php
echo SimpleSAML\Module::getModuleUrl('lsaai/res/img/ls_logo.png'); ?>" alt="Life Science Hostel logo"> echo SimpleSAML\Module::getModuleUrl('lsaai/res/img/ls_logo.png'); ?>" alt="LS Username login logo">
</div> </div>
<div class="col-md-6 col-md-offset-3"> <div class="col-md-6 col-md-offset-3">
<h1> <h1>
...@@ -224,14 +223,13 @@ echo $onLoad; ?>> ...@@ -224,14 +223,13 @@ echo $onLoad; ?>>
<a class="btn btn-link" href="<?php <a class="btn btn-link" href="<?php
echo $register_link; ?>"> echo $register_link; ?>">
<?php <?php
echo $this->t('{lsaai:lsaai:register_acc_hostel}'); ?> echo $this->t('{lsaai:lsaai:login_button_register}'); ?>
</a> |
<a class="btn btn-link" href="<?php
echo SimpleSAML\Module::getModuleURL("lsaai/pwd_reset.php");?>">
<?php
echo $this->t('{lsaai:lsaai:login_button_forgotten_password}')?>
</a> </a>
<!-- |-->
<!-- <a class="btn btn-link" href="--><?php
//echo SimpleSAML\Module::getModuleURL("lsaai/pwd_reset.php");?><!--">-->
<!-- --><?php
//echo $this->t('{lsaai:lsaai:forgot_password}')?>
<!-- </a>-->
</div> </div>
<?php <?php
foreach ($this->data['stateparams'] as $name => $value) { foreach ($this->data['stateparams'] as $name => $value) {
......
...@@ -139,10 +139,10 @@ echo $onLoad; ?>> ...@@ -139,10 +139,10 @@ echo $onLoad; ?>>
<div id="header"> <div id="header">
<img src="<?php <img src="<?php
echo SimpleSAML\Module::getModuleUrl('lsaai/res/img/ls_logo.png'); ?>" alt="Life Science Hostel logo"> echo SimpleSAML\Module::getModuleUrl('lsaai/res/img/ls_logo.png'); ?>" alt="LS Username Login logo">
<h1> <h1>
<?php <?php
echo isset($this->data['header']) ? $this->data['header'] : 'Life Science Hostel'; echo isset($this->data['header']) ? $this->data['header'] : 'LS Username Login';
?> ?>
</h1> </h1>
</div> </div>
......
...@@ -3,9 +3,6 @@ ...@@ -3,9 +3,6 @@
declare(strict_types=1); declare(strict_types=1);
use SimpleSAML\Configuration; use SimpleSAML\Configuration;
use SimpleSAML\Error\Exception;
use SimpleSAML\Logger;
use SimpleSAML\Module\lsaai\TemplateHelper;
use SimpleSAML\Module\perun\AdapterRpc; use SimpleSAML\Module\perun\AdapterRpc;
use SimpleSAML\XHTML\Template; use SimpleSAML\XHTML\Template;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment