2018-01-21 19:07:43 +01:00
|
|
|
<?php
|
2020-01-17 01:28:34 +01:00
|
|
|
require_once (__DIR__ . '/../internals/website.php');
|
2018-01-21 19:07:43 +01:00
|
|
|
|
2020-01-17 01:28:34 +01:00
|
|
|
/** @var PageFrameOptions $FRAME_OPTIONS */ global $FRAME_OPTIONS;
|
|
|
|
/** @var URLRoute $ROUTE */ global $ROUTE;
|
|
|
|
/** @var Website $SITE */ global $SITE;
|
|
|
|
?>
|
|
|
|
|
|
|
|
<?php
|
|
|
|
$FRAME_OPTIONS->title = 'Login';
|
|
|
|
$FRAME_OPTIONS->canonical_url = 'https://www.mikescher.com/login';
|
|
|
|
$FRAME_OPTIONS->activeHeader = 'login';
|
|
|
|
|
|
|
|
$FRAME_OPTIONS->addScript('/data/javascript/ms_basic.js', true);
|
|
|
|
?>
|
|
|
|
|
|
|
|
<?php
|
2018-01-21 19:07:43 +01:00
|
|
|
$err = false;
|
|
|
|
|
|
|
|
if (key_exists('username', $_GET) && key_exists('password', $_GET) && key_exists('redirect', $_GET))
|
|
|
|
{
|
2020-01-17 01:28:34 +01:00
|
|
|
if ($_GET['username'] === $SITE->config['admin_username'] && $_GET['password'] === $SITE->config['admin_password'])
|
|
|
|
{
|
|
|
|
$SITE->setLoginCookie($_GET['username'], $_GET['password']);
|
|
|
|
$FRAME_OPTIONS->setForcedRedirect($_GET['redirect']);
|
|
|
|
return;
|
2018-01-21 19:07:43 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
$err = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-01-17 01:28:34 +01:00
|
|
|
$redirect = $ROUTE->parameter['login_target'];
|
2019-12-28 23:52:19 +01:00
|
|
|
if (($redirect === '/' || $redirect === '') && isset($_GET['redirect'])) $redirect = $_GET['redirect'];
|
2020-01-17 01:28:34 +01:00
|
|
|
if (($redirect === '/' || $redirect === '')) $redirect = '/admin';
|
2018-01-21 19:07:43 +01:00
|
|
|
?>
|
|
|
|
|
2020-01-17 01:28:34 +01:00
|
|
|
<div class="aboutcontent">
|
2018-01-21 19:07:43 +01:00
|
|
|
|
2020-01-17 01:28:34 +01:00
|
|
|
<div class="boxedcontent">
|
|
|
|
<div class="bc_header">Mikescher.com - Login</div>
|
2018-01-21 19:07:43 +01:00
|
|
|
|
2020-01-17 01:28:34 +01:00
|
|
|
<div class="bc_data">
|
2018-01-21 19:07:43 +01:00
|
|
|
|
2020-01-17 01:28:34 +01:00
|
|
|
<div class="form">
|
|
|
|
<form id="loginform" action="/login" method="GET">
|
2018-01-21 19:07:43 +01:00
|
|
|
|
2020-01-17 01:28:34 +01:00
|
|
|
<?php if ($err): ?>
|
|
|
|
<span class="loginerror">Wrong username or password</span>
|
|
|
|
<?php endif; ?>
|
2018-01-21 19:07:43 +01:00
|
|
|
|
2020-01-17 01:28:34 +01:00
|
|
|
<div>
|
|
|
|
<label for="username" class="required">Username</label>
|
|
|
|
<input name="username" id="username" type="text" autofocus>
|
|
|
|
</div>
|
2018-01-21 19:07:43 +01:00
|
|
|
|
2020-01-17 01:28:34 +01:00
|
|
|
<div>
|
|
|
|
<label for="password">Password</label>
|
|
|
|
<input name="password" id="password" type="password">
|
|
|
|
</div>
|
2018-01-21 19:07:43 +01:00
|
|
|
|
2020-01-17 01:28:34 +01:00
|
|
|
<div style="display: none; visibility: hidden">
|
|
|
|
<label for="redirect">Redirect</label>
|
|
|
|
<input name="redirect" id="redirect" type="text" value="<?php echo $redirect ?>">
|
|
|
|
</div>
|
2018-01-21 19:07:43 +01:00
|
|
|
|
2020-01-17 01:28:34 +01:00
|
|
|
<div>
|
|
|
|
<button class="button" type="submit" name="yt0">Login</button>
|
|
|
|
</div>
|
2018-01-21 19:07:43 +01:00
|
|
|
|
2020-01-17 01:28:34 +01:00
|
|
|
</form>
|
|
|
|
</div>
|
2018-01-21 19:07:43 +01:00
|
|
|
|
2020-01-17 01:28:34 +01:00
|
|
|
</div>
|
2018-01-21 19:07:43 +01:00
|
|
|
|
2020-01-17 01:28:34 +01:00
|
|
|
</div>
|
2018-01-21 19:07:43 +01:00
|
|
|
|
|
|
|
</div>
|