aboutsummaryrefslogtreecommitdiffstats
path: root/php
diff options
context:
space:
mode:
authoradam <adam@>2021-02-12 17:09:33 +0200
committeradam <adam@>2021-02-12 17:09:33 +0200
commit69c729e663d3b50188629e82c6e41662aae64e4d (patch)
treeb27858dc11c324fb3fa227c52741d864bb9d6b82 /php
parentfe005fb926ad568333655a0794338516e4af5b9d (diff)
downloadfileup-69c729e663d3b50188629e82c6e41662aae64e4d.tar.gz
asdf
Diffstat (limited to 'php')
-rw-r--r--php/database.php1
-rw-r--r--php/register.php1
-rw-r--r--php/upload.php4
3 files changed, 4 insertions, 2 deletions
diff --git a/php/database.php b/php/database.php
index 0c5f9a8..f9b672d 100644
--- a/php/database.php
+++ b/php/database.php
@@ -242,6 +242,7 @@ require_once "node.php";
nodes.node_id=node_access.node_id
where nodes.node_id=:dir_id
");
+ $dir_prep->bindParam(':dir_id',$dir_id);
if($dir_prep->execute()==false)
{
error_log("could not exedude dir sql statement in create_file_node");
diff --git a/php/register.php b/php/register.php
index 1d31a91..c314856 100644
--- a/php/register.php
+++ b/php/register.php
@@ -32,7 +32,6 @@ if($database->register_user($username,$password,$email))
}
-$_SESSION['username'] = $username;
header('Location: /');
?>
diff --git a/php/upload.php b/php/upload.php
index 55ff4a4..b36a0f1 100644
--- a/php/upload.php
+++ b/php/upload.php
@@ -2,6 +2,7 @@
require_once "database.php";
require_once "configuration.php";
+session_start();
echo 1;
if (!isset( $_POST["filename"]) || !isset($_FILES["the_file"]))
{
@@ -13,10 +14,11 @@ echo 2;
$file=$_FILES["the_file"];
$filename=$_POST["filename"];
+$homedir=$_SESSION['user_object'];
echo 3;
-$codename=$database->create_file_node($filename);
+$codename=$database->create_file_node($filename,"",$_SESSION['user_object']->home_directory);
echo $codename;
if($codename=="error")
{