@@ -61,7 +61,7 @@ |
||
61 | 61 | return; |
62 | 62 | } |
63 | 63 | |
64 | - if (!$mediaWikiHelper->checkAccountExists($request->getName())){ |
|
64 | + if (!$mediaWikiHelper->checkAccountExists($request->getName())) { |
|
65 | 65 | $this->markFailed('Account does not exist!'); |
66 | 66 | |
67 | 67 | return; |
@@ -82,8 +82,8 @@ discard block |
||
82 | 82 | */ |
83 | 83 | protected abstract function getMediaWikiClient(); |
84 | 84 | |
85 | - protected function getMediaWikiHelper(){ |
|
86 | - if($this->mwHelper === null) { |
|
85 | + protected function getMediaWikiHelper() { |
|
86 | + if ($this->mwHelper === null) { |
|
87 | 87 | $this->mwHelper = new MediaWikiHelper($this->getMediaWikiClient(), $this->getSiteConfiguration()); |
88 | 88 | } |
89 | 89 | |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | |
93 | 93 | protected function getCreationReason(Request $request, User $user) |
94 | 94 | { |
95 | - return 'Requested account at [[WP:ACC]], request #' . $request->getId(); |
|
95 | + return 'Requested account at [[WP:ACC]], request #'.$request->getId(); |
|
96 | 96 | } |
97 | 97 | |
98 | 98 | /** |
@@ -102,7 +102,7 @@ |
||
102 | 102 | $formParameters['limit'] = $this->limit; |
103 | 103 | $this->assign('searchParamsUrl', http_build_query($formParameters, '', '&')); |
104 | 104 | |
105 | - foreach ($formParameters as $key => $value) { |
|
105 | + foreach ($formParameters as $key => $value) { |
|
106 | 106 | $this->assign($key, $value); |
107 | 107 | } |
108 | 108 | } |
@@ -21,7 +21,7 @@ |
||
21 | 21 | $users = UserSearchHelper::get($database)->inIds( |
22 | 22 | $database->query('SELECT user FROM oauthtoken WHERE type = \'access\'')->fetchColumn()); |
23 | 23 | |
24 | - foreach ($users as $u){ |
|
24 | + foreach ($users as $u) { |
|
25 | 25 | $oauth = new OAuthUserHelper($u, $database, $this->getOAuthProtocolHelper(), $this->getSiteConfiguration()); |
26 | 26 | $oauth->detach(); |
27 | 27 | } |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | |
112 | 112 | $results = $search->getRecordCount($requestCount)->fetch(); |
113 | 113 | |
114 | - if($requestCount > 0) { |
|
114 | + if ($requestCount > 0) { |
|
115 | 115 | $requestSectionData['Hospital - Requests failed auto-creation'] = array( |
116 | 116 | 'requests' => $results, |
117 | 117 | 'total' => $requestCount, |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | |
144 | 144 | $results = $search->getRecordCount($requestCount)->fetch(); |
145 | 145 | |
146 | - if($requestCount > 0) { |
|
146 | + if ($requestCount > 0) { |
|
147 | 147 | $requestSectionData['Requests queued in the Job Queue'] = array( |
148 | 148 | 'requests' => $results, |
149 | 149 | 'total' => $requestCount, |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | } |
131 | 131 | } |
132 | 132 | |
133 | - $this->setHtmlTitle($statusSymbol . ' #' . $request->getId()); |
|
133 | + $this->setHtmlTitle($statusSymbol.' #'.$request->getId()); |
|
134 | 134 | } |
135 | 135 | |
136 | 136 | /** |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | |
228 | 228 | $entryComment = $entry->getComment(); |
229 | 229 | |
230 | - if($entry->getAction() === 'JobIssueRequest' || $entry->getAction() === 'JobCompletedRequest'){ |
|
230 | + if ($entry->getAction() === 'JobIssueRequest' || $entry->getAction() === 'JobCompletedRequest') { |
|
231 | 231 | $data = unserialize($entry->getComment()); |
232 | 232 | /** @var JobQueue $job */ |
233 | 233 | $job = JobQueue::getById($data['job'], $database); |
@@ -58,12 +58,12 @@ discard block |
||
58 | 58 | $response = $this->mediaWikiClient->doApiCall($tokenParams, 'POST'); |
59 | 59 | |
60 | 60 | if (isset($response->error)) { |
61 | - throw new MediaWikiApiException($response->error->code . ': ' . $response->error->info); |
|
61 | + throw new MediaWikiApiException($response->error->code.': '.$response->error->info); |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | $token = $response->query->tokens->createaccounttoken; |
65 | 65 | |
66 | - $callback = $this->siteConfiguration->getBaseUrl() . '/internal.php/oauth/createCallback'; |
|
66 | + $callback = $this->siteConfiguration->getBaseUrl().'/internal.php/oauth/createCallback'; |
|
67 | 67 | |
68 | 68 | $checkboxFields = array(); |
69 | 69 | $requiredFields = array(); |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | $createResponse = $this->mediaWikiClient->doApiCall($createParams, 'POST'); |
87 | 87 | |
88 | 88 | if (isset($createResponse->error)) { |
89 | - throw new MediaWikiApiException($response->error->code . ': ' . $response->error->info); |
|
89 | + throw new MediaWikiApiException($response->error->code.': '.$response->error->info); |
|
90 | 90 | } |
91 | 91 | |
92 | 92 | if (!isset($createResponse->createaccount) || !isset($createResponse->createaccount->status)) { |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | return; |
103 | 103 | } |
104 | 104 | |
105 | - throw new Exception('API result reported status of ' . $createResponse->createaccount->status); |
|
105 | + throw new Exception('API result reported status of '.$createResponse->createaccount->status); |
|
106 | 106 | } |
107 | 107 | |
108 | 108 | /** |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | $response = $this->mediaWikiClient->doApiCall($tokenParams, 'POST'); |
127 | 127 | |
128 | 128 | if (isset($response->error)) { |
129 | - throw new MediaWikiApiException($response->error->code . ': ' . $response->error->info); |
|
129 | + throw new MediaWikiApiException($response->error->code.': '.$response->error->info); |
|
130 | 130 | } |
131 | 131 | |
132 | 132 | $token = $response->query->tokens->csrftoken; |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | |
138 | 138 | $editParameters = array( |
139 | 139 | 'action' => 'edit', |
140 | - 'title' => 'User talk:' . $username, |
|
140 | + 'title' => 'User talk:'.$username, |
|
141 | 141 | 'section' => 'new', |
142 | 142 | 'sectiontitle' => $title, |
143 | 143 | 'summary' => $summary, |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | |
154 | 154 | if (!isset($response->edit)) { |
155 | 155 | if (isset($response->error)) { |
156 | - throw new MediaWikiApiException($response->error->code . ': ' . $response->error->info); |
|
156 | + throw new MediaWikiApiException($response->error->code.': '.$response->error->info); |
|
157 | 157 | } |
158 | 158 | |
159 | 159 | throw new MediaWikiApiException('Unknown error encountered during editing.'); |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | return; |
165 | 165 | } |
166 | 166 | |
167 | - throw new MediaWikiApiException('Edit status unsuccessful: ' . $editResponse->result); |
|
167 | + throw new MediaWikiApiException('Edit status unsuccessful: '.$editResponse->result); |
|
168 | 168 | } |
169 | 169 | |
170 | 170 | public function getCreationFieldData(&$requiredFields, &$checkboxFields) |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | $response = $this->mediaWikiClient->doApiCall($params, 'GET'); |
180 | 180 | |
181 | 181 | if (isset($response->error)) { |
182 | - throw new MediaWikiApiException($response->error->code . ': ' . $response->error->info); |
|
182 | + throw new MediaWikiApiException($response->error->code.': '.$response->error->info); |
|
183 | 183 | } |
184 | 184 | |
185 | 185 | $requests = $response->query->authmanagerinfo->requests; |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | } |
135 | 135 | else { |
136 | 136 | // This is the login form, not the request form. We need protection here. |
137 | - $this->redirectUrl('https://' . WebRequest::serverName() . WebRequest::requestUri()); |
|
137 | + $this->redirectUrl('https://'.WebRequest::serverName().WebRequest::requestUri()); |
|
138 | 138 | |
139 | 139 | return false; |
140 | 140 | } |
@@ -278,7 +278,7 @@ discard block |
||
278 | 278 | throw new ApplicationLogicException('Unknown page handler for next authentication stage.'); |
279 | 279 | } |
280 | 280 | |
281 | - $this->redirect("login/" . $this->nextPageMap[$nextStage]); |
|
281 | + $this->redirect("login/".$this->nextPageMap[$nextStage]); |
|
282 | 282 | } |
283 | 283 | |
284 | 284 | private function setupAlternates(User $user, $partialStage, PdoDatabase $database) |
@@ -17,14 +17,14 @@ |
||
17 | 17 | { |
18 | 18 | list($partialId, $partialStage) = WebRequest::getAuthPartialLogin(); |
19 | 19 | |
20 | - if($partialId !== null && $partialStage > 1) { |
|
20 | + if ($partialId !== null && $partialStage > 1) { |
|
21 | 21 | $sql = 'SELECT type FROM credential WHERE user = :user AND factor = :stage AND disabled = 0 ORDER BY priority'; |
22 | 22 | $statement = $this->getDatabase()->prepare($sql); |
23 | 23 | $statement->execute(array(':user' => $partialId, ':stage' => $partialStage)); |
24 | 24 | $nextStage = $statement->fetchColumn(); |
25 | 25 | $statement->closeCursor(); |
26 | 26 | |
27 | - $this->redirect("login/" . $this->nextPageMap[$nextStage]); |
|
27 | + $this->redirect("login/".$this->nextPageMap[$nextStage]); |
|
28 | 28 | return; |
29 | 29 | } |
30 | 30 |