aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Zotlabs/Module/Attach.php2
-rw-r--r--Zotlabs/Module/Getfile.php2
-rw-r--r--include/attach.php8
-rw-r--r--include/import.php2
-rw-r--r--include/message.php2
5 files changed, 8 insertions, 8 deletions
diff --git a/Zotlabs/Module/Attach.php b/Zotlabs/Module/Attach.php
index de941d52c..94f46978a 100644
--- a/Zotlabs/Module/Attach.php
+++ b/Zotlabs/Module/Attach.php
@@ -14,7 +14,7 @@ class Attach extends \Zotlabs\Web\Controller {
return;
}
- $r = attach_by_hash(argv(1),((argc() > 2) ? intval(argv(2)) : 0));
+ $r = attach_by_hash(argv(1),get_observer_hash(),((argc() > 2) ? intval(argv(2)) : 0));
if(! $r['success']) {
notice( $r['message'] . EOL);
diff --git a/Zotlabs/Module/Getfile.php b/Zotlabs/Module/Getfile.php
index 986a819ea..12c1d0842 100644
--- a/Zotlabs/Module/Getfile.php
+++ b/Zotlabs/Module/Getfile.php
@@ -63,7 +63,7 @@ class Getfile extends \Zotlabs\Web\Controller {
killme();
}
- $r = attach_by_hash($resource,$revision);
+ $r = attach_by_hash($resource,$channel['channel_hash'],$revision);
if(! $r['success']) {
logger('attach_by_hash failed: ' . $r['message']);
diff --git a/include/attach.php b/include/attach.php
index f832427bb..8fa46a8b1 100644
--- a/include/attach.php
+++ b/include/attach.php
@@ -229,7 +229,7 @@ function attach_list_files($channel_id, $observer, $hash = '', $filename = '', $
* @param int $rev Revision
* @return array
*/
-function attach_by_hash($hash, $rev = 0) {
+function attach_by_hash($hash, $observer_hash, $rev = 0) {
$ret = array('success' => false);
@@ -249,7 +249,7 @@ function attach_by_hash($hash, $rev = 0) {
return $ret;
}
- if(! perm_is_allowed($r[0]['uid'], get_observer_hash(), 'view_storage')) {
+ if(! perm_is_allowed($r[0]['uid'], $observer_hash, 'view_storage')) {
$ret['message'] = t('Permission denied.');
return $ret;
}
@@ -315,7 +315,7 @@ function attach_can_view_folder($uid,$ob_hash,$folder_hash) {
* * \e string \b message (optional) only when success is false
* * \e array \b data array of attach DB entry without data component
*/
-function attach_by_hash_nodata($hash, $rev = 0) {
+function attach_by_hash_nodata($hash, $observer_hash, $rev = 0) {
$ret = array('success' => false);
@@ -335,7 +335,7 @@ function attach_by_hash_nodata($hash, $rev = 0) {
return $ret;
}
- if(! perm_is_allowed($r[0]['uid'],get_observer_hash(),'view_storage')) {
+ if(! perm_is_allowed($r[0]['uid'],$observer_hash,'view_storage')) {
$ret['message'] = t('Permission denied.');
return $ret;
}
diff --git a/include/import.php b/include/import.php
index 470ef982e..479e45cc2 100644
--- a/include/import.php
+++ b/include/import.php
@@ -1036,7 +1036,7 @@ function sync_files($channel,$files) {
}
$attach_exists = false;
- $x = attach_by_hash($att['hash']);
+ $x = attach_by_hash($att['hash'],$channel['channel_hash']);
logger('sync_files duplicate check: attach_exists=' . $attach_exists, LOGGER_DEBUG);
logger('sync_files duplicate check: att=' . print_r($att,true), LOGGER_DEBUG);
logger('sync_files duplicate check: attach_by_hash() returned ' . print_r($x,true), LOGGER_DEBUG);
diff --git a/include/message.php b/include/message.php
index 0829ebaaa..748689206 100644
--- a/include/message.php
+++ b/include/message.php
@@ -166,7 +166,7 @@ function send_message($uid = 0, $recipient='', $body='', $subject='', $replyto='
foreach($match[2] as $mtch) {
$hash = substr($mtch,0,strpos($mtch,','));
$rev = intval(substr($mtch,strpos($mtch,',')));
- $r = attach_by_hash_nodata($hash,$rev);
+ $r = attach_by_hash_nodata($hash,get_observer_hash(),$rev);
if($r['success']) {
$attachments[] = array(
'href' => z_root() . '/attach/' . $r['data']['hash'],