Failed Conditions
Push — dependabot/npm_and_yarn/sass-1... ( 173e70...4078c3 )
by
unknown
14:54 queued 09:32
created
includes/Pages/Statistics/StatsUsers.php 1 patch
Indentation   +93 added lines, -93 removed lines patch added patch discarded remove patch
@@ -25,13 +25,13 @@  discard block
 block discarded – undo
25 25
 
26 26
 class StatsUsers extends InternalPageBase
27 27
 {
28
-    public function main()
29
-    {
30
-        $this->setHtmlTitle('Users :: Statistics');
28
+	public function main()
29
+	{
30
+		$this->setHtmlTitle('Users :: Statistics');
31 31
 
32
-        $database = $this->getDatabase();
32
+		$database = $this->getDatabase();
33 33
 
34
-        $query = <<<SQL
34
+		$query = <<<SQL
35 35
 SELECT
36 36
     u.id
37 37
     , u.username
@@ -47,34 +47,34 @@  discard block
 block discarded – undo
47 47
 WHERE u.status = 'Active'
48 48
 SQL;
49 49
 
50
-        $users = $database->query($query)->fetchAll(PDO::FETCH_ASSOC);
51
-        $this->assign('users', $users);
50
+		$users = $database->query($query)->fetchAll(PDO::FETCH_ASSOC);
51
+		$this->assign('users', $users);
52 52
 
53
-        $this->assign('statsPageTitle', 'Account Creation Tool users');
54
-        $this->setTemplate("statistics/users.tpl");
55
-    }
53
+		$this->assign('statsPageTitle', 'Account Creation Tool users');
54
+		$this->setTemplate("statistics/users.tpl");
55
+	}
56 56
 
57
-    /**
58
-     * Entry point for the detail action.
59
-     *
60
-     * @throws ApplicationLogicException
61
-     */
62
-    protected function detail()
63
-    {
64
-        $userId = WebRequest::getInt('user');
65
-        if ($userId === null) {
66
-            throw new ApplicationLogicException("User not found");
67
-        }
57
+	/**
58
+	 * Entry point for the detail action.
59
+	 *
60
+	 * @throws ApplicationLogicException
61
+	 */
62
+	protected function detail()
63
+	{
64
+		$userId = WebRequest::getInt('user');
65
+		if ($userId === null) {
66
+			throw new ApplicationLogicException("User not found");
67
+		}
68 68
 
69
-        $database = $this->getDatabase();
69
+		$database = $this->getDatabase();
70 70
 
71
-        $user = User::getById($userId, $database);
72
-        if ($user == false) {
73
-            throw new ApplicationLogicException('User not found');
74
-        }
71
+		$user = User::getById($userId, $database);
72
+		if ($user == false) {
73
+			throw new ApplicationLogicException('User not found');
74
+		}
75 75
 
76 76
 
77
-        $activitySummary = $database->prepare(<<<SQL
77
+		$activitySummary = $database->prepare(<<<SQL
78 78
 SELECT COALESCE(closes.mail_desc, log.action) AS action, COUNT(*) AS count
79 79
 FROM log
80 80
 INNER JOIN user ON log.user = user.id
@@ -82,14 +82,14 @@  discard block
 block discarded – undo
82 82
 WHERE user.username = :username
83 83
 GROUP BY action;
84 84
 SQL
85
-        );
86
-        $activitySummary->execute(array(":username" => $user->getUsername()));
87
-        $activitySummaryData = $activitySummary->fetchAll(PDO::FETCH_ASSOC);
85
+		);
86
+		$activitySummary->execute(array(":username" => $user->getUsername()));
87
+		$activitySummaryData = $activitySummary->fetchAll(PDO::FETCH_ASSOC);
88 88
 
89
-        $this->assign("user", $user);
90
-        $this->assign("activity", $activitySummaryData);
89
+		$this->assign("user", $user);
90
+		$this->assign("activity", $activitySummaryData);
91 91
 
92
-        $usersCreatedQuery = $database->prepare(<<<SQL
92
+		$usersCreatedQuery = $database->prepare(<<<SQL
93 93
 SELECT log.timestamp time, request.name name, request.id id
94 94
 FROM log
95 95
 INNER JOIN request ON (request.id = log.objectid AND log.objecttype = 'Request')
@@ -100,12 +100,12 @@  discard block
 block discarded – undo
100 100
     AND (emailtemplate.defaultaction = :created OR log.action = 'Closed custom-y')
101 101
 ORDER BY log.timestamp;
102 102
 SQL
103
-        );
104
-        $usersCreatedQuery->execute(array(":username" => $user->getUsername(), ':created' => EmailTemplate::ACTION_CREATED));
105
-        $usersCreated = $usersCreatedQuery->fetchAll(PDO::FETCH_ASSOC);
106
-        $this->assign("created", $usersCreated);
103
+		);
104
+		$usersCreatedQuery->execute(array(":username" => $user->getUsername(), ':created' => EmailTemplate::ACTION_CREATED));
105
+		$usersCreated = $usersCreatedQuery->fetchAll(PDO::FETCH_ASSOC);
106
+		$this->assign("created", $usersCreated);
107 107
 
108
-        $usersNotCreatedQuery = $database->prepare(<<<SQL
108
+		$usersNotCreatedQuery = $database->prepare(<<<SQL
109 109
 SELECT log.timestamp time, request.name name, request.id id
110 110
 FROM log
111 111
 JOIN request ON request.id = log.objectid AND log.objecttype = 'Request'
@@ -116,59 +116,59 @@  discard block
 block discarded – undo
116 116
     AND (emailtemplate.defaultaction = :created OR log.action = 'Closed custom-n' OR log.action = 'Closed 0')
117 117
 ORDER BY log.timestamp;
118 118
 SQL
119
-        );
120
-        $usersNotCreatedQuery->execute(array(":username" => $user->getUsername(), ':created' => EmailTemplate::ACTION_NOT_CREATED));
121
-        $usersNotCreated = $usersNotCreatedQuery->fetchAll(PDO::FETCH_ASSOC);
122
-        $this->assign("notcreated", $usersNotCreated);
123
-
124
-        /** @var Log[] $logs */
125
-        $logs = LogSearchHelper::get($database, Domain::getCurrent($database)->getId())
126
-            ->byObjectType('User')
127
-            ->byObjectId($user->getId())
128
-            ->getRecordCount($logCount)
129
-            ->fetch();
130
-
131
-        if ($logCount === 0) {
132
-            $this->assign('accountlog', array());
133
-        }
134
-        else {
135
-            list($users, $logData) = LogHelper::prepareLogsForTemplate($logs, $database, $this->getSiteConfiguration(), $this->getSecurityManager());
136
-
137
-            $this->assign("accountlog", $logData);
138
-            $this->assign("users", $users);
139
-        }
140
-
141
-        $currentUser = User::getCurrent($database);
142
-        $this->assign('canApprove', $this->barrierTest('approve', $currentUser, PageUserManagement::class));
143
-        $this->assign('canDeactivate', $this->barrierTest('deactivate', $currentUser, PageUserManagement::class));
144
-        $this->assign('canRename', $this->barrierTest('rename', $currentUser, PageUserManagement::class));
145
-        $this->assign('canEditUser', $this->barrierTest('editUser', $currentUser, PageUserManagement::class));
146
-        $this->assign('canEditRoles', $this->barrierTest('editRoles', $currentUser, PageUserManagement::class));
147
-
148
-        $oauth = new OAuthUserHelper($user, $database, $this->getOAuthProtocolHelper(), $this->getSiteConfiguration());
149
-        $this->assign('oauth', $oauth);
150
-
151
-        if ($user->getForceIdentified() === null) {
152
-            $idVerifier = new IdentificationVerifier($this->getHttpHelper(), $this->getSiteConfiguration(), $this->getDatabase());
153
-            $this->assign('identificationStatus', $idVerifier->isUserIdentified($user->getOnWikiName()) ? 'detected' : 'missing');
154
-        }
155
-        else {
156
-            $this->assign('identificationStatus', $user->getForceIdentified() == 1 ? 'forced-on' : 'forced-off');
157
-        }
158
-
159
-        if ($oauth->isFullyLinked()) {
160
-            $this->assign('identity', $oauth->getIdentity(true));
161
-            $this->assign('identityExpired', $oauth->identityExpired());
162
-        }
163
-
164
-        $this->assign('statsPageTitle', 'Account Creation Tool users');
165
-
166
-        // FIXME: domains!
167
-        /** @var Domain $domain */
168
-        $domain = Domain::getById(1, $this->getDatabase());
169
-        $this->assign('mediawikiScriptPath', $domain->getWikiArticlePath());
170
-
171
-        $this->setHtmlTitle('{$user->getUsername()|escape} :: Users :: Statistics');
172
-        $this->setTemplate("statistics/userdetail.tpl");
173
-    }
119
+		);
120
+		$usersNotCreatedQuery->execute(array(":username" => $user->getUsername(), ':created' => EmailTemplate::ACTION_NOT_CREATED));
121
+		$usersNotCreated = $usersNotCreatedQuery->fetchAll(PDO::FETCH_ASSOC);
122
+		$this->assign("notcreated", $usersNotCreated);
123
+
124
+		/** @var Log[] $logs */
125
+		$logs = LogSearchHelper::get($database, Domain::getCurrent($database)->getId())
126
+			->byObjectType('User')
127
+			->byObjectId($user->getId())
128
+			->getRecordCount($logCount)
129
+			->fetch();
130
+
131
+		if ($logCount === 0) {
132
+			$this->assign('accountlog', array());
133
+		}
134
+		else {
135
+			list($users, $logData) = LogHelper::prepareLogsForTemplate($logs, $database, $this->getSiteConfiguration(), $this->getSecurityManager());
136
+
137
+			$this->assign("accountlog", $logData);
138
+			$this->assign("users", $users);
139
+		}
140
+
141
+		$currentUser = User::getCurrent($database);
142
+		$this->assign('canApprove', $this->barrierTest('approve', $currentUser, PageUserManagement::class));
143
+		$this->assign('canDeactivate', $this->barrierTest('deactivate', $currentUser, PageUserManagement::class));
144
+		$this->assign('canRename', $this->barrierTest('rename', $currentUser, PageUserManagement::class));
145
+		$this->assign('canEditUser', $this->barrierTest('editUser', $currentUser, PageUserManagement::class));
146
+		$this->assign('canEditRoles', $this->barrierTest('editRoles', $currentUser, PageUserManagement::class));
147
+
148
+		$oauth = new OAuthUserHelper($user, $database, $this->getOAuthProtocolHelper(), $this->getSiteConfiguration());
149
+		$this->assign('oauth', $oauth);
150
+
151
+		if ($user->getForceIdentified() === null) {
152
+			$idVerifier = new IdentificationVerifier($this->getHttpHelper(), $this->getSiteConfiguration(), $this->getDatabase());
153
+			$this->assign('identificationStatus', $idVerifier->isUserIdentified($user->getOnWikiName()) ? 'detected' : 'missing');
154
+		}
155
+		else {
156
+			$this->assign('identificationStatus', $user->getForceIdentified() == 1 ? 'forced-on' : 'forced-off');
157
+		}
158
+
159
+		if ($oauth->isFullyLinked()) {
160
+			$this->assign('identity', $oauth->getIdentity(true));
161
+			$this->assign('identityExpired', $oauth->identityExpired());
162
+		}
163
+
164
+		$this->assign('statsPageTitle', 'Account Creation Tool users');
165
+
166
+		// FIXME: domains!
167
+		/** @var Domain $domain */
168
+		$domain = Domain::getById(1, $this->getDatabase());
169
+		$this->assign('mediawikiScriptPath', $domain->getWikiArticlePath());
170
+
171
+		$this->setHtmlTitle('{$user->getUsername()|escape} :: Users :: Statistics');
172
+		$this->setTemplate("statistics/userdetail.tpl");
173
+	}
174 174
 }
Please login to merge, or discard this patch.
includes/Pages/RequestAction/PageCreateRequest.php 1 patch
Indentation   +152 added lines, -152 removed lines patch added patch discarded remove patch
@@ -35,156 +35,156 @@
 block discarded – undo
35 35
  */
36 36
 class PageCreateRequest extends RequestActionBase
37 37
 {
38
-    /**
39
-     * Main function for this page, when no specific actions are called.
40
-     * @return void
41
-     * @throws AccessDeniedException
42
-     * @throws ApplicationLogicException
43
-     */
44
-    protected function main()
45
-    {
46
-        $this->checkPosted();
47
-
48
-        $database = $this->getDatabase();
49
-
50
-        $request = $this->getRequest($database);
51
-        $template = $this->getTemplate($database);
52
-        $creationMode = $this->getCreationMode();
53
-        $user = User::getCurrent($database);
54
-        $preferencesManager = PreferenceManager::getForCurrent($database);
55
-
56
-        $secMgr = $this->getSecurityManager();
57
-        if ($secMgr->allows('RequestCreation', PreferenceManager::CREATION_BOT, $user) !== ISecurityManager::ALLOWED
58
-            && $creationMode === 'bot'
59
-        ) {
60
-            throw new AccessDeniedException($secMgr, $this->getDomainAccessManager());
61
-        }
62
-        elseif ($secMgr->allows('RequestCreation', PreferenceManager::CREATION_OAUTH, $user) !== ISecurityManager::ALLOWED
63
-            && $creationMode === 'oauth'
64
-        ) {
65
-            throw new AccessDeniedException($secMgr, $this->getDomainAccessManager());
66
-        }
67
-
68
-        if ($request->getEmailSent()) {
69
-            throw new ApplicationLogicException('This requester has already had an email sent to them. Please fall back to manual creation or a custom close');
70
-        }
71
-
72
-        $request->setStatus(RequestStatus::JOBQUEUE);
73
-        $request->setReserved(null);
74
-        $request->save();
75
-
76
-        Logger::enqueuedJobQueue($database, $request);
77
-
78
-        $creationTaskId = $this->enqueueCreationTask($creationMode, $request, $template, $user, $database);
79
-
80
-        $welcomeTemplate = $preferencesManager->getPreference(PreferenceManager::PREF_WELCOMETEMPLATE);
81
-        if ($welcomeTemplate !== null && !WebRequest::postBoolean('skipAutoWelcome')) {
82
-            $this->enqueueWelcomeTask($request, $creationTaskId, $user, $database);
83
-        }
84
-
85
-        $this->getNotificationHelper()->requestCloseQueued($request, $template->getName());
86
-
87
-        SessionAlert::success("Request {$request->getId()} has been queued for autocreation");
88
-
89
-        $this->redirect();
90
-    }
91
-
92
-    protected function getCreationMode()
93
-    {
94
-        $creationMode = WebRequest::postString('mode');
95
-        if ($creationMode !== 'oauth' && $creationMode !== 'bot') {
96
-            throw new ApplicationLogicException('Unknown creation mode');
97
-        }
98
-
99
-        return $creationMode;
100
-    }
101
-
102
-    /**
103
-     * @param PdoDatabase $database
104
-     *
105
-     * @return EmailTemplate
106
-     * @throws ApplicationLogicException
107
-     */
108
-    protected function getTemplate(PdoDatabase $database)
109
-    {
110
-        $templateId = WebRequest::postInt('template');
111
-        if ($templateId === null) {
112
-            throw new ApplicationLogicException('No template specified');
113
-        }
114
-
115
-        /** @var EmailTemplate $template */
116
-        $template = EmailTemplate::getById($templateId, $database);
117
-        if ($template === false || !$template->getActive()) {
118
-            throw new ApplicationLogicException('Invalid or inactive template specified');
119
-        }
120
-
121
-        if ($template->getDefaultAction() !== EmailTemplate::ACTION_CREATED) {
122
-            throw new ApplicationLogicException('Specified template is not a creation template!');
123
-        }
124
-
125
-        return $template;
126
-    }
127
-
128
-    /**
129
-     * @param PdoDatabase $database
130
-     *
131
-     * @return Request
132
-     * @throws ApplicationLogicException
133
-     */
134
-    protected function getRequest(PdoDatabase $database)
135
-    {
136
-        $request = parent::getRequest($database);
137
-
138
-        if ($request->getStatus() == RequestStatus::CLOSED) {
139
-            throw new ApplicationLogicException('Request is already closed');
140
-        }
141
-
142
-        return $request;
143
-    }
144
-
145
-    /**
146
-     * @param               $creationMode
147
-     * @param Request       $request
148
-     * @param EmailTemplate $template
149
-     * @param User          $user
150
-     *
151
-     * @param PdoDatabase   $database
152
-     *
153
-     * @return int
154
-     * @throws ApplicationLogicException
155
-     */
156
-    protected function enqueueCreationTask(
157
-        $creationMode,
158
-        Request $request,
159
-        EmailTemplate $template,
160
-        User $user,
161
-        PdoDatabase $database
162
-    ) {
163
-        $creationTaskClass = null;
164
-
165
-        if ($creationMode == "oauth") {
166
-            $creationTaskClass = UserCreationTask::class;
167
-        }
168
-
169
-        if ($creationMode == "bot") {
170
-            $creationTaskClass = BotCreationTask::class;
171
-        }
172
-
173
-        if ($creationTaskClass === null) {
174
-            throw new ApplicationLogicException('Cannot determine creation mode');
175
-        }
176
-
177
-        $creationTask = new JobQueue();
178
-        $creationTask->setDomain(1); // FIXME: domains!
179
-        $creationTask->setTask($creationTaskClass);
180
-        $creationTask->setRequest($request->getId());
181
-        $creationTask->setEmailTemplate($template->getId());
182
-        $creationTask->setTriggerUserId($user->getId());
183
-        $creationTask->setDatabase($database);
184
-        $creationTask->save();
185
-
186
-        $creationTaskId = $creationTask->getId();
187
-
188
-        return $creationTaskId;
189
-    }
38
+	/**
39
+	 * Main function for this page, when no specific actions are called.
40
+	 * @return void
41
+	 * @throws AccessDeniedException
42
+	 * @throws ApplicationLogicException
43
+	 */
44
+	protected function main()
45
+	{
46
+		$this->checkPosted();
47
+
48
+		$database = $this->getDatabase();
49
+
50
+		$request = $this->getRequest($database);
51
+		$template = $this->getTemplate($database);
52
+		$creationMode = $this->getCreationMode();
53
+		$user = User::getCurrent($database);
54
+		$preferencesManager = PreferenceManager::getForCurrent($database);
55
+
56
+		$secMgr = $this->getSecurityManager();
57
+		if ($secMgr->allows('RequestCreation', PreferenceManager::CREATION_BOT, $user) !== ISecurityManager::ALLOWED
58
+			&& $creationMode === 'bot'
59
+		) {
60
+			throw new AccessDeniedException($secMgr, $this->getDomainAccessManager());
61
+		}
62
+		elseif ($secMgr->allows('RequestCreation', PreferenceManager::CREATION_OAUTH, $user) !== ISecurityManager::ALLOWED
63
+			&& $creationMode === 'oauth'
64
+		) {
65
+			throw new AccessDeniedException($secMgr, $this->getDomainAccessManager());
66
+		}
67
+
68
+		if ($request->getEmailSent()) {
69
+			throw new ApplicationLogicException('This requester has already had an email sent to them. Please fall back to manual creation or a custom close');
70
+		}
71
+
72
+		$request->setStatus(RequestStatus::JOBQUEUE);
73
+		$request->setReserved(null);
74
+		$request->save();
75
+
76
+		Logger::enqueuedJobQueue($database, $request);
77
+
78
+		$creationTaskId = $this->enqueueCreationTask($creationMode, $request, $template, $user, $database);
79
+
80
+		$welcomeTemplate = $preferencesManager->getPreference(PreferenceManager::PREF_WELCOMETEMPLATE);
81
+		if ($welcomeTemplate !== null && !WebRequest::postBoolean('skipAutoWelcome')) {
82
+			$this->enqueueWelcomeTask($request, $creationTaskId, $user, $database);
83
+		}
84
+
85
+		$this->getNotificationHelper()->requestCloseQueued($request, $template->getName());
86
+
87
+		SessionAlert::success("Request {$request->getId()} has been queued for autocreation");
88
+
89
+		$this->redirect();
90
+	}
91
+
92
+	protected function getCreationMode()
93
+	{
94
+		$creationMode = WebRequest::postString('mode');
95
+		if ($creationMode !== 'oauth' && $creationMode !== 'bot') {
96
+			throw new ApplicationLogicException('Unknown creation mode');
97
+		}
98
+
99
+		return $creationMode;
100
+	}
101
+
102
+	/**
103
+	 * @param PdoDatabase $database
104
+	 *
105
+	 * @return EmailTemplate
106
+	 * @throws ApplicationLogicException
107
+	 */
108
+	protected function getTemplate(PdoDatabase $database)
109
+	{
110
+		$templateId = WebRequest::postInt('template');
111
+		if ($templateId === null) {
112
+			throw new ApplicationLogicException('No template specified');
113
+		}
114
+
115
+		/** @var EmailTemplate $template */
116
+		$template = EmailTemplate::getById($templateId, $database);
117
+		if ($template === false || !$template->getActive()) {
118
+			throw new ApplicationLogicException('Invalid or inactive template specified');
119
+		}
120
+
121
+		if ($template->getDefaultAction() !== EmailTemplate::ACTION_CREATED) {
122
+			throw new ApplicationLogicException('Specified template is not a creation template!');
123
+		}
124
+
125
+		return $template;
126
+	}
127
+
128
+	/**
129
+	 * @param PdoDatabase $database
130
+	 *
131
+	 * @return Request
132
+	 * @throws ApplicationLogicException
133
+	 */
134
+	protected function getRequest(PdoDatabase $database)
135
+	{
136
+		$request = parent::getRequest($database);
137
+
138
+		if ($request->getStatus() == RequestStatus::CLOSED) {
139
+			throw new ApplicationLogicException('Request is already closed');
140
+		}
141
+
142
+		return $request;
143
+	}
144
+
145
+	/**
146
+	 * @param               $creationMode
147
+	 * @param Request       $request
148
+	 * @param EmailTemplate $template
149
+	 * @param User          $user
150
+	 *
151
+	 * @param PdoDatabase   $database
152
+	 *
153
+	 * @return int
154
+	 * @throws ApplicationLogicException
155
+	 */
156
+	protected function enqueueCreationTask(
157
+		$creationMode,
158
+		Request $request,
159
+		EmailTemplate $template,
160
+		User $user,
161
+		PdoDatabase $database
162
+	) {
163
+		$creationTaskClass = null;
164
+
165
+		if ($creationMode == "oauth") {
166
+			$creationTaskClass = UserCreationTask::class;
167
+		}
168
+
169
+		if ($creationMode == "bot") {
170
+			$creationTaskClass = BotCreationTask::class;
171
+		}
172
+
173
+		if ($creationTaskClass === null) {
174
+			throw new ApplicationLogicException('Cannot determine creation mode');
175
+		}
176
+
177
+		$creationTask = new JobQueue();
178
+		$creationTask->setDomain(1); // FIXME: domains!
179
+		$creationTask->setTask($creationTaskClass);
180
+		$creationTask->setRequest($request->getId());
181
+		$creationTask->setEmailTemplate($template->getId());
182
+		$creationTask->setTriggerUserId($user->getId());
183
+		$creationTask->setDatabase($database);
184
+		$creationTask->save();
185
+
186
+		$creationTaskId = $creationTask->getId();
187
+
188
+		return $creationTaskId;
189
+	}
190 190
 }
Please login to merge, or discard this patch.
includes/Pages/PageListFlaggedComments.php 1 patch
Indentation   +108 added lines, -108 removed lines patch added patch discarded remove patch
@@ -18,112 +18,112 @@
 block discarded – undo
18 18
 
19 19
 class PageListFlaggedComments extends InternalPageBase
20 20
 {
21
-    /**
22
-     * @inheritDoc
23
-     */
24
-    protected function main()
25
-    {
26
-        $this->setHtmlTitle('Flagged comments');
27
-        $this->setTemplate('flagged-comments.tpl');
28
-
29
-        $database = $this->getDatabase();
30
-        $this->assignCSRFToken();
31
-
32
-        /** @var Comment[] $commentObjects */
33
-        $commentObjects = Comment::getFlaggedComments($database, 1); // FIXME: domains
34
-        $comments = [];
35
-
36
-        $currentUser = User::getCurrent($database);
37
-
38
-        $seeRestrictedComments = $this->barrierTest('seeRestrictedComments', $currentUser, 'RequestData');
39
-        $seeCheckuserComments = $this->barrierTest('seeCheckuserComments', $currentUser, 'RequestData');
40
-        $alwaysSeePrivateData = $this->barrierTest('alwaysSeePrivateData', $currentUser, 'RequestData');
41
-
42
-        foreach ($commentObjects as $object) {
43
-            $data = [
44
-                'visibility'    => $object->getVisibility(),
45
-                'hidden'        => false,
46
-                'hiddenText'    => false,
47
-            ];
48
-
49
-            if (!$alwaysSeePrivateData) {
50
-                // tl;dr: This is a stupid configuration, but let's account for it anyway.
51
-                //
52
-                // Flagged comments are treated as private data. If you don't have the privilege
53
-                // RequestData::alwaysSeePrivateData, then we can't show you the content of the comments here.
54
-                // This page is forced to degrade into basically a list of requests, seriously hampering the usefulness
55
-                // of this page. Still, we need to handle the case where we have access to this page, but not access
56
-                // to private data.
57
-                // At the time of writing, this case does not exist in the current role configuration, but for the role
58
-                // configuration to be free of assumptions, we need this code.
59
-
60
-                /** @var Request $request */
61
-                $request = Request::getById($object->getRequest(), $database);
62
-
63
-                if ($request->getReserved() === $currentUser->getId()) {
64
-                    $data['hiddenText'] = false;
65
-                }
66
-                else {
67
-                    $data['hiddenText'] = true;
68
-                }
69
-            }
70
-
71
-            if ($object->getVisibility() == 'requester' || $object->getVisibility() == 'user') {
72
-                $data['hidden'] = false;
73
-            }
74
-            elseif ($object->getVisibility() == 'admin') {
75
-                if ($seeRestrictedComments) {
76
-                    $data['hidden'] = false;
77
-                }
78
-                else {
79
-                    $data['hidden'] = true;
80
-                }
81
-            }
82
-            elseif ($object->getVisibility() == 'checkuser') {
83
-                if ($seeCheckuserComments) {
84
-                    $data['hidden'] = false;
85
-                }
86
-                else {
87
-                    $data['hidden'] = true;
88
-                }
89
-            }
90
-
91
-            $this->copyCommentData($object, $data, $database);
92
-
93
-            $comments[] = $data;
94
-        }
95
-
96
-        $this->assign('comments', $comments);
97
-        $this->assign('seeRestrictedComments', $seeRestrictedComments);
98
-        $this->assign('seeCheckuserComments', $seeCheckuserComments);
99
-
100
-        $this->assign('editOthersComments', $this->barrierTest('editOthers', $currentUser, PageEditComment::class));
101
-        $this->assign('editComments', $this->barrierTest(RoleConfigurationBase::MAIN, $currentUser, PageEditComment::class));
102
-        $this->assign('canUnflag', $this->barrierTest('unflag', $currentUser, PageFlagComment::class) && $this->barrierTest(RoleConfigurationBase::MAIN, $currentUser, PageFlagComment::class));
103
-    }
104
-
105
-    private function copyCommentData(Comment $object, array &$data, PdoDatabase $database): void
106
-    {
107
-        if ($data['hidden']) {
108
-            // All details hidden, so don't copy anything.
109
-            return;
110
-        }
111
-
112
-        /** @var Request $request */
113
-        $request = Request::getById($object->getRequest(), $database);
114
-
115
-        if (!$data['hiddenText']) {
116
-            // Comment text is hidden, but presence of the comment is visible.
117
-            $data['comment'] = $object->getComment();
118
-        }
119
-
120
-        $data['id'] = $object->getId();
121
-        $data['updateversion'] = $object->getUpdateVersion();
122
-        $data['time'] = $object->getTime();
123
-        $data['requestid'] = $object->getRequest();
124
-        $data['request'] = $request->getName();
125
-        $data['requeststatus'] = $request->getStatus();
126
-        $data['userid'] = $object->getUser();
127
-        $data['user'] = User::getById($object->getUser(), $database)->getUsername();
128
-    }
21
+	/**
22
+	 * @inheritDoc
23
+	 */
24
+	protected function main()
25
+	{
26
+		$this->setHtmlTitle('Flagged comments');
27
+		$this->setTemplate('flagged-comments.tpl');
28
+
29
+		$database = $this->getDatabase();
30
+		$this->assignCSRFToken();
31
+
32
+		/** @var Comment[] $commentObjects */
33
+		$commentObjects = Comment::getFlaggedComments($database, 1); // FIXME: domains
34
+		$comments = [];
35
+
36
+		$currentUser = User::getCurrent($database);
37
+
38
+		$seeRestrictedComments = $this->barrierTest('seeRestrictedComments', $currentUser, 'RequestData');
39
+		$seeCheckuserComments = $this->barrierTest('seeCheckuserComments', $currentUser, 'RequestData');
40
+		$alwaysSeePrivateData = $this->barrierTest('alwaysSeePrivateData', $currentUser, 'RequestData');
41
+
42
+		foreach ($commentObjects as $object) {
43
+			$data = [
44
+				'visibility'    => $object->getVisibility(),
45
+				'hidden'        => false,
46
+				'hiddenText'    => false,
47
+			];
48
+
49
+			if (!$alwaysSeePrivateData) {
50
+				// tl;dr: This is a stupid configuration, but let's account for it anyway.
51
+				//
52
+				// Flagged comments are treated as private data. If you don't have the privilege
53
+				// RequestData::alwaysSeePrivateData, then we can't show you the content of the comments here.
54
+				// This page is forced to degrade into basically a list of requests, seriously hampering the usefulness
55
+				// of this page. Still, we need to handle the case where we have access to this page, but not access
56
+				// to private data.
57
+				// At the time of writing, this case does not exist in the current role configuration, but for the role
58
+				// configuration to be free of assumptions, we need this code.
59
+
60
+				/** @var Request $request */
61
+				$request = Request::getById($object->getRequest(), $database);
62
+
63
+				if ($request->getReserved() === $currentUser->getId()) {
64
+					$data['hiddenText'] = false;
65
+				}
66
+				else {
67
+					$data['hiddenText'] = true;
68
+				}
69
+			}
70
+
71
+			if ($object->getVisibility() == 'requester' || $object->getVisibility() == 'user') {
72
+				$data['hidden'] = false;
73
+			}
74
+			elseif ($object->getVisibility() == 'admin') {
75
+				if ($seeRestrictedComments) {
76
+					$data['hidden'] = false;
77
+				}
78
+				else {
79
+					$data['hidden'] = true;
80
+				}
81
+			}
82
+			elseif ($object->getVisibility() == 'checkuser') {
83
+				if ($seeCheckuserComments) {
84
+					$data['hidden'] = false;
85
+				}
86
+				else {
87
+					$data['hidden'] = true;
88
+				}
89
+			}
90
+
91
+			$this->copyCommentData($object, $data, $database);
92
+
93
+			$comments[] = $data;
94
+		}
95
+
96
+		$this->assign('comments', $comments);
97
+		$this->assign('seeRestrictedComments', $seeRestrictedComments);
98
+		$this->assign('seeCheckuserComments', $seeCheckuserComments);
99
+
100
+		$this->assign('editOthersComments', $this->barrierTest('editOthers', $currentUser, PageEditComment::class));
101
+		$this->assign('editComments', $this->barrierTest(RoleConfigurationBase::MAIN, $currentUser, PageEditComment::class));
102
+		$this->assign('canUnflag', $this->barrierTest('unflag', $currentUser, PageFlagComment::class) && $this->barrierTest(RoleConfigurationBase::MAIN, $currentUser, PageFlagComment::class));
103
+	}
104
+
105
+	private function copyCommentData(Comment $object, array &$data, PdoDatabase $database): void
106
+	{
107
+		if ($data['hidden']) {
108
+			// All details hidden, so don't copy anything.
109
+			return;
110
+		}
111
+
112
+		/** @var Request $request */
113
+		$request = Request::getById($object->getRequest(), $database);
114
+
115
+		if (!$data['hiddenText']) {
116
+			// Comment text is hidden, but presence of the comment is visible.
117
+			$data['comment'] = $object->getComment();
118
+		}
119
+
120
+		$data['id'] = $object->getId();
121
+		$data['updateversion'] = $object->getUpdateVersion();
122
+		$data['time'] = $object->getTime();
123
+		$data['requestid'] = $object->getRequest();
124
+		$data['request'] = $request->getName();
125
+		$data['requeststatus'] = $request->getStatus();
126
+		$data['userid'] = $object->getUser();
127
+		$data['user'] = User::getById($object->getUser(), $database)->getUsername();
128
+	}
129 129
 }
130 130
\ No newline at end of file
Please login to merge, or discard this patch.
includes/SiteConfiguration.php 1 patch
Indentation   +1110 added lines, -1110 removed lines patch added patch discarded remove patch
@@ -18,1114 +18,1114 @@
 block discarded – undo
18 18
  */
19 19
 class SiteConfiguration
20 20
 {
21
-    private $baseUrl = 'https://accounts.wmflabs.org';
22
-    private $filePath = __DIR__ . '/..';
23
-    private $schemaVersion = 51;
24
-    private $debuggingTraceEnabled = false;
25
-    private $debuggingCssBreakpointsEnabled = false;
26
-    private $dataClearIp = '127.0.0.1';
27
-    private $dataClearEmail = '[email protected]';
28
-    private $dataClearInterval = '15 DAY';
29
-    private $forceIdentification = true;
30
-    private $identificationCacheExpiry = '1 DAY';
31
-    private $metaWikimediaWebServiceEndpoint = 'https://meta.wikimedia.org/w/api.php';
32
-    private $enforceOAuth = false;
33
-    private $emailConfirmationEnabled = true;
34
-    private $emailConfirmationExpiryDays = 7;
35
-    private $miserModeLimit = 25;
36
-    private $squidList = array();
37
-    private $useStrictTransportSecurity = false;
38
-    private $userAgent = 'Wikipedia-ACC Tool/0.1 (+https://accounts.wmflabs.org/internal.php/team)';
39
-    private $curlDisableVerifyPeer = false;
40
-    private $useOAuthSignup = true;
41
-    private $oauthConsumerToken;
42
-    /** @var array */
43
-    private $oauthLegacyConsumerTokens;
44
-    private $oauthConsumerSecret;
45
-    private $oauthIdentityGraceTime = '24 hours';
46
-    private $oauthMediaWikiCanonicalServer = 'https://en.wikipedia.org';
47
-    private $xffTrustedHostsFile = '../TrustedXFF/trusted-hosts.txt';
48
-    private $crossOriginResourceSharingHosts = array(
49
-        "https://en.wikipedia.org",
50
-        "https://meta.wikimedia.org",
51
-    );
52
-    private $ircNotificationsEnabled = true;
53
-    private $ircNotificationsInstance = 'Development';
54
-    private $errorLog = 'errorlog';
55
-    private $titleBlacklistEnabled = false;
56
-    /** @var null|string $locationProviderApiKey */
57
-    private $locationProviderApiKey = null;
58
-    private $torExitPaths = array();
59
-    private $creationBotUsername = '';
60
-    private $creationBotPassword = '';
61
-    private $curlCookieJar = __DIR__ . '/../../cookies.txt';
62
-    private $yubicoApiId = 0;
63
-    private $yubicoApiKey = "";
64
-    private $totpEncryptionKey = "1234";
65
-    private $identificationNoticeboardPage = 'Access to nonpublic personal data policy/Noticeboard';
66
-    private $identificationNoticeboardWebserviceEndpoint = 'https://meta.wikimedia.org/w/api.php';
67
-    private $registrationAllowed = true;
68
-    private $cspReportUri = null;
69
-    private $resourceCacheEpoch = 1;
70
-    private $commonEmailDomains = ['gmail.com', 'hotmail.com', 'outlook.com'];
71
-    private $banMaxIpBlockRange = [4 => 20, 6 => 48];
72
-    private $banMaxIpRange = [4 => 16, 6 => 32];
73
-    private $jobQueueBatchSize = 10;
74
-    private $amqpConfiguration = ['host' => 'localhost', 'port' => 5672, 'user' => 'guest', 'password' => 'guest', 'vhost' => '/', 'exchange' => '', 'tls' => false];
75
-    private $emailSender = '[email protected]';
76
-    private $acceptClientHints = [];
77
-    private string $cookiePath = '/';
78
-    private string $cookieSessionName = 'ACC';
79
-    private array $offline = ['offline' => false, 'reason' => '', 'culprit' => ''];
80
-    private array $databaseConfig = [
81
-        'datasource' => 'mysql:host=localhost;dbname=waca',
82
-        'username' => 'waca',
83
-        'password' => 'waca'
84
-    ];
85
-    private string $privacyStatementPath = '';
86
-
87
-    /**
88
-     * Gets the base URL of the tool
89
-     *
90
-     * If the internal page of the tool is at http://localhost/path/internal.php, this would be set to
91
-     * http://localhost/path
92
-     * @return string
93
-     */
94
-    public function getBaseUrl()
95
-    {
96
-        return $this->baseUrl;
97
-    }
98
-
99
-    /**
100
-     * @param string $baseUrl
101
-     *
102
-     * @return SiteConfiguration
103
-     */
104
-    public function setBaseUrl($baseUrl)
105
-    {
106
-        $this->baseUrl = $baseUrl;
107
-
108
-        return $this;
109
-    }
110
-
111
-    /**
112
-     * Path on disk to the directory containing the tool's code
113
-     * @return string
114
-     */
115
-    public function getFilePath()
116
-    {
117
-        return $this->filePath;
118
-    }
119
-
120
-    /**
121
-     * @param string $filePath
122
-     *
123
-     * @return SiteConfiguration
124
-     */
125
-    public function setFilePath($filePath)
126
-    {
127
-        $this->filePath = $filePath;
128
-
129
-        return $this;
130
-    }
131
-
132
-    /**
133
-     * @return int
134
-     */
135
-    public function getSchemaVersion()
136
-    {
137
-        return $this->schemaVersion;
138
-    }
139
-
140
-    /**
141
-     * @param int $schemaVersion
142
-     *
143
-     * @return SiteConfiguration
144
-     */
145
-    public function setSchemaVersion($schemaVersion)
146
-    {
147
-        $this->schemaVersion = $schemaVersion;
148
-
149
-        return $this;
150
-    }
151
-
152
-    /**
153
-     * @return mixed
154
-     */
155
-    public function getDebuggingTraceEnabled()
156
-    {
157
-        return $this->debuggingTraceEnabled;
158
-    }
159
-
160
-    /**
161
-     * @param mixed $debuggingTraceEnabled
162
-     *
163
-     * @return SiteConfiguration
164
-     */
165
-    public function setDebuggingTraceEnabled($debuggingTraceEnabled)
166
-    {
167
-        $this->debuggingTraceEnabled = $debuggingTraceEnabled;
168
-
169
-        return $this;
170
-    }
171
-
172
-    public function getDebuggingCssBreakpointsEnabled() : bool
173
-    {
174
-        return $this->debuggingCssBreakpointsEnabled;
175
-    }
176
-
177
-    public function setDebuggingCssBreakpointsEnabled(bool $debuggingCssBreakpointsEnabled) : SiteConfiguration
178
-    {
179
-        $this->debuggingCssBreakpointsEnabled = $debuggingCssBreakpointsEnabled;
180
-
181
-        return $this;
182
-    }
183
-
184
-    /**
185
-     * @return string
186
-     */
187
-    public function getDataClearIp()
188
-    {
189
-        return $this->dataClearIp;
190
-    }
191
-
192
-    /**
193
-     * @param string $dataClearIp
194
-     *
195
-     * @return SiteConfiguration
196
-     */
197
-    public function setDataClearIp($dataClearIp)
198
-    {
199
-        $this->dataClearIp = $dataClearIp;
200
-
201
-        return $this;
202
-    }
203
-
204
-    /**
205
-     * @return string
206
-     */
207
-    public function getDataClearEmail()
208
-    {
209
-        return $this->dataClearEmail;
210
-    }
211
-
212
-    /**
213
-     * @param string $dataClearEmail
214
-     *
215
-     * @return SiteConfiguration
216
-     */
217
-    public function setDataClearEmail($dataClearEmail)
218
-    {
219
-        $this->dataClearEmail = $dataClearEmail;
220
-
221
-        return $this;
222
-    }
223
-
224
-    /**
225
-     * @return boolean
226
-     */
227
-    public function getForceIdentification()
228
-    {
229
-        return $this->forceIdentification;
230
-    }
231
-
232
-    /**
233
-     * @param boolean $forceIdentification
234
-     *
235
-     * @return SiteConfiguration
236
-     */
237
-    public function setForceIdentification($forceIdentification)
238
-    {
239
-        $this->forceIdentification = $forceIdentification;
240
-
241
-        return $this;
242
-    }
243
-
244
-    /**
245
-     * @return string
246
-     */
247
-    public function getIdentificationCacheExpiry()
248
-    {
249
-        return $this->identificationCacheExpiry;
250
-    }
251
-
252
-    /**
253
-     * @param string $identificationCacheExpiry
254
-     *
255
-     * @return SiteConfiguration
256
-     */
257
-    public function setIdentificationCacheExpiry($identificationCacheExpiry)
258
-    {
259
-        $this->identificationCacheExpiry = $identificationCacheExpiry;
260
-
261
-        return $this;
262
-    }
263
-
264
-    /**
265
-     * @return string
266
-     */
267
-    public function getMetaWikimediaWebServiceEndpoint()
268
-    {
269
-        return $this->metaWikimediaWebServiceEndpoint;
270
-    }
271
-
272
-    /**
273
-     * @param string $metaWikimediaWebServiceEndpoint
274
-     *
275
-     * @return SiteConfiguration
276
-     */
277
-    public function setMetaWikimediaWebServiceEndpoint($metaWikimediaWebServiceEndpoint)
278
-    {
279
-        $this->metaWikimediaWebServiceEndpoint = $metaWikimediaWebServiceEndpoint;
280
-
281
-        return $this;
282
-    }
283
-
284
-    /**
285
-     * @return boolean
286
-     */
287
-    public function getEnforceOAuth()
288
-    {
289
-        return $this->enforceOAuth;
290
-    }
291
-
292
-    /**
293
-     * @param boolean $enforceOAuth
294
-     *
295
-     * @return SiteConfiguration
296
-     */
297
-    public function setEnforceOAuth($enforceOAuth)
298
-    {
299
-        $this->enforceOAuth = $enforceOAuth;
300
-
301
-        return $this;
302
-    }
303
-
304
-    /**
305
-     * @return boolean
306
-     */
307
-    public function getEmailConfirmationEnabled()
308
-    {
309
-        return $this->emailConfirmationEnabled;
310
-    }
311
-
312
-    /**
313
-     * @param boolean $emailConfirmationEnabled
314
-     *
315
-     * @return $this
316
-     */
317
-    public function setEmailConfirmationEnabled($emailConfirmationEnabled)
318
-    {
319
-        $this->emailConfirmationEnabled = $emailConfirmationEnabled;
320
-
321
-        return $this;
322
-    }
323
-
324
-    /**
325
-     * @return int
326
-     */
327
-    public function getMiserModeLimit()
328
-    {
329
-        return $this->miserModeLimit;
330
-    }
331
-
332
-    /**
333
-     * @param int $miserModeLimit
334
-     *
335
-     * @return SiteConfiguration
336
-     */
337
-    public function setMiserModeLimit($miserModeLimit)
338
-    {
339
-        $this->miserModeLimit = $miserModeLimit;
340
-
341
-        return $this;
342
-    }
343
-
344
-    /**
345
-     * @return array
346
-     */
347
-    public function getSquidList()
348
-    {
349
-        return $this->squidList;
350
-    }
351
-
352
-    /**
353
-     * @param array $squidList
354
-     *
355
-     * @return SiteConfiguration
356
-     */
357
-    public function setSquidList($squidList)
358
-    {
359
-        $this->squidList = $squidList;
360
-
361
-        return $this;
362
-    }
363
-
364
-    /**
365
-     * @return boolean
366
-     */
367
-    public function getUseStrictTransportSecurity()
368
-    {
369
-        return $this->useStrictTransportSecurity;
370
-    }
371
-
372
-    /**
373
-     * @param boolean $useStrictTransportSecurity
374
-     *
375
-     * @return SiteConfiguration
376
-     */
377
-    public function setUseStrictTransportSecurity($useStrictTransportSecurity)
378
-    {
379
-        $this->useStrictTransportSecurity = $useStrictTransportSecurity;
380
-
381
-        return $this;
382
-    }
383
-
384
-    /**
385
-     * @return string
386
-     */
387
-    public function getUserAgent()
388
-    {
389
-        return $this->userAgent;
390
-    }
391
-
392
-    /**
393
-     * @param string $userAgent
394
-     *
395
-     * @return SiteConfiguration
396
-     */
397
-    public function setUserAgent($userAgent)
398
-    {
399
-        $this->userAgent = $userAgent;
400
-
401
-        return $this;
402
-    }
403
-
404
-    /**
405
-     * @return boolean
406
-     */
407
-    public function getCurlDisableVerifyPeer()
408
-    {
409
-        return $this->curlDisableVerifyPeer;
410
-    }
411
-
412
-    /**
413
-     * @param boolean $curlDisableVerifyPeer
414
-     *
415
-     * @return SiteConfiguration
416
-     */
417
-    public function setCurlDisableVerifyPeer($curlDisableVerifyPeer)
418
-    {
419
-        $this->curlDisableVerifyPeer = $curlDisableVerifyPeer;
420
-
421
-        return $this;
422
-    }
423
-
424
-    /**
425
-     * @return boolean
426
-     */
427
-    public function getUseOAuthSignup()
428
-    {
429
-        return $this->useOAuthSignup;
430
-    }
431
-
432
-    /**
433
-     * @param boolean $useOAuthSignup
434
-     *
435
-     * @return SiteConfiguration
436
-     */
437
-    public function setUseOAuthSignup($useOAuthSignup)
438
-    {
439
-        $this->useOAuthSignup = $useOAuthSignup;
440
-
441
-        return $this;
442
-    }
443
-
444
-    /**
445
-     * @return mixed
446
-     */
447
-    public function getOAuthConsumerToken()
448
-    {
449
-        return $this->oauthConsumerToken;
450
-    }
451
-
452
-    /**
453
-     * @param mixed $oauthConsumerToken
454
-     *
455
-     * @return SiteConfiguration
456
-     */
457
-    public function setOAuthConsumerToken($oauthConsumerToken)
458
-    {
459
-        $this->oauthConsumerToken = $oauthConsumerToken;
460
-
461
-        return $this;
462
-    }
463
-
464
-    /**
465
-     * @return mixed
466
-     */
467
-    public function getOAuthConsumerSecret()
468
-    {
469
-        return $this->oauthConsumerSecret;
470
-    }
471
-
472
-    /**
473
-     * @param mixed $oauthConsumerSecret
474
-     *
475
-     * @return SiteConfiguration
476
-     */
477
-    public function setOAuthConsumerSecret($oauthConsumerSecret)
478
-    {
479
-        $this->oauthConsumerSecret = $oauthConsumerSecret;
480
-
481
-        return $this;
482
-    }
483
-
484
-    /**
485
-     * @return string
486
-     */
487
-    public function getDataClearInterval()
488
-    {
489
-        return $this->dataClearInterval;
490
-    }
491
-
492
-    /**
493
-     * @param string $dataClearInterval
494
-     *
495
-     * @return SiteConfiguration
496
-     */
497
-    public function setDataClearInterval($dataClearInterval)
498
-    {
499
-        $this->dataClearInterval = $dataClearInterval;
500
-
501
-        return $this;
502
-    }
503
-
504
-    /**
505
-     * @return string
506
-     */
507
-    public function getXffTrustedHostsFile()
508
-    {
509
-        return $this->xffTrustedHostsFile;
510
-    }
511
-
512
-    /**
513
-     * @param string $xffTrustedHostsFile
514
-     *
515
-     * @return SiteConfiguration
516
-     */
517
-    public function setXffTrustedHostsFile($xffTrustedHostsFile)
518
-    {
519
-        $this->xffTrustedHostsFile = $xffTrustedHostsFile;
520
-
521
-        return $this;
522
-    }
523
-
524
-    /**
525
-     * @return array
526
-     */
527
-    public function getCrossOriginResourceSharingHosts()
528
-    {
529
-        return $this->crossOriginResourceSharingHosts;
530
-    }
531
-
532
-    /**
533
-     * @param array $crossOriginResourceSharingHosts
534
-     *
535
-     * @return SiteConfiguration
536
-     */
537
-    public function setCrossOriginResourceSharingHosts($crossOriginResourceSharingHosts)
538
-    {
539
-        $this->crossOriginResourceSharingHosts = $crossOriginResourceSharingHosts;
540
-
541
-        return $this;
542
-    }
543
-
544
-    /**
545
-     * @return boolean
546
-     */
547
-    public function getIrcNotificationsEnabled()
548
-    {
549
-        return $this->ircNotificationsEnabled;
550
-    }
551
-
552
-    /**
553
-     * @param boolean $ircNotificationsEnabled
554
-     *
555
-     * @return SiteConfiguration
556
-     */
557
-    public function setIrcNotificationsEnabled($ircNotificationsEnabled)
558
-    {
559
-        $this->ircNotificationsEnabled = $ircNotificationsEnabled;
560
-
561
-        return $this;
562
-    }
563
-
564
-    /**
565
-     * @param string $errorLog
566
-     *
567
-     * @return SiteConfiguration
568
-     */
569
-    public function setErrorLog($errorLog)
570
-    {
571
-        $this->errorLog = $errorLog;
572
-
573
-        return $this;
574
-    }
575
-
576
-    /**
577
-     * @return string
578
-     */
579
-    public function getErrorLog()
580
-    {
581
-        return $this->errorLog;
582
-    }
583
-
584
-    /**
585
-     * @param int $emailConfirmationExpiryDays
586
-     *
587
-     * @return SiteConfiguration
588
-     */
589
-    public function setEmailConfirmationExpiryDays($emailConfirmationExpiryDays)
590
-    {
591
-        $this->emailConfirmationExpiryDays = $emailConfirmationExpiryDays;
592
-
593
-        return $this;
594
-    }
595
-
596
-    /**
597
-     * @return int
598
-     */
599
-    public function getEmailConfirmationExpiryDays()
600
-    {
601
-        return $this->emailConfirmationExpiryDays;
602
-    }
603
-
604
-    /**
605
-     * @param string $ircNotificationsInstance
606
-     *
607
-     * @return SiteConfiguration
608
-     */
609
-    public function setIrcNotificationsInstance($ircNotificationsInstance)
610
-    {
611
-        $this->ircNotificationsInstance = $ircNotificationsInstance;
612
-
613
-        return $this;
614
-    }
615
-
616
-    /**
617
-     * @return string
618
-     */
619
-    public function getIrcNotificationsInstance()
620
-    {
621
-        return $this->ircNotificationsInstance;
622
-    }
623
-
624
-    /**
625
-     * @param boolean $titleBlacklistEnabled
626
-     *
627
-     * @return SiteConfiguration
628
-     */
629
-    public function setTitleBlacklistEnabled($titleBlacklistEnabled)
630
-    {
631
-        $this->titleBlacklistEnabled = $titleBlacklistEnabled;
632
-
633
-        return $this;
634
-    }
635
-
636
-    /**
637
-     * @return boolean
638
-     */
639
-    public function getTitleBlacklistEnabled()
640
-    {
641
-        return $this->titleBlacklistEnabled;
642
-    }
643
-
644
-    /**
645
-     * @param string|null $locationProviderApiKey
646
-     *
647
-     * @return SiteConfiguration
648
-     */
649
-    public function setLocationProviderApiKey($locationProviderApiKey)
650
-    {
651
-        $this->locationProviderApiKey = $locationProviderApiKey;
652
-
653
-        return $this;
654
-    }
655
-
656
-    /**
657
-     * @return null|string
658
-     */
659
-    public function getLocationProviderApiKey()
660
-    {
661
-        return $this->locationProviderApiKey;
662
-    }
663
-
664
-    /**
665
-     * @param array $torExitPaths
666
-     *
667
-     * @return SiteConfiguration
668
-     */
669
-    public function setTorExitPaths($torExitPaths)
670
-    {
671
-        $this->torExitPaths = $torExitPaths;
672
-
673
-        return $this;
674
-    }
675
-
676
-    /**
677
-     * @return array
678
-     */
679
-    public function getTorExitPaths()
680
-    {
681
-        return $this->torExitPaths;
682
-    }
683
-
684
-    /**
685
-     * @param string $oauthIdentityGraceTime
686
-     *
687
-     * @return SiteConfiguration
688
-     */
689
-    public function setOauthIdentityGraceTime($oauthIdentityGraceTime)
690
-    {
691
-        $this->oauthIdentityGraceTime = $oauthIdentityGraceTime;
692
-
693
-        return $this;
694
-    }
695
-
696
-    /**
697
-     * @return string
698
-     */
699
-    public function getOauthIdentityGraceTime()
700
-    {
701
-        return $this->oauthIdentityGraceTime;
702
-    }
703
-
704
-    /**
705
-     * @param string $oauthMediaWikiCanonicalServer
706
-     *
707
-     * @return SiteConfiguration
708
-     */
709
-    public function setOauthMediaWikiCanonicalServer($oauthMediaWikiCanonicalServer)
710
-    {
711
-        $this->oauthMediaWikiCanonicalServer = $oauthMediaWikiCanonicalServer;
712
-
713
-        return $this;
714
-    }
715
-
716
-    /**
717
-     * @return string
718
-     */
719
-    public function getOauthMediaWikiCanonicalServer()
720
-    {
721
-        return $this->oauthMediaWikiCanonicalServer;
722
-    }
723
-
724
-    /**
725
-     * @param string $creationBotUsername
726
-     *
727
-     * @return SiteConfiguration
728
-     */
729
-    public function setCreationBotUsername($creationBotUsername)
730
-    {
731
-        $this->creationBotUsername = $creationBotUsername;
732
-
733
-        return $this;
734
-    }
735
-
736
-    /**
737
-     * @return string
738
-     */
739
-    public function getCreationBotUsername()
740
-    {
741
-        return $this->creationBotUsername;
742
-    }
743
-
744
-    /**
745
-     * @param string $creationBotPassword
746
-     *
747
-     * @return SiteConfiguration
748
-     */
749
-    public function setCreationBotPassword($creationBotPassword)
750
-    {
751
-        $this->creationBotPassword = $creationBotPassword;
752
-
753
-        return $this;
754
-    }
755
-
756
-    /**
757
-     * @return string
758
-     */
759
-    public function getCreationBotPassword()
760
-    {
761
-        return $this->creationBotPassword;
762
-    }
763
-
764
-    /**
765
-     * @param string|null $curlCookieJar
766
-     *
767
-     * @return SiteConfiguration
768
-     */
769
-    public function setCurlCookieJar($curlCookieJar)
770
-    {
771
-        $this->curlCookieJar = $curlCookieJar;
772
-
773
-        return $this;
774
-    }
775
-
776
-    /**
777
-     * @return string|null
778
-     */
779
-    public function getCurlCookieJar()
780
-    {
781
-        return $this->curlCookieJar;
782
-    }
783
-
784
-    public function getYubicoApiId()
785
-    {
786
-        return $this->yubicoApiId;
787
-    }
788
-
789
-    public function setYubicoApiId($id)
790
-    {
791
-        $this->yubicoApiId = $id;
792
-
793
-        return $this;
794
-    }
795
-
796
-    public function getYubicoApiKey()
797
-    {
798
-        return $this->yubicoApiKey;
799
-    }
800
-
801
-    public function setYubicoApiKey($key)
802
-    {
803
-        $this->yubicoApiKey = $key;
804
-
805
-        return $this;
806
-    }
807
-
808
-    /**
809
-     * @return string
810
-     */
811
-    public function getTotpEncryptionKey()
812
-    {
813
-        return $this->totpEncryptionKey;
814
-    }
815
-
816
-    /**
817
-     * @param string $totpEncryptionKey
818
-     *
819
-     * @return SiteConfiguration
820
-     */
821
-    public function setTotpEncryptionKey($totpEncryptionKey)
822
-    {
823
-        $this->totpEncryptionKey = $totpEncryptionKey;
824
-
825
-        return $this;
826
-    }
827
-
828
-    /**
829
-     * @return string
830
-     */
831
-    public function getIdentificationNoticeboardPage()
832
-    {
833
-        return $this->identificationNoticeboardPage;
834
-    }
835
-
836
-    /**
837
-     * @param string $identificationNoticeboardPage
838
-     *
839
-     * @return SiteConfiguration
840
-     */
841
-    public function setIdentificationNoticeboardPage($identificationNoticeboardPage)
842
-    {
843
-        $this->identificationNoticeboardPage = $identificationNoticeboardPage;
844
-
845
-        return $this;
846
-    }
847
-
848
-    public function setIdentificationNoticeboardWebserviceEndpoint(string $identificationNoticeboardWebserviceEndpoint
849
-    ): SiteConfiguration {
850
-        $this->identificationNoticeboardWebserviceEndpoint = $identificationNoticeboardWebserviceEndpoint;
851
-
852
-        return $this;
853
-    }
854
-
855
-    public function getIdentificationNoticeboardWebserviceEndpoint(): string
856
-    {
857
-        return $this->identificationNoticeboardWebserviceEndpoint;
858
-    }
859
-
860
-    public function isRegistrationAllowed(): bool
861
-    {
862
-        return $this->registrationAllowed;
863
-    }
864
-
865
-    public function setRegistrationAllowed(bool $registrationAllowed): SiteConfiguration
866
-    {
867
-        $this->registrationAllowed = $registrationAllowed;
868
-
869
-        return $this;
870
-    }
871
-
872
-    /**
873
-     * @return string|null
874
-     */
875
-    public function getCspReportUri()
876
-    {
877
-        return $this->cspReportUri;
878
-    }
879
-
880
-    /**
881
-     * @param string|null $cspReportUri
882
-     *
883
-     * @return SiteConfiguration
884
-     */
885
-    public function setCspReportUri($cspReportUri)
886
-    {
887
-        $this->cspReportUri = $cspReportUri;
888
-
889
-        return $this;
890
-    }
891
-
892
-    /**
893
-     * @return int
894
-     */
895
-    public function getResourceCacheEpoch(): int
896
-    {
897
-        return $this->resourceCacheEpoch;
898
-    }
899
-
900
-    /**
901
-     * @param int $resourceCacheEpoch
902
-     *
903
-     * @return SiteConfiguration
904
-     */
905
-    public function setResourceCacheEpoch(int $resourceCacheEpoch): SiteConfiguration
906
-    {
907
-        $this->resourceCacheEpoch = $resourceCacheEpoch;
908
-
909
-        return $this;
910
-    }
911
-
912
-    /**
913
-     * @return array
914
-     */
915
-    public function getCommonEmailDomains(): array
916
-    {
917
-        return $this->commonEmailDomains;
918
-    }
919
-
920
-    /**
921
-     * @param array $commonEmailDomains
922
-     *
923
-     * @return SiteConfiguration
924
-     */
925
-    public function setCommonEmailDomains(array $commonEmailDomains): SiteConfiguration
926
-    {
927
-        $this->commonEmailDomains = $commonEmailDomains;
928
-
929
-        return $this;
930
-    }
931
-
932
-    /**
933
-     * @param int[] $banMaxIpBlockRange
934
-     *
935
-     * @return SiteConfiguration
936
-     */
937
-    public function setBanMaxIpBlockRange(array $banMaxIpBlockRange): SiteConfiguration
938
-    {
939
-        $this->banMaxIpBlockRange = $banMaxIpBlockRange;
940
-
941
-        return $this;
942
-    }
943
-
944
-    /**
945
-     * @return int[]
946
-     */
947
-    public function getBanMaxIpBlockRange(): array
948
-    {
949
-        return $this->banMaxIpBlockRange;
950
-    }
951
-
952
-    /**
953
-     * @param int[] $banMaxIpRange
954
-     *
955
-     * @return SiteConfiguration
956
-     */
957
-    public function setBanMaxIpRange(array $banMaxIpRange): SiteConfiguration
958
-    {
959
-        $this->banMaxIpRange = $banMaxIpRange;
960
-
961
-        return $this;
962
-    }
963
-
964
-    /**
965
-     * @return int[]
966
-     */
967
-    public function getBanMaxIpRange(): array
968
-    {
969
-        return $this->banMaxIpRange;
970
-    }
971
-
972
-    /**
973
-     * @param array $oauthLegacyConsumerTokens
974
-     *
975
-     * @return SiteConfiguration
976
-     */
977
-    public function setOauthLegacyConsumerTokens(array $oauthLegacyConsumerTokens): SiteConfiguration
978
-    {
979
-        $this->oauthLegacyConsumerTokens = $oauthLegacyConsumerTokens;
980
-
981
-        return $this;
982
-    }
983
-
984
-    /**
985
-     * @return array
986
-     */
987
-    public function getOauthLegacyConsumerTokens(): array
988
-    {
989
-        return $this->oauthLegacyConsumerTokens;
990
-    }
991
-
992
-    /**
993
-     * @return int
994
-     */
995
-    public function getJobQueueBatchSize(): int
996
-    {
997
-        return $this->jobQueueBatchSize;
998
-    }
999
-
1000
-    /**
1001
-     * @param int $jobQueueBatchSize
1002
-     *
1003
-     * @return SiteConfiguration
1004
-     */
1005
-    public function setJobQueueBatchSize(int $jobQueueBatchSize): SiteConfiguration
1006
-    {
1007
-        $this->jobQueueBatchSize = $jobQueueBatchSize;
1008
-
1009
-        return $this;
1010
-    }
1011
-
1012
-    /**
1013
-     * @return array
1014
-     */
1015
-    public function getAmqpConfiguration(): array
1016
-    {
1017
-        return $this->amqpConfiguration;
1018
-    }
1019
-
1020
-    /**
1021
-     * @param array $amqpConfiguration
1022
-     *
1023
-     * @return SiteConfiguration
1024
-     */
1025
-    public function setAmqpConfiguration(array $amqpConfiguration): SiteConfiguration
1026
-    {
1027
-        $this->amqpConfiguration = $amqpConfiguration;
1028
-
1029
-        return $this;
1030
-    }
1031
-
1032
-    /**
1033
-     * @return string
1034
-     */
1035
-    public function getEmailSender(): string
1036
-    {
1037
-        return $this->emailSender;
1038
-    }
1039
-
1040
-    /**
1041
-     * @param string $emailSender
1042
-     *
1043
-     * @return SiteConfiguration
1044
-     */
1045
-    public function setEmailSender(string $emailSender): SiteConfiguration
1046
-    {
1047
-        $this->emailSender = $emailSender;
1048
-
1049
-        return $this;
1050
-    }
1051
-
1052
-    /**
1053
-     * @param array $acceptClientHints
1054
-     *
1055
-     * @return SiteConfiguration
1056
-     */
1057
-    public function setAcceptClientHints(array $acceptClientHints): SiteConfiguration
1058
-    {
1059
-        $this->acceptClientHints = $acceptClientHints;
1060
-
1061
-        return $this;
1062
-    }
1063
-
1064
-    /**
1065
-     * @return array
1066
-     */
1067
-    public function getAcceptClientHints(): array
1068
-    {
1069
-        return $this->acceptClientHints;
1070
-    }
1071
-
1072
-    public function setCookiePath(string $cookiePath): SiteConfiguration
1073
-    {
1074
-        $this->cookiePath = $cookiePath;
1075
-
1076
-        return $this;
1077
-    }
1078
-
1079
-    public function getCookiePath(): string
1080
-    {
1081
-        return $this->cookiePath;
1082
-    }
1083
-
1084
-    public function setCookieSessionName(string $cookieSessionName): SiteConfiguration
1085
-    {
1086
-        $this->cookieSessionName = $cookieSessionName;
1087
-
1088
-        return $this;
1089
-    }
1090
-
1091
-    public function getCookieSessionName(): string
1092
-    {
1093
-        return $this->cookieSessionName;
1094
-    }
1095
-
1096
-    public function setOffline(array $offline): SiteConfiguration
1097
-    {
1098
-        $this->offline = $offline;
1099
-
1100
-        return $this;
1101
-    }
1102
-
1103
-    public function getOffline(): array
1104
-    {
1105
-        return $this->offline;
1106
-    }
1107
-
1108
-    public function setDatabaseConfig(array $databaseConfig): SiteConfiguration
1109
-    {
1110
-        $this->databaseConfig = $databaseConfig;
1111
-
1112
-        return $this;
1113
-    }
1114
-
1115
-    public function getDatabaseConfig(): array
1116
-    {
1117
-        return $this->databaseConfig;
1118
-    }
1119
-
1120
-    public function getPrivacyStatementPath(): string
1121
-    {
1122
-        return $this->privacyStatementPath;
1123
-    }
1124
-
1125
-    public function setPrivacyStatementPath(string $privacyStatementPath): SiteConfiguration
1126
-    {
1127
-        $this->privacyStatementPath = $privacyStatementPath;
1128
-
1129
-        return $this;
1130
-    }
21
+	private $baseUrl = 'https://accounts.wmflabs.org';
22
+	private $filePath = __DIR__ . '/..';
23
+	private $schemaVersion = 51;
24
+	private $debuggingTraceEnabled = false;
25
+	private $debuggingCssBreakpointsEnabled = false;
26
+	private $dataClearIp = '127.0.0.1';
27
+	private $dataClearEmail = '[email protected]';
28
+	private $dataClearInterval = '15 DAY';
29
+	private $forceIdentification = true;
30
+	private $identificationCacheExpiry = '1 DAY';
31
+	private $metaWikimediaWebServiceEndpoint = 'https://meta.wikimedia.org/w/api.php';
32
+	private $enforceOAuth = false;
33
+	private $emailConfirmationEnabled = true;
34
+	private $emailConfirmationExpiryDays = 7;
35
+	private $miserModeLimit = 25;
36
+	private $squidList = array();
37
+	private $useStrictTransportSecurity = false;
38
+	private $userAgent = 'Wikipedia-ACC Tool/0.1 (+https://accounts.wmflabs.org/internal.php/team)';
39
+	private $curlDisableVerifyPeer = false;
40
+	private $useOAuthSignup = true;
41
+	private $oauthConsumerToken;
42
+	/** @var array */
43
+	private $oauthLegacyConsumerTokens;
44
+	private $oauthConsumerSecret;
45
+	private $oauthIdentityGraceTime = '24 hours';
46
+	private $oauthMediaWikiCanonicalServer = 'https://en.wikipedia.org';
47
+	private $xffTrustedHostsFile = '../TrustedXFF/trusted-hosts.txt';
48
+	private $crossOriginResourceSharingHosts = array(
49
+		"https://en.wikipedia.org",
50
+		"https://meta.wikimedia.org",
51
+	);
52
+	private $ircNotificationsEnabled = true;
53
+	private $ircNotificationsInstance = 'Development';
54
+	private $errorLog = 'errorlog';
55
+	private $titleBlacklistEnabled = false;
56
+	/** @var null|string $locationProviderApiKey */
57
+	private $locationProviderApiKey = null;
58
+	private $torExitPaths = array();
59
+	private $creationBotUsername = '';
60
+	private $creationBotPassword = '';
61
+	private $curlCookieJar = __DIR__ . '/../../cookies.txt';
62
+	private $yubicoApiId = 0;
63
+	private $yubicoApiKey = "";
64
+	private $totpEncryptionKey = "1234";
65
+	private $identificationNoticeboardPage = 'Access to nonpublic personal data policy/Noticeboard';
66
+	private $identificationNoticeboardWebserviceEndpoint = 'https://meta.wikimedia.org/w/api.php';
67
+	private $registrationAllowed = true;
68
+	private $cspReportUri = null;
69
+	private $resourceCacheEpoch = 1;
70
+	private $commonEmailDomains = ['gmail.com', 'hotmail.com', 'outlook.com'];
71
+	private $banMaxIpBlockRange = [4 => 20, 6 => 48];
72
+	private $banMaxIpRange = [4 => 16, 6 => 32];
73
+	private $jobQueueBatchSize = 10;
74
+	private $amqpConfiguration = ['host' => 'localhost', 'port' => 5672, 'user' => 'guest', 'password' => 'guest', 'vhost' => '/', 'exchange' => '', 'tls' => false];
75
+	private $emailSender = '[email protected]';
76
+	private $acceptClientHints = [];
77
+	private string $cookiePath = '/';
78
+	private string $cookieSessionName = 'ACC';
79
+	private array $offline = ['offline' => false, 'reason' => '', 'culprit' => ''];
80
+	private array $databaseConfig = [
81
+		'datasource' => 'mysql:host=localhost;dbname=waca',
82
+		'username' => 'waca',
83
+		'password' => 'waca'
84
+	];
85
+	private string $privacyStatementPath = '';
86
+
87
+	/**
88
+	 * Gets the base URL of the tool
89
+	 *
90
+	 * If the internal page of the tool is at http://localhost/path/internal.php, this would be set to
91
+	 * http://localhost/path
92
+	 * @return string
93
+	 */
94
+	public function getBaseUrl()
95
+	{
96
+		return $this->baseUrl;
97
+	}
98
+
99
+	/**
100
+	 * @param string $baseUrl
101
+	 *
102
+	 * @return SiteConfiguration
103
+	 */
104
+	public function setBaseUrl($baseUrl)
105
+	{
106
+		$this->baseUrl = $baseUrl;
107
+
108
+		return $this;
109
+	}
110
+
111
+	/**
112
+	 * Path on disk to the directory containing the tool's code
113
+	 * @return string
114
+	 */
115
+	public function getFilePath()
116
+	{
117
+		return $this->filePath;
118
+	}
119
+
120
+	/**
121
+	 * @param string $filePath
122
+	 *
123
+	 * @return SiteConfiguration
124
+	 */
125
+	public function setFilePath($filePath)
126
+	{
127
+		$this->filePath = $filePath;
128
+
129
+		return $this;
130
+	}
131
+
132
+	/**
133
+	 * @return int
134
+	 */
135
+	public function getSchemaVersion()
136
+	{
137
+		return $this->schemaVersion;
138
+	}
139
+
140
+	/**
141
+	 * @param int $schemaVersion
142
+	 *
143
+	 * @return SiteConfiguration
144
+	 */
145
+	public function setSchemaVersion($schemaVersion)
146
+	{
147
+		$this->schemaVersion = $schemaVersion;
148
+
149
+		return $this;
150
+	}
151
+
152
+	/**
153
+	 * @return mixed
154
+	 */
155
+	public function getDebuggingTraceEnabled()
156
+	{
157
+		return $this->debuggingTraceEnabled;
158
+	}
159
+
160
+	/**
161
+	 * @param mixed $debuggingTraceEnabled
162
+	 *
163
+	 * @return SiteConfiguration
164
+	 */
165
+	public function setDebuggingTraceEnabled($debuggingTraceEnabled)
166
+	{
167
+		$this->debuggingTraceEnabled = $debuggingTraceEnabled;
168
+
169
+		return $this;
170
+	}
171
+
172
+	public function getDebuggingCssBreakpointsEnabled() : bool
173
+	{
174
+		return $this->debuggingCssBreakpointsEnabled;
175
+	}
176
+
177
+	public function setDebuggingCssBreakpointsEnabled(bool $debuggingCssBreakpointsEnabled) : SiteConfiguration
178
+	{
179
+		$this->debuggingCssBreakpointsEnabled = $debuggingCssBreakpointsEnabled;
180
+
181
+		return $this;
182
+	}
183
+
184
+	/**
185
+	 * @return string
186
+	 */
187
+	public function getDataClearIp()
188
+	{
189
+		return $this->dataClearIp;
190
+	}
191
+
192
+	/**
193
+	 * @param string $dataClearIp
194
+	 *
195
+	 * @return SiteConfiguration
196
+	 */
197
+	public function setDataClearIp($dataClearIp)
198
+	{
199
+		$this->dataClearIp = $dataClearIp;
200
+
201
+		return $this;
202
+	}
203
+
204
+	/**
205
+	 * @return string
206
+	 */
207
+	public function getDataClearEmail()
208
+	{
209
+		return $this->dataClearEmail;
210
+	}
211
+
212
+	/**
213
+	 * @param string $dataClearEmail
214
+	 *
215
+	 * @return SiteConfiguration
216
+	 */
217
+	public function setDataClearEmail($dataClearEmail)
218
+	{
219
+		$this->dataClearEmail = $dataClearEmail;
220
+
221
+		return $this;
222
+	}
223
+
224
+	/**
225
+	 * @return boolean
226
+	 */
227
+	public function getForceIdentification()
228
+	{
229
+		return $this->forceIdentification;
230
+	}
231
+
232
+	/**
233
+	 * @param boolean $forceIdentification
234
+	 *
235
+	 * @return SiteConfiguration
236
+	 */
237
+	public function setForceIdentification($forceIdentification)
238
+	{
239
+		$this->forceIdentification = $forceIdentification;
240
+
241
+		return $this;
242
+	}
243
+
244
+	/**
245
+	 * @return string
246
+	 */
247
+	public function getIdentificationCacheExpiry()
248
+	{
249
+		return $this->identificationCacheExpiry;
250
+	}
251
+
252
+	/**
253
+	 * @param string $identificationCacheExpiry
254
+	 *
255
+	 * @return SiteConfiguration
256
+	 */
257
+	public function setIdentificationCacheExpiry($identificationCacheExpiry)
258
+	{
259
+		$this->identificationCacheExpiry = $identificationCacheExpiry;
260
+
261
+		return $this;
262
+	}
263
+
264
+	/**
265
+	 * @return string
266
+	 */
267
+	public function getMetaWikimediaWebServiceEndpoint()
268
+	{
269
+		return $this->metaWikimediaWebServiceEndpoint;
270
+	}
271
+
272
+	/**
273
+	 * @param string $metaWikimediaWebServiceEndpoint
274
+	 *
275
+	 * @return SiteConfiguration
276
+	 */
277
+	public function setMetaWikimediaWebServiceEndpoint($metaWikimediaWebServiceEndpoint)
278
+	{
279
+		$this->metaWikimediaWebServiceEndpoint = $metaWikimediaWebServiceEndpoint;
280
+
281
+		return $this;
282
+	}
283
+
284
+	/**
285
+	 * @return boolean
286
+	 */
287
+	public function getEnforceOAuth()
288
+	{
289
+		return $this->enforceOAuth;
290
+	}
291
+
292
+	/**
293
+	 * @param boolean $enforceOAuth
294
+	 *
295
+	 * @return SiteConfiguration
296
+	 */
297
+	public function setEnforceOAuth($enforceOAuth)
298
+	{
299
+		$this->enforceOAuth = $enforceOAuth;
300
+
301
+		return $this;
302
+	}
303
+
304
+	/**
305
+	 * @return boolean
306
+	 */
307
+	public function getEmailConfirmationEnabled()
308
+	{
309
+		return $this->emailConfirmationEnabled;
310
+	}
311
+
312
+	/**
313
+	 * @param boolean $emailConfirmationEnabled
314
+	 *
315
+	 * @return $this
316
+	 */
317
+	public function setEmailConfirmationEnabled($emailConfirmationEnabled)
318
+	{
319
+		$this->emailConfirmationEnabled = $emailConfirmationEnabled;
320
+
321
+		return $this;
322
+	}
323
+
324
+	/**
325
+	 * @return int
326
+	 */
327
+	public function getMiserModeLimit()
328
+	{
329
+		return $this->miserModeLimit;
330
+	}
331
+
332
+	/**
333
+	 * @param int $miserModeLimit
334
+	 *
335
+	 * @return SiteConfiguration
336
+	 */
337
+	public function setMiserModeLimit($miserModeLimit)
338
+	{
339
+		$this->miserModeLimit = $miserModeLimit;
340
+
341
+		return $this;
342
+	}
343
+
344
+	/**
345
+	 * @return array
346
+	 */
347
+	public function getSquidList()
348
+	{
349
+		return $this->squidList;
350
+	}
351
+
352
+	/**
353
+	 * @param array $squidList
354
+	 *
355
+	 * @return SiteConfiguration
356
+	 */
357
+	public function setSquidList($squidList)
358
+	{
359
+		$this->squidList = $squidList;
360
+
361
+		return $this;
362
+	}
363
+
364
+	/**
365
+	 * @return boolean
366
+	 */
367
+	public function getUseStrictTransportSecurity()
368
+	{
369
+		return $this->useStrictTransportSecurity;
370
+	}
371
+
372
+	/**
373
+	 * @param boolean $useStrictTransportSecurity
374
+	 *
375
+	 * @return SiteConfiguration
376
+	 */
377
+	public function setUseStrictTransportSecurity($useStrictTransportSecurity)
378
+	{
379
+		$this->useStrictTransportSecurity = $useStrictTransportSecurity;
380
+
381
+		return $this;
382
+	}
383
+
384
+	/**
385
+	 * @return string
386
+	 */
387
+	public function getUserAgent()
388
+	{
389
+		return $this->userAgent;
390
+	}
391
+
392
+	/**
393
+	 * @param string $userAgent
394
+	 *
395
+	 * @return SiteConfiguration
396
+	 */
397
+	public function setUserAgent($userAgent)
398
+	{
399
+		$this->userAgent = $userAgent;
400
+
401
+		return $this;
402
+	}
403
+
404
+	/**
405
+	 * @return boolean
406
+	 */
407
+	public function getCurlDisableVerifyPeer()
408
+	{
409
+		return $this->curlDisableVerifyPeer;
410
+	}
411
+
412
+	/**
413
+	 * @param boolean $curlDisableVerifyPeer
414
+	 *
415
+	 * @return SiteConfiguration
416
+	 */
417
+	public function setCurlDisableVerifyPeer($curlDisableVerifyPeer)
418
+	{
419
+		$this->curlDisableVerifyPeer = $curlDisableVerifyPeer;
420
+
421
+		return $this;
422
+	}
423
+
424
+	/**
425
+	 * @return boolean
426
+	 */
427
+	public function getUseOAuthSignup()
428
+	{
429
+		return $this->useOAuthSignup;
430
+	}
431
+
432
+	/**
433
+	 * @param boolean $useOAuthSignup
434
+	 *
435
+	 * @return SiteConfiguration
436
+	 */
437
+	public function setUseOAuthSignup($useOAuthSignup)
438
+	{
439
+		$this->useOAuthSignup = $useOAuthSignup;
440
+
441
+		return $this;
442
+	}
443
+
444
+	/**
445
+	 * @return mixed
446
+	 */
447
+	public function getOAuthConsumerToken()
448
+	{
449
+		return $this->oauthConsumerToken;
450
+	}
451
+
452
+	/**
453
+	 * @param mixed $oauthConsumerToken
454
+	 *
455
+	 * @return SiteConfiguration
456
+	 */
457
+	public function setOAuthConsumerToken($oauthConsumerToken)
458
+	{
459
+		$this->oauthConsumerToken = $oauthConsumerToken;
460
+
461
+		return $this;
462
+	}
463
+
464
+	/**
465
+	 * @return mixed
466
+	 */
467
+	public function getOAuthConsumerSecret()
468
+	{
469
+		return $this->oauthConsumerSecret;
470
+	}
471
+
472
+	/**
473
+	 * @param mixed $oauthConsumerSecret
474
+	 *
475
+	 * @return SiteConfiguration
476
+	 */
477
+	public function setOAuthConsumerSecret($oauthConsumerSecret)
478
+	{
479
+		$this->oauthConsumerSecret = $oauthConsumerSecret;
480
+
481
+		return $this;
482
+	}
483
+
484
+	/**
485
+	 * @return string
486
+	 */
487
+	public function getDataClearInterval()
488
+	{
489
+		return $this->dataClearInterval;
490
+	}
491
+
492
+	/**
493
+	 * @param string $dataClearInterval
494
+	 *
495
+	 * @return SiteConfiguration
496
+	 */
497
+	public function setDataClearInterval($dataClearInterval)
498
+	{
499
+		$this->dataClearInterval = $dataClearInterval;
500
+
501
+		return $this;
502
+	}
503
+
504
+	/**
505
+	 * @return string
506
+	 */
507
+	public function getXffTrustedHostsFile()
508
+	{
509
+		return $this->xffTrustedHostsFile;
510
+	}
511
+
512
+	/**
513
+	 * @param string $xffTrustedHostsFile
514
+	 *
515
+	 * @return SiteConfiguration
516
+	 */
517
+	public function setXffTrustedHostsFile($xffTrustedHostsFile)
518
+	{
519
+		$this->xffTrustedHostsFile = $xffTrustedHostsFile;
520
+
521
+		return $this;
522
+	}
523
+
524
+	/**
525
+	 * @return array
526
+	 */
527
+	public function getCrossOriginResourceSharingHosts()
528
+	{
529
+		return $this->crossOriginResourceSharingHosts;
530
+	}
531
+
532
+	/**
533
+	 * @param array $crossOriginResourceSharingHosts
534
+	 *
535
+	 * @return SiteConfiguration
536
+	 */
537
+	public function setCrossOriginResourceSharingHosts($crossOriginResourceSharingHosts)
538
+	{
539
+		$this->crossOriginResourceSharingHosts = $crossOriginResourceSharingHosts;
540
+
541
+		return $this;
542
+	}
543
+
544
+	/**
545
+	 * @return boolean
546
+	 */
547
+	public function getIrcNotificationsEnabled()
548
+	{
549
+		return $this->ircNotificationsEnabled;
550
+	}
551
+
552
+	/**
553
+	 * @param boolean $ircNotificationsEnabled
554
+	 *
555
+	 * @return SiteConfiguration
556
+	 */
557
+	public function setIrcNotificationsEnabled($ircNotificationsEnabled)
558
+	{
559
+		$this->ircNotificationsEnabled = $ircNotificationsEnabled;
560
+
561
+		return $this;
562
+	}
563
+
564
+	/**
565
+	 * @param string $errorLog
566
+	 *
567
+	 * @return SiteConfiguration
568
+	 */
569
+	public function setErrorLog($errorLog)
570
+	{
571
+		$this->errorLog = $errorLog;
572
+
573
+		return $this;
574
+	}
575
+
576
+	/**
577
+	 * @return string
578
+	 */
579
+	public function getErrorLog()
580
+	{
581
+		return $this->errorLog;
582
+	}
583
+
584
+	/**
585
+	 * @param int $emailConfirmationExpiryDays
586
+	 *
587
+	 * @return SiteConfiguration
588
+	 */
589
+	public function setEmailConfirmationExpiryDays($emailConfirmationExpiryDays)
590
+	{
591
+		$this->emailConfirmationExpiryDays = $emailConfirmationExpiryDays;
592
+
593
+		return $this;
594
+	}
595
+
596
+	/**
597
+	 * @return int
598
+	 */
599
+	public function getEmailConfirmationExpiryDays()
600
+	{
601
+		return $this->emailConfirmationExpiryDays;
602
+	}
603
+
604
+	/**
605
+	 * @param string $ircNotificationsInstance
606
+	 *
607
+	 * @return SiteConfiguration
608
+	 */
609
+	public function setIrcNotificationsInstance($ircNotificationsInstance)
610
+	{
611
+		$this->ircNotificationsInstance = $ircNotificationsInstance;
612
+
613
+		return $this;
614
+	}
615
+
616
+	/**
617
+	 * @return string
618
+	 */
619
+	public function getIrcNotificationsInstance()
620
+	{
621
+		return $this->ircNotificationsInstance;
622
+	}
623
+
624
+	/**
625
+	 * @param boolean $titleBlacklistEnabled
626
+	 *
627
+	 * @return SiteConfiguration
628
+	 */
629
+	public function setTitleBlacklistEnabled($titleBlacklistEnabled)
630
+	{
631
+		$this->titleBlacklistEnabled = $titleBlacklistEnabled;
632
+
633
+		return $this;
634
+	}
635
+
636
+	/**
637
+	 * @return boolean
638
+	 */
639
+	public function getTitleBlacklistEnabled()
640
+	{
641
+		return $this->titleBlacklistEnabled;
642
+	}
643
+
644
+	/**
645
+	 * @param string|null $locationProviderApiKey
646
+	 *
647
+	 * @return SiteConfiguration
648
+	 */
649
+	public function setLocationProviderApiKey($locationProviderApiKey)
650
+	{
651
+		$this->locationProviderApiKey = $locationProviderApiKey;
652
+
653
+		return $this;
654
+	}
655
+
656
+	/**
657
+	 * @return null|string
658
+	 */
659
+	public function getLocationProviderApiKey()
660
+	{
661
+		return $this->locationProviderApiKey;
662
+	}
663
+
664
+	/**
665
+	 * @param array $torExitPaths
666
+	 *
667
+	 * @return SiteConfiguration
668
+	 */
669
+	public function setTorExitPaths($torExitPaths)
670
+	{
671
+		$this->torExitPaths = $torExitPaths;
672
+
673
+		return $this;
674
+	}
675
+
676
+	/**
677
+	 * @return array
678
+	 */
679
+	public function getTorExitPaths()
680
+	{
681
+		return $this->torExitPaths;
682
+	}
683
+
684
+	/**
685
+	 * @param string $oauthIdentityGraceTime
686
+	 *
687
+	 * @return SiteConfiguration
688
+	 */
689
+	public function setOauthIdentityGraceTime($oauthIdentityGraceTime)
690
+	{
691
+		$this->oauthIdentityGraceTime = $oauthIdentityGraceTime;
692
+
693
+		return $this;
694
+	}
695
+
696
+	/**
697
+	 * @return string
698
+	 */
699
+	public function getOauthIdentityGraceTime()
700
+	{
701
+		return $this->oauthIdentityGraceTime;
702
+	}
703
+
704
+	/**
705
+	 * @param string $oauthMediaWikiCanonicalServer
706
+	 *
707
+	 * @return SiteConfiguration
708
+	 */
709
+	public function setOauthMediaWikiCanonicalServer($oauthMediaWikiCanonicalServer)
710
+	{
711
+		$this->oauthMediaWikiCanonicalServer = $oauthMediaWikiCanonicalServer;
712
+
713
+		return $this;
714
+	}
715
+
716
+	/**
717
+	 * @return string
718
+	 */
719
+	public function getOauthMediaWikiCanonicalServer()
720
+	{
721
+		return $this->oauthMediaWikiCanonicalServer;
722
+	}
723
+
724
+	/**
725
+	 * @param string $creationBotUsername
726
+	 *
727
+	 * @return SiteConfiguration
728
+	 */
729
+	public function setCreationBotUsername($creationBotUsername)
730
+	{
731
+		$this->creationBotUsername = $creationBotUsername;
732
+
733
+		return $this;
734
+	}
735
+
736
+	/**
737
+	 * @return string
738
+	 */
739
+	public function getCreationBotUsername()
740
+	{
741
+		return $this->creationBotUsername;
742
+	}
743
+
744
+	/**
745
+	 * @param string $creationBotPassword
746
+	 *
747
+	 * @return SiteConfiguration
748
+	 */
749
+	public function setCreationBotPassword($creationBotPassword)
750
+	{
751
+		$this->creationBotPassword = $creationBotPassword;
752
+
753
+		return $this;
754
+	}
755
+
756
+	/**
757
+	 * @return string
758
+	 */
759
+	public function getCreationBotPassword()
760
+	{
761
+		return $this->creationBotPassword;
762
+	}
763
+
764
+	/**
765
+	 * @param string|null $curlCookieJar
766
+	 *
767
+	 * @return SiteConfiguration
768
+	 */
769
+	public function setCurlCookieJar($curlCookieJar)
770
+	{
771
+		$this->curlCookieJar = $curlCookieJar;
772
+
773
+		return $this;
774
+	}
775
+
776
+	/**
777
+	 * @return string|null
778
+	 */
779
+	public function getCurlCookieJar()
780
+	{
781
+		return $this->curlCookieJar;
782
+	}
783
+
784
+	public function getYubicoApiId()
785
+	{
786
+		return $this->yubicoApiId;
787
+	}
788
+
789
+	public function setYubicoApiId($id)
790
+	{
791
+		$this->yubicoApiId = $id;
792
+
793
+		return $this;
794
+	}
795
+
796
+	public function getYubicoApiKey()
797
+	{
798
+		return $this->yubicoApiKey;
799
+	}
800
+
801
+	public function setYubicoApiKey($key)
802
+	{
803
+		$this->yubicoApiKey = $key;
804
+
805
+		return $this;
806
+	}
807
+
808
+	/**
809
+	 * @return string
810
+	 */
811
+	public function getTotpEncryptionKey()
812
+	{
813
+		return $this->totpEncryptionKey;
814
+	}
815
+
816
+	/**
817
+	 * @param string $totpEncryptionKey
818
+	 *
819
+	 * @return SiteConfiguration
820
+	 */
821
+	public function setTotpEncryptionKey($totpEncryptionKey)
822
+	{
823
+		$this->totpEncryptionKey = $totpEncryptionKey;
824
+
825
+		return $this;
826
+	}
827
+
828
+	/**
829
+	 * @return string
830
+	 */
831
+	public function getIdentificationNoticeboardPage()
832
+	{
833
+		return $this->identificationNoticeboardPage;
834
+	}
835
+
836
+	/**
837
+	 * @param string $identificationNoticeboardPage
838
+	 *
839
+	 * @return SiteConfiguration
840
+	 */
841
+	public function setIdentificationNoticeboardPage($identificationNoticeboardPage)
842
+	{
843
+		$this->identificationNoticeboardPage = $identificationNoticeboardPage;
844
+
845
+		return $this;
846
+	}
847
+
848
+	public function setIdentificationNoticeboardWebserviceEndpoint(string $identificationNoticeboardWebserviceEndpoint
849
+	): SiteConfiguration {
850
+		$this->identificationNoticeboardWebserviceEndpoint = $identificationNoticeboardWebserviceEndpoint;
851
+
852
+		return $this;
853
+	}
854
+
855
+	public function getIdentificationNoticeboardWebserviceEndpoint(): string
856
+	{
857
+		return $this->identificationNoticeboardWebserviceEndpoint;
858
+	}
859
+
860
+	public function isRegistrationAllowed(): bool
861
+	{
862
+		return $this->registrationAllowed;
863
+	}
864
+
865
+	public function setRegistrationAllowed(bool $registrationAllowed): SiteConfiguration
866
+	{
867
+		$this->registrationAllowed = $registrationAllowed;
868
+
869
+		return $this;
870
+	}
871
+
872
+	/**
873
+	 * @return string|null
874
+	 */
875
+	public function getCspReportUri()
876
+	{
877
+		return $this->cspReportUri;
878
+	}
879
+
880
+	/**
881
+	 * @param string|null $cspReportUri
882
+	 *
883
+	 * @return SiteConfiguration
884
+	 */
885
+	public function setCspReportUri($cspReportUri)
886
+	{
887
+		$this->cspReportUri = $cspReportUri;
888
+
889
+		return $this;
890
+	}
891
+
892
+	/**
893
+	 * @return int
894
+	 */
895
+	public function getResourceCacheEpoch(): int
896
+	{
897
+		return $this->resourceCacheEpoch;
898
+	}
899
+
900
+	/**
901
+	 * @param int $resourceCacheEpoch
902
+	 *
903
+	 * @return SiteConfiguration
904
+	 */
905
+	public function setResourceCacheEpoch(int $resourceCacheEpoch): SiteConfiguration
906
+	{
907
+		$this->resourceCacheEpoch = $resourceCacheEpoch;
908
+
909
+		return $this;
910
+	}
911
+
912
+	/**
913
+	 * @return array
914
+	 */
915
+	public function getCommonEmailDomains(): array
916
+	{
917
+		return $this->commonEmailDomains;
918
+	}
919
+
920
+	/**
921
+	 * @param array $commonEmailDomains
922
+	 *
923
+	 * @return SiteConfiguration
924
+	 */
925
+	public function setCommonEmailDomains(array $commonEmailDomains): SiteConfiguration
926
+	{
927
+		$this->commonEmailDomains = $commonEmailDomains;
928
+
929
+		return $this;
930
+	}
931
+
932
+	/**
933
+	 * @param int[] $banMaxIpBlockRange
934
+	 *
935
+	 * @return SiteConfiguration
936
+	 */
937
+	public function setBanMaxIpBlockRange(array $banMaxIpBlockRange): SiteConfiguration
938
+	{
939
+		$this->banMaxIpBlockRange = $banMaxIpBlockRange;
940
+
941
+		return $this;
942
+	}
943
+
944
+	/**
945
+	 * @return int[]
946
+	 */
947
+	public function getBanMaxIpBlockRange(): array
948
+	{
949
+		return $this->banMaxIpBlockRange;
950
+	}
951
+
952
+	/**
953
+	 * @param int[] $banMaxIpRange
954
+	 *
955
+	 * @return SiteConfiguration
956
+	 */
957
+	public function setBanMaxIpRange(array $banMaxIpRange): SiteConfiguration
958
+	{
959
+		$this->banMaxIpRange = $banMaxIpRange;
960
+
961
+		return $this;
962
+	}
963
+
964
+	/**
965
+	 * @return int[]
966
+	 */
967
+	public function getBanMaxIpRange(): array
968
+	{
969
+		return $this->banMaxIpRange;
970
+	}
971
+
972
+	/**
973
+	 * @param array $oauthLegacyConsumerTokens
974
+	 *
975
+	 * @return SiteConfiguration
976
+	 */
977
+	public function setOauthLegacyConsumerTokens(array $oauthLegacyConsumerTokens): SiteConfiguration
978
+	{
979
+		$this->oauthLegacyConsumerTokens = $oauthLegacyConsumerTokens;
980
+
981
+		return $this;
982
+	}
983
+
984
+	/**
985
+	 * @return array
986
+	 */
987
+	public function getOauthLegacyConsumerTokens(): array
988
+	{
989
+		return $this->oauthLegacyConsumerTokens;
990
+	}
991
+
992
+	/**
993
+	 * @return int
994
+	 */
995
+	public function getJobQueueBatchSize(): int
996
+	{
997
+		return $this->jobQueueBatchSize;
998
+	}
999
+
1000
+	/**
1001
+	 * @param int $jobQueueBatchSize
1002
+	 *
1003
+	 * @return SiteConfiguration
1004
+	 */
1005
+	public function setJobQueueBatchSize(int $jobQueueBatchSize): SiteConfiguration
1006
+	{
1007
+		$this->jobQueueBatchSize = $jobQueueBatchSize;
1008
+
1009
+		return $this;
1010
+	}
1011
+
1012
+	/**
1013
+	 * @return array
1014
+	 */
1015
+	public function getAmqpConfiguration(): array
1016
+	{
1017
+		return $this->amqpConfiguration;
1018
+	}
1019
+
1020
+	/**
1021
+	 * @param array $amqpConfiguration
1022
+	 *
1023
+	 * @return SiteConfiguration
1024
+	 */
1025
+	public function setAmqpConfiguration(array $amqpConfiguration): SiteConfiguration
1026
+	{
1027
+		$this->amqpConfiguration = $amqpConfiguration;
1028
+
1029
+		return $this;
1030
+	}
1031
+
1032
+	/**
1033
+	 * @return string
1034
+	 */
1035
+	public function getEmailSender(): string
1036
+	{
1037
+		return $this->emailSender;
1038
+	}
1039
+
1040
+	/**
1041
+	 * @param string $emailSender
1042
+	 *
1043
+	 * @return SiteConfiguration
1044
+	 */
1045
+	public function setEmailSender(string $emailSender): SiteConfiguration
1046
+	{
1047
+		$this->emailSender = $emailSender;
1048
+
1049
+		return $this;
1050
+	}
1051
+
1052
+	/**
1053
+	 * @param array $acceptClientHints
1054
+	 *
1055
+	 * @return SiteConfiguration
1056
+	 */
1057
+	public function setAcceptClientHints(array $acceptClientHints): SiteConfiguration
1058
+	{
1059
+		$this->acceptClientHints = $acceptClientHints;
1060
+
1061
+		return $this;
1062
+	}
1063
+
1064
+	/**
1065
+	 * @return array
1066
+	 */
1067
+	public function getAcceptClientHints(): array
1068
+	{
1069
+		return $this->acceptClientHints;
1070
+	}
1071
+
1072
+	public function setCookiePath(string $cookiePath): SiteConfiguration
1073
+	{
1074
+		$this->cookiePath = $cookiePath;
1075
+
1076
+		return $this;
1077
+	}
1078
+
1079
+	public function getCookiePath(): string
1080
+	{
1081
+		return $this->cookiePath;
1082
+	}
1083
+
1084
+	public function setCookieSessionName(string $cookieSessionName): SiteConfiguration
1085
+	{
1086
+		$this->cookieSessionName = $cookieSessionName;
1087
+
1088
+		return $this;
1089
+	}
1090
+
1091
+	public function getCookieSessionName(): string
1092
+	{
1093
+		return $this->cookieSessionName;
1094
+	}
1095
+
1096
+	public function setOffline(array $offline): SiteConfiguration
1097
+	{
1098
+		$this->offline = $offline;
1099
+
1100
+		return $this;
1101
+	}
1102
+
1103
+	public function getOffline(): array
1104
+	{
1105
+		return $this->offline;
1106
+	}
1107
+
1108
+	public function setDatabaseConfig(array $databaseConfig): SiteConfiguration
1109
+	{
1110
+		$this->databaseConfig = $databaseConfig;
1111
+
1112
+		return $this;
1113
+	}
1114
+
1115
+	public function getDatabaseConfig(): array
1116
+	{
1117
+		return $this->databaseConfig;
1118
+	}
1119
+
1120
+	public function getPrivacyStatementPath(): string
1121
+	{
1122
+		return $this->privacyStatementPath;
1123
+	}
1124
+
1125
+	public function setPrivacyStatementPath(string $privacyStatementPath): SiteConfiguration
1126
+	{
1127
+		$this->privacyStatementPath = $privacyStatementPath;
1128
+
1129
+		return $this;
1130
+	}
1131 1131
 }
Please login to merge, or discard this patch.