forked from GNUsocial/gnu-social
[COMPONENT][Feed] Restrict non-public feeds to logged in users
This commit is contained in:
parent
82e6e95b6a
commit
de89cffc34
@ -51,6 +51,7 @@ class Feeds extends FeedController
|
|||||||
*/
|
*/
|
||||||
public function network(Request $request): array
|
public function network(Request $request): array
|
||||||
{
|
{
|
||||||
|
Common::ensureLoggedIn();
|
||||||
$data = Feed::query(
|
$data = Feed::query(
|
||||||
query: 'note-local:false',
|
query: 'note-local:false',
|
||||||
page: $this->int('p'),
|
page: $this->int('p'),
|
||||||
@ -71,6 +72,7 @@ class Feeds extends FeedController
|
|||||||
*/
|
*/
|
||||||
public function clique(Request $request): array
|
public function clique(Request $request): array
|
||||||
{
|
{
|
||||||
|
Common::ensureLoggedIn();
|
||||||
$notes = DB::dql(
|
$notes = DB::dql(
|
||||||
<<<'EOF'
|
<<<'EOF'
|
||||||
SELECT n FROM \App\Entity\Note AS n
|
SELECT n FROM \App\Entity\Note AS n
|
||||||
@ -98,6 +100,7 @@ class Feeds extends FeedController
|
|||||||
*/
|
*/
|
||||||
public function federated(Request $request): array
|
public function federated(Request $request): array
|
||||||
{
|
{
|
||||||
|
Common::ensureLoggedIn();
|
||||||
$data = Feed::query(
|
$data = Feed::query(
|
||||||
query: '',
|
query: '',
|
||||||
page: $this->int('p'),
|
page: $this->int('p'),
|
||||||
|
@ -47,7 +47,7 @@ class Feed extends Controller
|
|||||||
*/
|
*/
|
||||||
public function notifications(Request $request): array
|
public function notifications(Request $request): array
|
||||||
{
|
{
|
||||||
$user = Common::user();
|
$user = Common::ensureLoggedIn();
|
||||||
$notes = DB::dql(<<<'EOF'
|
$notes = DB::dql(<<<'EOF'
|
||||||
SELECT n FROM \App\Entity\Note AS n
|
SELECT n FROM \App\Entity\Note AS n
|
||||||
WHERE n.id IN (
|
WHERE n.id IN (
|
||||||
|
@ -73,6 +73,7 @@ class Feeds extends FeedController
|
|||||||
*/
|
*/
|
||||||
public function home(Request $request): array
|
public function home(Request $request): array
|
||||||
{
|
{
|
||||||
|
Common::ensureLoggedIn();
|
||||||
$data = Feed::query(
|
$data = Feed::query(
|
||||||
query: 'note-from:subscribed',
|
query: 'note-from:subscribed',
|
||||||
page: $this->int('p'),
|
page: $this->int('p'),
|
||||||
|
Loading…
Reference in New Issue
Block a user