Passed
Push — bantools ( 1cbaa6...d648f7 )
by Simon
04:04
created

SiteConfiguration::getBanMaxIpBlockRange()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

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