1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* @link https://github.com/chrmorandi/yii2-ldap for the canonical source repository |
4
|
|
|
* @package yii2-ldap |
5
|
|
|
* @author Christopher Mota <[email protected]> |
6
|
|
|
* @license MIT License - view the LICENSE file that was distributed with this source code. |
7
|
|
|
*/ |
8
|
|
|
|
9
|
|
|
namespace chrmorandi\ldap\schemas; |
10
|
|
|
|
11
|
|
|
/** |
12
|
|
|
* |
13
|
|
|
* @since 1.0.0 |
14
|
|
|
*/ |
15
|
|
|
trait ADUserTrait |
16
|
|
|
{ |
17
|
|
|
|
18
|
|
|
/** |
19
|
|
|
* Contain the object class for make user in AD |
20
|
|
|
* User: This class is used to store information about an employee or contractor who works for an organization. |
21
|
|
|
* It is also possible to apply this class to long term visitors. |
22
|
|
|
* Person: Contains personal information about a user. |
23
|
|
|
* OrganizationalPerson: This class is used for objects that contain organizational information about a user, such |
24
|
|
|
* as the employee number, department, manager, title, office address, and so on. |
25
|
|
|
* Top: The top level class from which all classes are derived. |
26
|
|
|
* @link https://msdn.microsoft.com/en-us/library/ms680932(v=vs.85).aspx |
27
|
|
|
* @var array |
28
|
|
|
*/ |
29
|
|
|
protected $objectClass = ['user','person','organizationalPerson', 'top']; |
30
|
|
|
|
31
|
|
|
/** |
32
|
|
|
* The date when the account expires. This value represents the number of 100-nanosecond |
33
|
|
|
* intervals since January 1, 1601 (UTC). A value of 0 or 0x7FFFFFFFFFFFFFFF |
34
|
|
|
* (9223372036854775807) indicates that the account never expires. |
35
|
|
|
* @link https://msdn.microsoft.com/en-us/library/ms675098(v=vs.85).aspx |
36
|
|
|
* @var \DateTime|false |
37
|
|
|
*/ |
38
|
|
|
protected $accountExpires = 9223372036854775807; |
39
|
|
|
|
40
|
|
|
/** |
41
|
|
|
* The number of times the user tried to log on to the account using |
42
|
|
|
* an incorrect password. A value of 0 indicates that the |
43
|
|
|
* value is unknown. |
44
|
|
|
* @link https://msdn.microsoft.com/en-us/library/ms675244(v=vs.85).aspx |
45
|
|
|
* @var int |
46
|
|
|
*/ |
47
|
|
|
protected $badPwdCount; |
48
|
|
|
|
49
|
|
|
/** |
50
|
|
|
* The user's company name. |
51
|
|
|
* @link https://msdn.microsoft.com/en-us/library/ms675457(v=vs.85).aspx |
52
|
|
|
* @var string |
53
|
|
|
*/ |
54
|
|
|
protected $company; |
55
|
|
|
|
56
|
|
|
/** |
57
|
|
|
* The entry's country attribute. |
58
|
|
|
* @link https://msdn.microsoft.com/en-us/library/ms675432(v=vs.85).aspx |
59
|
|
|
* @var string |
60
|
|
|
*/ |
61
|
|
|
protected $c; |
62
|
|
|
|
63
|
|
|
/** |
64
|
|
|
* The name that represents an object. Used to perform searches. |
65
|
|
|
* @link https://msdn.microsoft.com/en-us/library/ms675449(v=vs.85).aspx |
66
|
|
|
* @var string |
67
|
|
|
*/ |
68
|
|
|
protected $cn; |
69
|
|
|
|
70
|
|
|
/** |
71
|
|
|
* Contains the name for the department in which the user works. |
72
|
|
|
* @link https://msdn.microsoft.com/en-us/library/ms675490(v=vs.85).aspx |
73
|
|
|
* @var string |
74
|
|
|
*/ |
75
|
|
|
protected $department; |
76
|
|
|
|
77
|
|
|
/** |
78
|
|
|
* Contains the description to display for an object. This value is restricted |
79
|
|
|
* as single-valued for backward compatibility in some cases but |
80
|
|
|
* is allowed to be multi-valued in others. |
81
|
|
|
* @link https://msdn.microsoft.com/en-us/library/ms675492(v=vs.85).aspx |
82
|
|
|
* @var string |
83
|
|
|
*/ |
84
|
|
|
protected $description; |
85
|
|
|
|
86
|
|
|
/** |
87
|
|
|
* The display name for an object. This is usually the combination |
88
|
|
|
* of the users first name, middle initial, and last name. |
89
|
|
|
* @link https://msdn.microsoft.com/en-us/library/ms675514(v=vs.85).aspx |
90
|
|
|
* @var string |
91
|
|
|
*/ |
92
|
|
|
protected $displayName; |
93
|
|
|
|
94
|
|
|
/** |
95
|
|
|
* The user's division. |
96
|
|
|
* @link https://msdn.microsoft.com/en-us/library/ms675518(v=vs.85).aspx |
97
|
|
|
* @var string |
98
|
|
|
*/ |
99
|
|
|
protected $division; |
100
|
|
|
|
101
|
|
|
/** |
102
|
|
|
* The ID of an employee. |
103
|
|
|
* @link https://msdn.microsoft.com/en-us/library/ms675662(v=vs.85).aspx |
104
|
|
|
* @var string |
105
|
|
|
*/ |
106
|
|
|
protected $employeeID; |
107
|
|
|
|
108
|
|
|
/** |
109
|
|
|
* The number assigned to an employee other than the ID. |
110
|
|
|
* @link https://msdn.microsoft.com/en-us/library/ms675663(v=vs.85).aspx |
111
|
|
|
* @var string |
112
|
|
|
*/ |
113
|
|
|
protected $employeeNumber; |
114
|
|
|
|
115
|
|
|
/** |
116
|
|
|
* Contains the given name (first name) of the user. |
117
|
|
|
* @link https://msdn.microsoft.com/en-us/library/ms675719(v=vs.85).aspx |
118
|
|
|
* @var string |
119
|
|
|
*/ |
120
|
|
|
protected $givenName; |
121
|
|
|
|
122
|
|
|
/** |
123
|
|
|
* The user's main home phone number. |
124
|
|
|
* @link https://msdn.microsoft.com/en-us/library/ms676192(v=vs.85).aspx |
125
|
|
|
* @var string |
126
|
|
|
*/ |
127
|
|
|
protected $homePhone; |
128
|
|
|
|
129
|
|
|
/** |
130
|
|
|
* Contains the initials for parts of the user's full name. This may be used as |
131
|
|
|
* the middle initial in the Windows Address Book. |
132
|
|
|
* @link https://msdn.microsoft.com/en-us/library/ms676202(v=vs.85).aspx |
133
|
|
|
* @var string |
134
|
|
|
*/ |
135
|
|
|
protected $initials; |
136
|
|
|
|
137
|
|
|
/** |
138
|
|
|
* The TCP/IP address for the phone. Used by Telephony. |
139
|
|
|
* @link https://msdn.microsoft.com/en-us/library/ms676213(v=vs.85).aspx |
140
|
|
|
* @var string |
141
|
|
|
*/ |
142
|
|
|
protected $ipPhone; |
143
|
|
|
|
144
|
|
|
/** |
145
|
|
|
* The date and time (UTC) that this account was locked out. This value is stored |
146
|
|
|
* as a large integer that represents the number of 100-nanosecond intervals since |
147
|
|
|
* January 1, 1601 (UTC). A value of zero means that the account is not currently |
148
|
|
|
* locked out. |
149
|
|
|
* @link https://msdn.microsoft.com/en-us/library/ms676843(v=vs.85).aspx |
150
|
|
|
* @var \DateTime|false |
151
|
|
|
*/ |
152
|
|
|
protected $lockoutTime; |
153
|
|
|
|
154
|
|
|
/** |
155
|
|
|
* The list of email addresses for a contact. |
156
|
|
|
* @link https://msdn.microsoft.com/en-us/library/ms676855(v=vs.85).aspx |
157
|
|
|
* @var string |
158
|
|
|
*/ |
159
|
|
|
protected $mail; |
160
|
|
|
|
161
|
|
|
/** |
162
|
|
|
* Contains the distinguished name of the user who is the user's manager. |
163
|
|
|
* The manager's user object contains a directReports property that contains |
164
|
|
|
* references to all user objects that have their manager properties set to this |
165
|
|
|
* distinguished name. |
166
|
|
|
* @link https://msdn.microsoft.com/en-us/library/ms676859(v=vs.85).aspx |
167
|
|
|
* @var string |
168
|
|
|
*/ |
169
|
|
|
protected $manager; |
170
|
|
|
|
171
|
|
|
/** |
172
|
|
|
* The distinguished name of the groups to which this object belongs. |
173
|
|
|
* @link https://msdn.microsoft.com/en-us/library/ms677099(v=vs.85).aspx |
174
|
|
|
* @var array |
175
|
|
|
*/ |
176
|
|
|
protected $memberOf; |
177
|
|
|
|
178
|
|
|
/** |
179
|
|
|
* The primary mobile phone number. |
180
|
|
|
* @link https://msdn.microsoft.com/en-us/library/ms677119(v=vs.85).aspx |
181
|
|
|
* @var string |
182
|
|
|
*/ |
183
|
|
|
protected $mobile; |
184
|
|
|
|
185
|
|
|
/** |
186
|
|
|
* The name of the company or organization. |
187
|
|
|
* @link https://msdn.microsoft.com/en-us/library/ms679009(v=vs.85).aspx |
188
|
|
|
* @var string |
189
|
|
|
*/ |
190
|
|
|
protected $o; |
191
|
|
|
|
192
|
|
|
/** |
193
|
|
|
* The unique identifier for an object. |
194
|
|
|
* @link https://msdn.microsoft.com/en-us/library/ms679021(v=vs.85).aspx |
195
|
|
|
* @var type |
196
|
|
|
*/ |
197
|
|
|
protected $objectGuid; |
198
|
|
|
|
199
|
|
|
/** |
200
|
|
|
* A binary value that specifies the security identifier (SID) of the user. The SID is a unique value used to |
201
|
|
|
* identify the user as a security principal. |
202
|
|
|
* @link https://msdn.microsoft.com/en-us/library/ms679024(v=vs.85).aspx |
203
|
|
|
* @var string |
204
|
|
|
*/ |
205
|
|
|
protected $objectSid; |
206
|
|
|
|
207
|
|
|
/** |
208
|
|
|
* The date and time that the password for this account was last changed. This value is stored as a large |
209
|
|
|
* integer that represents the number of 100 nanosecond intervals since January 1, 1601 (UTC). If this value |
210
|
|
|
* is set to 0 and the User-Account-Control attribute does not contain the UF_DONT_EXPIRE_PASSWD |
211
|
|
|
* flag, then the user must set the password at the next logon. |
212
|
|
|
* @link https://msdn.microsoft.com/en-us/library/ms679430(v=vs.85).aspx |
213
|
|
|
* @var type |
214
|
|
|
*/ |
215
|
|
|
protected $pwdLastSet; |
216
|
|
|
|
217
|
|
|
/** |
218
|
|
|
* The logon name used to support clients and servers running earlier versions of the operating system, such |
219
|
|
|
* as Windows NT 4.0, Windows 95, Windows 98, and LAN Manager. |
220
|
|
|
* @link https://msdn.microsoft.com/en-us/library/ms679635(v=vs.85).aspx |
221
|
|
|
* @var type |
222
|
|
|
*/ |
223
|
|
|
protected $sAMAccountName; |
224
|
|
|
|
225
|
|
|
/** |
226
|
|
|
* The name of a user's state or province. |
227
|
|
|
* @link https://msdn.microsoft.com/en-us/library/ms679880(v=vs.85).aspx |
228
|
|
|
* @var string |
229
|
|
|
*/ |
230
|
|
|
protected $st; |
231
|
|
|
|
232
|
|
|
/** |
233
|
|
|
* The street address. |
234
|
|
|
* @link https://msdn.microsoft.com/en-us/library/ms679882(v=vs.85).aspx |
235
|
|
|
* @var string |
236
|
|
|
*/ |
237
|
|
|
protected $streetAddress; |
238
|
|
|
|
239
|
|
|
/** |
240
|
|
|
* This attribute contains the family or last name for a user. |
241
|
|
|
* @link https://msdn.microsoft.com/en-us/library/ms679872(v=vs.85).aspx |
242
|
|
|
* @var string |
243
|
|
|
*/ |
244
|
|
|
protected $sn; |
245
|
|
|
|
246
|
|
|
/** |
247
|
|
|
* The primary telephone number. |
248
|
|
|
* @link https://msdn.microsoft.com/en-us/library/ms680027(v=vs.85).aspx |
249
|
|
|
* @return string |
250
|
|
|
*/ |
251
|
|
|
protected $telephoneNumber; |
252
|
|
|
|
253
|
|
|
/** |
254
|
|
|
* Contains the user's job title. This property is commonly used to indicate the formal job title, such as Senior |
255
|
|
|
* Programmer, rather than occupational class, such as programmer. It is not typically used for suffix titles |
256
|
|
|
* such as Esq. or DDS. |
257
|
|
|
* @link https://msdn.microsoft.com/en-us/library/ms680037(v=vs.85).aspx |
258
|
|
|
* @var type |
259
|
|
|
*/ |
260
|
|
|
protected $title; |
261
|
|
|
|
262
|
|
|
/** |
263
|
|
|
* Flags that control the behavior of the user account. |
264
|
|
|
* @link https://msdn.microsoft.com/en-us/library/ms680832(v=vs.85).aspx |
265
|
|
|
* @return string |
266
|
|
|
*/ |
267
|
|
|
protected $userAccountControl; |
268
|
|
|
|
269
|
|
|
/** |
270
|
|
|
* his attribute contains the UPN that is an Internet-style login name for |
271
|
|
|
* a user based on the Internet standard RFC 822. |
272
|
|
|
* @link https://msdn.microsoft.com/en-us/library/ms680857(v=vs.85).aspx |
273
|
|
|
* @return string |
274
|
|
|
*/ |
275
|
|
|
protected $userPrincipalName; |
276
|
|
|
|
277
|
|
|
/** |
278
|
|
|
* The entry's created at attribute. |
279
|
|
|
* @link https://msdn.microsoft.com/en-us/library/ms680924(v=vs.85).aspx |
280
|
|
|
* @var \DateTime |
281
|
|
|
*/ |
282
|
|
|
protected $whenCreated; |
283
|
|
|
|
284
|
|
|
/** |
285
|
|
|
* A web page that is the primary landing page of a website. |
286
|
|
|
* @link https://msdn.microsoft.com/en-us/library/ms680927(v=vs.85).aspx |
287
|
|
|
* @var string |
288
|
|
|
*/ |
289
|
|
|
protected $wWWHomePage; |
290
|
|
|
|
291
|
|
|
public function rules (){ |
292
|
|
|
return [['cn'],'safe']; |
293
|
|
|
} |
294
|
|
|
|
295
|
|
|
} |
296
|
|
|
|