From 8c55fc44a64f46d64ced2f053d8b441247cc1f36 Mon Sep 17 00:00:00 2001 From: Alex Vitkov Date: Mon, 15 Feb 2021 09:58:55 +0200 Subject: configuration --- php/.gitignore | 1 + php/configuration.php | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 php/.gitignore (limited to 'php') diff --git a/php/.gitignore b/php/.gitignore new file mode 100644 index 0000000..f980a0f --- /dev/null +++ b/php/.gitignore @@ -0,0 +1 @@ +custom_configuration.php diff --git a/php/configuration.php b/php/configuration.php index 1f2f423..6cfef48 100644 --- a/php/configuration.php +++ b/php/configuration.php @@ -23,6 +23,6 @@ $password_hash_algo=PASSWORD_BCRYPT; $has_email_verification=false; -@include_once("$_SERVER[HOME]/.fileup.config.php"); +@include_once("custom_configuration.php"); -?> \ No newline at end of file +?> -- cgit v1.2.3 From b6930703bb100ff3dc3637c5150b6ab993c1275a Mon Sep 17 00:00:00 2001 From: Alex Vitkov Date: Mon, 15 Feb 2021 10:22:26 +0200 Subject: Front end for password protected files --- php/share.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'php') diff --git a/php/share.php b/php/share.php index 8cc150a..c549c8a 100644 --- a/php/share.php +++ b/php/share.php @@ -69,11 +69,23 @@ if($_SERVER["REQUEST_METHOD"] == "POST") } $shared_node=$database->get_shared_node($code); - if($shared_node==NULL || $shared_node->password!=$password) + if($shared_node==NULL) { http_response_code(409); exit(0); } + if ($shared_node->password!=$password) { + if ($password == "") + { + require_once("../share_frontend.php"); + exit(0); + }else + { + echo "Invalid password"; + http_response_code(409); + exit(0); + } + } if(isset($_SESSION["user_object"])) { $user=$_SESSION["user_object"]; -- cgit v1.2.3