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

@@ -0,0 +1,46 @@
<?php
/*****************************************************************************
* PasswordResetForm.php
* Contains the password reset form template.
*
* Kabuki CMS (C) 2013-2016, Aaron van Geffen
*****************************************************************************/
class PasswordResetForm extends SubTemplate
{
private $email;
private $key;
public function __construct($email, $key)
{
$this->email = $email;
$this->key = $key;
}
protected function html_content()
{
echo '
<div class="boxed_content">
<h2>Password reset procedure</h2>';
foreach ($this->_subtemplates as $template)
$template->html_main();
echo '
<p>You have successfully confirmed your identify. Please use the form below to set a new password.</p>
<form class="form-horizontal" action="', BASEURL, '/resetpassword/?step=2&amp;email=', rawurlencode($this->email), '&amp;key=', $this->key, '" method="post">
<p>
<label class="control-label" for="field_password1">New password:</label>
<input type="password" id="field_password1" name="password1">
</p>
<p>
<label class="control-label" for="field_password2">Repeat new password:</label>
<input type="password" id="field_password2" name="password2">
</p>
<button type="submit" class="btn btn-primary">Reset password</button>
</form>
</div>';
}
}