2016-09-01 23:13:23 +02:00
|
|
|
<?php
|
|
|
|
/*****************************************************************************
|
|
|
|
* LogInForm.php
|
|
|
|
* Contains the login form template.
|
|
|
|
*
|
|
|
|
* Kabuki CMS (C) 2013-2015, Aaron van Geffen
|
|
|
|
*****************************************************************************/
|
|
|
|
|
|
|
|
class LogInForm extends SubTemplate
|
|
|
|
{
|
|
|
|
private $redirect_url = '';
|
|
|
|
private $emailaddress = '';
|
|
|
|
|
2023-03-11 21:57:55 +01:00
|
|
|
protected $_class = 'content-box container col-lg-6';
|
2023-03-11 13:44:36 +01:00
|
|
|
|
2016-09-01 23:13:23 +02:00
|
|
|
public function setRedirectUrl($url)
|
|
|
|
{
|
|
|
|
$this->redirect_url = $url;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function setEmail($addr)
|
|
|
|
{
|
2023-03-11 13:44:36 +01:00
|
|
|
$this->emailaddress = htmlspecialchars($addr);
|
2016-09-01 23:13:23 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
protected function html_content()
|
|
|
|
{
|
2023-03-11 13:44:36 +01:00
|
|
|
if (!empty($this->_title))
|
|
|
|
echo '
|
2023-03-11 19:34:01 +01:00
|
|
|
<h1 class="mb-4">Press #RU to continue</h1>';
|
2016-09-01 23:13:23 +02:00
|
|
|
|
2023-03-11 13:44:36 +01:00
|
|
|
if (!empty($this->_subtemplates))
|
|
|
|
{
|
|
|
|
foreach ($this->_subtemplates as $template)
|
|
|
|
$template->html_main();
|
|
|
|
}
|
2016-09-01 23:13:23 +02:00
|
|
|
|
|
|
|
echo '
|
2023-03-11 13:44:36 +01:00
|
|
|
<form class="mt-4" action="', BASEURL, '/login/" method="post">
|
|
|
|
<div class="row">
|
|
|
|
<label class="col-sm-3 col-form-label" for="field_emailaddress">E-mail address:</label>
|
|
|
|
<div class="col-sm">
|
|
|
|
<input type="text" class="form-control" id="field_emailaddress" name="emailaddress" value="', $this->emailaddress, '">
|
|
|
|
</div>
|
|
|
|
</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>';
|
2016-09-01 23:13:23 +02:00
|
|
|
|
|
|
|
// Throw in a redirect url if asked for.
|
|
|
|
if (!empty($this->redirect_url))
|
|
|
|
echo '
|
2023-03-11 13:44:36 +01:00
|
|
|
<input type="hidden" name="redirect_url" value="', base64_encode($this->redirect_url), '">';
|
2016-09-01 23:13:23 +02:00
|
|
|
|
|
|
|
echo '
|
2023-03-11 13:44:36 +01:00
|
|
|
<div class="mt-4">
|
|
|
|
<div class="offset-sm-3 col-sm-9">
|
|
|
|
<button type="submit" class="btn btn-primary">Sign in</button>
|
|
|
|
<a class="btn btn-light" href="', BASEURL, '/resetpassword/" style="margin-left: 1em">Forgotten your password?</a>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</form>';
|
2016-09-01 23:13:23 +02:00
|
|
|
}
|
|
|
|
}
|