aboutsummaryrefslogtreecommitdiffstats
path: root/php/database.php
diff options
context:
space:
mode:
authorAlex Vitkov <alexvitkov98@gmail.com>2021-02-14 11:58:31 +0200
committerAlex Vitkov <alexvitkov98@gmail.com>2021-02-14 11:58:31 +0200
commitcd872e6ed818761fc52a828c3af67ae44cfc9fe1 (patch)
treeb5d571ce5972267ba2edef68b22871fffcdbeebc /php/database.php
parent67a6b658b4ed300743292e99bb8d2a955ced24b3 (diff)
parent8c5e2a88177786da775deb551ea24cca26a686a2 (diff)
downloadfileup-cd872e6ed818761fc52a828c3af67ae44cfc9fe1.tar.gz
Merge branch 'master' of https://github.com/alexvitkov/india
Diffstat (limited to 'php/database.php')
-rw-r--r--php/database.php11
1 files changed, 7 insertions, 4 deletions
diff --git a/php/database.php b/php/database.php
index 58ca251..61ff344 100644
--- a/php/database.php
+++ b/php/database.php
@@ -21,7 +21,7 @@ require_once "node.php";
$this->pdo=new PDO("mysql:dbname={$database_name};host={$database_location}",$database_username,$database_password);
}
- /*returns false if this isn't a user, otherwise returns the user*/
+ /*returns NULL if this isn't a user, otherwise returns the user*/
function get_user(string $user)
{
$ret=new User;
@@ -33,16 +33,16 @@ require_once "node.php";
$hold=$prep->fetch(PDO::FETCH_ASSOC);
- if($hold)
+ if(isset($hold["user_id"]))
{
$ret->user_id=$hold["user_id"];
$ret->username=$hold["username"];
$ret->email_address=$hold["email"];
- $ret->current_directory=$hold["home_directory"];
+ $ret->home_directory=$hold["home_directory"];
return $ret;
}else
{
- return false;
+ return NULL;
}
}
/*returns false if this isn't a user or the password is incorrect, otherwise returns the userid*/
@@ -444,6 +444,9 @@ require_once "node.php";
$ret=$this->create_dangling_directory();
$trash_folder_id=$this->create_dangling_directory();
$this->link_nodes($ret,$trash_folder_id,"trash","trash folder");
+
+ $share_folder_id=$this->create_dangling_directory();
+ $this->link_nodes($ret,$share_folder_id,"share","shared things go in here");
return $ret;
}