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 // Redirect guests to Profile view, if url not set til home twtxt.txt
if (!isset($_SESSION['password']) && ($_GET['url'] != $config['public_txt_url']) ) { if (!isset($_SESSION['password']) && (isset($_GET['url']))) {
header('Location: ./profile'); if ($_GET['url'] != $config['public_txt_url']) {
exit(); header('Location: ./profile');
exit();
}
} }
include_once 'partials/header.php'; include_once 'partials/header.php';

View file

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