make directory hierarchy work
This commit is contained in:
parent
56f4b0f976
commit
e10c237386
@ -184,12 +184,13 @@ class RedDirectory extends DAV\Node implements DAV\ICollection {
|
|||||||
|
|
||||||
dbg(1);
|
dbg(1);
|
||||||
|
|
||||||
$r = q("INSERT INTO attach ( aid, uid, hash, filename, filetype, filesize, revision, data, created, edited, allow_cid, allow_gid, deny_cid, deny_gid )
|
$r = q("INSERT INTO attach ( aid, uid, hash, filename, folder, filetype, filesize, revision, data, created, edited, allow_cid, allow_gid, deny_cid, deny_gid )
|
||||||
VALUES ( %d, %d, '%s', '%s', '%s', %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s' ) ",
|
VALUES ( %d, %d, '%s', '%s', '%s', '%s', %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s' ) ",
|
||||||
intval($c[0]['channel_account_id']),
|
intval($c[0]['channel_account_id']),
|
||||||
intval($c[0]['channel_id']),
|
intval($c[0]['channel_id']),
|
||||||
dbesc($hash),
|
dbesc($hash),
|
||||||
dbesc($name),
|
dbesc($name),
|
||||||
|
dbesc($this->folder_hash),
|
||||||
dbesc($mimetype),
|
dbesc($mimetype),
|
||||||
intval($filesize),
|
intval($filesize),
|
||||||
intval(0),
|
intval(0),
|
||||||
@ -264,8 +265,10 @@ dbg(0);
|
|||||||
function getDir() {
|
function getDir() {
|
||||||
|
|
||||||
logger('getDir: ' . $this->ext_path);
|
logger('getDir: ' . $this->ext_path);
|
||||||
|
$file = $this->ext_path;
|
||||||
|
|
||||||
$x = strpos($this->ext_path,'/cloud');
|
|
||||||
|
$x = strpos($file,'/cloud');
|
||||||
if($x === false)
|
if($x === false)
|
||||||
return;
|
return;
|
||||||
if($x === 0) {
|
if($x === 0) {
|
||||||
@ -282,6 +285,9 @@ dbg(0);
|
|||||||
if(! $path_arr)
|
if(! $path_arr)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
||||||
|
logger('getDir(): path: ' . print_r($path_arr,true));
|
||||||
|
|
||||||
$channel_name = $path_arr[0];
|
$channel_name = $path_arr[0];
|
||||||
|
|
||||||
$r = q("select channel_id from channel where channel_address = '%s' limit 1",
|
$r = q("select channel_id from channel where channel_address = '%s' limit 1",
|
||||||
@ -300,8 +306,9 @@ dbg(0);
|
|||||||
|
|
||||||
for($x = 1; $x < count($path_arr); $x ++) {
|
for($x = 1; $x < count($path_arr); $x ++) {
|
||||||
dbg(1);
|
dbg(1);
|
||||||
$r = q("select id, hash, filename, flags from attach where folder = '%s' and (flags & %d)",
|
$r = q("select id, hash, filename, flags from attach where folder = '%s' and filename = '%s' and (flags & %d)",
|
||||||
dbesc($folder),
|
dbesc($folder),
|
||||||
|
dbesc($path_arr[$x]),
|
||||||
intval($channel_id),
|
intval($channel_id),
|
||||||
intval(ATTACH_FLAG_DIR)
|
intval(ATTACH_FLAG_DIR)
|
||||||
);
|
);
|
||||||
|
Reference in New Issue
Block a user