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