1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
context.php
См. документацию.
1<?php
2
9
10namespace Bitrix\Main\Authentication;
11
12class Context implements \JsonSerializable
13{
14 protected $userId;
15 protected $previousUserId;
16 protected $applicationId;
18 protected $storedAuthId;
19 protected $storedAuthHash;
20 protected $hitAuthId;
21 protected $requestId;
22 protected Method $method = Method::Unspecified;
23
24 public function getUserId(): int
25 {
26 return (int)$this->userId;
27 }
28
29 public function setUserId(?int $userId): static
30 {
31 $this->userId = $userId;
32 return $this;
33 }
34
35 public function getPreviousUserId(): int
36 {
37 return (int)$this->previousUserId;
38 }
39
40 public function setPreviousUserId(?int $userId): static
41 {
42 $this->previousUserId = $userId;
43 return $this;
44 }
45
46 public function getApplicationId(): ?string
47 {
48 return $this->applicationId;
49 }
50
51 public function setApplicationId(?string $applicationId): static
52 {
53 $this->applicationId = $applicationId;
54 return $this;
55 }
56
57 public function getApplicationPasswordId(): ?int
58 {
59 return $this->applicationPasswordId;
60 }
61
63 {
64 $this->applicationPasswordId = $applicationPasswordId;
65 return $this;
66 }
67
68 public function getStoredAuthId(): ?int
69 {
70 return $this->storedAuthId;
71 }
72
73 public function setStoredAuthId(?int $storedAuthId): static
74 {
75 $this->storedAuthId = $storedAuthId;
76 return $this;
77 }
78
79 public function getHitAuthId(): ?int
80 {
81 return $this->hitAuthId;
82 }
83
84 public function setHitAuthId(?int $hitAuthId): static
85 {
86 $this->hitAuthId = $hitAuthId;
87 return $this;
88 }
89
90 public function getStoredAuthHash(): ?string
91 {
92 return $this->storedAuthHash;
93 }
94
95 public function setStoredAuthHash(?string $storedAuthHash): static
96 {
97 $this->storedAuthHash = $storedAuthHash;
98 return $this;
99 }
100
101 public function getMethod(): Method
102 {
103 return $this->method;
104 }
105
106 public function setMethod(Method $method): static
107 {
108 $this->method = $method;
109 return $this;
110 }
111
112 public function getRequestId(): ?string
113 {
114 return $this->requestId;
115 }
116
117 public function setRequestId(?string $requestId): static
118 {
119 $this->requestId = $requestId;
120 return $this;
121 }
122
123 public function jsonSerialize(): array
124 {
125 $data = [];
126
127 foreach ($this as $property => $dummy)
128 {
129 $data[$property] = $this->{$property};
130 }
131
132 return $data;
133 }
134
135 public static function jsonDecode(string $json): static
136 {
137 $obj = new static();
138
139 if ($json != '')
140 {
141 $data = json_decode($json, true);
142
143 foreach ($obj as $property => $dummy)
144 {
145 if (isset($data[$property]))
146 {
147 if ($obj->{$property} instanceof Method)
148 {
149 $obj->{$property} = Method::tryFrom($data[$property]) ?? Method::Unspecified;
150 }
151 else
152 {
153 $obj->{$property} = $data[$property];
154 }
155 }
156 }
157 }
158
159 return $obj;
160 }
161
162 public function prepareForLog(): static
163 {
164 $context = clone $this;
165
166 unset($context->storedAuthHash);
167
168 foreach ($this as $property => $dummy)
169 {
170 if (empty($this->{$property}))
171 {
172 unset($context->{$property});
173 }
174 }
175
176 return $context;
177 }
178}
if(!is_object($USER)||! $USER->IsAuthorized()) $userId
Определения check_mail.php:18
setPreviousUserId(?int $userId)
Определения context.php:40
setApplicationId(?string $applicationId)
Определения context.php:51
getApplicationPasswordId()
Определения context.php:57
setUserId(?int $userId)
Определения context.php:29
setStoredAuthId(?int $storedAuthId)
Определения context.php:73
setApplicationPasswordId(?int $applicationPasswordId)
Определения context.php:62
setStoredAuthHash(?string $storedAuthHash)
Определения context.php:95
setHitAuthId(?int $hitAuthId)
Определения context.php:84
static jsonDecode(string $json)
Определения context.php:135
setMethod(Method $method)
Определения context.php:106
setRequestId(?string $requestId)
Определения context.php:117
$data['IS_AVAILABLE']
Определения .description.php:13
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$context
Определения csv_new_setup.php:223
Определения culture.php:9
$method
Определения index.php:27