Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
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()
25 {
26 return get_called_class();
27 }
28
33 public static function get()
34 {
35 global $USER;
36 $self = new static();
37 $self->cuser = $USER;
38
39 return $self;
40 }
41
45 public function getId()
46 {
47 return $this->cuser->getId();
48 }
49
53 public function getLogin()
54 {
55 return $this->cuser->getLogin();
56 }
57
61 public function getEmail()
62 {
63 return $this->cuser->getEmail();
64 }
65
69 public function getFullName()
70 {
71 return $this->cuser->getFullName();
72 }
73
77 public function getFirstName()
78 {
79 return $this->cuser->getFirstName();
80 }
81
85 public function getLastName()
86 {
87 return $this->cuser->getLastName();
88 }
89
93 public function getSecondName()
94 {
95 return $this->cuser->getSecondName();
96 }
97
101 public function getUserGroups()
102 {
103 return $this->cuser->getUserGroupArray();
104 }
105
109 public function getFormattedName()
110 {
111 return $this->cuser->getFormattedName(false, false);
112 }
113
118 public function canDoOperation($operationName)
119 {
120 return $this->cuser->canDoOperation($operationName);
121 }
122
126 public function isAdmin()
127 {
128 return $this->cuser->isAdmin();
129 }
130}