Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
IpPerUser.php
1
<?php
2
3
namespace
Bitrix\MessageService\Restriction
;
4
5
use
Bitrix\Main\Context
;
6
use
Bitrix\Main\Engine\CurrentUser
;
7
8
class
IpPerUser
extends
Base
9
{
10
use
Parameterizable
;
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
}
Bitrix\Main\Context\getCurrent
static getCurrent()
Definition
context.php:241
Bitrix\Main\Engine\CurrentUser
Definition
currentuser.php:8
Bitrix\MessageService\Restriction\Base
Definition
Base.php:12
Bitrix\MessageService\Restriction\IpPerUser
Definition
IpPerUser.php:9
Bitrix\MessageService\Restriction\IpPerUser\getEntityId
getEntityId()
Definition
IpPerUser.php:13
Bitrix\MessageService\Restriction\IpPerUser\getEntity
getEntity()
Definition
IpPerUser.php:23
Bitrix\MessageService\Restriction\IpPerUser\getDefaultLimit
getDefaultLimit()
Definition
IpPerUser.php:33
Bitrix\MessageService\Restriction\IpPerUser\getOptionLimitName
getOptionLimitName()
Definition
IpPerUser.php:18
Bitrix\MessageService\Restriction\IpPerUser\getCurrentAdditionalParam
getCurrentAdditionalParam()
Definition
IpPerUser.php:28
Bitrix\Main\Context
Definition
culture.php:9
Bitrix\MessageService\Restriction
Definition
Base.php:3
Bitrix\MessageService\Restriction\Parameterizable
trait Parameterizable
Definition
Parameterizable.php:8
modules
messageservice
lib
Restriction
IpPerUser.php
Создано системой
1.10.0