Allow resetting password through email.

This also adopts the use of an Alert template for error and success messages.
This commit is contained in:
2016-09-02 11:17:10 +02:00
parent 3587447cc0
commit 7487068171
13 changed files with 456 additions and 20 deletions

View File

@@ -8,15 +8,9 @@
class LogInForm extends SubTemplate
{
private $error_message = '';
private $redirect_url = '';
private $emailaddress = '';
public function setErrorMessage($message)
{
$this->error_message = $message;
}
public function setRedirectUrl($url)
{
$_SESSION['login_url'] = $url;
@@ -32,12 +26,10 @@ class LogInForm extends SubTemplate
{
echo '
<form action="', BASEURL, '/login/" method="post" id="login">
<h3>Admin login</h3>';
<h3>Log in</h3>';
// Invalid login? Show a message.
if (!empty($this->error_message))
echo '
<p style="color: red">', $this->error_message, '</p>';
foreach ($this->_subtemplates as $template)
$template->html_main();
echo '
<dl>
@@ -54,7 +46,10 @@ class LogInForm extends SubTemplate
<input type="hidden" name="redirect_url" value="', base64_encode($this->redirect_url), '">';
echo '
<div><button type="submit" class="btn btn-primary" id="field_login" name="login" tabindex="3">Log in</button></div>
<a href="', BASEURL, '/resetpassword/">Forgotten your password?</a>
<div class="buttonstrip">
<button type="submit" class="btn btn-primary" id="field_login" name="login" tabindex="3">Log in</button>
</div>
</form>';
}
}