Merge pull request #4582 from humhub/fix/4581

Fix #4581: Users see content of archived spaces on dashboard
This commit is contained in:
Lucas Bartholemy 2020-10-26 18:08:01 +01:00 committed by GitHub
commit 156f906df7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View File

@ -16,8 +16,10 @@ HumHub Changelog
- Enh #4531: Remove wall entry left padding on mobile
- Fix #4554: Code blocks in comments uses same background color
- Fix #4574: Different style between clickable and non clickable space/user counter
- Fix #4575: Increased text size of "Read more" link on short-text post
- Fix #4575: Increased text size of "Read more" link on short-text post
- Fix #4559: Dont check platform php extensions by composer v2
- Fix #4581: Users see content of archived spaces on dashboard
1.7.0-beta.1 (October 16, 2020)

View File

@ -66,7 +66,9 @@ class DashboardStreamAction extends ActivityStreamAction
->select(["contentcontainer.id"])
->from('space')
->leftJoin('contentcontainer', 'space.id=contentcontainer.pk AND contentcontainer.class=:spaceClass')
->where('space.visibility=' . Space::VISIBILITY_ALL);
->where('space.visibility=' . Space::VISIBILITY_ALL)
->andWhere('space.status='. Space::STATUS_ENABLED);
$union = Yii::$app->db->getQueryBuilder()->build($publicSpacesSql)[0];
$publicProfilesSql = (new Query())
@ -101,7 +103,7 @@ class DashboardStreamAction extends ActivityStreamAction
$spaceMemberships = (new Query())
->select("contentcontainer.id")
->from('space_membership')
->leftJoin('space sm', 'sm.id=space_membership.space_id')
->leftJoin('space sm', 'sm.id=space_membership.space_id AND sm.status='.Space::STATUS_ENABLED)
->leftJoin('contentcontainer', 'contentcontainer.pk=sm.id AND contentcontainer.class = :spaceClass')
->where('space_membership.user_id=' . $this->user->id . ' AND space_membership.show_at_dashboard = 1');
$union .= " UNION " . Yii::$app->db->getQueryBuilder()->build($spaceMemberships)[0];