aboutsummaryrefslogtreecommitdiffstats
path: root/php/share.php
diff options
context:
space:
mode:
authorAlex Vitkov <alexvitkov98@gmail.com>2021-02-15 10:22:26 +0200
committerAlex Vitkov <alexvitkov98@gmail.com>2021-02-15 10:22:26 +0200
commitb6930703bb100ff3dc3637c5150b6ab993c1275a (patch)
tree34310454da27d01ad73068464a463a548fbea0c9 /php/share.php
parent8c55fc44a64f46d64ced2f053d8b441247cc1f36 (diff)
downloadfileup-b6930703bb100ff3dc3637c5150b6ab993c1275a.tar.gz
Front end for password protected files
Diffstat (limited to 'php/share.php')
-rw-r--r--php/share.php14
1 files changed, 13 insertions, 1 deletions
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"];