diff --git a/CHANGELOG.md b/CHANGELOG.md index fd51163..f0bf9c0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,8 +25,8 @@ All notable changes to this project will be documented in this file. ## [v1.0.0] - First release -[Unreleased]: https://github.com/CESNET/lshostel-aai-proxy-idp-template/tree/master -[v1.3.0]: https://github.com/CESNET/lshostel-aai-proxy-idp-template/tree/v1.3.0 -[v1.2.0]: https://github.com/CESNET/lshostel-aai-proxy-idp-template/tree/v1.2.0 -[v1.1.0]: https://github.com/CESNET/lshostel-aai-proxy-idp-template/tree/v1.1.0 -[v1.0.0]: https://github.com/CESNET/lshostel-aai-proxy-idp-template/tree/v1.0.0 +[Unreleased]: https://github.com/CESNET/lsaai-aai-proxy-idp-template/tree/master +[v1.3.0]: https://github.com/CESNET/lsaai-aai-proxy-idp-template/tree/v1.3.0 +[v1.2.0]: https://github.com/CESNET/lsaai-aai-proxy-idp-template/tree/v1.2.0 +[v1.1.0]: https://github.com/CESNET/lsaai-aai-proxy-idp-template/tree/v1.1.0 +[v1.0.0]: https://github.com/CESNET/lsaai-aai-proxy-idp-template/tree/v1.0.0 diff --git a/README.md b/README.md index 979681f..8928718 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,11 @@ -# lshostel-aai-proxy-idp-template +# lsaai-aai-proxy-idp-template -[![Latest Stable Version](https://poser.pugx.org/bbmri/simplesamlphp-module-lshostel/v/stable)](https://packagist.org/packages/bbmri/simplesamlphp-module-lshostel) -[![Latest Unstable Version](https://poser.pugx.org/bbmri/simplesamlphp-module-lshostel/v/unstable)](https://packagist.org/packages/bbmri/simplesamlphp-module-lshostel) -[![CodeFactor](https://www.codefactor.io/repository/github/cesnet/lshostel-aai-proxy-idp-template/badge)](https://www.codefactor.io/repository/github/cesnet/lshostel-aai-proxy-idp-template) -[![License](https://poser.pugx.org/bbmri/simplesamlphp-module-lshostel/license)](https://packagist.org/packages/bbmri/simplesamlphp-module-lshostel) +[![Latest Stable Version](https://poser.pugx.org/bbmri/simplesamlphp-module-lsaai/v/stable)](https://packagist.org/packages/bbmri/simplesamlphp-module-lsaai) +[![Latest Unstable Version](https://poser.pugx.org/bbmri/simplesamlphp-module-lsaai/v/unstable)](https://packagist.org/packages/bbmri/simplesamlphp-module-lsaai) +[![CodeFactor](https://www.codefactor.io/repository/github/cesnet/lsaai-aai-proxy-idp-template/badge)](https://www.codefactor.io/repository/github/cesnet/lsaai-aai-proxy-idp-template) +[![License](https://poser.pugx.org/bbmri/simplesamlphp-module-lsaai/license)](https://packagist.org/packages/bbmri/simplesamlphp-module-lsaai) Template for LifeScience Hostel AAI Proxy IdP component ## Instalation - `php composer.phar require bbmri/simplesamlphp-module-lshostel` \ No newline at end of file + `php composer.phar require bbmri/simplesamlphp-module-lsaai` \ No newline at end of file diff --git a/composer.json b/composer.json index 9f9da58..70527f9 100644 --- a/composer.json +++ b/composer.json @@ -13,6 +13,6 @@ "require": { "simplesamlphp/composer-module-installer": "~1.0", "simplesamlphp/simplesamlphp": "~1.17", - "cesnet/simplesamlphp-module-perun": "~5.0" + "cesnet/simplesamlphp-module-perun": "~6.0" } } diff --git a/config-examples/module_lshostel.php b/config-examples/module_lshostel.php index 054bcde..5f31534 100644 --- a/config-examples/module_lshostel.php +++ b/config-examples/module_lshostel.php @@ -1,18 +1,18 @@ '', 'pwd_reset' => [ - 'lshostel_entity_id' => '', - 'lshostel_scope' => '', + 'lsaai_entity_id' => '', + 'lsaai_scope' => '', 'vo_short_name' => '', 'perun_namespace' => '', 'perun_url' => '', diff --git a/dictionaries/lsaai.definition.json b/dictionaries/lsaai.definition.json new file mode 100644 index 0000000..24bb672 --- /dev/null +++ b/dictionaries/lsaai.definition.json @@ -0,0 +1,26 @@ +{ + "error_report_email_message": { + "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": { + "en": "Life Science Hostel Login" + }, + "user_pass_text": { + "en": "Enter your email and password" + }, + "register_acc_hostel": { + "en": "Sign up" + }, + "email": { + "en": "Email" + }, + "forgot_password": { + "en": "Forgotten password" + }, + "title_WRONGUSERPASS": { + "en": "Incorrect email or password" + }, + "descr_WRONGUSERPASS": { + "en": "Either no user with this email could be found, or the password you gave was wrong. Please check the email and try again." + } +} diff --git a/lib/Auth/Process/LoginModify.php b/lib/Auth/Process/LoginModify.php index 85b22ae..e4471d7 100644 --- a/lib/Auth/Process/LoginModify.php +++ b/lib/Auth/Process/LoginModify.php @@ -1,6 +1,6 @@ loginAttrName][0] = $userName; - Logger::debug("lshostel:LoginModify - Modified " . $oldUserName . " to new format " . $userName); + Logger::debug("lsaai:LoginModify - Modified " . $oldUserName . " to new format " . $userName); } } diff --git a/templates/pwd_reset-tpl.php b/templates/pwd_reset-tpl.php index 69d9a28..8fbdd35 100644 --- a/templates/pwd_reset-tpl.php +++ b/templates/pwd_reset-tpl.php @@ -67,8 +67,8 @@ } ?> - - + + @@ -97,77 +97,84 @@
-
+
-
- Life Science Hostel logo +
+ Life Science Hostel logo
-
+
" . $this->t('{lshostel:pwd_reset:header}') . ""; -$userName = ""; -if (isset($_POST['username'])) { - $userName = $_POST['username']; - try { - if (!$_POST['passwordResetOk']) { - sendPasswordResetEmail($userName); - $_POST['passwordResetOk'] = true; - unset($_POST['username']); - } - ?> -
-

- - t('{lshostel:pwd_reset:ok_header}');?> -

-

t('{lshostel:pwd_reset:ok_text}');?>

-
- - -
- - t('{lshostel:pwd_reset:err_header}');?> -

t('{lshostel:pwd_reset:err_text_part1}');?>

-

t('{lshostel:pwd_reset:err_text_part2}');?> - t('{lshostel:pwd_reset:support}');?>. -

-
- - - -

t('{lshostel:pwd_reset:text}'); ?>

- -
- -
-
- -
- @ - -
-
- -
- -
-
- - + echo "

" . $this->t('{lsaai:pwd_reset:header}') . "

"; + $userName = ""; + if (isset($_POST['username'])) { + $userName = $_POST['username']; + try { + if (!$_POST['passwordResetOk']) { + sendPasswordResetEmail($userName); + $_POST['passwordResetOk'] = true; + unset($_POST['username']); + } + ?> +
+

+ + t('{lsaai:pwd_reset:ok_header}');?> +

+

t('{lsaai:pwd_reset:ok_text}');?>

+
+ + getString('technicalcontact_email'); + if (!str_starts_with("mailto:", $emailAddress)) { + $emailAddress = "mailto:" . $emailAddress; + } + + ?> +
+ + t('{lsaai:pwd_reset:err_header}');?> +

t('{lsaai:pwd_reset:err_text_part1}');?>

+

t('{lsaai:pwd_reset:err_text_part2}');?> + t('{lsaai:pwd_reset:support}');?>. +

+
+ + + +

t('{lsaai:pwd_reset:text}'); ?>

+ +
+ +
+
+ +
+ + + + +
+
+ +
+ +
+
+ +
- - */ - - -use SimpleSAML\Configuration; - -$config = Configuration::getInstance(); - -if (!isset($_POST['passwordResetOk'])) { - $_POST['passwordResetOk'] = false; -} - -/** - * Support the htmlinject hook, which allows modules to change header, pre and post body on all pages. - */ -$this->data['htmlinject'] = array( - 'htmlContentPre' => array(), - 'htmlContentPost' => array(), - 'htmlContentHead' => array(), -); - - -$jquery = array(); -if (array_key_exists('jquery', $this->data)) $jquery = $this->data['jquery']; - -if (array_key_exists('pageid', $this->data)) { - $hookinfo = array( - '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); -} - -header('X-Frame-Options: SAMEORIGIN'); - -?> - - - - - - LS Hostel - - - - - data['htmlinject']['htmlContentHead'])) { - foreach($this->data['htmlinject']['htmlContentHead'] AS $c) { - echo $c; - } - } - - - if ($this->isLanguageRTL()) { - ?> - - - - - - - - - - data)) { - echo '' . $this->data['head'] . ''; - } - ?> - -data)) { - $onLoad .= 'SimpleSAML_focus(\'' . $this->data['autofocus'] . '\');'; -} -if (isset($this->data['onLoad'])) { - $onLoad .= $this->data['onLoad']; -} - -if($onLoad !== '') { - $onLoad = ' onload="' . $onLoad . '"'; -} -?> -> - - -
- -
-
-
- Life Science Hostel logo -
-
- " . $this->t('{lshostel:pwd_reset:header}') . ""; -$userName = ""; -if (isset($_POST['username'])) { - $userName = $_POST['username']; - try { - if (!$_POST['passwordResetOk']) { - sendPasswordResetEmail($userName); - $_POST['passwordResetOk'] = true; - unset($_POST['username']); - } - ?> -
-

- - t('{lshostel:pwd_reset:ok_header}');?> -

-

t('{lshostel:pwd_reset:ok_text}');?>

-
- - -
- - t('{lshostel:pwd_reset:err_header}');?> -

t('{lshostel:pwd_reset:err_text_part1}');?>

-

t('{lshostel:pwd_reset:err_text_part2}');?> - t('{lshostel:pwd_reset:support}');?>. -

-
- - - -

t('{lshostel:pwd_reset:text}'); ?>

- -
- -
-
- -
- @ - -
-
- -
- -
-
- - -
- - includeAtTemplateBase('includes/footer.php'); diff --git a/themes/lshostel-bbmri/default/includes/footer.php b/themes/lshostel-bbmri/default/includes/footer.php deleted file mode 100644 index 26be6d1..0000000 --- a/themes/lshostel-bbmri/default/includes/footer.php +++ /dev/null @@ -1,33 +0,0 @@ -data['htmlinject']['htmlContentPost'])) { - foreach($this->data['htmlinject']['htmlContentPost'] AS $c) { - echo $c; - } -} -?> -
-
-
- - - - - - diff --git a/themes/lshostel/consent/consentform.php b/themes/lshostel/consent/consentform.php index 8c9cd2c..b77d402 100644 --- a/themes/lshostel/consent/consentform.php +++ b/themes/lshostel/consent/consentform.php @@ -57,7 +57,7 @@ $this->data['header'] = $this->t('{consent:consent:consent_header}'); $this->data['head'] = ''; -$this->data['head'] .= ''; +$this->data['head'] .= ''; $this->includeAtTemplateBase('includes/header.php'); ?> diff --git a/themes/lshostel/consent/noconsent.php b/themes/lshostel/consent/noconsent.php index c23deec..9a9211b 100644 --- a/themes/lshostel/consent/noconsent.php +++ b/themes/lshostel/consent/noconsent.php @@ -16,7 +16,7 @@ $this->data['header'] = $this->t('{consent:consent:noconsent_title}');; $this->data['head'] = ''; -$this->data['head'] .= ''; +$this->data['head'] .= ''; $this->includeAtTemplateBase('includes/header.php'); diff --git a/themes/lshostel/core/loginuserpass.php b/themes/lshostel/core/loginuserpass.php index 05945bd..0482247 100644 --- a/themes/lshostel/core/loginuserpass.php +++ b/themes/lshostel/core/loginuserpass.php @@ -2,7 +2,7 @@ use SimpleSAML\Configuration; -const CONFIG_FILE_NAME = 'module_lshostel.php'; +const CONFIG_FILE_NAME = 'module_lsaai.php'; const REGISTER_LINK = 'register_link'; $conf = Configuration::getConfig(CONFIG_FILE_NAME); @@ -67,8 +67,8 @@ } ?> - - + + @@ -96,18 +96,18 @@
-
+
-
- Life Science Hostel logo +
+ Life Science Hostel logo
-
+

t('{lshostel:lshostel:user_pass_header}'); + echo $this->t('{lsaai:lsaai:user_pass_header}'); ?>

-

t('{lshostel:lshostel:user_pass_text}'); ?>

+

t('{lsaai:lsaai:user_pass_text}'); ?>


t( - '{lshostel:lshostel:title_WRONGUSERPASS}', + '{lsaai:lsaai:title_WRONGUSERPASS}', $this->data['errorparams'] )); ?> @@ -133,7 +133,7 @@

t( - '{lshostel:lshostel:descr_WRONGUSERPASS}', + '{lsaai:lsaai:descr_WRONGUSERPASS}', $this->data['errorparams'] )); ?> @@ -161,7 +161,9 @@ - + "> + t('{lsaai:lsaai:forgot_password}') ?> +

- +
- @ - + + + +
@@ -193,12 +197,12 @@
data['stateparams'] as $name => $value) { diff --git a/themes/lshostel/default/error.php b/themes/lshostel/default/error.php index 92be6e9..c28cf1a 100644 --- a/themes/lshostel/default/error.php +++ b/themes/lshostel/default/error.php @@ -6,8 +6,8 @@ EOF; -$this->data['head'] .= ''; -$this->data['head'] .= ''; +$this->data['head'] .= ''; +$this->data['head'] .= ''; $this->includeAtTemplateBase('includes/header.php'); ?> @@ -65,7 +65,7 @@
- t('{lshostel:lshostel:error_report_email_message}');?> + t('{lsaai:lsaai:error_report_email_message}');?>
diff --git a/themes/lshostel/default/includes/header.php b/themes/lshostel/default/includes/header.php index bf150cb..6fbbeca 100644 --- a/themes/lshostel/default/includes/header.php +++ b/themes/lshostel/default/includes/header.php @@ -93,8 +93,8 @@ - - + + @@ -122,7 +122,7 @@