Replace login and password reset templates
This commit is contained in:
parent
307d34430a
commit
2d1a299fe0
@ -11,19 +11,25 @@ class ForgotPasswordForm extends SubTemplate
|
|||||||
protected function html_content()
|
protected function html_content()
|
||||||
{
|
{
|
||||||
echo '
|
echo '
|
||||||
<div class="boxed_content">
|
<h1>Password reset procedure</h1>';
|
||||||
<h2>Password reset procedure</h2>';
|
|
||||||
|
|
||||||
foreach ($this->_subtemplates as $template)
|
foreach ($this->_subtemplates as $template)
|
||||||
$template->html_main();
|
$template->html_main();
|
||||||
|
|
||||||
echo '
|
echo '
|
||||||
<p>Please fill in the email address you used to sign up in the form below. You will be sent a reset link to your email address.</p>
|
<p class="mt-3">Please fill in the email address you used to sign up in the form below. We will send a reset link to your email address.</p>
|
||||||
<form class="form-horizontal" action="', BASEURL, '/resetpassword/?step=1" method="post">
|
<form action="', BASEURL, '/resetpassword/?step=1" method="post">
|
||||||
<label class="control-label" for="field_emailaddress">E-mail address:</label><br>
|
<div class="row">
|
||||||
<input type="text" id="field_emailaddress" name="emailaddress">
|
<label class="col-sm-2 col-form-label" for="field_emailaddress">E-mail address:</label>
|
||||||
<button type="submit" class="btn btn-primary">Send mail</button>
|
<div class="col-sm-4">
|
||||||
</form>
|
<input type="text" class="form-control" id="field_emailaddress" name="emailaddress">
|
||||||
</div>';
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row mt-3">
|
||||||
|
<div class="offset-sm-2 col-sm-2">
|
||||||
|
<button type="submit" class="btn btn-primary">Send mail</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,45 +11,57 @@ class LogInForm extends SubTemplate
|
|||||||
private $redirect_url = '';
|
private $redirect_url = '';
|
||||||
private $emailaddress = '';
|
private $emailaddress = '';
|
||||||
|
|
||||||
|
protected $_class = 'content-box container w-50';
|
||||||
|
|
||||||
public function setRedirectUrl($url)
|
public function setRedirectUrl($url)
|
||||||
{
|
{
|
||||||
$_SESSION['login_url'] = $url;
|
|
||||||
$this->redirect_url = $url;
|
$this->redirect_url = $url;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setEmail($addr)
|
public function setEmail($addr)
|
||||||
{
|
{
|
||||||
$this->emailaddress = htmlentities($addr);
|
$this->emailaddress = htmlspecialchars($addr);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function html_content()
|
protected function html_content()
|
||||||
{
|
{
|
||||||
echo '
|
if (!empty($this->_title))
|
||||||
<form action="', BASEURL, '/login/" method="post" id="login">
|
echo '
|
||||||
<h3>Log in</h3>';
|
<h1 class="mb-4">Log in to your account</h1>';
|
||||||
|
|
||||||
foreach ($this->_subtemplates as $template)
|
if (!empty($this->_subtemplates))
|
||||||
$template->html_main();
|
{
|
||||||
|
foreach ($this->_subtemplates as $template)
|
||||||
|
$template->html_main();
|
||||||
|
}
|
||||||
|
|
||||||
echo '
|
echo '
|
||||||
<dl>
|
<form class="mt-4" action="', BASEURL, '/login/" method="post">
|
||||||
<dt><label for="field_emailaddress">E-mail address:</label></dt>
|
<div class="row">
|
||||||
<dd><input type="text" id="field_emailaddress" name="emailaddress" tabindex="1" value="', $this->emailaddress, '" autofocus></dd>
|
<label class="col-sm-3 col-form-label" for="field_emailaddress">E-mail address:</label>
|
||||||
|
<div class="col-sm">
|
||||||
<dt><label for="field_password">Password:</label></dt>
|
<input type="text" class="form-control" id="field_emailaddress" name="emailaddress" value="', $this->emailaddress, '">
|
||||||
<dd><input type="password" id="field_password" name="password" tabindex="2"></dd>
|
</div>
|
||||||
</dl>';
|
</div>
|
||||||
|
<div class="row mt-3">
|
||||||
|
<label class="col-sm-3 col-form-label" for="field_password">Password:</label>
|
||||||
|
<div class="col-sm">
|
||||||
|
<input type="password" class="form-control" id="field_password" name="password">
|
||||||
|
</div>
|
||||||
|
</div>';
|
||||||
|
|
||||||
// Throw in a redirect url if asked for.
|
// Throw in a redirect url if asked for.
|
||||||
if (!empty($this->redirect_url))
|
if (!empty($this->redirect_url))
|
||||||
echo '
|
echo '
|
||||||
<input type="hidden" name="redirect_url" value="', base64_encode($this->redirect_url), '">';
|
<input type="hidden" name="redirect_url" value="', base64_encode($this->redirect_url), '">';
|
||||||
|
|
||||||
echo '
|
echo '
|
||||||
<a href="', BASEURL, '/resetpassword/">Forgotten your password?</a>
|
<div class="mt-4">
|
||||||
<div class="buttonstrip">
|
<div class="offset-sm-3 col-sm-9">
|
||||||
<button type="submit" class="btn btn-primary" id="field_login" name="login" tabindex="3">Log in</button>
|
<button type="submit" class="btn btn-primary">Sign in</button>
|
||||||
</div>
|
<a class="btn btn-light" href="', BASEURL, '/resetpassword/" style="margin-left: 1em">Forgotten your password?</a>
|
||||||
</form>';
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -20,27 +20,31 @@ class PasswordResetForm extends SubTemplate
|
|||||||
protected function html_content()
|
protected function html_content()
|
||||||
{
|
{
|
||||||
echo '
|
echo '
|
||||||
<div class="boxed_content">
|
<h1 class="mb-4">Password reset procedure</h1>';
|
||||||
<h2>Password reset procedure</h2>';
|
|
||||||
|
|
||||||
foreach ($this->_subtemplates as $template)
|
foreach ($this->_subtemplates as $template)
|
||||||
$template->html_main();
|
$template->html_main();
|
||||||
|
|
||||||
echo '
|
echo '
|
||||||
<p>You have successfully confirmed your identify. Please use the form below to set a new password.</p>
|
<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&email=', rawurlencode($this->email), '&key=', $this->key, '" method="post">
|
<form action="', BASEURL, '/resetpassword/?step=2&email=', rawurlencode($this->email), '&key=', $this->key, '" method="post">
|
||||||
<p>
|
<div class="row mt-3">
|
||||||
<label class="control-label" for="field_password1">New password:</label>
|
<label class="col-sm-2 col-form-label" for="field_password1">New password:</label>
|
||||||
<input type="password" id="field_password1" name="password1">
|
<div class="col-sm-3">
|
||||||
</p>
|
<input type="password" class="form-control" id="field_password1" name="password1">
|
||||||
|
</div>
|
||||||
<p>
|
</div>
|
||||||
<label class="control-label" for="field_password2">Repeat new password:</label>
|
<div class="row mt-3">
|
||||||
<input type="password" id="field_password2" name="password2">
|
<label class="col-sm-2 col-form-label" for="field_password2">Repeat new password:</label>
|
||||||
</p>
|
<div class="col-sm-3">
|
||||||
|
<input type="password" class="form-control" id="field_password2" name="password2">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row mt-3">
|
||||||
|
<div class="offset-sm-2 col-sm-2">
|
||||||
<button type="submit" class="btn btn-primary">Reset password</button>
|
<button type="submit" class="btn btn-primary">Reset password</button>
|
||||||
</form>
|
</div>
|
||||||
</div>';
|
</div>
|
||||||
|
</form>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user