From 1fe76ba743a3418da9a0883b29756d442384d0bc Mon Sep 17 00:00:00 2001 From: Horus3 Date: Thu, 25 Sep 2014 10:33:47 +0200 Subject: init --- www/functions/notused/func_content.php | 121 --------------------------------- 1 file changed, 121 deletions(-) delete mode 100755 www/functions/notused/func_content.php (limited to 'www/functions/notused/func_content.php') diff --git a/www/functions/notused/func_content.php b/www/functions/notused/func_content.php deleted file mode 100755 index ad0c87e..0000000 --- a/www/functions/notused/func_content.php +++ /dev/null @@ -1,121 +0,0 @@ -query("SELECT * FROM files WHERE parent=" . $file_id . " AND owner=" . $owner . $share . " ORDER BY folder, name;"); - - $count=0; - - while($row = $content_db->fetchArray(SQLITE3_NUM)){ - $content[$count][0] = $row[0]; - $content[$count][1] = $row[1]; - $content[$count][2] = $row[2]; - $content[$count][3] = $row[3]; - $content[$count][4] = $row[4]; - $content[$count][5] = $row[5]; - $content[$count][6] = $row[6]; - $content[$count][7] = $row[7]; - $content[$count][8] = $row[8]; - $count++; - } - - if(!empty($content)){ - return $content; // returns everything listed in the folder which is commited as parameter - } else { - return false; // empty folder - } -} - -function get_path_to_wrong_folder($db, $username, $folder_path){ - - $owner = user_id($db, $username); - - if($_SESSION["login"] && $_SESSION["userid"] == $owner){ - $share = ""; - } else { - $share =" AND share='PUBLIC'"; - } - - $folder_array_unsafe = explode("/",$folder_path); - $length = count($folder_array_unsafe); - - $root_db = $db->query("SELECT id FROM files WHERE parent=0 AND owner=" . SQLite3::escapeString($owner) . " AND folder='DIRECTORY' " . $share . ";"); - $root_ar = $root_db->fetchArray(SQLITE3_NUM); - $root_id = $root_ar[0]; - - if(empty($root_id)){ - return FOLDER_NOT_PUBLIC; - } - - $parentdir = $root_id; - - for($i=0; $i<$length; $i++){ - $parentdir_db = $db->query("SELECT id, parent FROM files WHERE owner=" . $owner . $share . " AND parent=". $parentdir . " AND name='" . SQLite3::escapeString($folder_array_unsafe[$i]) . "';"); - $prim_id = $parentdir_db->fetchArray(SQLITE3_NUM); - - if($parentdir != $prim_id[1]){ - $wrong_folder = $folder_array_unsafe[$i]; - $working_path[0] = $wrong_folder; - - for($j=0; $j<$i; $j++){ - $working_path[$j] = $folder_array_unsafe[$j]; - } - - $lwp = count($working_path); - $working_path[$lwp] = $wrong_folder; - - if($i == 0){ - $working_path[0] = ""; // shows just the root slash - } - - return $working_path; // returns working path and wrong folder as an array - } - - $parentdir = $prim_id[0]; - - } - - return false; -} - -function print_wrong_folder($content){ - - $length = count($content); - - $wrong_folder = $content[$length-1]; - $working_path[0] = $wrong_folder; // initialize empty array - - for($i=0; $i<$length-1; $i++){ - $working_path[$i] = $content[$i]; - } - - get_404($working_path, $wrong_folder); -} -- cgit v1.2.3