diff options
author | Mario <mario@mariovavti.com> | 2019-02-20 08:52:13 +0100 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2019-02-20 08:52:13 +0100 |
commit | 65e8ed6871ba40b1582853cf3e20822232226b24 (patch) | |
tree | eaf2eff7a7d5a9902f93554bfd29e2e1dbbfac37 /Zotlabs/Storage/Browser.php | |
parent | cead10b9af6ff9d8b1bc702ca21d27af7c2112f0 (diff) | |
parent | a77d7b844240030a764455b78b1b13fc886322f5 (diff) | |
download | volse-hubzilla-65e8ed6871ba40b1582853cf3e20822232226b24.tar.gz volse-hubzilla-65e8ed6871ba40b1582853cf3e20822232226b24.tar.bz2 volse-hubzilla-65e8ed6871ba40b1582853cf3e20822232226b24.zip |
Merge branch 'dev' into 'dev'
basic support for nomadic content, fix for permitted guests deleting their own files in cloud space of other channel,urlencode category widget links
See merge request hubzilla/core!1523
Diffstat (limited to 'Zotlabs/Storage/Browser.php')
-rw-r--r-- | Zotlabs/Storage/Browser.php | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/Zotlabs/Storage/Browser.php b/Zotlabs/Storage/Browser.php index c2d70b854..fde66efcd 100644 --- a/Zotlabs/Storage/Browser.php +++ b/Zotlabs/Storage/Browser.php @@ -205,17 +205,21 @@ class Browser extends DAV\Browser\Plugin { // upload access. system.thumbnail_security should be set to 1 if you want to include these // types + $is_creator = false; $photo_icon = ''; $preview_style = intval(get_config('system','thumbnail_security',0)); - $r = q("select content from attach where hash = '%s' and uid = %d limit 1", + $r = q("select content, creator from attach where hash = '%s' and uid = %d limit 1", dbesc($attachHash), intval($owner) ); - if($r && file_exists(dbunescbin($r[0]['content']) . '.thumb')) { - $photo_icon = 'data:image/jpeg;base64,' . base64_encode(file_get_contents(dbunescbin($r[0]['content']) . '.thumb')); -// logger('found thumb: ' . $photo_icon); + if($r) { + $is_creator = (($r[0]['creator'] === get_observer_hash()) ? true : false); + if(file_exists(dbunescbin($r[0]['content']) . '.thumb')) { + $photo_icon = 'data:image/jpeg;base64,' . base64_encode(file_get_contents(dbunescbin($r[0]['content']) . '.thumb')); +// logger('found thumb: ' . $photo_icon); + } } if(strpos($type,'image/') === 0 && $attachHash) { @@ -247,6 +251,7 @@ class Browser extends DAV\Browser\Plugin { $ft['attachIcon'] = (($size) ? $attachIcon : ''); // @todo Should this be an item value, not a global one? $ft['is_owner'] = $is_owner; + $ft['is_creator'] = $is_creator; $ft['fullPath'] = $fullPath; $ft['displayName'] = $displayName; $ft['type'] = $type; @@ -256,6 +261,7 @@ class Browser extends DAV\Browser\Plugin { $ft['iconFromType'] = getIconFromType($type); $f[] = $ft; + } |