This commit is contained in:
lalka2016 2023-08-31 16:05:24 +03:00
parent a91a79dc6f
commit f955b1fc56
7 changed files with 13 additions and 14 deletions

View file

@ -27,7 +27,7 @@ class Notes implements Handler
$reject(160, "You don't have permission to access this note");
if(!$note->canBeViewedBy($this->user))
$reject(15, "Happy new year");
$reject(15, "Access to note denied");
$resolve([
"title" => $note->getName(),

View file

@ -24,7 +24,7 @@ class Wall implements Handler
$reject("No post with id=$id");
if(!$post->canBeViewedBy($this->user))
$reject(12, "Aces denid,");
$reject(12, "Access denied");
$res = (object) [];
$res->id = $post->getId();

View file

@ -48,8 +48,8 @@ final class Users extends VKAPIRequestHandler
"id" => $usr->getId(),
"first_name" => $usr->getFirstName(),
"last_name" => $usr->getLastName(),
"is_closed" => false,
"can_access_closed" => true,
"is_closed" => $usr->isClosed(),
"can_access_closed" => (bool)$usr->canBeViewedBy($this->getUser()),
];
$flds = explode(',', $fields);

View file

@ -168,8 +168,8 @@ final class Wall extends VKAPIRequestHandler
"first_name" => $user->getFirstName(),
"id" => $user->getId(),
"last_name" => $user->getLastName(),
"can_access_closed" => false,
"is_closed" => false,
"can_access_closed" => (bool)$user->canBeViewedBy($this->getUser()),
"is_closed" => $user->isClosed(),
"sex" => $user->isFemale() ? 1 : 2,
"screen_name" => $user->getShortCode(),
"photo_50" => $user->getAvatarUrl(),
@ -349,8 +349,8 @@ final class Wall extends VKAPIRequestHandler
"first_name" => $user->getFirstName(),
"id" => $user->getId(),
"last_name" => $user->getLastName(),
"can_access_closed" => false,
"is_closed" => false,
"can_access_closed" => (bool)$user->canBeViewedBy($this->getUser()),
"is_closed" => $user->isClosed(),
"sex" => $user->isFemale() ? 1 : 2,
"screen_name" => $user->getShortCode(),
"photo_50" => $user->getAvatarUrl(),

View file

@ -442,7 +442,6 @@ final class UserPresenter extends OpenVKPresenter
$prof = $this->postParam("profile_type") == 1 || $this->postParam("profile_type") == 0 ? (int)$this->postParam("profile_type") : 0;
$user->setProfile_type($prof);
$user->save();
} else if($_GET['act'] === "finance.top-up") {
$token = $this->postParam("key0") . $this->postParam("key1") . $this->postParam("key2") . $this->postParam("key3");

View file

@ -39,13 +39,13 @@ final class VideosPresenter extends OpenVKPresenter
function renderView(int $owner, int $vId): void
{
$user = $this->users->get($owner);
$video = $this->videos->getByOwnerAndVID($owner, $vId);
if(!$user) $this->notFound();
if(!$video || $video->isDeleted()) $this->notFound();
if(!$user->getPrivacyPermission('videos.read', $this->user->identity ?? NULL) || !$video->canBeViewedBy($this->user->identity))
$this->flashFail("err", tr("forbidden"), tr("forbidden_comment"));
$video = $this->videos->getByOwnerAndVID($owner, $vId);
if($this->videos->getByOwnerAndVID($owner, $vId)->isDeleted()) $this->notFound();
$this->template->user = $user;
$this->template->video = $this->videos->getByOwnerAndVID($owner, $vId);
$this->template->cCount = $this->template->video->getCommentsCount();

View file

@ -16,7 +16,7 @@
alt="{$user->getCanonicalName()}"
style="width: 100%; image-rendering: -webkit-optimize-contrast;" />
</div>
<div id="profile_links">
<div id="profile_links" n:if="isset($thisUser)">
<a style="width: 194px;" n:if="$user->getPrivacyPermission('messages.write', $thisUser)" href="/im?sel={$user->getId()}" class="profile_link">{_send_message}</a>
{var $subStatus = $user->getSubscriptionStatus($thisUser)}
{if $subStatus === 0}