diff options
Diffstat (limited to 'include/RedDAV/RedFile.php')
-rw-r--r-- | include/RedDAV/RedFile.php | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/include/RedDAV/RedFile.php b/include/RedDAV/RedFile.php index e4f9c21b9..0a021b5ed 100644 --- a/include/RedDAV/RedFile.php +++ b/include/RedDAV/RedFile.php @@ -49,7 +49,7 @@ class RedFile extends DAV\Node implements DAV\IFile { $this->data = $data; $this->auth = $auth; - //logger(print_r($this->data, true), LOGGER_DATA); + logger(print_r($this->data, true), LOGGER_DATA); } /** @@ -165,6 +165,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 ); $p = photo_upload($c[0],$this->auth->observer,$args); } @@ -207,6 +208,7 @@ class RedFile extends DAV\Node implements DAV\IFile { */ public function get() { logger('get file ' . basename($this->name), LOGGER_DEBUG); + logger('os_path: ' . $this->os_path, LOGGER_DATA); $r = q("SELECT data, flags, os_storage, filename, filetype FROM attach WHERE hash = '%s' AND uid = %d LIMIT 1", dbesc($this->data['hash']), @@ -300,7 +302,7 @@ class RedFile extends DAV\Node implements DAV\IFile { } if ($this->auth->owner_id !== $this->auth->channel_id) { - if (($this->auth->observer !== $this->data['creator']) || ($this->data['flags'] & ATTACH_FLAG_DIR)) { + if (($this->auth->observer !== $this->data['creator']) || intval($this->data['is_dir'])) { throw new DAV\Exception\Forbidden('Permission denied.'); } } |