From 203b16b87c8e0305d21de25ad1d89a9de96851d0 Mon Sep 17 00:00:00 2001 From: Maxim Leshchenko Date: Mon, 23 May 2022 20:24:32 +0100 Subject: [PATCH] Users: Fix list of user groups a little bit --- Web/Presenters/UserPresenter.php | 3 +++ Web/Presenters/templates/@listView.xml | 2 +- Web/Presenters/templates/User/Groups.xml | 6 +++--- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Web/Presenters/UserPresenter.php b/Web/Presenters/UserPresenter.php index c6a41616..e2f26d59 100644 --- a/Web/Presenters/UserPresenter.php +++ b/Web/Presenters/UserPresenter.php @@ -90,6 +90,9 @@ final class UserPresenter extends OpenVKPresenter elseif (!$user->getPrivacyPermission('groups.read', $this->user->identity ?? NULL)) $this->flashFail("err", tr("forbidden"), tr("forbidden_comment")); else { + if($this->queryParam("act") === "managed" && $this->user->id !== $user->getId()) + $this->flashFail("err", tr("forbidden"), tr("forbidden_comment")); + $this->template->user = $user; $this->template->page = (int) ($this->queryParam("p") ?? 1); $this->template->admin = $this->queryParam("act") == "managed"; diff --git a/Web/Presenters/templates/@listView.xml b/Web/Presenters/templates/@listView.xml index 7d69bf00..811f8724 100644 --- a/Web/Presenters/templates/@listView.xml +++ b/Web/Presenters/templates/@listView.xml @@ -4,7 +4,7 @@
-
+
{include tabs}
diff --git a/Web/Presenters/templates/User/Groups.xml b/Web/Presenters/templates/User/Groups.xml index 395ffe19..ee014a19 100644 --- a/Web/Presenters/templates/User/Groups.xml +++ b/Web/Presenters/templates/User/Groups.xml @@ -32,7 +32,7 @@ {/block} {block size} -
+
{if !is_null($thisUser) && $user->getId() === $thisUser->getId()} {tr("groups_list", $thisUser->getClubCount())} @@ -90,7 +90,7 @@ {/if}
- +
@@ -101,7 +101,7 @@ {block bottom} {if !is_null($thisUser) && $user->getId() === $thisUser->getId()}
-
+

{_open_new_group}

{_open_group_desc}