From 08e945b89d649759f40916877f40044657314d9a Mon Sep 17 00:00:00 2001 From: root Date: Fri, 21 Mar 2014 11:56:08 +0100 Subject: If you are loged in, now you can download your files. --- www/functions/func_interface.php | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'www/functions/func_interface.php') 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."); -- cgit v1.2.3