From 8df2b0debb7158af1ac7792559cbefe96ec0d520 Mon Sep 17 00:00:00 2001 From: max/sooulix Date: Wed, 12 Feb 2025 10:21:48 +0100 Subject: [PATCH] login / logout --- src/auth.php | 32 ++++++++++++++++++++++++++++++++ src/common.php | 12 ++++++++++++ src/config_sanddir.php | 2 ++ src/index.php | 13 +++++++++++++ 4 files changed, 59 insertions(+) create mode 100644 src/auth.php diff --git a/src/auth.php b/src/auth.php new file mode 100644 index 0000000..fc7a6dd --- /dev/null +++ b/src/auth.php @@ -0,0 +1,32 @@ + + +
+ +
+ +
+ +
+ diff --git a/src/common.php b/src/common.php index 563b2fb..9d11a96 100644 --- a/src/common.php +++ b/src/common.php @@ -1,4 +1,16 @@ diff --git a/src/index.php b/src/index.php index 68a281c..4c1a2af 100644 --- a/src/index.php +++ b/src/index.php @@ -3,10 +3,17 @@ $new_share = NULL; $selected_dir = NULL; +session_start(); + require_once('./common.php'); require_once('./config_sanddir.php'); +if (!checkpw()) +{ + header('Location: /auth.php'); +} + if (isset($_GET['dir'])) { $selected_dir = $_GET['dir']; @@ -34,4 +41,10 @@ else if ($selected_dir) } ?> + +