aboutsummaryrefslogtreecommitdiffstats
path: root/include/reddav.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-01-05 18:44:32 -0800
committerfriendica <info@friendica.com>2014-01-05 18:44:32 -0800
commite10c237386c95a180a1b6951304b98ce1d953551 (patch)
treee19683cb0460ae7b99bacce68ae5b9c771b092c4 /include/reddav.php
parent56f4b0f976cd4397d145756b6481cbc17eeae90f (diff)
downloadvolse-hubzilla-e10c237386c95a180a1b6951304b98ce1d953551.tar.gz
volse-hubzilla-e10c237386c95a180a1b6951304b98ce1d953551.tar.bz2
volse-hubzilla-e10c237386c95a180a1b6951304b98ce1d953551.zip
make directory hierarchy work
Diffstat (limited to 'include/reddav.php')
-rw-r--r--include/reddav.php15
1 files changed, 11 insertions, 4 deletions
diff --git a/include/reddav.php b/include/reddav.php
index b8604978f..fc4a53b17 100644
--- a/include/reddav.php
+++ b/include/reddav.php
@@ -184,12 +184,13 @@ class RedDirectory extends DAV\Node implements DAV\ICollection {
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 )
- VALUES ( %d, %d, '%s', '%s', '%s', %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s' ) ",
+ $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', '%s', %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s' ) ",
intval($c[0]['channel_account_id']),
intval($c[0]['channel_id']),
dbesc($hash),
dbesc($name),
+ dbesc($this->folder_hash),
dbesc($mimetype),
intval($filesize),
intval(0),
@@ -264,8 +265,10 @@ dbg(0);
function getDir() {
logger('getDir: ' . $this->ext_path);
+ $file = $this->ext_path;
- $x = strpos($this->ext_path,'/cloud');
+
+ $x = strpos($file,'/cloud');
if($x === false)
return;
if($x === 0) {
@@ -282,6 +285,9 @@ dbg(0);
if(! $path_arr)
return;
+
+ logger('getDir(): path: ' . print_r($path_arr,true));
+
$channel_name = $path_arr[0];
$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 ++) {
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($path_arr[$x]),
intval($channel_id),
intval(ATTACH_FLAG_DIR)
);