diff options
Diffstat (limited to 'php/node.php')
-rw-r--r-- | php/node.php | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/php/node.php b/php/node.php index 62b9ad2..3d56d99 100644 --- a/php/node.php +++ b/php/node.php @@ -7,25 +7,26 @@ require_once "user.php"; /*path is in terms of the simulated filesystem*/ function get_directory(string $abstract_path,User $user) { + global $database; if($abstract_path[0]!="/") { return NULL; } if($component=strtok($abstract_path,"/")==false) { - return NULL; + return $database->get_links_of($user->home_directory); } - $current_dir=$database->get_node($component,$user->home_directory); + $current_dir=$database->get_node_id($component,$user->home_directory); if($current_dir==NULL) return NULL; /*traverse path*/ while($component=strtok("/")) { - $current_dir=get_node($component,$current_dir); + $current_dir=$database->get_node_id($component,$current_dir); if($current_dir==NULL) return NULL; } - return get_links_of(NULL,$current_dir); + return $database->get_links_of($current_dir); } ?> |