aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
authorredmatrix <redmatrix@redmatrix.me>2015-06-17 11:14:18 +1000
committerredmatrix <redmatrix@redmatrix.me>2015-06-17 11:14:18 +1000
commitec54111e6b0000f87323b2b0a26756da3b41f146 (patch)
tree136e821b2438bb722734e1bcad0bf1e9ad6e505c /mod
parent24befa2197d3dfc9ebeac10b307eaddcc7dd5cf1 (diff)
parent40ee0d41dc977584a78307f151773137c7f0744d (diff)
downloadvolse-hubzilla-ec54111e6b0000f87323b2b0a26756da3b41f146.tar.gz
volse-hubzilla-ec54111e6b0000f87323b2b0a26756da3b41f146.tar.bz2
volse-hubzilla-ec54111e6b0000f87323b2b0a26756da3b41f146.zip
Merge pull request #349 from git-marijus/master
make photo upload work for remote channels with perms
Diffstat (limited to 'mod')
-rw-r--r--mod/photos.php14
1 files changed, 13 insertions, 1 deletions
diff --git a/mod/photos.php b/mod/photos.php
index e88d1497e..2af90610e 100644
--- a/mod/photos.php
+++ b/mod/photos.php
@@ -6,6 +6,7 @@ require_once('include/acl_selectors.php');
require_once('include/bbcode.php');
require_once('include/security.php');
require_once('include/Contact.php');
+require_once('include/text.php');
function photos_init(&$a) {
@@ -401,9 +402,20 @@ function photos_post(&$a) {
* default post action - upload a photo
*/
+ $channel = $a->data['channel'];
+ $observer = $a->data['observer'];
+
$_REQUEST['source'] = 'photos';
- $r = photo_upload($a->channel,$a->get_observer(), $_REQUEST);
+ if(!local_channel()) {
+ $_REQUEST['contact_allow'] = expand_acl($channel['channel_allow_cid']);
+ $_REQUEST['group_allow'] = expand_acl($channel['channel_allow_gid']);
+ $_REQUEST['contact_deny'] = expand_acl($channel['channel_deny_cid']);
+ $_REQUEST['group_deny'] = expand_acl($channel['channel_deny_gid']);
+ }
+
+ $r = photo_upload($channel, $observer, $_REQUEST);
+
if(! $r['success']) {
notice($r['message'] . EOL);
}