Passed
Push — comment-flagging ( 6669bb...9d978e )
by Simon
06:56 queued 02:53
created

SiteConfiguration::setDataClearEmail()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

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

409
        return /** @scrutinizer ignore-deprecated */ $this->requestStates;
Loading history...
410
    }
411
412
    /**
413
     * @param array $requestStates
414
     *
415
     * @return SiteConfiguration
416
     * @deprecated To be removed after dynamic queues hit production. This will need to be major point release.
417
     */
418
    public function setRequestStates($requestStates)
419
    {
420
        $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

420
        /** @scrutinizer ignore-deprecated */ $this->requestStates = $requestStates;
Loading history...
421
422
        return $this;
423
    }
424
425
    /**
426
     * @return array
427
     */
428 1
    public function getSquidList()
429
    {
430 1
        return $this->squidList;
431
    }
432
433
    /**
434
     * @param array $squidList
435
     *
436
     * @return SiteConfiguration
437
     */
438 1
    public function setSquidList($squidList)
439
    {
440 1
        $this->squidList = $squidList;
441
442 1
        return $this;
443
    }
444
445
    /**
446
     * @return int
447
     * @deprecated
448
     */
449
    public function getDefaultCreatedTemplateId()
450
    {
451
        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

451
        return /** @scrutinizer ignore-deprecated */ $this->defaultCreatedTemplateId;
Loading history...
452
    }
453
454
    /**
455
     * @param int $defaultCreatedTemplateId
456
     * @deprecated
457
     * @return SiteConfiguration
458
     */
459
    public function setDefaultCreatedTemplateId($defaultCreatedTemplateId)
460
    {
461
        $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

461
        /** @scrutinizer ignore-deprecated */ $this->defaultCreatedTemplateId = $defaultCreatedTemplateId;
Loading history...
462
463
        return $this;
464
    }
465
466
    /**
467
     * @return string
468
     * @deprecated
469
     */
470
    public function getDefaultRequestStateKey()
471
    {
472
        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

472
        return /** @scrutinizer ignore-deprecated */ $this->defaultRequestStateKey;
Loading history...
473
    }
474
475
    /**
476
     * @param string $defaultRequestStateKey
477
     *
478
     * @return SiteConfiguration
479
     * @deprecated
480
     */
481
    public function setDefaultRequestStateKey($defaultRequestStateKey)
482
    {
483
        $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

483
        /** @scrutinizer ignore-deprecated */ $this->defaultRequestStateKey = $defaultRequestStateKey;
Loading history...
484
485
        return $this;
486
    }
487
488
    /**
489
     * @return string
490
     * @deprecated
491
     */
492
    public function getDefaultRequestDeferredStateKey()
493
    {
494
        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

494
        return /** @scrutinizer ignore-deprecated */ $this->defaultRequestDeferredStateKey;
Loading history...
495
    }
496
497
    /**
498
     * @param string $defaultRequestDeferredStateKey
499
     *
500
     * @return SiteConfiguration
501
     * @deprecated
502
     */
503
    public function setDefaultRequestDeferredStateKey($defaultRequestDeferredStateKey)
504
    {
505
        $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

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