aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorredmatrix <redmatrix@redmatrix.me>2015-10-01 20:22:03 -0700
committerredmatrix <redmatrix@redmatrix.me>2015-10-01 20:22:03 -0700
commit1da3828a09485a9b2bc6113cbab9ca9ca483ffc0 (patch)
tree48427e8f48421b3bb8f344d85f2ebfe1271ea34e
parent982ff8733fc4c66833c94bb9d4c135f6fb3ed7fe (diff)
downloadvolse-hubzilla-0.10.tar.gz
volse-hubzilla-0.10.tar.bz2
volse-hubzilla-0.10.zip
issue with resetting post perms to default audience - not sticking.0.10
-rw-r--r--mod/item.php23
1 files changed, 17 insertions, 6 deletions
diff --git a/mod/item.php b/mod/item.php
index 93f24bd1a..7488e709b 100644
--- a/mod/item.php
+++ b/mod/item.php
@@ -372,12 +372,23 @@ function item_post(&$a) {
}
else {
- if((! $walltowall) &&
- ((array_key_exists('contact_allow',$_REQUEST))
- || (array_key_exists('group_allow',$_REQUEST))
- || (array_key_exists('contact_deny',$_REQUEST))
- || (array_key_exists('group_deny',$_REQUEST)))) {
- $acl->set_from_array($_REQUEST);
+ if(! $walltowall) {
+ if((array_key_exists('contact_allow',$_REQUEST))
+ || (array_key_exists('group_allow',$_REQUEST))
+ || (array_key_exists('contact_deny',$_REQUEST))
+ || (array_key_exists('group_deny',$_REQUEST))) {
+ $acl->set_from_array($_REQUEST);
+ }
+ elseif(! $api_source) {
+
+ // if no ACL has been defined and we aren't using the API, the form
+ // didn't send us any parameters. This means there's no ACL or it has
+ // been reset to the default audience.
+ // If $api_source is set and there are no ACL parameters, we default
+ // to the channel permissions which were set in the ACL contructor.
+
+ $acl->set(array('allow_cid' => '', 'allow_gid' => '', 'deny_cid' => '', 'deny_gid' => ''));
+ }
}