summaryrefslogtreecommitdiff
path: root/www/functions/func_select.php
diff options
context:
space:
mode:
Diffstat (limited to 'www/functions/func_select.php')
-rwxr-xr-xwww/functions/func_select.php7
1 files changed, 3 insertions, 4 deletions
diff --git a/www/functions/func_select.php b/www/functions/func_select.php
index f0dc601..357b6b6 100755
--- a/www/functions/func_select.php
+++ b/www/functions/func_select.php
@@ -1,5 +1,5 @@
<?php
-function select($db, $owner){
+function select_file_id($db, $owner){
if($_SESSION["login"] && $_SESSION["userid"] == $owner){ // TODO: Check if loged in user really the user who does the query - fix 12.3.14
$share=""; // to print all files, even hidden ones
@@ -33,13 +33,12 @@ function select($db, $owner){
$parentdir_db = $db->query("SELECT id, parent FROM files WHERE owner=" . $owner . " AND folder='DIRECTORY' " . $share . " AND parent=" . $parentdir . " AND name='" . SQLite3::escapeString($folder_array_unsafe[$i]) . "';");
if(empty($folder_array_unsafe[$i])){
- return $parentdir;
+ return $parentdir; // TODO: Is there a way this can happen?
}
$prim_id = $parentdir_db->fetchArray(SQLITE3_NUM);
if(empty($prim_id)){
failure("Database error.");
- echo $prim_id;
}
if($parentdir != $prim_id[1]){
@@ -58,6 +57,6 @@ function select($db, $owner){
$parentdir = $prim_id[0];
}
- return $parentdir;
+ return $parentdir; // returns the primary key from the last entry in the folder array
}