summaryrefslogtreecommitdiff
path: root/www/functions/func_interface.php
diff options
context:
space:
mode:
Diffstat (limited to 'www/functions/func_interface.php')
-rwxr-xr-xwww/functions/func_interface.php17
1 files changed, 16 insertions, 1 deletions
diff --git a/www/functions/func_interface.php b/www/functions/func_interface.php
index 0c765f4..192e94f 100755
--- a/www/functions/func_interface.php
+++ b/www/functions/func_interface.php
@@ -9,7 +9,22 @@ function collect_content($db,$username, $folder_path){
$file_id = select_file_id($db, $owner, $folder_path);
- $content = get_content($db, $file_id, $owner);
+ $check_if_file_db = $db->query("SELECT folder FROM files WHERE id=".$file_id.";");
+ $check_if_file_ar = $check_if_file_db->fetchArray(SQLITE3_NUM);
+
+ //TODO: Instead of exit; let the browser start_download or print folder content
+ if($check_if_file_ar[0] == "FILE"){
+ if(start_file_download($username, $folder_path)){
+ exit;
+ return true;
+ } else {
+ exit;
+ return false;
+ }
+ } else {
+ $content = get_content($db, $file_id, $owner);
+ }
+
/*if(!$content){
failure("This folder is empty.");