This repository has been archived by the owner on Sep 19, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Refactored * Refactored * Refactored * Refactored * Refactored * Refactored * Refactored * Refactored * Refactored * Refactored
- Loading branch information
Dominik František Bučík
authored
May 27, 2021
1 parent
e857dff
commit dbaacd2
Showing
18 changed files
with
435 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,174 @@ | ||
<?php | ||
/** | ||
* @author Pavel Vyskocil <[email protected]> | ||
*/ | ||
|
||
|
||
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'); | ||
|
||
?><!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | ||
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0" /> | ||
<script type="text/javascript" src="/<?php echo $this->data['baseurlpath']; ?>resources/script.js"></script> | ||
<title>LS Hostel</title> | ||
|
||
<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" /> | ||
|
||
<?php | ||
|
||
|
||
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 | ||
} | ||
?> | ||
|
||
<link rel="stylesheet" type="text/css" href="<?php echo SimpleSAML\Module::getModuleUrl('lshostel/res/bootstrap/css/bootstrap.min.css'); ?>" /> | ||
<link rel="stylesheet" type="text/css" href="<?php echo SimpleSAML\Module::getModuleUrl('lshostel/res/css/lshostel-bbmri.css'); ?>" /> | ||
|
||
<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 .= 'SimpleSAML_focus(\'' . $this->data['autofocus'] . '\');'; | ||
} | ||
if (isset($this->data['onLoad'])) { | ||
$onLoad .= $this->data['onLoad']; | ||
} | ||
|
||
if($onLoad !== '') { | ||
$onLoad = ' onload="' . $onLoad . '"'; | ||
} | ||
?> | ||
<body<?php echo $onLoad; ?>> | ||
|
||
|
||
<div id="wrap"> | ||
|
||
<div id="content"> | ||
<div class="row pl-0 pr-0"> | ||
<div class="col-sm-6 logo-wrap col-align--center"> | ||
<img src="<?php echo SimpleSAML\Module::getModuleUrl('lshostel/res/img/lshostel_256.png'); ?>" alt="Life Science Hostel logo"> | ||
</div> | ||
<div class="col-sm-6"> | ||
<?php | ||
echo "<h1> " . $this->t('{lshostel:pwd_reset:header}') . "</h1>"; | ||
$userName = ""; | ||
if (isset($_POST['username'])) { | ||
$userName = $_POST['username']; | ||
try { | ||
if (!$_POST['passwordResetOk']) { | ||
sendPasswordResetEmail($userName); | ||
$_POST['passwordResetOk'] = true; | ||
unset($_POST['username']); | ||
} | ||
?> | ||
<div class="alert alert-success" > | ||
<p> | ||
<span class="glyphicon glyphicon-exclamation-sign" style="float:left; font-size: 38px; margin-right: 10px;"></span> | ||
<strong><?php echo $this->t('{lshostel:pwd_reset:ok_header}');?></strong> | ||
</p> | ||
<p><?php echo $this->t('{lshostel:pwd_reset:ok_text}');?></p> | ||
</div> | ||
|
||
<?php | ||
} catch (\Exception $exception) { | ||
?> | ||
<div class="alert alert-danger" > | ||
<span class="glyphicon glyphicon-exclamation-sign" style="float:left; font-size: 38px; margin-right: 10px;"></span> | ||
<strong><?php echo $this->t('{lshostel:pwd_reset:err_header}');?></strong> | ||
<p><?php echo $this->t('{lshostel:pwd_reset:err_text_part1}');?></p> | ||
<p><?php echo $this->t('{lshostel:pwd_reset:err_text_part2}');?> | ||
<a href="<?php echo $config->getString('technicalcontact_email'); ?>"><?php echo $this->t('{lshostel:pwd_reset:support}');?></a>. | ||
</p> | ||
</div> | ||
|
||
<?php | ||
} | ||
} | ||
|
||
if (!$_POST['passwordResetOk']) { | ||
?> | ||
|
||
<p><?php echo $this->t('{lshostel:pwd_reset:text}'); ?></p> | ||
|
||
<br> | ||
|
||
<form action="" method="post" name="passwd_reset" class="form-horizontal"> | ||
<div class="form-group"> | ||
<label class="sr-only" for="inlineFormInputGroup"><?php echo $this->t('{{lshostel:pwd_reset:email}'); ?></label> | ||
<div class="input-group mb-2"> | ||
<span class="input-group-addon" id="basic-addon1">@</span> | ||
<input id="username" type="email" name="username" class="form-control" value="<?php echo $userName; ?>" placeholder="Email" aria-describedby="basic-addon1"/> | ||
</div> | ||
</div> | ||
|
||
<div class="form-group"> | ||
<button class="btn btn-success btn-block" type="submit"> | ||
<?php echo $this->t('{lshostel:pwd_reset:submit}'); ?> | ||
</button> | ||
</div> | ||
</form> | ||
|
||
<?php | ||
} | ||
?> | ||
</div> | ||
|
||
<?php | ||
|
||
|
||
|
||
$this->includeAtTemplateBase('includes/footer.php'); |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
if(!empty($this->data['htmlinject']['htmlContentPost'])) { | ||
foreach($this->data['htmlinject']['htmlContentPost'] AS $c) { | ||
echo $c; | ||
} | ||
} | ||
?> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div id="footer"> | ||
|
||
<div style="margin: 0px auto; max-width: 1000px;" class="clearfix"> | ||
|
||
<div style="float: left;"> | ||
<img src="<?php echo SimpleSAML\Module::getModuleUrl('lshostel/res/img/BBMRI-ERIC-gateway-for-health_216.png') ?>"> | ||
</div> | ||
|
||
<div style="float: left;"> | ||
<p>BBMRI-ERIC, Neue Stiftingtalstrasse 2/B/6, 8010 Graz, Austria | ||
+43 316 34 99 17-0 | ||
<a href="mailto:[email protected]">[email protected]</a> | ||
</p> | ||
<p>Copyright © BBMRI-ERIC <?php echo date("Y"); ?> </p> | ||
</div> | ||
</div> | ||
|
||
</div> | ||
|
||
</body> | ||
</html> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,18 +12,16 @@ | |
<div id="footer"> | ||
|
||
<div style="margin: 0px auto; max-width: 1000px;"> | ||
<div class="row"> | ||
|
||
<div style="float: left;"> | ||
<img src="<?php echo SimpleSAML\Module::getModuleUrl('lshostel/res/img/BBMRI-ERIC-gateway-for-health_216.png') ?>"> | ||
</div> | ||
|
||
<div style="float: left;"> | ||
<p>BBMRI-ERIC, Neue Stiftingtalstrasse 2/B/6, 8010 Graz, Austria | ||
+43 316 34 99 17-0 | ||
<a href="mailto:[email protected]">[email protected]</a> | ||
</p> | ||
<p>Copyright © BBMRI-ERIC <?php echo date("Y"); ?> </p> | ||
</div> | ||
|
||
<div id="eu" class="col-md-6"> | ||
<p>This project has received funding from the European Union’s Horizon 2020 research and innovation programme under grant agreement No 654248.</p> | ||
</div> | ||
<div class="col-md-6"> | ||
<p><a href="mailto:[email protected]">CONTACT</a></p> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
</div> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.