diff --git a/composer.json b/composer.json index 1290c8b..fece055 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": "~4.0" + "cesnet/simplesamlphp-module-perun": "~5.0" } } diff --git a/templates/pwd_reset_bbmri-tpl.php b/templates/pwd_reset_bbmri-tpl.php new file mode 100644 index 0000000..9d42876 --- /dev/null +++ b/templates/pwd_reset_bbmri-tpl.php @@ -0,0 +1,174 @@ + + */ + + +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/lshostel2/consent/consentform.php b/themes/lshostel-bbmri/consent/consentform.php similarity index 100% rename from themes/lshostel2/consent/consentform.php rename to themes/lshostel-bbmri/consent/consentform.php diff --git a/themes/lshostel2/consent/noconsent.php b/themes/lshostel-bbmri/consent/noconsent.php similarity index 100% rename from themes/lshostel2/consent/noconsent.php rename to themes/lshostel-bbmri/consent/noconsent.php diff --git a/themes/lshostel2/core/loginuserpass.php b/themes/lshostel-bbmri/core/loginuserpass.php similarity index 98% rename from themes/lshostel2/core/loginuserpass.php rename to themes/lshostel-bbmri/core/loginuserpass.php index 05945bd..111f04c 100644 --- a/themes/lshostel2/core/loginuserpass.php +++ b/themes/lshostel-bbmri/core/loginuserpass.php @@ -68,7 +68,7 @@ ?> - + @@ -196,7 +196,7 @@ t('{lshostel:lshostel:register_acc_hostel}') ?> | - "> + "> t('{lshostel:lshostel:forgot_password}') ?>
diff --git a/themes/lshostel2/default/error.php b/themes/lshostel-bbmri/default/error.php similarity index 100% rename from themes/lshostel2/default/error.php rename to themes/lshostel-bbmri/default/error.php diff --git a/themes/lshostel2/default/errorreport.php b/themes/lshostel-bbmri/default/errorreport.php similarity index 100% rename from themes/lshostel2/default/errorreport.php rename to themes/lshostel-bbmri/default/errorreport.php diff --git a/themes/lshostel-bbmri/default/includes/footer.php b/themes/lshostel-bbmri/default/includes/footer.php new file mode 100644 index 0000000..26be6d1 --- /dev/null +++ b/themes/lshostel-bbmri/default/includes/footer.php @@ -0,0 +1,33 @@ +data['htmlinject']['htmlContentPost'])) { + foreach($this->data['htmlinject']['htmlContentPost'] AS $c) { + echo $c; + } +} +?> +
+
+ + + + + + + diff --git a/themes/lshostel2/default/includes/header.php b/themes/lshostel-bbmri/default/includes/header.php similarity index 85% rename from themes/lshostel2/default/includes/header.php rename to themes/lshostel-bbmri/default/includes/header.php index bf150cb..ff2c1da 100644 --- a/themes/lshostel2/default/includes/header.php +++ b/themes/lshostel-bbmri/default/includes/header.php @@ -87,14 +87,19 @@ } } + + + if ($this->isLanguageRTL()) { ?> - - + + + + @@ -118,24 +123,20 @@ } ?> > -
- -
- -data['htmlinject']['htmlContentPre'])) { - foreach($this->data['htmlinject']['htmlContentPre'] AS $c) { - echo $c; - } -} + data['htmlinject']['htmlContentPre'])) { + foreach($this->data['htmlinject']['htmlContentPre'] AS $c) { + echo $c; + } + } diff --git a/themes/lshostel2/default/post.php b/themes/lshostel-bbmri/default/post.php similarity index 100% rename from themes/lshostel2/default/post.php rename to themes/lshostel-bbmri/default/post.php diff --git a/themes/lshostel2/perun/disco-tpl.php b/themes/lshostel-bbmri/perun/disco-tpl.php similarity index 100% rename from themes/lshostel2/perun/disco-tpl.php rename to themes/lshostel-bbmri/perun/disco-tpl.php diff --git a/themes/lshostel/core/loginuserpass.php b/themes/lshostel/core/loginuserpass.php index 92718f5..05945bd 100644 --- a/themes/lshostel/core/loginuserpass.php +++ b/themes/lshostel/core/loginuserpass.php @@ -1,5 +1,13 @@ getString(REGISTER_LINK); + if (strlen($this->data['username']) > 0) { $this->data['autofocus'] = 'password'; } else { @@ -184,7 +192,7 @@
- + t('{lshostel:lshostel:register_acc_hostel}') ?> | diff --git a/themes/lshostel/default/includes/footer.php b/themes/lshostel/default/includes/footer.php index 4f85848..05da8c4 100644 --- a/themes/lshostel/default/includes/footer.php +++ b/themes/lshostel/default/includes/footer.php @@ -12,18 +12,16 @@ diff --git a/themes/lshostel/default/includes/header.php b/themes/lshostel/default/includes/header.php index 237cfa9..bf150cb 100644 --- a/themes/lshostel/default/includes/header.php +++ b/themes/lshostel/default/includes/header.php @@ -87,19 +87,14 @@ } } - - - if ($this->isLanguageRTL()) { ?> - - - - + + @@ -124,12 +119,10 @@ ?> > - -
-
- - data['htmlinject']['htmlContentPre'])) { diff --git a/themes/lshostel/perun/disco-tpl.php b/themes/lshostel/perun/disco-tpl.php index 9e30005..4e7f15e 100644 --- a/themes/lshostel/perun/disco-tpl.php +++ b/themes/lshostel/perun/disco-tpl.php @@ -17,19 +17,11 @@ $this->data['head'] .= searchScript(); - - $this->includeAtTemplateBase('includes/header.php'); $this->includeAtTemplateBase('includes/footer.php'); - - - - - - function searchScript() { $script = '