this does not related to this branch

This commit is contained in:
mrilyew 2025-06-29 16:01:50 +03:00
parent 3e44516095
commit fc05f0ea23
3 changed files with 9 additions and 4 deletions

View file

@ -103,6 +103,10 @@ final class ReportPresenter extends OpenVKPresenter
exit(json_encode([ "error" => "You can't report yourself" ])); exit(json_encode([ "error" => "You can't report yourself" ]));
} }
if ($this->user->identity->isBannedInSupport()) {
exit(json_encode([ "reason" => $this->queryParam("reason") ]));
}
if (in_array($this->queryParam("type"), ["post", "photo", "video", "group", "comment", "note", "app", "user", "audio", "doc"])) { if (in_array($this->queryParam("type"), ["post", "photo", "video", "group", "comment", "note", "app", "user", "audio", "doc"])) {
if (count(iterator_to_array($this->reports->getDuplicates($this->queryParam("type"), $id, null, $this->user->id))) <= 0) { if (count(iterator_to_array($this->reports->getDuplicates($this->queryParam("type"), $id, null, $this->user->id))) <= 0) {
$report = new Report(); $report = new Report();

View file

@ -67,7 +67,7 @@
}, },
success: (response) => { success: (response) => {
if (response?.reports?.length != _content) { if (response?.reports?.length != _content) {
NewNotification("Обратите внимание", "В списке появились новые жалобы. Работа ждёт :)"); // NewNotification("Обратите внимание", "В списке появились новые жалобы. Работа ждёт :)");
} }
if (response.reports.length > 0) { if (response.reports.length > 0) {

View file

@ -21,9 +21,8 @@ class EventRateLimiter
public function tryToLimit(?User $user, string $event_type, bool $is_update = true): bool public function tryToLimit(?User $user, string $event_type, bool $is_update = true): bool
{ {
/*
/* Checks count of actions for last x seconds
Checks count of actions for last x seconds.
Uses OPENVK_ROOT_CONF["openvk"]["preferences"]["security"]["rateLimits"]["eventsLimit"] Uses OPENVK_ROOT_CONF["openvk"]["preferences"]["security"]["rateLimits"]["eventsLimit"]
@ -34,6 +33,8 @@ class EventRateLimiter
true limit has exceed and the action must be restricted true limit has exceed and the action must be restricted
false the action can be performed false the action can be performed
Also returns "true" if this option is disabled
*/ */
$isEnabled = $this->config['enable']; $isEnabled = $this->config['enable'];