Completed
Push — multiproject/db ( 3bc833...5daa57 )
by Simon
17:59 queued 13:50
created

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

393
        return /** @scrutinizer ignore-deprecated */ $this->requestStates;
Loading history...
394
    }
395
396
    /**
397
     * @param array $requestStates
398
     *
399
     * @return SiteConfiguration
400
     * @deprecated To be removed after dynamic queues hit production. This will need to be major point release.
401
     */
402
    public function setRequestStates($requestStates)
403
    {
404
        $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

404
        /** @scrutinizer ignore-deprecated */ $this->requestStates = $requestStates;
Loading history...
405
406
        return $this;
407
    }
408
409
    /**
410
     * @return array
411
     */
412 1
    public function getSquidList()
413
    {
414 1
        return $this->squidList;
415
    }
416
417
    /**
418
     * @param array $squidList
419
     *
420
     * @return SiteConfiguration
421
     */
422 1
    public function setSquidList($squidList)
423
    {
424 1
        $this->squidList = $squidList;
425
426 1
        return $this;
427
    }
428
429
    /**
430
     * @return int
431
     * @deprecated
432
     */
433
    public function getDefaultCreatedTemplateId()
434
    {
435
        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

435
        return /** @scrutinizer ignore-deprecated */ $this->defaultCreatedTemplateId;
Loading history...
436
    }
437
438
    /**
439
     * @param int $defaultCreatedTemplateId
440
     * @deprecated
441
     * @return SiteConfiguration
442
     */
443
    public function setDefaultCreatedTemplateId($defaultCreatedTemplateId)
444
    {
445
        $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

445
        /** @scrutinizer ignore-deprecated */ $this->defaultCreatedTemplateId = $defaultCreatedTemplateId;
Loading history...
446
447
        return $this;
448
    }
449
450
    /**
451
     * @return string
452
     * @deprecated
453
     */
454
    public function getDefaultRequestStateKey()
455
    {
456
        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

456
        return /** @scrutinizer ignore-deprecated */ $this->defaultRequestStateKey;
Loading history...
457
    }
458
459
    /**
460
     * @param string $defaultRequestStateKey
461
     *
462
     * @return SiteConfiguration
463
     * @deprecated
464
     */
465
    public function setDefaultRequestStateKey($defaultRequestStateKey)
466
    {
467
        $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

467
        /** @scrutinizer ignore-deprecated */ $this->defaultRequestStateKey = $defaultRequestStateKey;
Loading history...
468
469
        return $this;
470
    }
471
472
    /**
473
     * @return string
474
     * @deprecated
475
     */
476
    public function getDefaultRequestDeferredStateKey()
477
    {
478
        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

478
        return /** @scrutinizer ignore-deprecated */ $this->defaultRequestDeferredStateKey;
Loading history...
479
    }
480
481
    /**
482
     * @param string $defaultRequestDeferredStateKey
483
     *
484
     * @return SiteConfiguration
485
     * @deprecated
486
     */
487
    public function setDefaultRequestDeferredStateKey($defaultRequestDeferredStateKey)
488
    {
489
        $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

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