aboutsummaryrefslogtreecommitdiffstats
path: root/php
diff options
context:
space:
mode:
authoradam <adam@>2021-02-14 10:00:06 +0200
committeradam <adam@>2021-02-14 10:00:06 +0200
commita3b6210ac043e2fdeb20d48d464e3a1466f388b4 (patch)
treecefb4c6095e980e6e627e0995dfa7a905310a2a1 /php
parent4dc542a5e3d7a2a9d2b0eb97de0c567cbdd01720 (diff)
downloadfileup-a3b6210ac043e2fdeb20d48d464e3a1466f388b4.tar.gz
destroys sessions more propperly now
Diffstat (limited to 'php')
-rw-r--r--php/logout.php3
-rw-r--r--php/mkdir.php1
-rw-r--r--php/share.php1
-rw-r--r--php/upload.php3
4 files changed, 6 insertions, 2 deletions
diff --git a/php/logout.php b/php/logout.php
index d37b0a0..37304d7 100644
--- a/php/logout.php
+++ b/php/logout.php
@@ -5,6 +5,7 @@
// which will log the user out of our webpage
session_start();
-unset($_SESSION['user_object']);
+//unset($_SESSION['user_object']);
+session_destroy();
header('Location: /');
?>
diff --git a/php/mkdir.php b/php/mkdir.php
index cf5e8e4..def17b7 100644
--- a/php/mkdir.php
+++ b/php/mkdir.php
@@ -8,6 +8,7 @@ $parent_directory=$_POST['parent_directory'];
$dirname=$_POST['dirname'];
$user=$_SESSION['user_object'];
+error_log("user is creating a directory".$user->username);
create_directory($parent_directory,$dirname,"",$user);
diff --git a/php/share.php b/php/share.php
index 73b1c3b..aeffac4 100644
--- a/php/share.php
+++ b/php/share.php
@@ -2,6 +2,7 @@
require_once "configuration.php";
require_once "database.php";
require_once "user.php";
+
session_start();
$user=$_SESSION['user_object'];
diff --git a/php/upload.php b/php/upload.php
index 9739744..97fbf2f 100644
--- a/php/upload.php
+++ b/php/upload.php
@@ -2,9 +2,10 @@
require_once "database.php";
require_once "configuration.php";
require_once "file_type_recogniser.php";
+require_once "user.php";
require_once "node.php";
-
session_start();
+
if (!isset( $_POST["filename"]) || !isset($_FILES["the_file"]) || !isset($_POST['parent_directory']))
{
error_log("someone tried to upload something impropperly");