1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
IpPerUser.php
См. документацию.
1<?php
2
3namespace Bitrix\MessageService\Restriction;
4
5use Bitrix\Main\Context;
6use Bitrix\Main\Engine\CurrentUser;
7
8class IpPerUser extends Base
9{
11 use SkippingUnauthorized;
12
13 public function getEntityId(): string
14 {
15 return 'ipu_' . $this->getEntity();
16 }
17
18 protected function getOptionLimitName(): string
19 {
20 return 'network_restriction_ip_per_user';
21 }
22
23 protected function getEntity(): string
24 {
25 return (string)($this->message->getAuthorId() ?: CurrentUser::get()->getId());
26 }
27
28 protected function getCurrentAdditionalParam(): string
29 {
30 return Context::getCurrent()->getServer()->getRemoteAddr();
31 }
32
33 protected function getDefaultLimit(): int
34 {
35 return 0;
36 }
37
38}