1
|
|
|
<?php |
2
|
|
|
/****************************************************************************** |
3
|
|
|
* Wikipedia Account Creation Assistance tool * |
4
|
|
|
* ACC Development Team. Please see team.json for a list of contributors. * |
5
|
|
|
* * |
6
|
|
|
* This is free and unencumbered software released into the public domain. * |
7
|
|
|
* Please see LICENSE.md for the full licencing statement. * |
8
|
|
|
******************************************************************************/ |
9
|
|
|
|
10
|
|
|
namespace Waca; |
11
|
|
|
|
12
|
|
|
/** |
13
|
|
|
* Class SiteConfiguration |
14
|
|
|
* |
15
|
|
|
* IMPORTANT: This class must never throw an exception or trigger an error. It's used in the error handler. |
16
|
|
|
* |
17
|
|
|
* @package Waca |
18
|
|
|
*/ |
19
|
|
|
class SiteConfiguration |
20
|
|
|
{ |
21
|
|
|
private $baseUrl = 'https://accounts.wmflabs.org'; |
22
|
|
|
private $filePath = __DIR__ . '/..'; |
23
|
|
|
private $schemaVersion = 51; |
24
|
|
|
private $debuggingTraceEnabled = false; |
25
|
|
|
private $debuggingCssBreakpointsEnabled = false; |
26
|
|
|
private $dataClearIp = '127.0.0.1'; |
27
|
|
|
private $dataClearEmail = '[email protected]'; |
28
|
|
|
private $dataClearInterval = '15 DAY'; |
29
|
|
|
private $forceIdentification = true; |
30
|
|
|
private $identificationCacheExpiry = '1 DAY'; |
31
|
|
|
private $metaWikimediaWebServiceEndpoint = 'https://meta.wikimedia.org/w/api.php'; |
32
|
|
|
private $enforceOAuth = false; |
33
|
|
|
private $emailConfirmationEnabled = true; |
34
|
|
|
private $emailConfirmationExpiryDays = 7; |
35
|
|
|
private $miserModeLimit = 25; |
36
|
|
|
private $squidList = array(); |
37
|
|
|
private $useStrictTransportSecurity = false; |
38
|
|
|
private $userAgent = 'Wikipedia-ACC Tool/0.1 (+https://accounts.wmflabs.org/internal.php/team)'; |
39
|
|
|
private $curlDisableVerifyPeer = false; |
40
|
|
|
private $useOAuthSignup = true; |
41
|
|
|
private $oauthConsumerToken; |
42
|
|
|
/** @var array */ |
43
|
|
|
private $oauthLegacyConsumerTokens; |
44
|
|
|
private $oauthConsumerSecret; |
45
|
|
|
private $oauthIdentityGraceTime = '24 hours'; |
46
|
|
|
private $oauthMediaWikiCanonicalServer = 'https://en.wikipedia.org'; |
47
|
|
|
private $xffTrustedHostsFile = '../TrustedXFF/trusted-hosts.txt'; |
48
|
|
|
private $crossOriginResourceSharingHosts = array( |
49
|
|
|
"https://en.wikipedia.org", |
50
|
|
|
"https://meta.wikimedia.org", |
51
|
|
|
); |
52
|
|
|
private $ircNotificationsEnabled = true; |
53
|
|
|
private $ircNotificationsInstance = 'Development'; |
54
|
|
|
private $errorLog = 'errorlog'; |
55
|
|
|
private $titleBlacklistEnabled = false; |
56
|
|
|
/** @var null|string $locationProviderApiKey */ |
57
|
|
|
private $locationProviderApiKey = null; |
58
|
|
|
private $torExitPaths = array(); |
59
|
|
|
private $creationBotUsername = ''; |
60
|
|
|
private $creationBotPassword = ''; |
61
|
|
|
private $curlCookieJar = __DIR__ . '/../../cookies.txt'; |
62
|
|
|
private $yubicoApiId = 0; |
63
|
|
|
private $yubicoApiKey = ""; |
64
|
|
|
private $totpEncryptionKey = "1234"; |
65
|
|
|
private $identificationNoticeboardPage = 'Access to nonpublic personal data policy/Noticeboard'; |
66
|
|
|
private $identificationNoticeboardWebserviceEndpoint = 'https://meta.wikimedia.org/w/api.php'; |
67
|
|
|
private $registrationAllowed = true; |
68
|
|
|
private $cspReportUri = null; |
69
|
|
|
private $resourceCacheEpoch = 1; |
70
|
|
|
private $commonEmailDomains = ['gmail.com', 'hotmail.com', 'outlook.com']; |
71
|
|
|
private $banMaxIpBlockRange = [4 => 20, 6 => 48]; |
72
|
|
|
private $banMaxIpRange = [4 => 16, 6 => 32]; |
73
|
|
|
private $jobQueueBatchSize = 10; |
74
|
|
|
private $amqpConfiguration = ['host' => 'localhost', 'port' => 5672, 'user' => 'guest', 'password' => 'guest', 'vhost' => '/', 'exchange' => '', 'tls' => false]; |
75
|
|
|
private $emailSender = '[email protected]'; |
76
|
|
|
private $acceptClientHints = []; |
77
|
|
|
private string $cookiePath = '/'; |
78
|
|
|
private string $cookieSessionName = 'ACC'; |
79
|
|
|
private array $offline = ['offline' => false, 'reason' => '', 'culprit' => '']; |
80
|
|
|
private array $databaseConfig = [ |
81
|
|
|
'datasource' => 'mysql:host=localhost;dbname=waca', |
82
|
|
|
'username' => 'waca', |
83
|
|
|
'password' => 'waca' |
84
|
|
|
]; |
85
|
2 |
|
private string $privacyStatementPath = ''; |
86
|
|
|
|
87
|
2 |
|
private string $createAccountLink = '{articlePath}/Special:CreateAccount'; |
88
|
|
|
|
89
|
|
|
/** |
90
|
|
|
* Gets the base URL of the tool |
91
|
|
|
* |
92
|
|
|
* If the internal page of the tool is at http://localhost/path/internal.php, this would be set to |
93
|
|
|
* http://localhost/path |
94
|
|
|
* @return string |
95
|
1 |
|
*/ |
96
|
|
|
public function getBaseUrl() |
97
|
1 |
|
{ |
98
|
|
|
return $this->baseUrl; |
99
|
1 |
|
} |
100
|
|
|
|
101
|
|
|
/** |
102
|
|
|
* @param string $baseUrl |
103
|
|
|
* |
104
|
|
|
* @return SiteConfiguration |
105
|
|
|
*/ |
106
|
1 |
|
public function setBaseUrl($baseUrl) |
107
|
|
|
{ |
108
|
1 |
|
$this->baseUrl = $baseUrl; |
109
|
|
|
|
110
|
|
|
return $this; |
111
|
|
|
} |
112
|
|
|
|
113
|
|
|
/** |
114
|
|
|
* Path on disk to the directory containing the tool's code |
115
|
|
|
* @return string |
116
|
1 |
|
*/ |
117
|
|
|
public function getFilePath() |
118
|
1 |
|
{ |
119
|
|
|
return $this->filePath; |
120
|
1 |
|
} |
121
|
|
|
|
122
|
|
|
/** |
123
|
|
|
* @param string $filePath |
124
|
|
|
* |
125
|
|
|
* @return SiteConfiguration |
126
|
1 |
|
*/ |
127
|
|
|
public function setFilePath($filePath) |
128
|
1 |
|
{ |
129
|
|
|
$this->filePath = $filePath; |
130
|
|
|
|
131
|
|
|
return $this; |
132
|
|
|
} |
133
|
|
|
|
134
|
|
|
/** |
135
|
|
|
* @return int |
136
|
|
|
*/ |
137
|
|
|
public function getSchemaVersion() |
138
|
|
|
{ |
139
|
|
|
return $this->schemaVersion; |
140
|
|
|
} |
141
|
|
|
|
142
|
|
|
/** |
143
|
|
|
* @param int $schemaVersion |
144
|
|
|
* |
145
|
|
|
* @return SiteConfiguration |
146
|
2 |
|
*/ |
147
|
|
|
public function setSchemaVersion($schemaVersion) |
148
|
2 |
|
{ |
149
|
|
|
$this->schemaVersion = $schemaVersion; |
150
|
|
|
|
151
|
|
|
return $this; |
152
|
|
|
} |
153
|
|
|
|
154
|
|
|
/** |
155
|
|
|
* @return mixed |
156
|
3 |
|
*/ |
157
|
|
|
public function getDebuggingTraceEnabled() |
158
|
3 |
|
{ |
159
|
|
|
return $this->debuggingTraceEnabled; |
160
|
3 |
|
} |
161
|
|
|
|
162
|
|
|
/** |
163
|
|
|
* @param mixed $debuggingTraceEnabled |
164
|
|
|
* |
165
|
|
|
* @return SiteConfiguration |
166
|
|
|
*/ |
167
|
|
|
public function setDebuggingTraceEnabled($debuggingTraceEnabled) |
168
|
|
|
{ |
169
|
|
|
$this->debuggingTraceEnabled = $debuggingTraceEnabled; |
170
|
|
|
|
171
|
|
|
return $this; |
172
|
|
|
} |
173
|
|
|
|
174
|
|
|
public function getDebuggingCssBreakpointsEnabled() : bool |
175
|
|
|
{ |
176
|
|
|
return $this->debuggingCssBreakpointsEnabled; |
177
|
|
|
} |
178
|
1 |
|
|
179
|
|
|
public function setDebuggingCssBreakpointsEnabled(bool $debuggingCssBreakpointsEnabled) : SiteConfiguration |
180
|
1 |
|
{ |
181
|
|
|
$this->debuggingCssBreakpointsEnabled = $debuggingCssBreakpointsEnabled; |
182
|
|
|
|
183
|
|
|
return $this; |
184
|
|
|
} |
185
|
|
|
|
186
|
|
|
/** |
187
|
|
|
* @return string |
188
|
1 |
|
*/ |
189
|
|
|
public function getDataClearIp() |
190
|
1 |
|
{ |
191
|
|
|
return $this->dataClearIp; |
192
|
1 |
|
} |
193
|
|
|
|
194
|
|
|
/** |
195
|
|
|
* @param string $dataClearIp |
196
|
|
|
* |
197
|
|
|
* @return SiteConfiguration |
198
|
1 |
|
*/ |
199
|
|
|
public function setDataClearIp($dataClearIp) |
200
|
1 |
|
{ |
201
|
|
|
$this->dataClearIp = $dataClearIp; |
202
|
|
|
|
203
|
|
|
return $this; |
204
|
|
|
} |
205
|
|
|
|
206
|
|
|
/** |
207
|
|
|
* @return string |
208
|
1 |
|
*/ |
209
|
|
|
public function getDataClearEmail() |
210
|
1 |
|
{ |
211
|
|
|
return $this->dataClearEmail; |
212
|
1 |
|
} |
213
|
|
|
|
214
|
|
|
/** |
215
|
|
|
* @param string $dataClearEmail |
216
|
|
|
* |
217
|
|
|
* @return SiteConfiguration |
218
|
1 |
|
*/ |
219
|
|
|
public function setDataClearEmail($dataClearEmail) |
220
|
1 |
|
{ |
221
|
|
|
$this->dataClearEmail = $dataClearEmail; |
222
|
|
|
|
223
|
|
|
return $this; |
224
|
|
|
} |
225
|
|
|
|
226
|
|
|
/** |
227
|
|
|
* @return boolean |
228
|
1 |
|
*/ |
229
|
|
|
public function getForceIdentification() |
230
|
1 |
|
{ |
231
|
|
|
return $this->forceIdentification; |
232
|
1 |
|
} |
233
|
|
|
|
234
|
|
|
/** |
235
|
|
|
* @param boolean $forceIdentification |
236
|
|
|
* |
237
|
|
|
* @return SiteConfiguration |
238
|
1 |
|
*/ |
239
|
|
|
public function setForceIdentification($forceIdentification) |
240
|
1 |
|
{ |
241
|
|
|
$this->forceIdentification = $forceIdentification; |
242
|
|
|
|
243
|
|
|
return $this; |
244
|
|
|
} |
245
|
|
|
|
246
|
|
|
/** |
247
|
|
|
* @return string |
248
|
1 |
|
*/ |
249
|
|
|
public function getIdentificationCacheExpiry() |
250
|
1 |
|
{ |
251
|
|
|
return $this->identificationCacheExpiry; |
252
|
1 |
|
} |
253
|
|
|
|
254
|
|
|
/** |
255
|
|
|
* @param string $identificationCacheExpiry |
256
|
|
|
* |
257
|
|
|
* @return SiteConfiguration |
258
|
2 |
|
*/ |
259
|
|
|
public function setIdentificationCacheExpiry($identificationCacheExpiry) |
260
|
2 |
|
{ |
261
|
|
|
$this->identificationCacheExpiry = $identificationCacheExpiry; |
262
|
|
|
|
263
|
|
|
return $this; |
264
|
|
|
} |
265
|
|
|
|
266
|
|
|
/** |
267
|
|
|
* @return string |
268
|
1 |
|
*/ |
269
|
|
|
public function getMetaWikimediaWebServiceEndpoint() |
270
|
1 |
|
{ |
271
|
|
|
return $this->metaWikimediaWebServiceEndpoint; |
272
|
1 |
|
} |
273
|
|
|
|
274
|
|
|
/** |
275
|
|
|
* @param string $metaWikimediaWebServiceEndpoint |
276
|
|
|
* |
277
|
|
|
* @return SiteConfiguration |
278
|
1 |
|
*/ |
279
|
|
|
public function setMetaWikimediaWebServiceEndpoint($metaWikimediaWebServiceEndpoint) |
280
|
1 |
|
{ |
281
|
|
|
$this->metaWikimediaWebServiceEndpoint = $metaWikimediaWebServiceEndpoint; |
282
|
|
|
|
283
|
|
|
return $this; |
284
|
|
|
} |
285
|
|
|
|
286
|
|
|
/** |
287
|
|
|
* @return boolean |
288
|
1 |
|
*/ |
289
|
|
|
public function getEnforceOAuth() |
290
|
1 |
|
{ |
291
|
|
|
return $this->enforceOAuth; |
292
|
1 |
|
} |
293
|
|
|
|
294
|
|
|
/** |
295
|
|
|
* @param boolean $enforceOAuth |
296
|
|
|
* |
297
|
|
|
* @return SiteConfiguration |
298
|
1 |
|
*/ |
299
|
|
|
public function setEnforceOAuth($enforceOAuth) |
300
|
1 |
|
{ |
301
|
|
|
$this->enforceOAuth = $enforceOAuth; |
302
|
|
|
|
303
|
|
|
return $this; |
304
|
|
|
} |
305
|
|
|
|
306
|
|
|
/** |
307
|
|
|
* @return boolean |
308
|
1 |
|
*/ |
309
|
|
|
public function getEmailConfirmationEnabled() |
310
|
1 |
|
{ |
311
|
|
|
return $this->emailConfirmationEnabled; |
312
|
1 |
|
} |
313
|
|
|
|
314
|
|
|
/** |
315
|
|
|
* @param boolean $emailConfirmationEnabled |
316
|
|
|
* |
317
|
|
|
* @return $this |
318
|
1 |
|
*/ |
319
|
|
|
public function setEmailConfirmationEnabled($emailConfirmationEnabled) |
320
|
1 |
|
{ |
321
|
|
|
$this->emailConfirmationEnabled = $emailConfirmationEnabled; |
322
|
|
|
|
323
|
|
|
return $this; |
324
|
|
|
} |
325
|
|
|
|
326
|
|
|
/** |
327
|
|
|
* @return int |
328
|
1 |
|
*/ |
329
|
|
|
public function getMiserModeLimit() |
330
|
1 |
|
{ |
331
|
|
|
return $this->miserModeLimit; |
332
|
1 |
|
} |
333
|
|
|
|
334
|
|
|
/** |
335
|
|
|
* @param int $miserModeLimit |
336
|
|
|
* |
337
|
|
|
* @return SiteConfiguration |
338
|
1 |
|
*/ |
339
|
|
|
public function setMiserModeLimit($miserModeLimit) |
340
|
1 |
|
{ |
341
|
|
|
$this->miserModeLimit = $miserModeLimit; |
342
|
|
|
|
343
|
|
|
return $this; |
344
|
|
|
} |
345
|
|
|
|
346
|
|
|
/** |
347
|
|
|
* @return array |
348
|
1 |
|
*/ |
349
|
|
|
public function getSquidList() |
350
|
1 |
|
{ |
351
|
|
|
return $this->squidList; |
352
|
1 |
|
} |
353
|
|
|
|
354
|
|
|
/** |
355
|
|
|
* @param array $squidList |
356
|
|
|
* |
357
|
|
|
* @return SiteConfiguration |
358
|
1 |
|
*/ |
359
|
|
|
public function setSquidList($squidList) |
360
|
1 |
|
{ |
361
|
|
|
$this->squidList = $squidList; |
362
|
|
|
|
363
|
|
|
return $this; |
364
|
|
|
} |
365
|
|
|
|
366
|
|
|
/** |
367
|
|
|
* @return boolean |
368
|
1 |
|
*/ |
369
|
|
|
public function getUseStrictTransportSecurity() |
370
|
1 |
|
{ |
371
|
|
|
return $this->useStrictTransportSecurity; |
372
|
1 |
|
} |
373
|
|
|
|
374
|
|
|
/** |
375
|
|
|
* @param boolean $useStrictTransportSecurity |
376
|
|
|
* |
377
|
|
|
* @return SiteConfiguration |
378
|
2 |
|
*/ |
379
|
|
|
public function setUseStrictTransportSecurity($useStrictTransportSecurity) |
380
|
2 |
|
{ |
381
|
|
|
$this->useStrictTransportSecurity = $useStrictTransportSecurity; |
382
|
|
|
|
383
|
|
|
return $this; |
384
|
|
|
} |
385
|
|
|
|
386
|
|
|
/** |
387
|
|
|
* @return string |
388
|
1 |
|
*/ |
389
|
|
|
public function getUserAgent() |
390
|
1 |
|
{ |
391
|
|
|
return $this->userAgent; |
392
|
1 |
|
} |
393
|
|
|
|
394
|
|
|
/** |
395
|
|
|
* @param string $userAgent |
396
|
|
|
* |
397
|
|
|
* @return SiteConfiguration |
398
|
2 |
|
*/ |
399
|
|
|
public function setUserAgent($userAgent) |
400
|
2 |
|
{ |
401
|
|
|
$this->userAgent = $userAgent; |
402
|
|
|
|
403
|
|
|
return $this; |
404
|
|
|
} |
405
|
|
|
|
406
|
|
|
/** |
407
|
|
|
* @return boolean |
408
|
2 |
|
*/ |
409
|
|
|
public function getCurlDisableVerifyPeer() |
410
|
2 |
|
{ |
411
|
|
|
return $this->curlDisableVerifyPeer; |
412
|
2 |
|
} |
413
|
|
|
|
414
|
|
|
/** |
415
|
|
|
* @param boolean $curlDisableVerifyPeer |
416
|
|
|
* |
417
|
|
|
* @return SiteConfiguration |
418
|
1 |
|
*/ |
419
|
|
|
public function setCurlDisableVerifyPeer($curlDisableVerifyPeer) |
420
|
1 |
|
{ |
421
|
|
|
$this->curlDisableVerifyPeer = $curlDisableVerifyPeer; |
422
|
|
|
|
423
|
|
|
return $this; |
424
|
|
|
} |
425
|
|
|
|
426
|
|
|
/** |
427
|
|
|
* @return boolean |
428
|
1 |
|
*/ |
429
|
|
|
public function getUseOAuthSignup() |
430
|
1 |
|
{ |
431
|
|
|
return $this->useOAuthSignup; |
432
|
1 |
|
} |
433
|
|
|
|
434
|
|
|
/** |
435
|
|
|
* @param boolean $useOAuthSignup |
436
|
|
|
* |
437
|
|
|
* @return SiteConfiguration |
438
|
1 |
|
*/ |
439
|
|
|
public function setUseOAuthSignup($useOAuthSignup) |
440
|
1 |
|
{ |
441
|
|
|
$this->useOAuthSignup = $useOAuthSignup; |
442
|
|
|
|
443
|
|
|
return $this; |
444
|
|
|
} |
445
|
|
|
|
446
|
|
|
/** |
447
|
|
|
* @return mixed |
448
|
1 |
|
*/ |
449
|
|
|
public function getOAuthConsumerToken() |
450
|
1 |
|
{ |
451
|
|
|
return $this->oauthConsumerToken; |
452
|
1 |
|
} |
453
|
|
|
|
454
|
|
|
/** |
455
|
|
|
* @param mixed $oauthConsumerToken |
456
|
|
|
* |
457
|
|
|
* @return SiteConfiguration |
458
|
1 |
|
*/ |
459
|
|
|
public function setOAuthConsumerToken($oauthConsumerToken) |
460
|
1 |
|
{ |
461
|
|
|
$this->oauthConsumerToken = $oauthConsumerToken; |
462
|
|
|
|
463
|
|
|
return $this; |
464
|
|
|
} |
465
|
|
|
|
466
|
|
|
/** |
467
|
|
|
* @return mixed |
468
|
1 |
|
*/ |
469
|
|
|
public function getOAuthConsumerSecret() |
470
|
1 |
|
{ |
471
|
|
|
return $this->oauthConsumerSecret; |
472
|
1 |
|
} |
473
|
|
|
|
474
|
|
|
/** |
475
|
|
|
* @param mixed $oauthConsumerSecret |
476
|
|
|
* |
477
|
|
|
* @return SiteConfiguration |
478
|
1 |
|
*/ |
479
|
|
|
public function setOAuthConsumerSecret($oauthConsumerSecret) |
480
|
1 |
|
{ |
481
|
|
|
$this->oauthConsumerSecret = $oauthConsumerSecret; |
482
|
|
|
|
483
|
|
|
return $this; |
484
|
|
|
} |
485
|
|
|
|
486
|
|
|
/** |
487
|
|
|
* @return string |
488
|
1 |
|
*/ |
489
|
|
|
public function getDataClearInterval() |
490
|
1 |
|
{ |
491
|
|
|
return $this->dataClearInterval; |
492
|
1 |
|
} |
493
|
|
|
|
494
|
|
|
/** |
495
|
|
|
* @param string $dataClearInterval |
496
|
|
|
* |
497
|
|
|
* @return SiteConfiguration |
498
|
1 |
|
*/ |
499
|
|
|
public function setDataClearInterval($dataClearInterval) |
500
|
1 |
|
{ |
501
|
|
|
$this->dataClearInterval = $dataClearInterval; |
502
|
|
|
|
503
|
|
|
return $this; |
504
|
|
|
} |
505
|
|
|
|
506
|
|
|
/** |
507
|
|
|
* @return string |
508
|
1 |
|
*/ |
509
|
|
|
public function getXffTrustedHostsFile() |
510
|
1 |
|
{ |
511
|
|
|
return $this->xffTrustedHostsFile; |
512
|
1 |
|
} |
513
|
|
|
|
514
|
|
|
/** |
515
|
|
|
* @param string $xffTrustedHostsFile |
516
|
|
|
* |
517
|
|
|
* @return SiteConfiguration |
518
|
1 |
|
*/ |
519
|
|
|
public function setXffTrustedHostsFile($xffTrustedHostsFile) |
520
|
1 |
|
{ |
521
|
|
|
$this->xffTrustedHostsFile = $xffTrustedHostsFile; |
522
|
|
|
|
523
|
|
|
return $this; |
524
|
|
|
} |
525
|
|
|
|
526
|
|
|
/** |
527
|
|
|
* @return array |
528
|
1 |
|
*/ |
529
|
|
|
public function getCrossOriginResourceSharingHosts() |
530
|
1 |
|
{ |
531
|
|
|
return $this->crossOriginResourceSharingHosts; |
532
|
1 |
|
} |
533
|
|
|
|
534
|
|
|
/** |
535
|
|
|
* @param array $crossOriginResourceSharingHosts |
536
|
|
|
* |
537
|
|
|
* @return SiteConfiguration |
538
|
1 |
|
*/ |
539
|
|
|
public function setCrossOriginResourceSharingHosts($crossOriginResourceSharingHosts) |
540
|
1 |
|
{ |
541
|
|
|
$this->crossOriginResourceSharingHosts = $crossOriginResourceSharingHosts; |
542
|
|
|
|
543
|
|
|
return $this; |
544
|
|
|
} |
545
|
|
|
|
546
|
|
|
/** |
547
|
|
|
* @return boolean |
548
|
1 |
|
*/ |
549
|
|
|
public function getIrcNotificationsEnabled() |
550
|
1 |
|
{ |
551
|
|
|
return $this->ircNotificationsEnabled; |
552
|
1 |
|
} |
553
|
|
|
|
554
|
|
|
/** |
555
|
|
|
* @param boolean $ircNotificationsEnabled |
556
|
|
|
* |
557
|
|
|
* @return SiteConfiguration |
558
|
|
|
*/ |
559
|
|
|
public function setIrcNotificationsEnabled($ircNotificationsEnabled) |
560
|
1 |
|
{ |
561
|
|
|
$this->ircNotificationsEnabled = $ircNotificationsEnabled; |
562
|
1 |
|
|
563
|
|
|
return $this; |
564
|
1 |
|
} |
565
|
|
|
|
566
|
|
|
/** |
567
|
|
|
* @param string $errorLog |
568
|
|
|
* |
569
|
|
|
* @return SiteConfiguration |
570
|
2 |
|
*/ |
571
|
|
|
public function setErrorLog($errorLog) |
572
|
2 |
|
{ |
573
|
|
|
$this->errorLog = $errorLog; |
574
|
|
|
|
575
|
|
|
return $this; |
576
|
|
|
} |
577
|
|
|
|
578
|
|
|
/** |
579
|
|
|
* @return string |
580
|
1 |
|
*/ |
581
|
|
|
public function getErrorLog() |
582
|
1 |
|
{ |
583
|
|
|
return $this->errorLog; |
584
|
1 |
|
} |
585
|
|
|
|
586
|
|
|
/** |
587
|
|
|
* @param int $emailConfirmationExpiryDays |
588
|
|
|
* |
589
|
|
|
* @return SiteConfiguration |
590
|
1 |
|
*/ |
591
|
|
|
public function setEmailConfirmationExpiryDays($emailConfirmationExpiryDays) |
592
|
1 |
|
{ |
593
|
|
|
$this->emailConfirmationExpiryDays = $emailConfirmationExpiryDays; |
594
|
|
|
|
595
|
|
|
return $this; |
596
|
|
|
} |
597
|
|
|
|
598
|
|
|
/** |
599
|
|
|
* @return int |
600
|
1 |
|
*/ |
601
|
|
|
public function getEmailConfirmationExpiryDays() |
602
|
1 |
|
{ |
603
|
|
|
return $this->emailConfirmationExpiryDays; |
604
|
1 |
|
} |
605
|
|
|
|
606
|
|
|
/** |
607
|
|
|
* @param string $ircNotificationsInstance |
608
|
|
|
* |
609
|
|
|
* @return SiteConfiguration |
610
|
1 |
|
*/ |
611
|
|
|
public function setIrcNotificationsInstance($ircNotificationsInstance) |
612
|
1 |
|
{ |
613
|
|
|
$this->ircNotificationsInstance = $ircNotificationsInstance; |
614
|
|
|
|
615
|
|
|
return $this; |
616
|
|
|
} |
617
|
|
|
|
618
|
|
|
/** |
619
|
|
|
* @return string |
620
|
1 |
|
*/ |
621
|
|
|
public function getIrcNotificationsInstance() |
622
|
1 |
|
{ |
623
|
|
|
return $this->ircNotificationsInstance; |
624
|
1 |
|
} |
625
|
|
|
|
626
|
|
|
/** |
627
|
|
|
* @param boolean $titleBlacklistEnabled |
628
|
|
|
* |
629
|
|
|
* @return SiteConfiguration |
630
|
1 |
|
*/ |
631
|
|
|
public function setTitleBlacklistEnabled($titleBlacklistEnabled) |
632
|
1 |
|
{ |
633
|
|
|
$this->titleBlacklistEnabled = $titleBlacklistEnabled; |
634
|
|
|
|
635
|
|
|
return $this; |
636
|
|
|
} |
637
|
|
|
|
638
|
|
|
/** |
639
|
|
|
* @return boolean |
640
|
1 |
|
*/ |
641
|
|
|
public function getTitleBlacklistEnabled() |
642
|
1 |
|
{ |
643
|
|
|
return $this->titleBlacklistEnabled; |
644
|
1 |
|
} |
645
|
|
|
|
646
|
|
|
/** |
647
|
|
|
* @param string|null $locationProviderApiKey |
648
|
|
|
* |
649
|
|
|
* @return SiteConfiguration |
650
|
1 |
|
*/ |
651
|
|
|
public function setLocationProviderApiKey($locationProviderApiKey) |
652
|
1 |
|
{ |
653
|
|
|
$this->locationProviderApiKey = $locationProviderApiKey; |
654
|
|
|
|
655
|
|
|
return $this; |
656
|
|
|
} |
657
|
|
|
|
658
|
|
|
/** |
659
|
|
|
* @return null|string |
660
|
1 |
|
*/ |
661
|
|
|
public function getLocationProviderApiKey() |
662
|
1 |
|
{ |
663
|
|
|
return $this->locationProviderApiKey; |
664
|
1 |
|
} |
665
|
|
|
|
666
|
|
|
/** |
667
|
|
|
* @param array $torExitPaths |
668
|
|
|
* |
669
|
|
|
* @return SiteConfiguration |
670
|
1 |
|
*/ |
671
|
|
|
public function setTorExitPaths($torExitPaths) |
672
|
1 |
|
{ |
673
|
|
|
$this->torExitPaths = $torExitPaths; |
674
|
|
|
|
675
|
|
|
return $this; |
676
|
|
|
} |
677
|
|
|
|
678
|
|
|
/** |
679
|
|
|
* @return array |
680
|
|
|
*/ |
681
|
|
|
public function getTorExitPaths() |
682
|
|
|
{ |
683
|
|
|
return $this->torExitPaths; |
684
|
|
|
} |
685
|
|
|
|
686
|
|
|
/** |
687
|
|
|
* @param string $oauthIdentityGraceTime |
688
|
|
|
* |
689
|
|
|
* @return SiteConfiguration |
690
|
|
|
*/ |
691
|
|
|
public function setOauthIdentityGraceTime($oauthIdentityGraceTime) |
692
|
|
|
{ |
693
|
|
|
$this->oauthIdentityGraceTime = $oauthIdentityGraceTime; |
694
|
|
|
|
695
|
|
|
return $this; |
696
|
|
|
} |
697
|
|
|
|
698
|
|
|
/** |
699
|
|
|
* @return string |
700
|
|
|
*/ |
701
|
|
|
public function getOauthIdentityGraceTime() |
702
|
|
|
{ |
703
|
|
|
return $this->oauthIdentityGraceTime; |
704
|
|
|
} |
705
|
|
|
|
706
|
|
|
/** |
707
|
|
|
* @param string $oauthMediaWikiCanonicalServer |
708
|
|
|
* |
709
|
|
|
* @return SiteConfiguration |
710
|
|
|
*/ |
711
|
|
|
public function setOauthMediaWikiCanonicalServer($oauthMediaWikiCanonicalServer) |
712
|
|
|
{ |
713
|
|
|
$this->oauthMediaWikiCanonicalServer = $oauthMediaWikiCanonicalServer; |
714
|
|
|
|
715
|
|
|
return $this; |
716
|
|
|
} |
717
|
|
|
|
718
|
|
|
/** |
719
|
|
|
* @return string |
720
|
|
|
*/ |
721
|
|
|
public function getOauthMediaWikiCanonicalServer() |
722
|
|
|
{ |
723
|
|
|
return $this->oauthMediaWikiCanonicalServer; |
724
|
|
|
} |
725
|
|
|
|
726
|
|
|
/** |
727
|
|
|
* @param string $creationBotUsername |
728
|
|
|
* |
729
|
|
|
* @return SiteConfiguration |
730
|
|
|
*/ |
731
|
|
|
public function setCreationBotUsername($creationBotUsername) |
732
|
|
|
{ |
733
|
|
|
$this->creationBotUsername = $creationBotUsername; |
734
|
|
|
|
735
|
|
|
return $this; |
736
|
|
|
} |
737
|
|
|
|
738
|
|
|
/** |
739
|
|
|
* @return string |
740
|
|
|
*/ |
741
|
|
|
public function getCreationBotUsername() |
742
|
|
|
{ |
743
|
|
|
return $this->creationBotUsername; |
744
|
|
|
} |
745
|
|
|
|
746
|
|
|
/** |
747
|
|
|
* @param string $creationBotPassword |
748
|
|
|
* |
749
|
|
|
* @return SiteConfiguration |
750
|
|
|
*/ |
751
|
|
|
public function setCreationBotPassword($creationBotPassword) |
752
|
|
|
{ |
753
|
|
|
$this->creationBotPassword = $creationBotPassword; |
754
|
|
|
|
755
|
|
|
return $this; |
756
|
|
|
} |
757
|
|
|
|
758
|
|
|
/** |
759
|
|
|
* @return string |
760
|
|
|
*/ |
761
|
|
|
public function getCreationBotPassword() |
762
|
|
|
{ |
763
|
|
|
return $this->creationBotPassword; |
764
|
|
|
} |
765
|
|
|
|
766
|
|
|
/** |
767
|
|
|
* @param string|null $curlCookieJar |
768
|
|
|
* |
769
|
|
|
* @return SiteConfiguration |
770
|
|
|
*/ |
771
|
|
|
public function setCurlCookieJar($curlCookieJar) |
772
|
|
|
{ |
773
|
|
|
$this->curlCookieJar = $curlCookieJar; |
774
|
|
|
|
775
|
|
|
return $this; |
776
|
|
|
} |
777
|
|
|
|
778
|
|
|
/** |
779
|
|
|
* @return string|null |
780
|
|
|
*/ |
781
|
|
|
public function getCurlCookieJar() |
782
|
|
|
{ |
783
|
|
|
return $this->curlCookieJar; |
784
|
|
|
} |
785
|
|
|
|
786
|
|
|
public function getYubicoApiId() |
787
|
|
|
{ |
788
|
|
|
return $this->yubicoApiId; |
789
|
|
|
} |
790
|
|
|
|
791
|
|
|
public function setYubicoApiId($id) |
792
|
|
|
{ |
793
|
|
|
$this->yubicoApiId = $id; |
794
|
|
|
|
795
|
|
|
return $this; |
796
|
|
|
} |
797
|
|
|
|
798
|
|
|
public function getYubicoApiKey() |
799
|
|
|
{ |
800
|
|
|
return $this->yubicoApiKey; |
801
|
|
|
} |
802
|
|
|
|
803
|
|
|
public function setYubicoApiKey($key) |
804
|
|
|
{ |
805
|
|
|
$this->yubicoApiKey = $key; |
806
|
|
|
|
807
|
|
|
return $this; |
808
|
|
|
} |
809
|
|
|
|
810
|
|
|
/** |
811
|
|
|
* @return string |
812
|
|
|
*/ |
813
|
|
|
public function getTotpEncryptionKey() |
814
|
|
|
{ |
815
|
|
|
return $this->totpEncryptionKey; |
816
|
|
|
} |
817
|
|
|
|
818
|
|
|
/** |
819
|
|
|
* @param string $totpEncryptionKey |
820
|
|
|
* |
821
|
|
|
* @return SiteConfiguration |
822
|
1 |
|
*/ |
823
|
|
|
public function setTotpEncryptionKey($totpEncryptionKey) |
824
|
1 |
|
{ |
825
|
|
|
$this->totpEncryptionKey = $totpEncryptionKey; |
826
|
|
|
|
827
|
|
|
return $this; |
828
|
|
|
} |
829
|
|
|
|
830
|
|
|
/** |
831
|
|
|
* @return string |
832
|
|
|
*/ |
833
|
|
|
public function getIdentificationNoticeboardPage() |
834
|
|
|
{ |
835
|
|
|
return $this->identificationNoticeboardPage; |
836
|
|
|
} |
837
|
|
|
|
838
|
|
|
/** |
839
|
|
|
* @param string $identificationNoticeboardPage |
840
|
|
|
* |
841
|
|
|
* @return SiteConfiguration |
842
|
|
|
*/ |
843
|
|
|
public function setIdentificationNoticeboardPage($identificationNoticeboardPage) |
844
|
|
|
{ |
845
|
|
|
$this->identificationNoticeboardPage = $identificationNoticeboardPage; |
846
|
1 |
|
|
847
|
|
|
return $this; |
848
|
1 |
|
} |
849
|
|
|
|
850
|
|
|
public function setIdentificationNoticeboardWebserviceEndpoint(string $identificationNoticeboardWebserviceEndpoint |
851
|
|
|
): SiteConfiguration { |
852
|
|
|
$this->identificationNoticeboardWebserviceEndpoint = $identificationNoticeboardWebserviceEndpoint; |
853
|
|
|
|
854
|
|
|
return $this; |
855
|
|
|
} |
856
|
|
|
|
857
|
|
|
public function getIdentificationNoticeboardWebserviceEndpoint(): string |
858
|
|
|
{ |
859
|
|
|
return $this->identificationNoticeboardWebserviceEndpoint; |
860
|
|
|
} |
861
|
|
|
|
862
|
|
|
public function isRegistrationAllowed(): bool |
863
|
|
|
{ |
864
|
|
|
return $this->registrationAllowed; |
865
|
|
|
} |
866
|
|
|
|
867
|
|
|
public function setRegistrationAllowed(bool $registrationAllowed): SiteConfiguration |
868
|
|
|
{ |
869
|
|
|
$this->registrationAllowed = $registrationAllowed; |
870
|
|
|
|
871
|
|
|
return $this; |
872
|
|
|
} |
873
|
|
|
|
874
|
|
|
/** |
875
|
|
|
* @return string|null |
876
|
|
|
*/ |
877
|
|
|
public function getCspReportUri() |
878
|
|
|
{ |
879
|
|
|
return $this->cspReportUri; |
880
|
|
|
} |
881
|
|
|
|
882
|
|
|
/** |
883
|
|
|
* @param string|null $cspReportUri |
884
|
|
|
* |
885
|
|
|
* @return SiteConfiguration |
886
|
|
|
*/ |
887
|
|
|
public function setCspReportUri($cspReportUri) |
888
|
|
|
{ |
889
|
|
|
$this->cspReportUri = $cspReportUri; |
890
|
|
|
|
891
|
|
|
return $this; |
892
|
|
|
} |
893
|
|
|
|
894
|
|
|
/** |
895
|
|
|
* @return int |
896
|
|
|
*/ |
897
|
|
|
public function getResourceCacheEpoch(): int |
898
|
|
|
{ |
899
|
|
|
return $this->resourceCacheEpoch; |
900
|
|
|
} |
901
|
|
|
|
902
|
|
|
/** |
903
|
|
|
* @param int $resourceCacheEpoch |
904
|
|
|
* |
905
|
|
|
* @return SiteConfiguration |
906
|
|
|
*/ |
907
|
|
|
public function setResourceCacheEpoch(int $resourceCacheEpoch): SiteConfiguration |
908
|
|
|
{ |
909
|
|
|
$this->resourceCacheEpoch = $resourceCacheEpoch; |
910
|
|
|
|
911
|
|
|
return $this; |
912
|
|
|
} |
913
|
|
|
|
914
|
|
|
/** |
915
|
|
|
* @return array |
916
|
|
|
*/ |
917
|
|
|
public function getCommonEmailDomains(): array |
918
|
|
|
{ |
919
|
|
|
return $this->commonEmailDomains; |
920
|
|
|
} |
921
|
|
|
|
922
|
|
|
/** |
923
|
|
|
* @param array $commonEmailDomains |
924
|
|
|
* |
925
|
|
|
* @return SiteConfiguration |
926
|
|
|
*/ |
927
|
|
|
public function setCommonEmailDomains(array $commonEmailDomains): SiteConfiguration |
928
|
|
|
{ |
929
|
|
|
$this->commonEmailDomains = $commonEmailDomains; |
930
|
|
|
|
931
|
|
|
return $this; |
932
|
|
|
} |
933
|
|
|
|
934
|
|
|
/** |
935
|
|
|
* @param int[] $banMaxIpBlockRange |
936
|
|
|
* |
937
|
|
|
* @return SiteConfiguration |
938
|
|
|
*/ |
939
|
|
|
public function setBanMaxIpBlockRange(array $banMaxIpBlockRange): SiteConfiguration |
940
|
|
|
{ |
941
|
|
|
$this->banMaxIpBlockRange = $banMaxIpBlockRange; |
942
|
|
|
|
943
|
|
|
return $this; |
944
|
|
|
} |
945
|
|
|
|
946
|
|
|
/** |
947
|
|
|
* @return int[] |
948
|
|
|
*/ |
949
|
|
|
public function getBanMaxIpBlockRange(): array |
950
|
|
|
{ |
951
|
|
|
return $this->banMaxIpBlockRange; |
952
|
|
|
} |
953
|
|
|
|
954
|
|
|
/** |
955
|
|
|
* @param int[] $banMaxIpRange |
956
|
|
|
* |
957
|
|
|
* @return SiteConfiguration |
958
|
|
|
*/ |
959
|
|
|
public function setBanMaxIpRange(array $banMaxIpRange): SiteConfiguration |
960
|
|
|
{ |
961
|
|
|
$this->banMaxIpRange = $banMaxIpRange; |
962
|
|
|
|
963
|
|
|
return $this; |
964
|
|
|
} |
965
|
|
|
|
966
|
|
|
/** |
967
|
|
|
* @return int[] |
968
|
|
|
*/ |
969
|
|
|
public function getBanMaxIpRange(): array |
970
|
|
|
{ |
971
|
|
|
return $this->banMaxIpRange; |
972
|
|
|
} |
973
|
|
|
|
974
|
|
|
/** |
975
|
|
|
* @param array $oauthLegacyConsumerTokens |
976
|
|
|
* |
977
|
|
|
* @return SiteConfiguration |
978
|
|
|
*/ |
979
|
|
|
public function setOauthLegacyConsumerTokens(array $oauthLegacyConsumerTokens): SiteConfiguration |
980
|
|
|
{ |
981
|
|
|
$this->oauthLegacyConsumerTokens = $oauthLegacyConsumerTokens; |
982
|
|
|
|
983
|
|
|
return $this; |
984
|
|
|
} |
985
|
|
|
|
986
|
|
|
/** |
987
|
|
|
* @return array |
988
|
|
|
*/ |
989
|
|
|
public function getOauthLegacyConsumerTokens(): array |
990
|
|
|
{ |
991
|
|
|
return $this->oauthLegacyConsumerTokens; |
992
|
|
|
} |
993
|
|
|
|
994
|
|
|
/** |
995
|
|
|
* @return int |
996
|
|
|
*/ |
997
|
|
|
public function getJobQueueBatchSize(): int |
998
|
|
|
{ |
999
|
|
|
return $this->jobQueueBatchSize; |
1000
|
|
|
} |
1001
|
|
|
|
1002
|
|
|
/** |
1003
|
|
|
* @param int $jobQueueBatchSize |
1004
|
|
|
* |
1005
|
|
|
* @return SiteConfiguration |
1006
|
|
|
*/ |
1007
|
|
|
public function setJobQueueBatchSize(int $jobQueueBatchSize): SiteConfiguration |
1008
|
|
|
{ |
1009
|
|
|
$this->jobQueueBatchSize = $jobQueueBatchSize; |
1010
|
|
|
|
1011
|
|
|
return $this; |
1012
|
|
|
} |
1013
|
|
|
|
1014
|
|
|
/** |
1015
|
|
|
* @return array |
1016
|
|
|
*/ |
1017
|
|
|
public function getAmqpConfiguration(): array |
1018
|
|
|
{ |
1019
|
|
|
return $this->amqpConfiguration; |
1020
|
|
|
} |
1021
|
|
|
|
1022
|
|
|
/** |
1023
|
|
|
* @param array $amqpConfiguration |
1024
|
|
|
* |
1025
|
|
|
* @return SiteConfiguration |
1026
|
|
|
*/ |
1027
|
|
|
public function setAmqpConfiguration(array $amqpConfiguration): SiteConfiguration |
1028
|
|
|
{ |
1029
|
|
|
$this->amqpConfiguration = $amqpConfiguration; |
1030
|
|
|
|
1031
|
|
|
return $this; |
1032
|
|
|
} |
1033
|
|
|
|
1034
|
|
|
/** |
1035
|
|
|
* @return string |
1036
|
|
|
*/ |
1037
|
|
|
public function getEmailSender(): string |
1038
|
|
|
{ |
1039
|
|
|
return $this->emailSender; |
1040
|
|
|
} |
1041
|
|
|
|
1042
|
|
|
/** |
1043
|
|
|
* @param string $emailSender |
1044
|
|
|
* |
1045
|
|
|
* @return SiteConfiguration |
1046
|
|
|
*/ |
1047
|
|
|
public function setEmailSender(string $emailSender): SiteConfiguration |
1048
|
|
|
{ |
1049
|
|
|
$this->emailSender = $emailSender; |
1050
|
|
|
|
1051
|
|
|
return $this; |
1052
|
|
|
} |
1053
|
|
|
|
1054
|
|
|
/** |
1055
|
|
|
* @param array $acceptClientHints |
1056
|
|
|
* |
1057
|
|
|
* @return SiteConfiguration |
1058
|
|
|
*/ |
1059
|
|
|
public function setAcceptClientHints(array $acceptClientHints): SiteConfiguration |
1060
|
|
|
{ |
1061
|
|
|
$this->acceptClientHints = $acceptClientHints; |
1062
|
|
|
|
1063
|
|
|
return $this; |
1064
|
|
|
} |
1065
|
|
|
|
1066
|
|
|
/** |
1067
|
|
|
* @return array |
1068
|
|
|
*/ |
1069
|
|
|
public function getAcceptClientHints(): array |
1070
|
|
|
{ |
1071
|
|
|
return $this->acceptClientHints; |
1072
|
|
|
} |
1073
|
|
|
|
1074
|
|
|
public function setCookiePath(string $cookiePath): SiteConfiguration |
1075
|
|
|
{ |
1076
|
|
|
$this->cookiePath = $cookiePath; |
1077
|
|
|
|
1078
|
|
|
return $this; |
1079
|
|
|
} |
1080
|
|
|
|
1081
|
|
|
public function getCookiePath(): string |
1082
|
|
|
{ |
1083
|
|
|
return $this->cookiePath; |
1084
|
|
|
} |
1085
|
|
|
|
1086
|
|
|
public function setCookieSessionName(string $cookieSessionName): SiteConfiguration |
1087
|
|
|
{ |
1088
|
|
|
$this->cookieSessionName = $cookieSessionName; |
1089
|
|
|
|
1090
|
|
|
return $this; |
1091
|
|
|
} |
1092
|
|
|
|
1093
|
|
|
public function getCookieSessionName(): string |
1094
|
|
|
{ |
1095
|
|
|
return $this->cookieSessionName; |
1096
|
|
|
} |
1097
|
|
|
|
1098
|
|
|
public function setOffline(array $offline): SiteConfiguration |
1099
|
|
|
{ |
1100
|
|
|
$this->offline = $offline; |
1101
|
|
|
|
1102
|
|
|
return $this; |
1103
|
|
|
} |
1104
|
|
|
|
1105
|
|
|
public function getOffline(): array |
1106
|
|
|
{ |
1107
|
|
|
return $this->offline; |
1108
|
|
|
} |
1109
|
|
|
|
1110
|
|
|
public function setDatabaseConfig(array $databaseConfig): SiteConfiguration |
1111
|
|
|
{ |
1112
|
|
|
$this->databaseConfig = $databaseConfig; |
1113
|
|
|
|
1114
|
|
|
return $this; |
1115
|
|
|
} |
1116
|
|
|
|
1117
|
|
|
public function getDatabaseConfig(): array |
1118
|
|
|
{ |
1119
|
|
|
return $this->databaseConfig; |
1120
|
|
|
} |
1121
|
|
|
|
1122
|
|
|
public function getPrivacyStatementPath(): string |
1123
|
|
|
{ |
1124
|
|
|
return $this->privacyStatementPath; |
1125
|
|
|
} |
1126
|
|
|
|
1127
|
|
|
public function setPrivacyStatementPath(string $privacyStatementPath): SiteConfiguration |
1128
|
|
|
{ |
1129
|
|
|
$this->privacyStatementPath = $privacyStatementPath; |
1130
|
|
|
|
1131
|
|
|
return $this; |
1132
|
|
|
} |
1133
|
|
|
|
1134
|
|
|
public function getCreateAccountLink(): string |
1135
|
|
|
{ |
1136
|
|
|
return $this->createAccountLink; |
1137
|
|
|
} |
1138
|
|
|
|
1139
|
|
|
public function setCreateAccountLink(string $createAccountLink): SiteConfiguration |
1140
|
|
|
{ |
1141
|
|
|
$this->createAccountLink = $createAccountLink; |
1142
|
|
|
|
1143
|
|
|
return $this; |
1144
|
|
|
} |
1145
|
|
|
} |
1146
|
|
|
|