diff options
author | redmatrix <redmatrix@redmatrix.me> | 2015-08-24 20:58:12 -0700 |
---|---|---|
committer | redmatrix <redmatrix@redmatrix.me> | 2015-08-24 20:58:12 -0700 |
commit | 5fa2aa6d481fe0597044f2e3d4434fc9f4311fe7 (patch) | |
tree | 2c7b59b4c1b099e6a5c90467b6d6e4e0b82c1c16 /include/photos.php | |
parent | 0edac8810b702ee4a8b8aeef18003d5549c1ac0d (diff) | |
download | volse-hubzilla-5fa2aa6d481fe0597044f2e3d4434fc9f4311fe7.tar.gz volse-hubzilla-5fa2aa6d481fe0597044f2e3d4434fc9f4311fe7.tar.bz2 volse-hubzilla-5fa2aa6d481fe0597044f2e3d4434fc9f4311fe7.zip |
lots of stuff that was needed for successful photo import from red
Diffstat (limited to 'include/photos.php')
-rw-r--r-- | include/photos.php | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/include/photos.php b/include/photos.php index cb7fabc98..dc7df2d0d 100644 --- a/include/photos.php +++ b/include/photos.php @@ -52,12 +52,21 @@ function photo_upload($channel, $observer, $args) { // Set to default channel permissions. If the parent directory (album) has permissions set, // use those instead. If we have specific permissions supplied, they take precedence over - // all other settings. - - $str_group_allow = $channel['channel_allow_gid']; - $str_contact_allow = $channel['channel_allow_cid']; - $str_group_deny = $channel['channel_deny_gid']; - $str_contact_deny = $channel['channel_deny_cid']; + // all other settings. 'allow_cid' being passed from an external source takes priority over channel settings. + // ...messy... needs re-factoring once the photos/files integration stabilises + + if(array_key_exists('allow_cid',$args)) { + $str_group_allow = $args['allow_gid']; + $str_contact_allow = $args['allow_cid']; + $str_group_deny = $args['deny_gid']; + $str_contact_deny = $args['deny_cid']; + } + else { + $str_group_allow = $channel['channel_allow_gid']; + $str_contact_allow = $channel['channel_allow_cid']; + $str_group_deny = $channel['channel_deny_gid']; + $str_contact_deny = $channel['channel_deny_cid']; + } if($args['directory']) { $str_group_allow = $args['directory']['allow_gid']; |