summaryrefslogtreecommitdiff
path: root/www/functions/func_download.php
diff options
context:
space:
mode:
authorroot2014-03-21 19:25:02 +0100
committerroot2014-03-21 19:25:02 +0100
commit296d8a14511739a15327ffe30c0895cd3490e940 (patch)
tree2bd7d23df26374b99b3235366e267ed734eef2bf /www/functions/func_download.php
parent4611b609e81cce6ba1269707ff7f483d285bcec3 (diff)
downloadfiles.iamfabulous.de-296d8a14511739a15327ffe30c0895cd3490e940.tar.gz
Doesn't show private files anymore and trying to write a empty_folder function.
Diffstat (limited to 'www/functions/func_download.php')
-rw-r--r--www/functions/func_download.php17
1 files changed, 13 insertions, 4 deletions
diff --git a/www/functions/func_download.php b/www/functions/func_download.php
index 26b2188..64ca335 100644
--- a/www/functions/func_download.php
+++ b/www/functions/func_download.php
@@ -11,14 +11,23 @@ function check_if_file($db, $name, $folder_path){
$file_id = select_file_id($db, $owner, $folder_path);
- $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);
+ if($file_id){
+ $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);
- if($check_if_file_ar[0] == "FILE"){
- return true;
+ if($check_if_file_ar[0] == "FILE"){
+ return true;
+ } else {
+ return false;
+ }
} else {
+ $content = get_path_to_empty_folder($db, $name, $folder_path);
+ print_empty_folder($content);
+ //get_404("/", "Protected file");
+ exit;
return false;
}
+
}