Compare commits

..

No commits in common. "82a487d3dd13a963857730e4357d19bd50250dc2" and "40fc554954e8c8f4ff7abeaccb7dbd14783908cc" have entirely different histories.

2 changed files with 22 additions and 28 deletions

View File

@ -1,22 +1,3 @@
<?php
if (null !== $_POST['set_pwd']) {
$pwd = $_POST['set_pwd'];
file_put_contents('data/admin_pwd', password_hash($pwd, PASSWORD_DEFAULT));
setcookie('owe_admin', base64_encode($pwd), ['httponly' => true]);
header('location: admin.php');
} elseif (null !== $_POST['pwd']) {
$pwd = $_POST['pwd'];
if (password_verify($pwd, file_get_contents('data/admin_pwd'))) {
setcookie('owe_admin', base64_encode($pwd), ['httponly' => true]);
header('location: admin.php');
print("DER KEKS MÜSSTE GESETZT SEIN");
} else {
print("Nope, falsch");
}
}
?>
<!DOCTYPE html>
<?php
@ -66,6 +47,13 @@ $config_data = json_decode($raw_json_config, false);
<?php
if (null !== $_POST['set_pwd']) {
$pwd = $_POST['set_pwd'];
file_put_contents('data/admin_pwd', password_hash($pwd, PASSWORD_DEFAULT));
setcookie('owe_admin', base64_encode($pwd), ['httponly' => true]);
header('location: admin.php');
}
endif;
if ($login):
@ -108,8 +96,17 @@ $config_data = json_decode($raw_json_config, false);
</form>
<?php
endif;
?>
if (null !== $_POST['pwd']) {
$pwd = $_POST['pwd'];
if (password_verify($pwd, file_get_contents('data/admin_pwd'))) {
setcookie('owe_admin', base64_encode($pwd), ['httponly' => true]);
header('location: admin.php');
} else {
print("Nope, falsch");
}
}
endif; ?>
</p>
<script>

11
owe.js
View File

@ -31,14 +31,11 @@ function loadSentences(alertIfNew = false, increaseUnread = true) {
// color
var spans = document.querySelector(".sentences").getElementsByTagName("span");
// we expect this to be from the user who's turn it is now
var histurnspan = spans[spans.length - config_data.users.length];
//console.log(histurnspan.getAttribute("style"));
document.getElementById("wordinput").setAttribute("style", histurnspan.getAttribute("style"));
if (spans.length >= config_data.users.length) {
var histurnspan = spans[spans.length - config_data.users.length];
//console.log(histurnspan.getAttribute("style"));
document.getElementById("wordinput").setAttribute("style", histurnspan.getAttribute("style"));
} else {
console.error('Not enough spans available for users.');
}
initializeLoginArea();
});
});