*/
public $reasonHidden = '';
+ /**
+ * @var bool
+ */
+ public $requireLogin = false;
+
/**
* Determine visibility of items within a container for the current user
*
$ret->reasonHidden = self::REASON_NOACCESS;
}
}
+
+ if ($ret->shouldHideItems && !$user) {
+ $ret->requireLogin = true;
+ }
+
$cache[$cache_key] = $ret;
}
return $cache[$cache_key];
$group = get_entity($page_owner_guid);
$forward_url = $group ? $group->getURL() : '';
- if ($visibility->reasonHidden !== ElggGroupItemVisibility::REASON_MEMBERSHIP) {
+ if (!elgg_is_logged_in()) {
$_SESSION['last_forward_from'] = current_page_url();
$forward_reason = 'login';
} else {