Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
user.php
1<?php
3
5
6class 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}
$GLOBALS['____1444769544']
Definition license.php:1