Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
user.php
1
<?php
2
namespace
Bitrix\MessageService\Context
;
3
4
use
Bitrix\Main\Loader
;
5
6
class
User
7
{
8
public
static
function
getId
()
9
{
10
$user = static::getUser();
11
return
$user? (int)$user->getId() : 0;
12
}
13
15
public
static
function
getUser
()
16
{
17
return
isset(
$GLOBALS
[
'USER'
]) &&
$GLOBALS
[
'USER'
] instanceof \CUser ?
$GLOBALS
[
'USER'
] :
null
;
18
}
19
20
public
static
function
isAdmin
()
21
{
22
$user = static::getUser();
23
24
if
($user && $user->isAuthorized())
25
{
26
return
(
27
$user->IsAdmin()
28
||
29
Loader::includeModule(
'bitrix24'
) && \CBitrix24::isPortalAdmin($user->getId())
30
);
31
}
32
33
return
false
;
34
}
35
}
Bitrix\Main\Loader
Definition
loader.php:12
Bitrix\MessageService\Context\User
Definition
user.php:7
Bitrix\MessageService\Context\User\isAdmin
static isAdmin()
Definition
user.php:20
Bitrix\MessageService\Context\User\getId
static getId()
Definition
user.php:8
Bitrix\MessageService\Context\User\getUser
static getUser()
Definition
user.php:15
Bitrix\Main\$GLOBALS
$GLOBALS['____1444769544']
Definition
license.php:1
Bitrix\MessageService\Context
Definition
user.php:2
modules
messageservice
lib
context
user.php
Создано системой
1.10.0