Reply via email for non-user and other stuff

This commit is contained in:
sørenpeter 2023-11-13 21:15:34 +01:00
parent b43c8f7342
commit d6a12a1630
7 changed files with 32 additions and 13 deletions

View file

@ -24,19 +24,20 @@ $profile = getTwtsFromTwtxtString($config['public_txt_url']);
<nav>
<ul class="secondary">
<li><?php include 'partials/lists.php'; ?></li>
<li><a href="<?= $baseURL ?>/following">Following <?php // echo count($twtFollowingList); ?></a></li>
<?php //if ($validSession) { // TODO: Make login seqcure ?>
<?php if( isset($_SESSION['password'])) { /*
if($_SESSION['password']=="$password") {*/ // Hacky login ?>
<li><?php include 'partials/lists.php'; ?></li>
<li><a href="<?= $baseURL ?>/refresh?url=<?= $url ?>">Refresh</a></li>
<li><a href="<?= $baseURL ?>/following">Following <?php // echo count($twtFollowingList); ?></a></li>
<li><a href="<?= $baseURL ?>/add">Add feed</a></li>
<li><a href="<?= $baseURL ?>/?profile=<?=$url ?>">Profile</a></li>
<li><a href="<?= $baseURL ?>/logout">Log Out</a></li>
<?php /*}*/ } else { ?>
<li><a href="<?= $baseURL ?>/following">Following <?php // echo count($twtFollowingList); ?></a></li>
<li><a href="<?= $baseURL ?>/?profile=<?= $url ?>">Profile</a></li>
<li><a href="<?= $baseURL ?>/login">Log in</a></li>
<?php } ?>
<!-- <li><a href="<?= $baseURL ?>/?profile=<?=$profile->mainURL ?>">Profile</a></li> -->
<li><a href="<?= $baseURL ?>/?profile=<?=$config["public_txt_url"] ?>">Profile</a></li>
</ul>
</nav>
</header>

View file

@ -49,4 +49,11 @@
</div>
</article>
<?php } ?>
<?php }
if (!isset($_SESSION['password'])) {
echo '<center><a href="mailto:'.$config['email'].'?subject=RE: '.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'].'" class="button">Comment via email</a></center>';
}
?>

View file

@ -39,5 +39,9 @@ totp_secret = "1234567890"
; In case it's in HTTP (not secure), set this to false
secure_cookies = true
; E-mail for comments
email = ""
; Simple password for unnamed user
password = ""

View file

@ -31,6 +31,9 @@ header > nav a {
/* border: none;*/
}
header > nav select {
padding: 0.4rem;
}
/* === Timeline Style === */
@ -97,10 +100,6 @@ header a {
/* line-height: 1.5;*/
}
nav form {
margin: 0;
}
nav .link-btn {
background: none;
border: none;

View file

@ -11,7 +11,10 @@ if ($config['debug_mode']) {
$txt_file_path = $config['txt_file_path'];
if (!isset($_SESSION['password'])) {
header('Location: ./login');
exit();
}
/*
if (!has_valid_session()) {

View file

@ -3,7 +3,7 @@ require_once("partials/base.php");
//$title = "Login - ".$title;
include 'partials/header.php';
include_once 'partials/header.php';
?>
<!-- PHP: PROFILE CARD -->
@ -31,7 +31,7 @@ if( isset($_SESSION['password'])) {
}
?>
<!-- PHP: TIMELINE --><?php include 'partials/timeline.php'?>
<!-- PHP: TIMELINE --><?php include_once 'partials/timeline.php'?>
<!-- PHP: FOOTER --><?php include 'partials/footer.php';?>
<!-- PHP: FOOTER --><?php include_once 'partials/footer.php';?>

View file

@ -8,6 +8,11 @@ require_once('libs/hash.php');
$config = parse_ini_file('private/config.ini');
if (!isset($_SESSION['password'])) {
header('Location: ./login');
exit();
}
$max_execution_time = intval($config['max_execution_time']);
if ($max_execution_time < 1) {
$max_execution_time = 1;