aboutsummaryrefslogtreecommitdiffstats
path: root/mod/photos.php
diff options
context:
space:
mode:
authorredmatrix <redmatrix@redmatrix.me>2015-06-16 18:43:03 -0700
committerredmatrix <redmatrix@redmatrix.me>2015-06-16 18:43:03 -0700
commit65661b7ec31d3524401e6b6d840763cb4d636935 (patch)
tree87e09f54fc087e46b2b8aae12e803e0e8f234bcd /mod/photos.php
parentd84b3cfc3c42c2d62813ff78ccfc9b9c34afc92d (diff)
parentec54111e6b0000f87323b2b0a26756da3b41f146 (diff)
downloadvolse-hubzilla-65661b7ec31d3524401e6b6d840763cb4d636935.tar.gz
volse-hubzilla-65661b7ec31d3524401e6b6d840763cb4d636935.tar.bz2
volse-hubzilla-65661b7ec31d3524401e6b6d840763cb4d636935.zip
Merge branch 'master' of https://github.com/redmatrix/redmatrix
Conflicts: mod/photos.php mod/siteinfo.php
Diffstat (limited to 'mod/photos.php')
-rw-r--r--mod/photos.php23
1 files changed, 23 insertions, 0 deletions
diff --git a/mod/photos.php b/mod/photos.php
index 2bd809b19..786194cd8 100644
--- a/mod/photos.php
+++ b/mod/photos.php
@@ -7,6 +7,7 @@ require_once('include/bbcode.php');
require_once('include/security.php');
require_once('include/Contact.php');
require_once('include/attach.php');
+require_once('include/text.php');
function photos_init(&$a) {
@@ -334,6 +335,17 @@ function photos_post(&$a) {
intval($item_id)
);
+ // make sure the attach has the same permissions as the photo regardless of any other changes
+ $x = q("update attach set allow_cid = '%s', allow_gid = '%s', deny_cid = '%s', deny_gid = '%s' where hash = '%s' and uid = %d and is_photo = 1",
+ dbesc($str_contact_allow),
+ dbesc($str_group_allow),
+ dbesc($str_contact_deny),
+ dbesc($str_group_deny),
+ dbesc($resource_id),
+ intval($page_owner_uid)
+ );
+
+
if(strlen($rawtags)) {
@@ -396,10 +408,21 @@ function photos_post(&$a) {
* default post action - upload a photo
*/
+ $channel = $a->data['channel'];
+ $observer = $a->data['observer'];
+
$_REQUEST['source'] = 'photos';
require_once('include/attach.php');
+ 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 = attach_store($a->channel,get_observer_hash(), $_REQUEST);
+
if(! $r['success']) {
notice($r['message'] . EOL);
}