Compare commits

..

1 commit

Author SHA1 Message Date
mrilyew
6b9cbd5a16
Merge 530287feed into 2aedc3e861 2024-12-06 16:11:12 +00:00
2 changed files with 9 additions and 1 deletions

View file

@ -287,6 +287,7 @@ final class Board extends VKAPIRequestHandler
{ {
# start_comment_id ne robit # start_comment_id ne robit
$this->requireUser(); $this->requireUser();
$this->willExecuteWriteAction();
$topic = (new TopicsRepo)->getTopicById($group_id, $topic_id); $topic = (new TopicsRepo)->getTopicById($group_id, $topic_id);
@ -320,6 +321,7 @@ final class Board extends VKAPIRequestHandler
{ {
# order и extended ничё не делают # order и extended ничё не делают
$this->requireUser(); $this->requireUser();
$this->willExecuteWriteAction();
$arr = []; $arr = [];
$club = (new ClubsRepo)->get($group_id); $club = (new ClubsRepo)->get($group_id);
@ -328,7 +330,7 @@ final class Board extends VKAPIRequestHandler
$arr["count"] = (new TopicsRepo)->getClubTopicsCount($club); $arr["count"] = (new TopicsRepo)->getClubTopicsCount($club);
$arr["items"] = []; $arr["items"] = [];
$arr["default_order"] = $order; $arr["default_order"] = $order;
$arr["can_add_topics"] = $club->canBeModifiedBy($this->getUser()) ? true : ($club->isEveryoneCanCreateTopics() ? true : false); $arr["can_add_topics"] = $club->canBeModifiedBy($this->getUser()) ? true : $club->isEveryoneCanCreateTopics() ? true : false;
$arr["profiles"] = []; $arr["profiles"] = [];
if(empty($topic_ids)) { if(empty($topic_ids)) {

View file

@ -288,6 +288,7 @@ final class Photos extends VKAPIRequestHandler
function getAlbums(int $owner_id, string $album_ids = "", int $offset = 0, int $count = 100, bool $need_system = true, bool $need_covers = true, bool $photo_sizes = false) function getAlbums(int $owner_id, string $album_ids = "", int $offset = 0, int $count = 100, bool $need_system = true, bool $need_covers = true, bool $photo_sizes = false)
{ {
$this->requireUser(); $this->requireUser();
$this->willExecuteWriteAction();
$res = []; $res = [];
@ -359,6 +360,7 @@ final class Photos extends VKAPIRequestHandler
function getAlbumsCount(int $user_id = 0, int $group_id = 0) function getAlbumsCount(int $user_id = 0, int $group_id = 0)
{ {
$this->requireUser(); $this->requireUser();
$this->willExecuteWriteAction();
if($user_id == 0 && $group_id == 0 || $user_id > 0 && $group_id > 0) if($user_id == 0 && $group_id == 0 || $user_id > 0 && $group_id > 0)
$this->fail(21, "Select user_id or group_id"); $this->fail(21, "Select user_id or group_id");
@ -387,6 +389,7 @@ final class Photos extends VKAPIRequestHandler
function getById(string $photos, bool $extended = false, bool $photo_sizes = false) function getById(string $photos, bool $extended = false, bool $photo_sizes = false)
{ {
$this->requireUser(); $this->requireUser();
$this->willExecuteWriteAction();
$phts = explode(",", $photos); $phts = explode(",", $photos);
$res = []; $res = [];
@ -410,6 +413,7 @@ final class Photos extends VKAPIRequestHandler
function get(int $owner_id, int $album_id, string $photo_ids = "", bool $extended = false, bool $photo_sizes = false, int $offset = 0, int $count = 10) function get(int $owner_id, int $album_id, string $photo_ids = "", bool $extended = false, bool $photo_sizes = false, int $offset = 0, int $count = 10)
{ {
$this->requireUser(); $this->requireUser();
$this->willExecuteWriteAction();
$res = []; $res = [];
@ -628,6 +632,7 @@ final class Photos extends VKAPIRequestHandler
function getAll(int $owner_id, bool $extended = false, int $offset = 0, int $count = 100, bool $photo_sizes = false) function getAll(int $owner_id, bool $extended = false, int $offset = 0, int $count = 100, bool $photo_sizes = false)
{ {
$this->requireUser(); $this->requireUser();
$this->willExecuteWriteAction();
if($owner_id < 0) if($owner_id < 0)
$this->fail(4, "This method doesn't works with clubs"); $this->fail(4, "This method doesn't works with clubs");
@ -656,6 +661,7 @@ final class Photos extends VKAPIRequestHandler
function getComments(int $owner_id, int $photo_id, bool $need_likes = false, int $offset = 0, int $count = 100, bool $extended = false, string $fields = "") function getComments(int $owner_id, int $photo_id, bool $need_likes = false, int $offset = 0, int $count = 100, bool $extended = false, string $fields = "")
{ {
$this->requireUser(); $this->requireUser();
$this->willExecuteWriteAction();
$photo = (new PhotosRepo)->getByOwnerAndVID($owner_id, $photo_id); $photo = (new PhotosRepo)->getByOwnerAndVID($owner_id, $photo_id);
$comms = array_slice(iterator_to_array($photo->getComments(1, $offset + $count)), $offset); $comms = array_slice(iterator_to_array($photo->getComments(1, $offset + $count)), $offset);