This commit is contained in:
Trygve 2025-10-31 01:45:41 +01:00
parent 5b62326c42
commit 2aff55b50d
10 changed files with 21 additions and 22 deletions

View File

@ -33,10 +33,10 @@
<li class="disabled"><a href="/registrering.php">⏱️ Registrer passering matpost/mål</a></li> <li class="disabled"><a href="/registrering.php">⏱️ Registrer passering matpost/mål</a></li>
<li class="disabled"><a href="/db_editor.html">👥 Endre løperbase</a></li> <li class="disabled"><a href="/db_editor.html">👥 Endre løperbase</a></li>
<li class="disabled"><a href="/config_editor.html">⚙️ Konfigurasjon</a></li> <li class="disabled"><a href="/config_editor.html">⚙️ Konfigurasjon</a></li>
<li class="selected">⏳️ Nedtelling matpost <li class="disabled">⏳️ Nedtelling matpost
<menu> <menu>
<li><a href="http://localhost:8000/matpost_nedtelling.php?matpost=0">1. mat</a></li> <li><a href="/matpost_nedtelling.php?matpost=0">1. mat</a></li>
<li><a href="http://localhost:8000/matpost_nedtelling.php?matpost=1">2. mat</a></li> <li><a href="/matpost_nedtelling.php?matpost=1">2. mat</a></li>
</menu> </menu>
</li> </li>
</menu> </menu>

View File

@ -18,7 +18,7 @@ function write_ini_file($assoc_array, $path) {
$config = parse_ini_file("$documentRoot/data/config.ini"); $config = parse_ini_file("$documentRoot/data/config.ini");
$hash = file_get_contents("$documentRoot/data/hash.txt"); include("$documentRoot/data/hash.php");
$method = $_SERVER['REQUEST_METHOD']; $method = $_SERVER['REQUEST_METHOD'];
if ($method == "POST") { if ($method == "POST") {
$start_time = $_POST['start_time']; $start_time = $_POST['start_time'];

View File

@ -1,7 +1,7 @@
<?php <?php
$documentRoot = $_SERVER['DOCUMENT_ROOT']; $documentRoot = $_SERVER['DOCUMENT_ROOT'];
include("$documentRoot/import_runners.php"); include("$documentRoot/import_runners.php");
$hash = file_get_contents("$documentRoot/data/hash.txt"); include("$documentRoot/data/hash.php");
$method = $_SERVER['REQUEST_METHOD']; $method = $_SERVER['REQUEST_METHOD'];
if ($method == "GET") { if ($method == "GET") {
parse_str($_SERVER['QUERY_STRING'], $query); parse_str($_SERVER['QUERY_STRING'], $query);

View File

@ -1,18 +1,17 @@
<?php <?php
$documentRoot = $_SERVER['DOCUMENT_ROOT']; $documentRoot = $_SERVER['DOCUMENT_ROOT'];
print_r($documentRoot); include("$documentRoot/data/hash.php");
$hash = file_get_contents("$documentRoot/data/hash.txt");
$method = $_SERVER['REQUEST_METHOD']; $method = $_SERVER['REQUEST_METHOD'];
if ($method == "POST") { if ($method == "POST") {
$password = $_POST['password']; $password = $_POST['password'];
if (!password_verify($password, $hash)) { if (!password_verify($password, $hash)) {
http_response_code(response_code: 401); http_response_code(response_code: 401);
} }
else { else {
http_response_code(response_code: 200); http_response_code(response_code: 200);
} }
} }else {
else {
http_response_code(response_code: 405); http_response_code(response_code: 405);
} }

View File

@ -6,7 +6,7 @@ $runner_id = $_POST['id'];
$time = $_POST['time']; $time = $_POST['time'];
$password = $_POST['password']; $password = $_POST['password'];
$hash = file_get_contents("$documentRoot/data/hash.txt"); include("$documentRoot/data/hash.php");
if (!password_verify($password, $hash)) { if (!password_verify($password, $hash)) {
http_response_code(response_code: 401); http_response_code(response_code: 401);

View File

@ -3,7 +3,7 @@ $documentRoot = $_SERVER['DOCUMENT_ROOT'];
include("$documentRoot/import_runners.php"); include("$documentRoot/import_runners.php");
$hash = file_get_contents("$documentRoot/data/hash.txt"); include("$documentRoot/data/hash.php");
$method = $_SERVER['REQUEST_METHOD']; $method = $_SERVER['REQUEST_METHOD'];
if ($method == "POST") { if ($method == "POST") {
$runner_id = $_POST['id']; $runner_id = $_POST['id'];

View File

@ -19,10 +19,10 @@
<li class="disabled"><a href="/registrering.php">⏱️ Registrer passering på matpost/mål</a></li> <li class="disabled"><a href="/registrering.php">⏱️ Registrer passering på matpost/mål</a></li>
<li class="disabled"><a href="/db_editor.html">👥 Endre løperbase</a></li> <li class="disabled"><a href="/db_editor.html">👥 Endre løperbase</a></li>
<li class="selected"><a href="/config_editor.html">⚙️ Konfigurasjon</a></li> <li class="selected"><a href="/config_editor.html">⚙️ Konfigurasjon</a></li>
<li class="selected">⏳️ Nedtelling matpost <li class="disabled">⏳️ Nedtelling matpost
<menu> <menu>
<li><a href="http://localhost:8000/matpost_nedtelling.php?matpost=0">1. mat</a></li> <li><a href="/matpost_nedtelling.php?matpost=0">1. mat</a></li>
<li><a href="http://localhost:8000/matpost_nedtelling.php?matpost=1">2. mat</a></li> <li><a href="/matpost_nedtelling.php?matpost=1">2. mat</a></li>
</menu> </menu>
</li> </li>
</menu> </menu>

View File

@ -19,10 +19,10 @@
<li class="disabled"><a href="/registrering.php">⏱️ Registrer passering på matpost/mål</a></li> <li class="disabled"><a href="/registrering.php">⏱️ Registrer passering på matpost/mål</a></li>
<li class="selected"><a href="/db_editor.html">👥 Endre løperbase</a></li> <li class="selected"><a href="/db_editor.html">👥 Endre løperbase</a></li>
<li class="disabled"><a href="/config_editor.html">⚙️ Konfigurasjon</a></li> <li class="disabled"><a href="/config_editor.html">⚙️ Konfigurasjon</a></li>
<li class="selected">⏳️ Nedtelling matpost <li class="disabled">⏳️ Nedtelling matpost
<menu> <menu>
<li><a href="http://localhost:8000/matpost_nedtelling.php?matpost=0">1. mat</a></li> <li><a href="/matpost_nedtelling.php?matpost=0">1. mat</a></li>
<li><a href="http://localhost:8000/matpost_nedtelling.php?matpost=1">2. mat</a></li> <li><a href="/matpost_nedtelling.php?matpost=1">2. mat</a></li>
</menu> </menu>
</li> </li>
</menu> </menu>

View File

@ -50,8 +50,8 @@
<li class="disabled"><a href="/config_editor.html">⚙️ Konfigurasjon</a></li> <li class="disabled"><a href="/config_editor.html">⚙️ Konfigurasjon</a></li>
<li class="selected">⏳️ Nedtelling matpost <li class="selected">⏳️ Nedtelling matpost
<menu> <menu>
<li><a href="http://localhost:8000/matpost_nedtelling.php?matpost=0">1. mat</a></li> <li><a href="/matpost_nedtelling.php?matpost=0">1. mat</a></li>
<li><a href="http://localhost:8000/matpost_nedtelling.php?matpost=1">2. mat</a></li> <li><a href="/matpost_nedtelling.php?matpost=1">2. mat</a></li>
</menu> </menu>
</li> </li>
</menu> </menu>

View File

@ -53,10 +53,10 @@
<li class="selected"><a href="/registrering.php">⏱️ Registrer passering matpost/mål</a></li> <li class="selected"><a href="/registrering.php">⏱️ Registrer passering matpost/mål</a></li>
<li class="disabled"><a href="/db_editor.html">👥 Endre løperbase</a></li> <li class="disabled"><a href="/db_editor.html">👥 Endre løperbase</a></li>
<li class="disabled"><a href="/config_editor.html">⚙️ Konfigurasjon</a></li> <li class="disabled"><a href="/config_editor.html">⚙️ Konfigurasjon</a></li>
<li class="selected">⏳️ Nedtelling matpost <li class="disabled">⏳️ Nedtelling matpost
<menu> <menu>
<li><a href="http://localhost:8000/matpost_nedtelling.php?matpost=0">1. mat</a></li> <li><a href="/matpost_nedtelling.php?matpost=0">1. mat</a></li>
<li><a href="http://localhost:8000/matpost_nedtelling.php?matpost=1">2. mat</a></li> <li><a href="/matpost_nedtelling.php?matpost=1">2. mat</a></li>
</menu> </menu>
</li> </li>
</menu> </menu>