when creating an event from a post in our stream, if the original post was private, set the event permissions to "just me". If it was a public event, set the event permissions to the channel default permissions.

This commit is contained in:
redmatrix 2016-02-25 00:36:35 -08:00
parent 43521bb10b
commit ebfa1a12b9
5 changed files with 16 additions and 5 deletions

View File

@ -440,6 +440,17 @@ function event_addtocal($item_id, $uid) {
$ev['event_hash'] = $item['resource_id']; $ev['event_hash'] = $item['resource_id'];
} }
if($ev->private)
$ev['allow_cid'] = '<' . $channel['channel_hash'] . '>';
else {
$acl = new Zotlabs\Access\AccessList($channel);
$x = $acl->get();
$ev['allow_cid'] = $x['allow_cid'];
$ev['allow_gid'] = $x['allow_gid'];
$ev['deny_cid'] = $x['deny_cid'];
$ev['deny_gid'] = $x['deny_gid'];
}
$event = event_store_event($ev); $event = event_store_event($ev);
if($event) { if($event) {
$r = q("update item set resource_id = '%s', resource_type = 'event' where id = %d and uid = %d", $r = q("update item set resource_id = '%s', resource_type = 'event' where id = %d and uid = %d",

View File

@ -124,12 +124,12 @@ session_set_save_handler(
// Force cookies to be secure (https only) if this site is SSL enabled. Must be done before session_start(). // Force cookies to be secure (https only) if this site is SSL enabled. Must be done before session_start().
if(intval($a->config['system']['ssl_cookie_protection'])) { if(intval(get_app()->config['system']['ssl_cookie_protection'])) {
$arr = session_get_cookie_params(); $arr = session_get_cookie_params();
session_set_cookie_params( session_set_cookie_params(
((isset($arr['lifetime'])) ? $arr['lifetime'] : 0), ((isset($arr['lifetime'])) ? $arr['lifetime'] : 0),
((isset($arr['path'])) ? $arr['path'] : '/'), ((isset($arr['path'])) ? $arr['path'] : '/'),
((isset($arr['domain'])) ? $arr['domain'] : $a->get_hostname()), ((isset($arr['domain'])) ? $arr['domain'] : get_app()->get_hostname()),
((isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on') ? true : false), ((isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on') ? true : false),
((isset($arr['httponly'])) ? $arr['httponly'] : true)); ((isset($arr['httponly'])) ? $arr['httponly'] : true));
} }

View File

@ -85,7 +85,7 @@ function cal_content(&$a) {
$m = 0; $m = 0;
$ignored = ((x($_REQUEST,'ignored')) ? " and ignored = " . intval($_REQUEST['ignored']) . " " : ''); $ignored = ((x($_REQUEST,'ignored')) ? " and ignored = " . intval($_REQUEST['ignored']) . " " : '');
logger('args: ' . print_r($a->argv,true)); // logger('args: ' . print_r($a->argv,true));
if(argc() > 3 && intval(argv(2)) && intval(argv(3))) { if(argc() > 3 && intval(argv(2)) && intval(argv(3))) {
$mode = 'view'; $mode = 'view';

View File

@ -299,7 +299,7 @@ function events_content(&$a) {
$ignored = ((x($_REQUEST,'ignored')) ? " and ignored = " . intval($_REQUEST['ignored']) . " " : ''); $ignored = ((x($_REQUEST,'ignored')) ? " and ignored = " . intval($_REQUEST['ignored']) . " " : '');
logger('args: ' . print_r($a->argv,true)); // logger('args: ' . print_r($a->argv,true));

View File

@ -1 +1 @@
2016-02-24.1317H 2016-02-25.1318H