aboutsummaryrefslogtreecommitdiffstats
path: root/include/RedDAV/RedFile.php
diff options
context:
space:
mode:
authorredmatrix <redmatrix@redmatrix.me>2015-08-06 17:09:09 -0700
committerredmatrix <redmatrix@redmatrix.me>2015-08-06 17:09:09 -0700
commit91bbfcf554d190c1956d16c652ceefb95a18735a (patch)
tree15f7e74bca33b308d7e048629bd036b78d481452 /include/RedDAV/RedFile.php
parent1b0cb9388cd5c416af5ba270127b14efdd1c0a6b (diff)
downloadvolse-hubzilla-91bbfcf554d190c1956d16c652ceefb95a18735a.tar.gz
volse-hubzilla-91bbfcf554d190c1956d16c652ceefb95a18735a.tar.bz2
volse-hubzilla-91bbfcf554d190c1956d16c652ceefb95a18735a.zip
photo permission inheritance. We want to use the folder permissions unless specific permissions have been set to over-ride them. If nothing is set, use the channel default. We may have to mess with his further in the case of somebody trying to create a public photo directory when their normal permissions are set to private. Kind of a chicken/egg problem because the folder permissions will be empty.
Diffstat (limited to 'include/RedDAV/RedFile.php')
-rw-r--r--include/RedDAV/RedFile.php8
1 files changed, 5 insertions, 3 deletions
diff --git a/include/RedDAV/RedFile.php b/include/RedDAV/RedFile.php
index d4eb6812a..ec6871a69 100644
--- a/include/RedDAV/RedFile.php
+++ b/include/RedDAV/RedFile.php
@@ -116,12 +116,14 @@ class RedFile extends DAV\Node implements DAV\IFile {
);
if($d) {
if($d[0]['folder']) {
- $f1 = q("select filename from attach where is_dir = 1 and hash = '%s' and uid = %d limit 1",
+ $f1 = q("select * from attach where is_dir = 1 and hash = '%s' and uid = %d limit 1",
dbesc($d[0]['folder']),
intval($c[0]['channel_id'])
);
- if($f1)
+ if($f1) {
$album = $f1[0]['filename'];
+ $direct = $f1[0];
+ }
}
$fname = dbunescbin($d[0]['data']);
$f = 'store/' . $this->auth->owner_nick . '/' . (($fname) ? $fname : '');
@@ -166,7 +168,7 @@ class RedFile extends DAV\Node implements DAV\IFile {
if($is_photo) {
require_once('include/photos.php');
- $args = array( 'resource_id' => $this->data['hash'], 'album' => $album, 'os_path' => $f, 'filename' => $r[0]['filename'], 'getimagesize' => $gis );
+ $args = array( 'resource_id' => $this->data['hash'], 'album' => $album, 'os_path' => $f, 'filename' => $r[0]['filename'], 'getimagesize' => $gis, 'directory' => $direct );
$p = photo_upload($c[0],get_app()->get_observer(),$args);
}