Merge branch 'main' of github.com:sorenpeter/timeline

forgot to pull before push!?
This commit is contained in:
sørenpeter 2024-12-08 18:37:41 +01:00
commit 566d24017d
2 changed files with 11 additions and 10 deletions

View file

@ -24,9 +24,11 @@ $title = "Timeline for ".$title;
// Redirect guests to Profile view, if url not set til home twtxt.txt
if (!isset($_SESSION['password']) && ($_GET['url'] != $config['public_txt_url']) ) {
header('Location: ./profile');
exit();
if (!isset($_SESSION['password']) && (isset($_GET['url']))) {
if ($_GET['url'] != $config['public_txt_url']) {
header('Location: ./profile');
exit();
}
}
include_once 'partials/header.php';
@ -43,4 +45,4 @@ if (isset($_SESSION['password'])) {
include_once 'partials/timeline.php';
include_once 'partials/footer.php';
include_once 'partials/footer.php';

View file

@ -3,19 +3,18 @@ require_once("partials/base.php");
$title = "Login - ".$title;
include 'partials/header.php';
?>
<?php
// Password comes from libs/session.php
if (isset($_SESSION['password'])) {
if ($_SESSION['password'] == $password) {
header("Location: .");
include 'partials/header.php';
die();
}
}
else { ?>
else {
include 'partials/header.php';
?>
<center>
<h2>Enter password or TOTP</h2>
<form method="post" action="" id="login_form">
@ -26,4 +25,4 @@ include 'partials/header.php';
</center>
<?php } ?>
<!-- PHP: GET FOOTER --><?php include 'partials/footer.php';?>
<!-- PHP: GET FOOTER --><?php include 'partials/footer.php';?>