Commit a31331bf authored by Zot's avatar Zot

hubzilla issue #972 - provide system toggle to allow/disallow anonymous comments

parent 07d33a11
......@@ -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;
......
......@@ -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:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment