1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
currentuser.php
См. документацию.
1<?php
2
3namespace Bitrix\Main\Engine;
4
5use CUser;
6
7final class CurrentUser
8{
10 private $cuser;
11
16 protected function __construct()
17 {
18 }
19
24 public static function className(): string
25 {
26 return self::class;
27 }
28
33 public static function get(): self
34 {
35 global $USER;
36
37 $self = new self();
38 if ($USER instanceof \CUser)
39 {
40 $self->cuser = $USER;
41 }
42
43 return $self;
44 }
45
49 public function getId()
50 {
51 return $this->cuser?->getId();
52 }
53
57 public function getLogin()
58 {
59 return $this->cuser?->getLogin();
60 }
61
65 public function getEmail()
66 {
67 return $this->cuser?->getEmail();
68 }
69
73 public function getFullName()
74 {
75 return $this->cuser?->getFullName();
76 }
77
81 public function getFirstName()
82 {
83 return $this->cuser?->getFirstName();
84 }
85
89 public function getLastName()
90 {
91 return $this->cuser?->getLastName();
92 }
93
97 public function getSecondName()
98 {
99 return $this->cuser?->getSecondName();
100 }
101
105 public function getUserGroups(): array
106 {
107 $groups = $this->cuser?->getUserGroupArray();
108 return is_array($groups) ? $groups : [];
109 }
110
114 public function getFormattedName(): string
115 {
116 return (string)$this->cuser?->getFormattedName(false, false);
117 }
118
123 public function canDoOperation($operationName): bool
124 {
125 return (bool)$this->cuser?->canDoOperation($operationName);
126 }
127
131 public function isAdmin(): bool
132 {
133 return (bool)$this->cuser?->isAdmin();
134 }
135}
canDoOperation($operationName)
Определения currentuser.php:123
static className()
Определения currentuser.php:24
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
global $USER
Определения csv_new_run.php:40
$groups
Определения options.php:30