diff --git a/Web/Presenters/ReportPresenter.php b/Web/Presenters/ReportPresenter.php index f58eaa5c..19254ab0 100644 --- a/Web/Presenters/ReportPresenter.php +++ b/Web/Presenters/ReportPresenter.php @@ -103,6 +103,10 @@ final class ReportPresenter extends OpenVKPresenter 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 (count(iterator_to_array($this->reports->getDuplicates($this->queryParam("type"), $id, null, $this->user->id))) <= 0) { $report = new Report(); diff --git a/Web/Presenters/templates/Report/Tabs.xml b/Web/Presenters/templates/Report/Tabs.xml index 1107b44c..8cf548dd 100644 --- a/Web/Presenters/templates/Report/Tabs.xml +++ b/Web/Presenters/templates/Report/Tabs.xml @@ -67,7 +67,7 @@ }, success: (response) => { if (response?.reports?.length != _content) { - NewNotification("Обратите внимание", "В списке появились новые жалобы. Работа ждёт :)"); + // NewNotification("Обратите внимание", "В списке появились новые жалобы. Работа ждёт :)"); } if (response.reports.length > 0) { diff --git a/Web/Util/EventRateLimiter.php b/Web/Util/EventRateLimiter.php index cc71309f..b7d31657 100644 --- a/Web/Util/EventRateLimiter.php +++ b/Web/Util/EventRateLimiter.php @@ -21,9 +21,8 @@ class EventRateLimiter 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"] @@ -34,6 +33,8 @@ class EventRateLimiter true — limit has exceed and the action must be restricted false — the action can be performed + + Also returns "true" if this option is disabled */ $isEnabled = $this->config['enable'];