1
0

admin fixes

This commit is contained in:
Mike Schwörer 2018-02-03 14:43:41 +01:00
parent 0999209e5b
commit 07227175af
Signed by: Mikescher
GPG Key ID: D3C7172E0A70F8CF
5 changed files with 21 additions and 8 deletions

View File

@ -106,7 +106,7 @@ try {
if ($partcount !== count($rule['url'])) continue;
$urlparams = [];
$opt = key_exists('_opt', $rule['options']) ? explode($rule['options']['_opt'], '|') : [];
$ctrlOpt = key_exists('_opt', $rule['options']) ? explode($rule['options']['_opt'], '|') : [];
$target = $rule['target'];
$match = true;
@ -129,7 +129,7 @@ try {
}
if (!$match) continue;
$opt = [];
$opt = [ 'controllerOptions' => $ctrlOpt, 'uri' => $requri ];
foreach($rule['options'] as $optname => $optvalue)
{
$value = $optvalue;
@ -154,9 +154,9 @@ try {
}
if (!$match) continue;
if (in_array('disabled', $opt)) continue;
if (in_array('disabled', $ctrlOpt)) continue;
if (in_array('password', $opt))
if (in_array('password', $ctrlOpt))
{
if (!isLoggedInByCookie())
{
@ -167,7 +167,7 @@ try {
$is_http = (!isset($_SERVER['HTTPS'])) || empty($_SERVER['HTTPS']) || $_SERVER['HTTPS'] == "off";
if ($is_http && !in_array('http', $opt))
if (isProd() && $is_http && !in_array('http', $ctrlOpt))
{
ob_clean();
$redirect = 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
@ -210,5 +210,4 @@ try {
//TODO remove db table prefixes
//TODO euler insert+show 32bit | 64bit mode
//TODO send cache header (?)
//TODO self update (admin+webhook)
//TODO v4 subdomain+static

View File

@ -42,7 +42,7 @@ class MikescherGitGraph
{
$p = self::getPathRenderedData();
if (!file($p)) return ['result'=>'err', 'message' => 'Rendered data not found'];
if (!file_exists($p)) return ['result'=>'err', 'message' => 'Rendered data not found'];
if (filemtime($p) < time()-(3*7*24*60*60)) return ['result'=>'warn', 'message' => 'Rendered data is older than 3 weeks'];

View File

@ -63,7 +63,7 @@ class Programs
public static function listUpdateData()
{
$a = require (__DIR__ . '/../statics/updates/programupdates.php');
$a = require (__DIR__ . '/../statics/updates/_all.php');
return $a;
}

View File

@ -139,6 +139,20 @@ function dumpConsistency($c) {
<!------------------------------------------>
<div class="boxedcontent">
<div class="bc_header">Statics</div>
<div class="bc_data keyvaluelist kvl_200">
<div><span>Blog entries:</span> <span><?php echo count(Blog::listAll()); ?></span></div>
<div><span>Book entries:</span> <span><?php echo count(Books::listAll()); ?></span></div>
<div><span>Euler entries:</span> <span><?php echo count(Euler::listAll()); ?></span></div>
<div><span>Program entries:</span> <span><?php echo count(Programs::listAll()); ?></span></div>
<div><span>Update entries:</span> <span><?php echo count(Programs::listUpdateData()); ?></span></div>
</div>
</div>
<!------------------------------------------>
<div class="boxedcontent">
<div class="bc_header">Highscores</div>