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