From 5fa2aa6d481fe0597044f2e3d4434fc9f4311fe7 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Mon, 24 Aug 2015 20:58:12 -0700 Subject: lots of stuff that was needed for successful photo import from red --- include/photos.php | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'include/photos.php') 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']; -- cgit v1.2.3