@@ -124,7 +124,7 @@ {/if}
From c39780c3f9c4b126cc316f93ccff9b08db03eba3 Mon Sep 17 00:00:00 2001 From: lalka2016 <99399973+lalka2016@users.noreply.github.com> Date: Tue, 11 Jul 2023 15:09:37 +0300 Subject: [PATCH] Fih --- VKAPI/Handlers/Groups.php | 2 +- VKAPI/Handlers/Users.php | 2 +- Web/Models/Entities/Video.php | 2 +- Web/Models/Repositories/Clubs.php | 4 ++-- Web/Presenters/GroupPresenter.php | 2 +- Web/Presenters/templates/Search/Index.xml | 2 +- Web/Presenters/templates/User/View.xml | 6 +++--- locales/en.strings | 1 + locales/ru.strings | 1 + 9 files changed, 12 insertions(+), 10 deletions(-) diff --git a/VKAPI/Handlers/Groups.php b/VKAPI/Handlers/Groups.php index 54742b65..95068a78 100644 --- a/VKAPI/Handlers/Groups.php +++ b/VKAPI/Handlers/Groups.php @@ -21,7 +21,7 @@ final class Groups extends VKAPIRequestHandler if(is_null($user) || $user->isDeleted() || $user->isBanned()) $this->fail(15, "Invalid user"); - if($user->getPrivacyPermission("page.info.read", $this->getUser() ?? NULL)) { + if(!$user->getPrivacyPermission("groups.read", $this->getUser() ?? NULL)) { $this->fail(8, "Access denied: this user chose to hide his groups."); } diff --git a/VKAPI/Handlers/Users.php b/VKAPI/Handlers/Users.php index f15199df..a1d95848 100644 --- a/VKAPI/Handlers/Users.php +++ b/VKAPI/Handlers/Users.php @@ -223,7 +223,7 @@ final class Users extends VKAPIRequestHandler $user = $users->get($user_id); if(!$user || $user->isDeleted()) { - $this->fail(4, "User deleted"); + $this->fail(4, "User is deleted"); } if(!$user->canBeViewedBy($this->getUser() ?? NULL)) { diff --git a/Web/Models/Entities/Video.php b/Web/Models/Entities/Video.php index ae069ac0..0299f5ce 100644 --- a/Web/Models/Entities/Video.php +++ b/Web/Models/Entities/Video.php @@ -230,7 +230,7 @@ class Video extends Media return $this->getOwner()->canBeViewedBy($user) && $this->getOwner()->getPrivacyPermission('videos.read', $user); } else { # когда у видосов появятся группы - return true; + return $this->getOwner()->canBeViewedBy($user); } } } diff --git a/Web/Models/Repositories/Clubs.php b/Web/Models/Repositories/Clubs.php index c00fc12a..d0077e99 100644 --- a/Web/Models/Repositories/Clubs.php +++ b/Web/Models/Repositories/Clubs.php @@ -52,7 +52,7 @@ class Clubs $nnparamsCount = 0; foreach($pars as $paramName => $paramValue) - if($paramName != "before" && $paramName != "after" && $paramName != "gender" && $paramName != "maritalstatus" && $paramName != "politViews" && $paramName != "doNotSearchMe") + if($paramName != "doNotShowDeleted") $paramValue != NULL ? $notNullParams += ["$paramName" => "%$paramValue%"] : NULL; else $paramValue != NULL ? $notNullParams += ["$paramName" => "$paramValue"] : NULL; @@ -93,7 +93,7 @@ class Clubs ]; */ } - + function getWriteableClubs(int $id): \Traversable { $result = $this->clubs->where("owner", $id)->where("deleted", 0); diff --git a/Web/Presenters/GroupPresenter.php b/Web/Presenters/GroupPresenter.php index ba474d67..7266ee93 100644 --- a/Web/Presenters/GroupPresenter.php +++ b/Web/Presenters/GroupPresenter.php @@ -454,7 +454,7 @@ final class GroupPresenter extends OpenVKPresenter } if($club->isBanned()) { - $this->flashFail("err", tr("error")); + $this->flashFail("err", tr("error"), tr("banned_restore")); } $club->setDeleted(0); diff --git a/Web/Presenters/templates/Search/Index.xml b/Web/Presenters/templates/Search/Index.xml index 4d322f2a..78d27267 100644 --- a/Web/Presenters/templates/Search/Index.xml +++ b/Web/Presenters/templates/Search/Index.xml @@ -188,7 +188,7 @@ {elseif $type == "posts"}