Passed
Push — multiproject/db ( 16c0c4...9dd649 )
by Simon
15:28 queued 11:05
created

SiteConfiguration::setOauthLegacyConsumerTokens()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
c 1
b 0
f 0
dl 0
loc 5
ccs 0
cts 3
cp 0
rs 10
cc 1
nc 1
nop 1
crap 2
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 = 37;
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
    /** @deprecated */
37
    private $requestStates = array(
38
        'Open'          => array(
39
            'defertolog' => 'users', // don't change or you'll break old logs
40
            'deferto'    => 'users',
41
            'header'     => 'Open requests',
42
            'api'        => "open",
43
        ),
44
        'Flagged users' => array(
45
            'defertolog' => 'flagged users', // don't change or you'll break old logs
46
            'deferto'    => 'flagged users',
47
            'header'     => 'Flagged user needed',
48
            'api'        => "admin",
49
        ),
50
        'Checkuser'     => array(
51
            'defertolog' => 'checkusers', // don't change or you'll break old logs
52
            'deferto'    => 'checkusers',
53
            'header'     => 'Checkuser needed',
54
            'api'        => "checkuser",
55
        ),
56
    );
57
    private $squidList = array();
58
    /** @deprecated */
59
    private $defaultCreatedTemplateId = 1;
60
    /** @deprecated */
61
    private $defaultRequestStateKey = 'Open';
62
    /** @deprecated */
63
    private $defaultRequestDeferredStateKey = 'Flagged users';
64
    private $useStrictTransportSecurity = false;
65
    private $userAgent = 'Wikipedia-ACC Tool/0.1 (+https://accounts.wmflabs.org/internal.php/team)';
66
    private $curlDisableVerifyPeer = false;
67
    private $useOAuthSignup = true;
68
    private $oauthBaseUrl;
69
    private $oauthConsumerToken;
70
    /** @var array */
71
    private $oauthLegacyConsumerTokens;
72
    private $oauthConsumerSecret;
73
    private $oauthIdentityGraceTime = '24 hours';
74
    private $oauthMediaWikiCanonicalServer = 'http://en.wikipedia.org';
75
    private $xffTrustedHostsFile = '../TrustedXFF/trusted-hosts.txt';
76
    private $crossOriginResourceSharingHosts = array(
77
        "http://en.wikipedia.org",
78
        "https://en.wikipedia.org",
79
        "http://meta.wikimedia.org",
80
        "https://meta.wikimedia.org",
81
    );
82
    private $ircNotificationType = 1;
83
    private $ircNotificationsEnabled = true;
84
    private $ircNotificationsInstance = 'Development';
85
    private $errorLog = 'errorlog';
86
    private $titleBlacklistEnabled = false;
87
    /** @var null|string $locationProviderApiKey */
88
    private $locationProviderApiKey = null;
89
    private $torExitPaths = array();
90
    private $creationBotUsername = '';
91
    private $creationBotPassword = '';
92
    private $curlCookieJar = null;
93
    private $yubicoApiId = 0;
94
    private $yubicoApiKey = "";
95
    private $totpEncryptionKey = "1234";
96
    private $identificationNoticeboardPage = 'Access to nonpublic personal data policy/Noticeboard';
97
    private $registrationAllowed = true;
98
    private $cspReportUri = null;
99
    private $resourceCacheEpoch = 1;
100
    private $commonEmailDomains = [];
101
    private $banMaxIpBlockRange = [4 => 20, 6 => 48];
102
    private $banMaxIpRange = [4 => 16, 6 => 32];
103
    private $jobQueueBatchSize = 10;
104
105
    /**
106
     * Gets the base URL of the tool
107
     *
108
     * If the internal page of the tool is at http://localhost/path/internal.php, this would be set to
109
     * http://localhost/path
110
     * @return string
111
     */
112 1
    public function getBaseUrl()
113
    {
114 1
        return $this->baseUrl;
115
    }
116
117
    /**
118
     * @param string $baseUrl
119
     *
120
     * @return SiteConfiguration
121
     */
122 1
    public function setBaseUrl($baseUrl)
123
    {
124 1
        $this->baseUrl = $baseUrl;
125
126 1
        return $this;
127
    }
128
129
    /**
130
     * Path on disk to the directory containing the tool's code
131
     * @return string
132
     */
133 1
    public function getFilePath()
134
    {
135 1
        return $this->filePath;
136
    }
137
138
    /**
139
     * @param string $filePath
140
     *
141
     * @return SiteConfiguration
142
     */
143 1
    public function setFilePath($filePath)
144
    {
145 1
        $this->filePath = $filePath;
146
147 1
        return $this;
148
    }
149
150
    /**
151
     * @return int
152
     */
153 1
    public function getSchemaVersion()
154
    {
155 1
        return $this->schemaVersion;
156
    }
157
158
    /**
159
     * @param int $schemaVersion
160
     *
161
     * @return SiteConfiguration
162
     */
163
    public function setSchemaVersion($schemaVersion)
164
    {
165
        $this->schemaVersion = $schemaVersion;
166
167
        return $this;
168
    }
169
170
    /**
171
     * @return mixed
172
     */
173 1
    public function getDebuggingTraceEnabled()
174
    {
175 1
        return $this->debuggingTraceEnabled;
176
    }
177
178
    /**
179
     * @param mixed $debuggingTraceEnabled
180
     *
181
     * @return SiteConfiguration
182
     */
183 1
    public function setDebuggingTraceEnabled($debuggingTraceEnabled)
184
    {
185 1
        $this->debuggingTraceEnabled = $debuggingTraceEnabled;
186
187 1
        return $this;
188
    }
189
190
    /**
191
     * @return string
192
     */
193 1
    public function getDataClearIp()
194
    {
195 1
        return $this->dataClearIp;
196
    }
197
198
    /**
199
     * @param string $dataClearIp
200
     *
201
     * @return SiteConfiguration
202
     */
203 1
    public function setDataClearIp($dataClearIp)
204
    {
205 1
        $this->dataClearIp = $dataClearIp;
206
207 1
        return $this;
208
    }
209
210
    /**
211
     * @return string
212
     */
213 1
    public function getDataClearEmail()
214
    {
215 1
        return $this->dataClearEmail;
216
    }
217
218
    /**
219
     * @param string $dataClearEmail
220
     *
221
     * @return SiteConfiguration
222
     */
223 1
    public function setDataClearEmail($dataClearEmail)
224
    {
225 1
        $this->dataClearEmail = $dataClearEmail;
226
227 1
        return $this;
228
    }
229
230
    /**
231
     * @return boolean
232
     */
233 1
    public function getForceIdentification()
234
    {
235 1
        return $this->forceIdentification;
236
    }
237
238
    /**
239
     * @param boolean $forceIdentification
240
     *
241
     * @return SiteConfiguration
242
     */
243 1
    public function setForceIdentification($forceIdentification)
244
    {
245 1
        $this->forceIdentification = $forceIdentification;
246
247 1
        return $this;
248
    }
249
250
    /**
251
     * @return string
252
     */
253 1
    public function getIdentificationCacheExpiry()
254
    {
255 1
        return $this->identificationCacheExpiry;
256
    }
257
258
    /**
259
     * @param string $identificationCacheExpiry
260
     *
261
     * @return SiteConfiguration
262
     */
263 1
    public function setIdentificationCacheExpiry($identificationCacheExpiry)
264
    {
265 1
        $this->identificationCacheExpiry = $identificationCacheExpiry;
266
267 1
        return $this;
268
    }
269
270
    /**
271
     * @return string
272
     */
273 1
    public function getMediawikiScriptPath()
274
    {
275 1
        return $this->mediawikiScriptPath;
276
    }
277
278
    /**
279
     * @param string $mediawikiScriptPath
280
     *
281
     * @return SiteConfiguration
282
     */
283 1
    public function setMediawikiScriptPath($mediawikiScriptPath)
284
    {
285 1
        $this->mediawikiScriptPath = $mediawikiScriptPath;
286
287 1
        return $this;
288
    }
289
290
    /**
291
     * @return string
292
     */
293 1
    public function getMediawikiWebServiceEndpoint()
294
    {
295 1
        return $this->mediawikiWebServiceEndpoint;
296
    }
297
298
    /**
299
     * @param string $mediawikiWebServiceEndpoint
300
     *
301
     * @return SiteConfiguration
302
     */
303 1
    public function setMediawikiWebServiceEndpoint($mediawikiWebServiceEndpoint)
304
    {
305 1
        $this->mediawikiWebServiceEndpoint = $mediawikiWebServiceEndpoint;
306
307 1
        return $this;
308
    }
309
310
    /**
311
     * @return string
312
     */
313 2
    public function getMetaWikimediaWebServiceEndpoint()
314
    {
315 2
        return $this->metaWikimediaWebServiceEndpoint;
316
    }
317
318
    /**
319
     * @param string $metaWikimediaWebServiceEndpoint
320
     *
321
     * @return SiteConfiguration
322
     */
323 1
    public function setMetaWikimediaWebServiceEndpoint($metaWikimediaWebServiceEndpoint)
324
    {
325 1
        $this->metaWikimediaWebServiceEndpoint = $metaWikimediaWebServiceEndpoint;
326
327 1
        return $this;
328
    }
329
330
    /**
331
     * @return boolean
332
     */
333 1
    public function getEnforceOAuth()
334
    {
335 1
        return $this->enforceOAuth;
336
    }
337
338
    /**
339
     * @param boolean $enforceOAuth
340
     *
341
     * @return SiteConfiguration
342
     */
343 1
    public function setEnforceOAuth($enforceOAuth)
344
    {
345 1
        $this->enforceOAuth = $enforceOAuth;
346
347 1
        return $this;
348
    }
349
350
    /**
351
     * @return boolean
352
     */
353 1
    public function getEmailConfirmationEnabled()
354
    {
355 1
        return $this->emailConfirmationEnabled;
356
    }
357
358
    /**
359
     * @param boolean $emailConfirmationEnabled
360
     *
361
     * @return $this
362
     */
363 1
    public function setEmailConfirmationEnabled($emailConfirmationEnabled)
364
    {
365 1
        $this->emailConfirmationEnabled = $emailConfirmationEnabled;
366
367 1
        return $this;
368
    }
369
370
    /**
371
     * @return int
372
     */
373 1
    public function getMiserModeLimit()
374
    {
375 1
        return $this->miserModeLimit;
376
    }
377
378
    /**
379
     * @param int $miserModeLimit
380
     *
381
     * @return SiteConfiguration
382
     */
383 1
    public function setMiserModeLimit($miserModeLimit)
384
    {
385 1
        $this->miserModeLimit = $miserModeLimit;
386
387 1
        return $this;
388
    }
389
390
    /**
391
     * @return array
392
     * @deprecated To be removed after dynamic queues hit production. This will need to be major point release.
393
     */
394
    public function getRequestStates()
395
    {
396
        return $this->requestStates;
0 ignored issues
show
Deprecated Code introduced by
The property Waca\SiteConfiguration::$requestStates has been deprecated. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

396
        return /** @scrutinizer ignore-deprecated */ $this->requestStates;
Loading history...
397
    }
398
399
    /**
400
     * @param array $requestStates
401
     *
402
     * @return SiteConfiguration
403
     * @deprecated To be removed after dynamic queues hit production. This will need to be major point release.
404
     */
405
    public function setRequestStates($requestStates)
406
    {
407
        $this->requestStates = $requestStates;
0 ignored issues
show
Deprecated Code introduced by
The property Waca\SiteConfiguration::$requestStates has been deprecated. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

407
        /** @scrutinizer ignore-deprecated */ $this->requestStates = $requestStates;
Loading history...
408
409
        return $this;
410
    }
411
412
    /**
413
     * @return array
414
     */
415 1
    public function getSquidList()
416
    {
417 1
        return $this->squidList;
418
    }
419
420
    /**
421
     * @param array $squidList
422
     *
423
     * @return SiteConfiguration
424
     */
425 1
    public function setSquidList($squidList)
426
    {
427 1
        $this->squidList = $squidList;
428
429 1
        return $this;
430
    }
431
432
    /**
433
     * @return int
434
     * @deprecated
435
     */
436
    public function getDefaultCreatedTemplateId()
437
    {
438
        return $this->defaultCreatedTemplateId;
0 ignored issues
show
Deprecated Code introduced by
The property Waca\SiteConfiguration::$defaultCreatedTemplateId has been deprecated. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

438
        return /** @scrutinizer ignore-deprecated */ $this->defaultCreatedTemplateId;
Loading history...
439
    }
440
441
    /**
442
     * @param int $defaultCreatedTemplateId
443
     * @deprecated
444
     * @return SiteConfiguration
445
     */
446
    public function setDefaultCreatedTemplateId($defaultCreatedTemplateId)
447
    {
448
        $this->defaultCreatedTemplateId = $defaultCreatedTemplateId;
0 ignored issues
show
Deprecated Code introduced by
The property Waca\SiteConfiguration::$defaultCreatedTemplateId has been deprecated. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

448
        /** @scrutinizer ignore-deprecated */ $this->defaultCreatedTemplateId = $defaultCreatedTemplateId;
Loading history...
449
450
        return $this;
451
    }
452
453
    /**
454
     * @return string
455
     * @deprecated
456
     */
457
    public function getDefaultRequestStateKey()
458
    {
459
        return $this->defaultRequestStateKey;
0 ignored issues
show
Deprecated Code introduced by
The property Waca\SiteConfiguration::$defaultRequestStateKey has been deprecated. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

459
        return /** @scrutinizer ignore-deprecated */ $this->defaultRequestStateKey;
Loading history...
460
    }
461
462
    /**
463
     * @param string $defaultRequestStateKey
464
     *
465
     * @return SiteConfiguration
466
     * @deprecated
467
     */
468
    public function setDefaultRequestStateKey($defaultRequestStateKey)
469
    {
470
        $this->defaultRequestStateKey = $defaultRequestStateKey;
0 ignored issues
show
Deprecated Code introduced by
The property Waca\SiteConfiguration::$defaultRequestStateKey has been deprecated. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

470
        /** @scrutinizer ignore-deprecated */ $this->defaultRequestStateKey = $defaultRequestStateKey;
Loading history...
471
472
        return $this;
473
    }
474
475
    /**
476
     * @return string
477
     * @deprecated
478
     */
479
    public function getDefaultRequestDeferredStateKey()
480
    {
481
        return $this->defaultRequestDeferredStateKey;
0 ignored issues
show
Deprecated Code introduced by
The property Waca\SiteConfiguration::...RequestDeferredStateKey has been deprecated. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

481
        return /** @scrutinizer ignore-deprecated */ $this->defaultRequestDeferredStateKey;
Loading history...
482
    }
483
484
    /**
485
     * @param string $defaultRequestDeferredStateKey
486
     *
487
     * @return SiteConfiguration
488
     * @deprecated
489
     */
490
    public function setDefaultRequestDeferredStateKey($defaultRequestDeferredStateKey)
491
    {
492
        $this->defaultRequestDeferredStateKey = $defaultRequestDeferredStateKey;
0 ignored issues
show
Deprecated Code introduced by
The property Waca\SiteConfiguration::...RequestDeferredStateKey has been deprecated. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

492
        /** @scrutinizer ignore-deprecated */ $this->defaultRequestDeferredStateKey = $defaultRequestDeferredStateKey;
Loading history...
493
494
        return $this;
495
    }
496
497
    /**
498
     * @return boolean
499
     */
500 1
    public function getUseStrictTransportSecurity()
501
    {
502 1
        return $this->useStrictTransportSecurity;
503
    }
504
505
    /**
506
     * @param boolean $useStrictTransportSecurity
507
     *
508
     * @return SiteConfiguration
509
     */
510 1
    public function setUseStrictTransportSecurity($useStrictTransportSecurity)
511
    {
512 1
        $this->useStrictTransportSecurity = $useStrictTransportSecurity;
513
514 1
        return $this;
515
    }
516
517
    /**
518
     * @return string
519
     */
520 2
    public function getUserAgent()
521
    {
522 2
        return $this->userAgent;
523
    }
524
525
    /**
526
     * @param string $userAgent
527
     *
528
     * @return SiteConfiguration
529
     */
530 1
    public function setUserAgent($userAgent)
531
    {
532 1
        $this->userAgent = $userAgent;
533
534 1
        return $this;
535
    }
536
537
    /**
538
     * @return boolean
539
     */
540 2
    public function getCurlDisableVerifyPeer()
541
    {
542 2
        return $this->curlDisableVerifyPeer;
543
    }
544
545
    /**
546
     * @param boolean $curlDisableVerifyPeer
547
     *
548
     * @return SiteConfiguration
549
     */
550 2
    public function setCurlDisableVerifyPeer($curlDisableVerifyPeer)
551
    {
552 2
        $this->curlDisableVerifyPeer = $curlDisableVerifyPeer;
553
554 2
        return $this;
555
    }
556
557
    /**
558
     * @return boolean
559
     */
560 1
    public function getUseOAuthSignup()
561
    {
562 1
        return $this->useOAuthSignup;
563
    }
564
565
    /**
566
     * @param boolean $useOAuthSignup
567
     *
568
     * @return SiteConfiguration
569
     */
570 1
    public function setUseOAuthSignup($useOAuthSignup)
571
    {
572 1
        $this->useOAuthSignup = $useOAuthSignup;
573
574 1
        return $this;
575
    }
576
577
    /**
578
     * @return string
579
     */
580 1
    public function getOAuthBaseUrl()
581
    {
582 1
        return $this->oauthBaseUrl;
583
    }
584
585
    /**
586
     * @param string $oauthBaseUrl
587
     *
588
     * @return SiteConfiguration
589
     */
590 1
    public function setOAuthBaseUrl($oauthBaseUrl)
591
    {
592 1
        $this->oauthBaseUrl = $oauthBaseUrl;
593
594 1
        return $this;
595
    }
596
597
    /**
598
     * @return mixed
599
     */
600 1
    public function getOAuthConsumerToken()
601
    {
602 1
        return $this->oauthConsumerToken;
603
    }
604
605
    /**
606
     * @param mixed $oauthConsumerToken
607
     *
608
     * @return SiteConfiguration
609
     */
610 1
    public function setOAuthConsumerToken($oauthConsumerToken)
611
    {
612 1
        $this->oauthConsumerToken = $oauthConsumerToken;
613
614 1
        return $this;
615
    }
616
617
    /**
618
     * @return mixed
619
     */
620 1
    public function getOAuthConsumerSecret()
621
    {
622 1
        return $this->oauthConsumerSecret;
623
    }
624
625
    /**
626
     * @param mixed $oauthConsumerSecret
627
     *
628
     * @return SiteConfiguration
629
     */
630 1
    public function setOAuthConsumerSecret($oauthConsumerSecret)
631
    {
632 1
        $this->oauthConsumerSecret = $oauthConsumerSecret;
633
634 1
        return $this;
635
    }
636
637
    /**
638
     * @return string
639
     */
640 1
    public function getDataClearInterval()
641
    {
642 1
        return $this->dataClearInterval;
643
    }
644
645
    /**
646
     * @param string $dataClearInterval
647
     *
648
     * @return SiteConfiguration
649
     */
650 1
    public function setDataClearInterval($dataClearInterval)
651
    {
652 1
        $this->dataClearInterval = $dataClearInterval;
653
654 1
        return $this;
655
    }
656
657
    /**
658
     * @return string
659
     */
660 1
    public function getXffTrustedHostsFile()
661
    {
662 1
        return $this->xffTrustedHostsFile;
663
    }
664
665
    /**
666
     * @param string $xffTrustedHostsFile
667
     *
668
     * @return SiteConfiguration
669
     */
670 1
    public function setXffTrustedHostsFile($xffTrustedHostsFile)
671
    {
672 1
        $this->xffTrustedHostsFile = $xffTrustedHostsFile;
673
674 1
        return $this;
675
    }
676
677
    /**
678
     * @return array
679
     */
680 1
    public function getCrossOriginResourceSharingHosts()
681
    {
682 1
        return $this->crossOriginResourceSharingHosts;
683
    }
684
685
    /**
686
     * @param array $crossOriginResourceSharingHosts
687
     *
688
     * @return SiteConfiguration
689
     */
690 1
    public function setCrossOriginResourceSharingHosts($crossOriginResourceSharingHosts)
691
    {
692 1
        $this->crossOriginResourceSharingHosts = $crossOriginResourceSharingHosts;
693
694 1
        return $this;
695
    }
696
697
    /**
698
     * @return boolean
699
     */
700 1
    public function getIrcNotificationsEnabled()
701
    {
702 1
        return $this->ircNotificationsEnabled;
703
    }
704
705
    /**
706
     * @param boolean $ircNotificationsEnabled
707
     *
708
     * @return SiteConfiguration
709
     */
710 1
    public function setIrcNotificationsEnabled($ircNotificationsEnabled)
711
    {
712 1
        $this->ircNotificationsEnabled = $ircNotificationsEnabled;
713
714 1
        return $this;
715
    }
716
717
    /**
718
     * @return int
719
     */
720 1
    public function getIrcNotificationType()
721
    {
722 1
        return $this->ircNotificationType;
723
    }
724
725
    /**
726
     * @param int $ircNotificationType
727
     *
728
     * @return SiteConfiguration
729
     */
730 1
    public function setIrcNotificationType($ircNotificationType)
731
    {
732 1
        $this->ircNotificationType = $ircNotificationType;
733
734 1
        return $this;
735
    }
736
737
    /**
738
     * @param string $errorLog
739
     *
740
     * @return SiteConfiguration
741
     */
742 1
    public function setErrorLog($errorLog)
743
    {
744 1
        $this->errorLog = $errorLog;
745
746 1
        return $this;
747
    }
748
749
    /**
750
     * @return string
751
     */
752 1
    public function getErrorLog()
753
    {
754 1
        return $this->errorLog;
755
    }
756
757
    /**
758
     * @param int $emailConfirmationExpiryDays
759
     *
760
     * @return SiteConfiguration
761
     */
762 1
    public function setEmailConfirmationExpiryDays($emailConfirmationExpiryDays)
763
    {
764 1
        $this->emailConfirmationExpiryDays = $emailConfirmationExpiryDays;
765
766 1
        return $this;
767
    }
768
769
    /**
770
     * @return int
771
     */
772 1
    public function getEmailConfirmationExpiryDays()
773
    {
774 1
        return $this->emailConfirmationExpiryDays;
775
    }
776
777
    /**
778
     * @param string $ircNotificationsInstance
779
     *
780
     * @return SiteConfiguration
781
     */
782 1
    public function setIrcNotificationsInstance($ircNotificationsInstance)
783
    {
784 1
        $this->ircNotificationsInstance = $ircNotificationsInstance;
785
786 1
        return $this;
787
    }
788
789
    /**
790
     * @return string
791
     */
792 1
    public function getIrcNotificationsInstance()
793
    {
794 1
        return $this->ircNotificationsInstance;
795
    }
796
797
    /**
798
     * @param boolean $titleBlacklistEnabled
799
     *
800
     * @return SiteConfiguration
801
     */
802 1
    public function setTitleBlacklistEnabled($titleBlacklistEnabled)
803
    {
804 1
        $this->titleBlacklistEnabled = $titleBlacklistEnabled;
805
806 1
        return $this;
807
    }
808
809
    /**
810
     * @return boolean
811
     */
812 1
    public function getTitleBlacklistEnabled()
813
    {
814 1
        return $this->titleBlacklistEnabled;
815
    }
816
817
    /**
818
     * @param string|null $locationProviderApiKey
819
     *
820
     * @return SiteConfiguration
821
     */
822 1
    public function setLocationProviderApiKey($locationProviderApiKey)
823
    {
824 1
        $this->locationProviderApiKey = $locationProviderApiKey;
825
826 1
        return $this;
827
    }
828
829
    /**
830
     * @return null|string
831
     */
832 1
    public function getLocationProviderApiKey()
833
    {
834 1
        return $this->locationProviderApiKey;
835
    }
836
837
    /**
838
     * @param array $torExitPaths
839
     *
840
     * @return SiteConfiguration
841
     */
842 1
    public function setTorExitPaths($torExitPaths)
843
    {
844 1
        $this->torExitPaths = $torExitPaths;
845
846 1
        return $this;
847
    }
848
849
    /**
850
     * @return array
851
     */
852 1
    public function getTorExitPaths()
853
    {
854 1
        return $this->torExitPaths;
855
    }
856
857
    /**
858
     * @param string $oauthIdentityGraceTime
859
     *
860
     * @return SiteConfiguration
861
     */
862
    public function setOauthIdentityGraceTime($oauthIdentityGraceTime)
863
    {
864
        $this->oauthIdentityGraceTime = $oauthIdentityGraceTime;
865
866
        return $this;
867
    }
868
869
    /**
870
     * @return string
871
     */
872
    public function getOauthIdentityGraceTime()
873
    {
874
        return $this->oauthIdentityGraceTime;
875
    }
876
877
    /**
878
     * @param string $oauthMediaWikiCanonicalServer
879
     *
880
     * @return SiteConfiguration
881
     */
882
    public function setOauthMediaWikiCanonicalServer($oauthMediaWikiCanonicalServer)
883
    {
884
        $this->oauthMediaWikiCanonicalServer = $oauthMediaWikiCanonicalServer;
885
886
        return $this;
887
    }
888
889
    /**
890
     * @return string
891
     */
892
    public function getOauthMediaWikiCanonicalServer()
893
    {
894
        return $this->oauthMediaWikiCanonicalServer;
895
    }
896
897
    /**
898
     * @param string $creationBotUsername
899
     *
900
     * @return SiteConfiguration
901
     */
902
    public function setCreationBotUsername($creationBotUsername)
903
    {
904
        $this->creationBotUsername = $creationBotUsername;
905
906
        return $this;
907
    }
908
909
    /**
910
     * @return string
911
     */
912
    public function getCreationBotUsername()
913
    {
914
        return $this->creationBotUsername;
915
    }
916
917
    /**
918
     * @param string $creationBotPassword
919
     *
920
     * @return SiteConfiguration
921
     */
922
    public function setCreationBotPassword($creationBotPassword)
923
    {
924
        $this->creationBotPassword = $creationBotPassword;
925
926
        return $this;
927
    }
928
929
    /**
930
     * @return string
931
     */
932
    public function getCreationBotPassword()
933
    {
934
        return $this->creationBotPassword;
935
    }
936
937
    /**
938
     * @param string|null $curlCookieJar
939
     *
940
     * @return SiteConfiguration
941
     */
942
    public function setCurlCookieJar($curlCookieJar)
943
    {
944
        $this->curlCookieJar = $curlCookieJar;
945
946
        return $this;
947
    }
948
949
    /**
950
     * @return string|null
951
     */
952
    public function getCurlCookieJar()
953
    {
954
        return $this->curlCookieJar;
955
    }
956
957
    public function getYubicoApiId()
958
    {
959
        return $this->yubicoApiId;
960
    }
961
962
    public function setYubicoApiId($id)
963
    {
964
        $this->yubicoApiId = $id;
965
966
        return $this;
967
    }
968
969
    public function getYubicoApiKey()
970
    {
971
        return $this->yubicoApiKey;
972
    }
973
974
    public function setYubicoApiKey($key)
975
    {
976
        $this->yubicoApiKey = $key;
977
978
        return $this;
979
    }
980
981
    /**
982
     * @return string
983
     */
984
    public function getTotpEncryptionKey()
985
    {
986
        return $this->totpEncryptionKey;
987
    }
988
989
    /**
990
     * @param string $totpEncryptionKey
991
     *
992
     * @return SiteConfiguration
993
     */
994
    public function setTotpEncryptionKey($totpEncryptionKey)
995
    {
996
        $this->totpEncryptionKey = $totpEncryptionKey;
997
998
        return $this;
999
    }
1000
1001
    /**
1002
     * @return string
1003
     */
1004 1
    public function getIdentificationNoticeboardPage()
1005
    {
1006 1
        return $this->identificationNoticeboardPage;
1007
    }
1008
1009
    /**
1010
     * @param string $identificationNoticeboardPage
1011
     *
1012
     * @return SiteConfiguration
1013
     */
1014
    public function setIdentificationNoticeboardPage($identificationNoticeboardPage)
1015
    {
1016
        $this->identificationNoticeboardPage = $identificationNoticeboardPage;
1017
1018
        return $this;
1019
    }
1020
1021
    public function isRegistrationAllowed(): bool
1022
    {
1023
        return $this->registrationAllowed;
1024
    }
1025
1026
    public function setRegistrationAllowed(bool $registrationAllowed): SiteConfiguration
1027
    {
1028
        $this->registrationAllowed = $registrationAllowed;
1029
1030
        return $this;
1031
    }
1032
1033
    /**
1034
     * @return string|null
1035
     */
1036
    public function getCspReportUri()
1037
    {
1038
        return $this->cspReportUri;
1039
    }
1040
1041
    /**
1042
     * @param string|null $cspReportUri
1043
     *
1044
     * @return SiteConfiguration
1045
     */
1046
    public function setCspReportUri($cspReportUri)
1047
    {
1048
        $this->cspReportUri = $cspReportUri;
1049
1050
        return $this;
1051
    }
1052
1053
    /**
1054
     * @return int
1055
     */
1056
    public function getResourceCacheEpoch(): int
1057
    {
1058
        return $this->resourceCacheEpoch;
1059
    }
1060
1061
    /**
1062
     * @param int $resourceCacheEpoch
1063
     *
1064
     * @return SiteConfiguration
1065
     */
1066
    public function setResourceCacheEpoch(int $resourceCacheEpoch): SiteConfiguration
1067
    {
1068
        $this->resourceCacheEpoch = $resourceCacheEpoch;
1069
1070
        return $this;
1071
    }
1072
1073
    /**
1074
     * @return array
1075
     */
1076
    public function getCommonEmailDomains(): array
1077
    {
1078
        return $this->commonEmailDomains;
1079
    }
1080
1081
    /**
1082
     * @param array $commonEmailDomains
1083
     *
1084
     * @return SiteConfiguration
1085
     */
1086
    public function setCommonEmailDomains(array $commonEmailDomains): SiteConfiguration
1087
    {
1088
        $this->commonEmailDomains = $commonEmailDomains;
1089
1090
        return $this;
1091
    }
1092
1093
    /**
1094
     * @param int[] $banMaxIpBlockRange
1095
     *
1096
     * @return SiteConfiguration
1097
     */
1098
    public function setBanMaxIpBlockRange(array $banMaxIpBlockRange): SiteConfiguration
1099
    {
1100
        $this->banMaxIpBlockRange = $banMaxIpBlockRange;
1101
1102
        return $this;
1103
    }
1104
1105
    /**
1106
     * @return int[]
1107
     */
1108
    public function getBanMaxIpBlockRange(): array
1109
    {
1110
        return $this->banMaxIpBlockRange;
1111
    }
1112
1113
    /**
1114
     * @param int[] $banMaxIpRange
1115
     *
1116
     * @return SiteConfiguration
1117
     */
1118
    public function setBanMaxIpRange(array $banMaxIpRange): SiteConfiguration
1119
    {
1120
        $this->banMaxIpRange = $banMaxIpRange;
1121
1122
        return $this;
1123
    }
1124
1125
    /**
1126
     * @return int[]
1127
     */
1128
    public function getBanMaxIpRange(): array
1129
    {
1130
        return $this->banMaxIpRange;
1131
    }
1132
1133
    /**
1134
     * @param array $oauthLegacyConsumerTokens
1135
     *
1136
     * @return SiteConfiguration
1137
     */
1138
    public function setOauthLegacyConsumerTokens(array $oauthLegacyConsumerTokens): SiteConfiguration
1139
    {
1140
        $this->oauthLegacyConsumerTokens = $oauthLegacyConsumerTokens;
1141
1142
        return $this;
1143
    }
1144
1145
    /**
1146
     * @return array
1147
     */
1148
    public function getOauthLegacyConsumerTokens(): array
1149
    {
1150
        return $this->oauthLegacyConsumerTokens;
1151
    }
1152
1153
    /**
1154
     * @return int
1155
     */
1156
    public function getJobQueueBatchSize(): int
1157
    {
1158
        return $this->jobQueueBatchSize;
1159
    }
1160
1161
    /**
1162
     * @param int $jobQueueBatchSize
1163
     *
1164
     * @return SiteConfiguration
1165
     */
1166
    public function setJobQueueBatchSize(int $jobQueueBatchSize): SiteConfiguration
1167
    {
1168
        $this->jobQueueBatchSize = $jobQueueBatchSize;
1169
1170
        return $this;
1171
}
1172
}
1173