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 = '';
|
|
|
|
|
|
|
|
public function setRedirectUrl($url)
|
|
|
|
{
|
|
|
|
$_SESSION['login_url'] = $url;
|
|
|
|
$this->redirect_url = $url;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function setEmail($addr)
|
|
|
|
{
|
|
|
|
$this->emailaddress = htmlentities($addr);
|
|
|
|
}
|
|
|
|
|
|
|
|
protected function html_content()
|
|
|
|
{
|
|
|
|
echo '
|
|
|
|
<form action="', BASEURL, '/login/" method="post" id="login">
|
2016-09-02 11:17:10 +02:00
|
|
|
<h3>Log in</h3>';
|
2016-09-01 23:13:23 +02:00
|
|
|
|
2016-09-02 11:17:10 +02:00
|
|
|
foreach ($this->_subtemplates as $template)
|
|
|
|
$template->html_main();
|
2016-09-01 23:13:23 +02:00
|
|
|
|
|
|
|
echo '
|
|
|
|
<dl>
|
|
|
|
<dt><label for="field_emailaddress">E-mail address:</label></dt>
|
|
|
|
<dd><input type="text" id="field_emailaddress" name="emailaddress" tabindex="1" value="', $this->emailaddress, '" autofocus></dd>
|
|
|
|
|
|
|
|
<dt><label for="field_password">Password:</label></dt>
|
|
|
|
<dd><input type="password" id="field_password" name="password" tabindex="2"></dd>
|
|
|
|
</dl>';
|
|
|
|
|
|
|
|
// Throw in a redirect url if asked for.
|
|
|
|
if (!empty($this->redirect_url))
|
|
|
|
echo '
|
|
|
|
<input type="hidden" name="redirect_url" value="', base64_encode($this->redirect_url), '">';
|
|
|
|
|
|
|
|
echo '
|
2016-09-02 11:17:10 +02:00
|
|
|
<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>
|
2016-09-01 23:13:23 +02:00
|
|
|
</form>';
|
|
|
|
}
|
|
|
|
}
|