From a31331bfd9500ad7dab117692b2c118d99c5c2f0 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Sun, 11 Feb 2018 18:02:28 -0800 Subject: hubzilla issue #972 - provide system toggle to allow/disallow anonymous comments --- Zotlabs/Access/PermissionLimits.php | 4 +++- include/items.php | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Zotlabs/Access/PermissionLimits.php b/Zotlabs/Access/PermissionLimits.php index 9ee0656b1..1d15098fc 100644 --- a/Zotlabs/Access/PermissionLimits.php +++ b/Zotlabs/Access/PermissionLimits.php @@ -41,8 +41,10 @@ class PermissionLimits { $limits = []; $perms = Permissions::Perms(); + $anon_comments = get_config('system','anonymous_comments',true); + foreach($perms as $k => $v) { - if(strstr($k, 'view') || $k === 'post_comments') + if(strstr($k, 'view') || ($k === 'post_comments' && $anon_comments)) $limits[$k] = PERMS_PUBLIC; else $limits[$k] = PERMS_SPECIFIC; diff --git a/include/items.php b/include/items.php index c7206458e..42f147eec 100755 --- a/include/items.php +++ b/include/items.php @@ -3653,7 +3653,7 @@ function delete_item_lowlevel($item, $stage = DROPITEM_NORMAL, $force = false) { $linked_item = (($item['resource_id']) ? true : false); - logger('item: ' . $item . ' stage: ' . $stage . ' force: ' . $force, LOGGER_DATA); + logger('item: ' . $item['id'] . ' stage: ' . $stage . ' force: ' . $force, LOGGER_DATA); switch($stage) { case DROPITEM_PHASE2: -- cgit v1.2.3