aboutsummaryrefslogtreecommitdiffstats
path: root/php
diff options
context:
space:
mode:
authoradam <adam@>2021-02-15 11:09:03 +0200
committeradam <adam@>2021-02-15 11:09:03 +0200
commitceb1706e1caf92054bbc6291a70824f16e30eff0 (patch)
treef61414f03c85753790b39603c5906fe1209be328 /php
parentf4e5ef20b3d0dd21867f24db5bea2b2137abe1e1 (diff)
parente2ab5591cc6d30b1fa26e094b2c50aa7879cdd88 (diff)
downloadfileup-ceb1706e1caf92054bbc6291a70824f16e30eff0.tar.gz
Merge https://github.com/alexvitkov/india
Diffstat (limited to 'php')
-rw-r--r--php/.gitignore1
-rw-r--r--php/configuration.php2
-rw-r--r--php/share.php14
3 files changed, 15 insertions, 2 deletions
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 4a516f4..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");
?>
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"];