Initial commit.
This is to be the new HashRU website based on the Aaronweb.net/Kabuki CMS.
This commit is contained in:
60
templates/LogInForm.php
Normal file
60
templates/LogInForm.php
Normal file
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
/*****************************************************************************
|
||||
* LogInForm.php
|
||||
* Contains the login form template.
|
||||
*
|
||||
* Kabuki CMS (C) 2013-2015, Aaron van Geffen
|
||||
*****************************************************************************/
|
||||
|
||||
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;
|
||||
$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">
|
||||
<h3>Admin login</h3>';
|
||||
|
||||
// Invalid login? Show a message.
|
||||
if (!empty($this->error_message))
|
||||
echo '
|
||||
<p style="color: red">', $this->error_message, '</p>';
|
||||
|
||||
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 '
|
||||
<div><button type="submit" class="btn btn-primary" id="field_login" name="login" tabindex="3">Log in</button></div>
|
||||
</form>';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user