@@ -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,7 +82,8 @@ |
||
| 82 | 82 | */ |
| 83 | 83 | protected abstract function getMediaWikiClient(); |
| 84 | 84 | |
| 85 | - protected function getMediaWikiHelper(){ |
|
| 85 | + protected function getMediaWikiHelper() |
|
| 86 | + { |
|
| 86 | 87 | if($this->mwHelper === null) { |
| 87 | 88 | $this->mwHelper = new MediaWikiHelper($this->getMediaWikiClient(), $this->getSiteConfiguration()); |
| 88 | 89 | } |
@@ -177,7 +177,7 @@ |
||
| 177 | 177 | throw new ApplicationLogicException('Cannot locate request'); |
| 178 | 178 | } |
| 179 | 179 | |
| 180 | - if($this->job->getEmailTemplate() !== null){ |
|
| 180 | + if($this->job->getEmailTemplate() !== null) { |
|
| 181 | 181 | $this->emailTemplate = EmailTemplate::getById($this->job->getEmailTemplate(), $this->getDatabase()); |
| 182 | 182 | |
| 183 | 183 | if ($this->emailTemplate === false) { |
@@ -115,8 +115,7 @@ discard block |
||
| 115 | 115 | SessionAlert::success("Email template has been saved successfully."); |
| 116 | 116 | |
| 117 | 117 | $this->redirect('emailManagement'); |
| 118 | - } |
|
| 119 | - else { |
|
| 118 | + } else { |
|
| 120 | 119 | $this->assignCSRFToken(); |
| 121 | 120 | $this->assign('id', $template->getId()); |
| 122 | 121 | $this->assign('emailTemplate', $template); |
@@ -183,8 +182,7 @@ discard block |
||
| 183 | 182 | SessionAlert::success("Email template has been saved successfully."); |
| 184 | 183 | |
| 185 | 184 | $this->redirect('emailManagement'); |
| 186 | - } |
|
| 187 | - else { |
|
| 185 | + } else { |
|
| 188 | 186 | $this->assignCSRFToken(); |
| 189 | 187 | $this->assign('id', -1); |
| 190 | 188 | $this->assign('emailTemplate', new EmailTemplate()); |
@@ -42,8 +42,7 @@ |
||
| 42 | 42 | if ($config->getEmailConfirmationEnabled()) { |
| 43 | 43 | $query = "SELECT * FROM request WHERE status = :type AND emailconfirm = 'Confirmed';"; |
| 44 | 44 | $totalQuery = "SELECT COUNT(id) FROM request WHERE status = :type AND emailconfirm = 'Confirmed';"; |
| 45 | - } |
|
| 46 | - else { |
|
| 45 | + } else { |
|
| 47 | 46 | $query = "SELECT * FROM request WHERE status = :type;"; |
| 48 | 47 | $totalQuery = "SELECT COUNT(id) FROM request WHERE status = :type;"; |
| 49 | 48 | } |
@@ -33,13 +33,11 @@ discard block |
||
| 33 | 33 | |
| 34 | 34 | if ($currentUser->getId() === $request->getReserved()) { |
| 35 | 35 | $this->doUnreserve($request, $database); |
| 36 | - } |
|
| 37 | - else { |
|
| 36 | + } else { |
|
| 38 | 37 | // not the same user! |
| 39 | 38 | if ($this->barrierTest('force', $currentUser)) { |
| 40 | 39 | $this->doBreakReserve($request, $database); |
| 41 | - } |
|
| 42 | - else { |
|
| 40 | + } else { |
|
| 43 | 41 | throw new AccessDeniedException($this->getSecurityManager()); |
| 44 | 42 | } |
| 45 | 43 | } |
@@ -83,8 +81,7 @@ discard block |
||
| 83 | 81 | $this->skipAlerts(); |
| 84 | 82 | |
| 85 | 83 | $this->setTemplate("confirmations/breakreserve.tpl"); |
| 86 | - } |
|
| 87 | - else { |
|
| 84 | + } else { |
|
| 88 | 85 | $request->setReserved(null); |
| 89 | 86 | $request->setUpdateVersion(WebRequest::postInt('updateversion')); |
| 90 | 87 | $request->save(); |
@@ -55,8 +55,7 @@ |
||
| 55 | 55 | && $creationMode === 'bot' |
| 56 | 56 | ) { |
| 57 | 57 | throw new AccessDeniedException($secMgr); |
| 58 | - } |
|
| 59 | - elseif ($secMgr->allows('RequestCreation', User::CREATION_OAUTH, $user) !== SecurityManager::ALLOWED |
|
| 58 | + } elseif ($secMgr->allows('RequestCreation', User::CREATION_OAUTH, $user) !== SecurityManager::ALLOWED |
|
| 60 | 59 | && $creationMode === 'oauth' |
| 61 | 60 | ) { |
| 62 | 61 | throw new AccessDeniedException($secMgr); |
@@ -94,8 +94,7 @@ discard block |
||
| 94 | 94 | $this->setTemplate('view-request/main-with-checkuser-data.tpl'); |
| 95 | 95 | $this->setupCheckUserData($request); |
| 96 | 96 | } |
| 97 | - } |
|
| 98 | - else { |
|
| 97 | + } else { |
|
| 99 | 98 | $this->setTemplate('view-request/main.tpl'); |
| 100 | 99 | } |
| 101 | 100 | } |
@@ -109,8 +108,7 @@ discard block |
||
| 109 | 108 | if ($request->getStatus() === 'Closed') { |
| 110 | 109 | if ($request->getWasCreated()) { |
| 111 | 110 | $statusSymbol = self::STATUS_SYMBOL_ACCEPTED; |
| 112 | - } |
|
| 113 | - else { |
|
| 111 | + } else { |
|
| 114 | 112 | $statusSymbol = self::STATUS_SYMBOL_REJECTED; |
| 115 | 113 | } |
| 116 | 114 | } |
@@ -207,7 +205,7 @@ discard block |
||
| 207 | 205 | |
| 208 | 206 | $entryComment = $entry->getComment(); |
| 209 | 207 | |
| 210 | - if($entry->getAction() === 'JobIssueRequest' || $entry->getAction() === 'JobCompletedRequest'){ |
|
| 208 | + if($entry->getAction() === 'JobIssueRequest' || $entry->getAction() === 'JobCompletedRequest') { |
|
| 211 | 209 | $data = unserialize($entry->getComment()); |
| 212 | 210 | /** @var JobQueue $job */ |
| 213 | 211 | $job = JobQueue::getById($data['job'], $database); |
@@ -60,8 +60,7 @@ discard block |
||
| 60 | 60 | $this->assign("declinedUsers", $declinedUsers); |
| 61 | 61 | |
| 62 | 62 | UserSearchHelper::get($database)->getRoleMap($roleMap); |
| 63 | - } |
|
| 64 | - else { |
|
| 63 | + } else { |
|
| 65 | 64 | $this->assign("showAll", false); |
| 66 | 65 | $this->assign("suspendedUsers", array()); |
| 67 | 66 | $this->assign("declinedUsers", array()); |
@@ -182,8 +181,7 @@ discard block |
||
| 182 | 181 | $this->redirect('statistics/users', 'detail', array('user' => $user->getId())); |
| 183 | 182 | |
| 184 | 183 | return; |
| 185 | - } |
|
| 186 | - else { |
|
| 184 | + } else { |
|
| 187 | 185 | $this->assignCSRFToken(); |
| 188 | 186 | $this->setTemplate('usermanagement/roleedit.tpl'); |
| 189 | 187 | $this->assign('user', $user); |
@@ -244,8 +242,7 @@ discard block |
||
| 244 | 242 | $this->redirect('userManagement'); |
| 245 | 243 | |
| 246 | 244 | return; |
| 247 | - } |
|
| 248 | - else { |
|
| 245 | + } else { |
|
| 249 | 246 | $this->assignCSRFToken(); |
| 250 | 247 | $this->setTemplate('usermanagement/changelevel-reason.tpl'); |
| 251 | 248 | $this->assign('user', $user); |
@@ -309,8 +306,7 @@ discard block |
||
| 309 | 306 | $this->redirect('userManagement'); |
| 310 | 307 | |
| 311 | 308 | return; |
| 312 | - } |
|
| 313 | - else { |
|
| 309 | + } else { |
|
| 314 | 310 | $this->assignCSRFToken(); |
| 315 | 311 | $this->setTemplate('usermanagement/changelevel-reason.tpl'); |
| 316 | 312 | $this->assign('user', $user); |
@@ -364,8 +360,7 @@ discard block |
||
| 364 | 360 | $this->redirect("userManagement"); |
| 365 | 361 | |
| 366 | 362 | return; |
| 367 | - } |
|
| 368 | - else { |
|
| 363 | + } else { |
|
| 369 | 364 | $this->assignCSRFToken(); |
| 370 | 365 | $this->setTemplate("usermanagement/changelevel-reason.tpl"); |
| 371 | 366 | $this->assign("user", $user); |
@@ -445,8 +440,7 @@ discard block |
||
| 445 | 440 | $this->redirect("userManagement"); |
| 446 | 441 | |
| 447 | 442 | return; |
| 448 | - } |
|
| 449 | - else { |
|
| 443 | + } else { |
|
| 450 | 444 | $this->assignCSRFToken(); |
| 451 | 445 | $this->setTemplate('usermanagement/renameuser.tpl'); |
| 452 | 446 | $this->assign('user', $user); |
@@ -505,8 +499,7 @@ discard block |
||
| 505 | 499 | $this->redirect("userManagement"); |
| 506 | 500 | |
| 507 | 501 | return; |
| 508 | - } |
|
| 509 | - else { |
|
| 502 | + } else { |
|
| 510 | 503 | $this->assignCSRFToken(); |
| 511 | 504 | $oauth = new OAuthUserHelper($user, $database, $this->getOAuthProtocolHelper(), |
| 512 | 505 | $this->getSiteConfiguration()); |