1
0
This commit is contained in:
Mike Schwörer 2020-01-17 01:28:34 +01:00
parent 85f107e8bd
commit b2e90d2f42
Signed by: Mikescher
GPG Key ID: D3C7172E0A70F8CF
11 changed files with 282 additions and 323 deletions

View File

@ -887,6 +887,10 @@ html, body {
background: -webkit-radial-gradient(circle, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0) 100%); background: -webkit-radial-gradient(circle, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0) 100%);
} }
.admindberr {
color: #BB2222;
}
/* 400px */ /* 400px */
#loginform div { #loginform div {
display: flex; display: flex;

View File

@ -173,6 +173,7 @@ html,body{margin:0;padding:0;height:100%}
.consistency_result_warn{background:#ff0} .consistency_result_warn{background:#ff0}
.consistency_result_err{background:red} .consistency_result_err{background:red}
.admincontent .boxedcontent hr{width:95%;height:1px;border:0;color:#FFFFFF00;background:-moz-radial-gradient(circle,rgba(0,0,0,0.1),rgba(0,0,0,0));background:-webkit-radial-gradient(circle,rgba(0,0,0,0.1) 0,rgba(0,0,0,0) 100%)} .admincontent .boxedcontent hr{width:95%;height:1px;border:0;color:#FFFFFF00;background:-moz-radial-gradient(circle,rgba(0,0,0,0.1),rgba(0,0,0,0));background:-webkit-radial-gradient(circle,rgba(0,0,0,0.1) 0,rgba(0,0,0,0) 100%)}
.admindberr{color:#b22}
#loginform div{display:flex;flex-direction:column} #loginform div{display:flex;flex-direction:column}
#loginform div button{margin:10px 0;padding:0} #loginform div button{margin:10px 0;padding:0}
.loginerror{display:flex;background:#f44;color:#222;border:1px solid #a44;border-radius:2px;font-weight:bold;padding:0 5px;margin:5px 0 20px 0} .loginerror{display:flex;background:#f44;color:#222;border:1px solid #a44;border-radius:2px;font-weight:bold;padding:0 5px;margin:5px 0 20px 0}

View File

@ -62,3 +62,5 @@
background: -moz-radial-gradient( circle, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.0)); background: -moz-radial-gradient( circle, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.0));
background: -webkit-radial-gradient(circle, rgba(0, 0, 0, 0.1) 0%,rgba(0, 0, 0, 0.0) 100%); background: -webkit-radial-gradient(circle, rgba(0, 0, 0, 0.1) 0%,rgba(0, 0, 0, 0.0) 100%);
} }
.admindberr { color: $COL_ADMIN_STATUS_DB_ERROR; }

View File

@ -156,6 +156,8 @@ $COL_ADMIN_ERROR: #FF0000;
$COL_ADMIN_STATUS_FG: #222222; $COL_ADMIN_STATUS_FG: #222222;
$COL_ADMIN_STATUS_BORDER: 1px solid #888; $COL_ADMIN_STATUS_BORDER: 1px solid #888;
$COL_ADMIN_STATUS_DB_ERROR: #BB2222;
// ------------------------------------ ------------------------------------ // ------------------------------------ ------------------------------------

View File

@ -44,7 +44,7 @@ class Modules
public function Books(): Books public function Books(): Books
{ {
if ($this->books === null) { require_once 'modules/books.php'; $this->books = new Books(); } if ($this->books === null) { require_once 'modules/books.php'; $this->books = new Books($this->site); }
return $this->books; return $this->books;
} }

View File

@ -2,11 +2,15 @@
class Books class Books
{ {
/** @var Website */
private $site;
/** @var array */ /** @var array */
private $staticData; private $staticData;
public function __construct() public function __construct(Website $site)
{ {
$this->site = $site;
$this->load(); $this->load();
} }
@ -104,12 +108,10 @@ class Books
public function createPreview($prog) public function createPreview($prog)
{ {
global $CONFIG;
$src = $prog['imgfront_path']; $src = $prog['imgfront_path'];
$dst = $prog['preview_path']; $dst = $prog['preview_path'];
if ($CONFIG['use_magick']) if ($this->site->config['use_magick'])
magick_resize_image($src, 200, 0, $dst); magick_resize_image($src, 200, 0, $dst);
else else
smart_resize_image($src, 200, 0, true, $dst); smart_resize_image($src, 200, 0, true, $dst);

View File

@ -223,7 +223,7 @@ class Programs
if (strpos($prog['internal_name'], ' ') !== FALSE) return ['result'=>'err', 'message' => 'Internal name contains spaces ' . $prog['name']]; if (strpos($prog['internal_name'], ' ') !== FALSE) return ['result'=>'err', 'message' => 'Internal name contains spaces ' . $prog['name']];
foreach (explode('|', $prog['ui_language']) as $lang) if (convertLanguageToFlag($lang) === null) return ['result'=>'err', 'message' => 'Unknown ui-lang ' . $prog['name']];; foreach (explode('|', $prog['ui_language']) as $lang) if ($this->convertLanguageToFlag($lang) === null) return ['result'=>'err', 'message' => 'Unknown ui-lang ' . $prog['name']];;
if (!in_array($prog['prog_language'], self::PROG_LANGS)) return ['result'=>'err', 'message' => 'Unknown prog-lang ' . $prog['name']]; if (!in_array($prog['prog_language'], self::PROG_LANGS)) return ['result'=>'err', 'message' => 'Unknown prog-lang ' . $prog['name']];
@ -232,11 +232,11 @@ class Programs
if ($prog['license'] !== null && !array_key_exists($prog['license'], self::LICENSES)) return ['result'=>'err', 'message' => 'Unknown license ' . $prog['name']]; if ($prog['license'] !== null && !array_key_exists($prog['license'], self::LICENSES)) return ['result'=>'err', 'message' => 'Unknown license ' . $prog['name']];
$isdl = false; $isdl = false;
foreach (self::getURLs($prog) as $xurl) foreach ($this->getURLs($prog) as $xurl)
{ {
if (!in_array($xurl['type'], self::URL_ORDER)) return ['result'=>'err', 'message' => 'Unknown url ' . $xurl['type']]; if (!in_array($xurl['type'], self::URL_ORDER)) return ['result'=>'err', 'message' => 'Unknown url ' . $xurl['type']];
if ($xurl['type']==='download' && $xurl['isdirect'] && !file_exists(self::getDirectDownloadPath($prog))) return ['result'=>'err', 'message' => 'Direct download not found ' . $prog['name']]; if ($xurl['type']==='download' && $xurl['isdirect'] && !file_exists($this->getDirectDownloadPath($prog))) return ['result'=>'err', 'message' => 'Direct download not found ' . $prog['name']];
if ($xurl['type']==='download' || $xurl['type']==='playstore' || $xurl['type']==='itunesstore') $isdl = true; if ($xurl['type']==='download' || $xurl['type']==='playstore' || $xurl['type']==='itunesstore') $isdl = true;
} }

View File

@ -63,11 +63,6 @@ function formatMilliseconds($millis)
} }
} }
function isProd() {
global $CONFIG;
return $CONFIG['prod'];
}
/** /**
* easy image resize function * easy image resize function
* @author http://www.nimrodstech.com/php-image-resize/ * @author http://www.nimrodstech.com/php-image-resize/

View File

@ -1,56 +1,43 @@
<!DOCTYPE html>
<html lang="en">
<?php <?php
require_once (__DIR__ . '/../internals/base.php'); require_once (__DIR__ . '/../internals/website.php');
require_once (__DIR__ . '/../internals/highscores.php');
require_once (__DIR__ . '/../internals/alephnoteStatistics.php');
require_once (__DIR__ . '/../internals/blog.php');
require_once (__DIR__ . '/../internals/euler.php');
require_once (__DIR__ . '/../internals/adventofcode.php');
require_once (__DIR__ . '/../internals/highscores.php');
require_once (__DIR__ . '/../internals/mikeschergitgraph.php');
require_once (__DIR__ . '/../internals/programs.php');
require_once (__DIR__ . '/../internals/books.php');
require_once (__DIR__ . '/../internals/updateslog.php');
$connected = Database::tryconnect();
$consistency_blog = Blog::checkConsistency();
$consistency_prog = Programs::checkConsistency();
$consistency_euler = Euler::checkConsistency();
$consistency_books = Books::checkConsistency();
$consistency_egg = MikescherGitGraph::checkConsistency();
$consistency_progimg = Programs::checkThumbnails();
$consistency_bookimg = Books::checkThumbnails();
$consistency_aoc = AdventOfCode::checkConsistency();
/** @var PageFrameOptions $FRAME_OPTIONS */ global $FRAME_OPTIONS;
/** @var URLRoute $ROUTE */ global $ROUTE;
/** @var Website $SITE */ global $SITE;
?> ?>
<?php
function dumpConsistency($c) { <?php
$FRAME_OPTIONS->title = 'Admin';
$FRAME_OPTIONS->canonical_url = 'https://www.mikescher.com/admin';
$FRAME_OPTIONS->activeHeader = 'admin';
$FRAME_OPTIONS->addScript('https://code.jquery.com/jquery-latest.min.js', true);
$FRAME_OPTIONS->addScript('/data/javascript/admin.js', true);
$connected = true; try { $SITE->modules->Database(); } catch (Exception $e) { $connected = false; }
$rok = ['result'=>'ok','message'=>''];
$consistency_blog = $rok; try { $consistency_blog = $SITE->modules->Blog()->checkConsistency(); } catch (Exception $e) { $consistency_blog = ['result'=>'ok', 'message'=>"$e"]; }
$consistency_prog = $rok; try { $consistency_prog = $SITE->modules->Programs()->checkConsistency(); } catch (Exception $e) { $consistency_prog = ['result'=>'ok', 'message'=>"$e"]; }
$consistency_euler = $rok; try { $consistency_euler = $SITE->modules->Euler()->checkConsistency(); } catch (Exception $e) { $consistency_euler = ['result'=>'ok', 'message'=>"$e"]; }
$consistency_books = $rok; try { $consistency_books = $SITE->modules->Books()->checkConsistency(); } catch (Exception $e) { $consistency_books = ['result'=>'ok', 'message'=>"$e"]; }
$consistency_egg = $rok; try { $consistency_egg = $SITE->modules->ExtendedGitGraph()->checkConsistency(); } catch (Exception $e) { $consistency_egg = ['result'=>'ok', 'message'=>"$e"]; }
$consistency_progimg = $rok; try { $consistency_progimg = $SITE->modules->Programs()->checkThumbnails(); } catch (Exception $e) { $consistency_progimg = ['result'=>'ok', 'message'=>"$e"]; }
$consistency_bookimg = $rok; try { $consistency_bookimg = $SITE->modules->Books()->checkThumbnails(); } catch (Exception $e) { $consistency_bookimg = ['result'=>'ok', 'message'=>"$e"]; }
$consistency_aoc = $rok; try { $consistency_aoc = $SITE->modules->AdventOfCode()->checkConsistency(); } catch (Exception $e) { $consistency_aoc = ['result'=>'ok', 'message'=>"$e"]; }
function dumpConsistency($c)
{
if ($c['result']==='ok') echo "<span class='consistency_result_ok'>OK</span>"; if ($c['result']==='ok') echo "<span class='consistency_result_ok'>OK</span>";
else if ($c['result']==='warn') echo "<span class='consistency_result_warn'>".$c['message']."</span>"; else if ($c['result']==='warn') echo "<span class='consistency_result_warn'>".$c['message']."</span>";
else echo "<span class='consistency_result_err'>".$c['message']."</span>"; else echo "<span class='consistency_result_err'>".$c['message']."</span>";
} }
?> ?>
<head>
<meta charset="utf-8">
<title>Mikescher.com - Admin</title>
<link rel="icon" type="image/png" href="/data/images/favicon.png"/>
<link rel="canonical" href="https://www.mikescher.com/about"/>
<?php printHeaderCSS(); ?>
<?php includeAdditionalScript("https://code.jquery.com/jquery-latest.min.js", '', true) ?>
<?php includeAdditionalScript("/data/javascript/admin.js", 'defer', true) ?>
</head>
<body>
<div id="mastercontainer">
<?php $HEADER_ACTIVE = 'admin'; include (__DIR__ . '/../fragments/header.php'); ?> <div class="admincontent">
<div id="content" class="content-responsive">
<div class="admincontent">
<div class="contentheader"><h1>Admin</h1><hr/></div> <div class="contentheader"><h1>Admin</h1><hr/></div>
@ -122,8 +109,8 @@ function dumpConsistency($c) {
<div class="bc_data"> <div class="bc_data">
<textarea class="egg_ajaxOutput" id="egg_ajaxOutput" readonly="readonly"></textarea> <textarea class="egg_ajaxOutput" id="egg_ajaxOutput" readonly="readonly"></textarea>
<a class="button" href="javascript:startAjaxRefresh('<?php echo $CONFIG['ajax_secret'] ?>')">Update</a> <a class="button" href="javascript:startAjaxRefresh('<?php echo $SITE->config['ajax_secret'] ?>')">Update</a>
<a class="button" href="javascript:startAjaxRedraw('<?php echo $CONFIG['ajax_secret'] ?>')">Redraw</a> <a class="button" href="javascript:startAjaxRedraw('<?php echo $SITE->config['ajax_secret'] ?>')">Redraw</a>
</div> </div>
@ -137,16 +124,16 @@ function dumpConsistency($c) {
<?php if ($connected): ?> <?php if ($connected): ?>
<div class="bc_data"> <div class="bc_data">
<div class="keyvaluelist kvl_200"> <div class="keyvaluelist kvl_200">
<div><span>Total users:</span> <span><?php echo AlephNoteStatistics::getTotalUserCount(); ?></span></div> <div><span>Total users:</span> <span><?php echo $SITE->modules->AlephNoteStatistics()->getTotalUserCount(); ?></span></div>
<div><span>Users on latest version:</span> <span><?php echo AlephNoteStatistics::getUserCountFromLastVersion(); ?></span></div> <div><span>Users on latest version:</span> <span><?php echo $SITE->modules->AlephNoteStatistics()->getUserCountFromLastVersion(); ?></span></div>
<div><span>Active users:</span> <span><?php echo AlephNoteStatistics::getActiveUserCount(32); ?></span></div> <div><span>Active users:</span> <span><?php echo $SITE->modules->AlephNoteStatistics()->getActiveUserCount(32); ?></span></div>
</div> </div>
<br/> <br/>
<div id="an_ajax_target"></div> <div id="an_ajax_target"></div>
<a class="button" href="javascript:startAjaxReplace('#an_ajax_target', '/api/alephnote::show?secret=<?php echo $CONFIG['ajax_secret'] ?>')">Show</a> <a class="button" href="javascript:startAjaxReplace('#an_ajax_target', '/api/alephnote::show?secret=<?php echo $SITE->config['ajax_secret'] ?>')">Show</a>
</div> </div>
<?php else: ?> <?php else: ?>
<div class="bc_data keyvaluelist">Database not connected.</div> <div class="bc_data keyvaluelist admindberr">Database not connected.</div>
<?php endif; ?> <?php endif; ?>
</div> </div>
@ -157,11 +144,11 @@ function dumpConsistency($c) {
<div class="bc_header">Statics</div> <div class="bc_header">Statics</div>
<div class="bc_data keyvaluelist kvl_200"> <div class="bc_data keyvaluelist kvl_200">
<div><span>Blog entries:</span> <span><?php echo count(Blog::listAll()); ?></span></div> <div><span>Blog entries:</span> <span><?php echo count($SITE->modules->Blog()->listAll()); ?></span></div>
<div><span>Book entries:</span> <span><?php echo count(Books::listAll()); ?></span></div> <div><span>Book entries:</span> <span><?php echo count($SITE->modules->Books()->listAll()); ?></span></div>
<div><span>Euler entries:</span> <span><?php echo count(Euler::listAll()); ?></span></div> <div><span>Euler entries:</span> <span><?php echo count($SITE->modules->Euler()->listAll()); ?></span></div>
<div><span>Program entries:</span> <span><?php echo count(Programs::listAll()); ?></span></div> <div><span>Program entries:</span> <span><?php echo count($SITE->modules->Programs()->listAll()); ?></span></div>
<div><span>Update entries:</span> <span><?php echo count(Programs::listUpdateData()); ?></span></div> <div><span>Update entries:</span> <span><?php echo count($SITE->modules->UpdatesLog()->listUpdateData()); ?></span></div>
</div> </div>
</div> </div>
@ -172,8 +159,8 @@ function dumpConsistency($c) {
<?php if ($connected): ?> <?php if ($connected): ?>
<div class="bc_data keyvaluelist kvl_300"> <div class="bc_data keyvaluelist kvl_300">
<?php foreach (UpdatesLog::listProgramsInformation() as $info): ?> <?php foreach ($SITE->modules->UpdatesLog()->listProgramsInformation() as $info): ?>
<div><span><?php echo '[' . $info['name'] . '] Count:' ?></span> <span><a href="javascript:startAjaxReplace('#ul_ajax_target', '/api/updates::show?secret=<?php echo $CONFIG['ajax_secret'] ?>&ulname=<?php echo $info['name'] ?>')"><?php echo $info['count_total']; ?></a></span></div> <div><span><?php echo '[' . $info['name'] . '] Count:' ?></span> <span><a href="javascript:startAjaxReplace('#ul_ajax_target', '/api/updates::show?secret=<?php echo $SITE->config['ajax_secret'] ?>&ulname=<?php echo $info['name'] ?>')"><?php echo $info['count_total']; ?></a></span></div>
<div><span><?php echo '[' . $info['name'] . '] Last query:' ?></span> <span><?php echo $info['last_query']; ?></span></div> <div><span><?php echo '[' . $info['name'] . '] Last query:' ?></span> <span><?php echo $info['last_query']; ?></span></div>
<div><span><?php echo '[' . $info['name'] . '] Count (1 week):' ?></span> <span><?php echo $info['count_week']; ?></span></div> <div><span><?php echo '[' . $info['name'] . '] Count (1 week):' ?></span> <span><?php echo $info['count_week']; ?></span></div>
<hr /> <hr />
@ -182,7 +169,7 @@ function dumpConsistency($c) {
<div id="ul_ajax_target"></div> <div id="ul_ajax_target"></div>
</div> </div>
<?php else: ?> <?php else: ?>
<div class="bc_data keyvaluelist">Database not connected.</div> <div class="bc_data keyvaluelist admindberr">Database not connected.</div>
<?php endif; ?> <?php endif; ?>
</div> </div>
@ -194,14 +181,14 @@ function dumpConsistency($c) {
<?php if ($connected): ?> <?php if ($connected): ?>
<div class="bc_data keyvaluelist kvl_300"> <div class="bc_data keyvaluelist kvl_300">
<?php foreach (Highscores::getAllGames() as $game): ?> <?php foreach ($SITE->modules->Highscores()->getAllGames() as $game): ?>
<div><span><?php echo '[' . $game['NAME'] . '] Entries:' ?></span> <span><a href="/highscores/list?gameid=<?php echo $game['ID']; ?>"><?php echo Highscores::getEntryCountFromGame($game['ID']); ?></a></span></div> <div><span><?php echo '[' . $game['NAME'] . '] Entries:' ?></span> <span><a href="/highscores/list?gameid=<?php echo $game['ID']; ?>"><?php echo $SITE->modules->Highscores()->getEntryCountFromGame($game['ID']); ?></a></span></div>
<div><span><?php echo '[' . $game['NAME'] . '] Highscore:' ?></span> <span><?php <div><span><?php echo '[' . $game['NAME'] . '] Highscore:' ?></span> <span><?php
$hs = Highscores::getOrderedEntriesFromGame($game['ID'], 1)[0]; $hs = $SITE->modules->Highscores()->getOrderedEntriesFromGame($game['ID'], 1)[0];
echo $hs['POINTS'] . ' (' . $hs['PLAYER'] . ') @ ' . $hs['TIMESTAMP']; echo $hs['POINTS'] . ' (' . $hs['PLAYER'] . ') @ ' . $hs['TIMESTAMP'];
?></span></div> ?></span></div>
<div><span><?php echo '[' . $game['NAME'] . '] Last Update:' ?></span> <span><?php echo Highscores::getNewestEntriesFromGame($game['ID'], 1)[0]['TIMESTAMP']; ?></span></div> <div><span><?php echo '[' . $game['NAME'] . '] Last Update:' ?></span> <span><?php echo $SITE->modules->Highscores()->getNewestEntriesFromGame($game['ID'], 1)[0]['TIMESTAMP']; ?></span></div>
<hr /> <hr />
@ -209,7 +196,7 @@ function dumpConsistency($c) {
</div> </div>
<?php else: ?> <?php else: ?>
<div class="bc_data keyvaluelist">Database not connected.</div> <div class="bc_data keyvaluelist admindberr">Database not connected.</div>
<?php endif; ?> <?php endif; ?>
</div> </div>
@ -220,7 +207,7 @@ function dumpConsistency($c) {
<div class="bc_header">Configuration</div> <div class="bc_header">Configuration</div>
<div class="bc_data keyvaluelist kvl_200"> <div class="bc_data keyvaluelist kvl_200">
<?php <?php
foreach ($CONFIG as $key => $value) foreach ($SITE->config as $key => $value)
{ {
if ($key === 'extendedgitgraph') continue; if ($key === 'extendedgitgraph') continue;
@ -237,7 +224,7 @@ function dumpConsistency($c) {
<div class="bc_header">Configuration['extendedgitgraph']</div> <div class="bc_header">Configuration['extendedgitgraph']</div>
<div class="bc_data keyvaluelist kvl_200"> <div class="bc_data keyvaluelist kvl_200">
<?php <?php
foreach ($CONFIG['extendedgitgraph'] as $key => $value) foreach ($SITE->config['extendedgitgraph'] as $key => $value)
{ {
if (is_array($value)) if (is_array($value))
echo '<div><span>' . $key . '</span> <span style="white-space: pre">' . json_encode($value, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE) . '</span></div>' . "\n"; echo '<div><span>' . $key . '</span> <span style="white-space: pre">' . json_encode($value, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE) . '</span></div>' . "\n";
@ -248,14 +235,4 @@ function dumpConsistency($c) {
</div> </div>
</div> </div>
</div>
</div>
<?php include (__DIR__ . '/../fragments/footer.php'); ?>
</div> </div>
<?php printAdditionalScripts(); ?>
<?php printAdditionalStylesheets(); ?>
</body>
</html>

View File

@ -1,18 +1,29 @@
<!DOCTYPE html>
<html lang="en">
<?php <?php
require_once (__DIR__ . '/../internals/base.php'); require_once (__DIR__ . '/../internals/website.php');
global $OPTIONS;
/** @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
$err = false; $err = false;
if (key_exists('username', $_GET) && key_exists('password', $_GET) && key_exists('redirect', $_GET)) if (key_exists('username', $_GET) && key_exists('password', $_GET) && key_exists('redirect', $_GET))
{ {
if ($_GET['username'] === $CONFIG['admin_username'] && $_GET['password'] === $CONFIG['admin_password']) if ($_GET['username'] === $SITE->config['admin_username'] && $_GET['password'] === $SITE->config['admin_password'])
{ {
setLoginCookie($_GET['username'], $_GET['password']); $SITE->setLoginCookie($_GET['username'], $_GET['password']);
header('Location: ' . $_GET['redirect']); $FRAME_OPTIONS->setForcedRedirect($_GET['redirect']);
die(); return;
} }
else else
{ {
@ -20,25 +31,12 @@ if (key_exists('username', $_GET) && key_exists('password', $_GET) && key_exists
} }
} }
$redirect = $OPTIONS['login_target']; $redirect = $ROUTE->parameter['login_target'];
if (($redirect === '/' || $redirect === '') && isset($_GET['redirect'])) $redirect = $_GET['redirect']; if (($redirect === '/' || $redirect === '') && isset($_GET['redirect'])) $redirect = $_GET['redirect'];
if (($redirect === '/' || $redirect === '')) $redirect = '/admin';
?> ?>
<head>
<meta charset="utf-8">
<title>Mikescher.com - Login</title>
<link rel="icon" type="image/png" href="/data/images/favicon.png"/>
<link rel="canonical" href="https://www.mikescher.com/login"/>
<?php printHeaderCSS(); ?>
</head>
<body>
<div id="mastercontainer">
<?php $HEADER_ACTIVE = 'login'; include (__DIR__ . '/../fragments/header.php'); ?> <div class="aboutcontent">
<div id="content" class="content-responsive">
<div class="aboutcontent">
<div class="boxedcontent"> <div class="boxedcontent">
<div class="bc_header">Mikescher.com - Login</div> <div class="bc_header">Mikescher.com - Login</div>
@ -54,7 +52,7 @@ if (($redirect === '/' || $redirect === '') && isset($_GET['redirect'])) $redire
<div> <div>
<label for="username" class="required">Username</label> <label for="username" class="required">Username</label>
<input name="username" id="username" type="text" autofocus > <input name="username" id="username" type="text" autofocus>
</div> </div>
<div> <div>
@ -74,19 +72,8 @@ if (($redirect === '/' || $redirect === '') && isset($_GET['redirect'])) $redire
</form> </form>
</div> </div>
</div> </div>
</div> </div>
</div>
</div>
<?php include (__DIR__ . '/../fragments/footer.php'); ?>
</div> </div>
<?php printAdditionalScripts(); ?>
<?php printAdditionalStylesheets(); ?>
</body>
</html>

View File

@ -1,27 +1,16 @@
<?php <?php
require_once (__DIR__ . '/../internals/base.php'); require_once (__DIR__ . '/../internals/website.php');
global $OPTIONS;
$redirect = $OPTIONS['logout_target'];
clearLoginCookie();
/** @var PageFrameOptions $FRAME_OPTIONS */ global $FRAME_OPTIONS;
/** @var URLRoute $ROUTE */ global $ROUTE;
/** @var Website $SITE */ global $SITE;
?> ?>
<!DOCTYPE html>
<html lang="en">
<head> <?php
<meta charset="utf-8"> $redirect = $ROUTE->parameter['logout_target'];
<title>Mikescher.com - Logout</title> $SITE->clearLoginCookie();
<link rel="icon" type="image/png" href="/data/images/favicon.png"/> ?>
<link rel="canonical" href="https://www.mikescher.com/logout"/>
<meta http-equiv="refresh" content="1; url=<?php echo $redirect; ?>" />
</head>
<body>
You have been logged out You have been logged out
<script> <script> setTimeout(function () { window.location.href = "<?php echo $redirect; ?>"; }, 1000); </script>
setTimeout(function () { window.location.href = "<?php echo $redirect; ?>"; }, 1000);
</script>
<?php printAdditionalScripts(); ?>
<?php printAdditionalStylesheets(); ?>
</body>
</html>