@@ -57,8 +57,7 @@ |
||
| 57 | 57 | && $creationMode === 'bot' |
| 58 | 58 | ) { |
| 59 | 59 | throw new AccessDeniedException($secMgr, $this->getDomainAccessManager()); |
| 60 | - } |
|
| 61 | - elseif ($secMgr->allows('RequestCreation', PreferenceManager::CREATION_OAUTH, $user) !== SecurityManager::ALLOWED |
|
| 60 | + } elseif ($secMgr->allows('RequestCreation', PreferenceManager::CREATION_OAUTH, $user) !== SecurityManager::ALLOWED |
|
| 62 | 61 | && $creationMode === 'oauth' |
| 63 | 62 | ) { |
| 64 | 63 | throw new AccessDeniedException($secMgr, $this->getDomainAccessManager()); |
@@ -83,8 +83,7 @@ discard block |
||
| 83 | 83 | |
| 84 | 84 | Logger::domainCreated($database, $domain); |
| 85 | 85 | $this->redirect('domainManagement'); |
| 86 | - } |
|
| 87 | - else { |
|
| 86 | + } else { |
|
| 88 | 87 | $this->assignCSRFToken(); |
| 89 | 88 | |
| 90 | 89 | $this->assign('shortName', ''); |
@@ -129,8 +128,7 @@ discard block |
||
| 129 | 128 | && $template->getPreloadOnly() === false |
| 130 | 129 | && $template->getDefaultAction() === EmailTemplate::ACTION_CREATED) { |
| 131 | 130 | $domain->setDefaultClose(WebRequest::postInt('defaultClose')); |
| 132 | - } |
|
| 133 | - else { |
|
| 131 | + } else { |
|
| 134 | 132 | SessionAlert::warning("Chosen email template is not valid for use as the default creation template"); |
| 135 | 133 | } |
| 136 | 134 | |
@@ -146,8 +144,7 @@ discard block |
||
| 146 | 144 | |
| 147 | 145 | Logger::domainEdited($database, $domain); |
| 148 | 146 | $this->redirect('domainManagement'); |
| 149 | - } |
|
| 150 | - else { |
|
| 147 | + } else { |
|
| 151 | 148 | $this->assignCSRFToken(); |
| 152 | 149 | |
| 153 | 150 | $templates = EmailTemplate::getActiveNonpreloadTemplates( |
@@ -111,8 +111,7 @@ |
||
| 111 | 111 | list($defaultSort, $defaultSortDirection) = WebRequest::requestListDefaultSort(); |
| 112 | 112 | $this->assign('defaultSort', $defaultSort); |
| 113 | 113 | $this->assign('defaultSortDirection', $defaultSortDirection); |
| 114 | - } |
|
| 115 | - else { |
|
| 114 | + } else { |
|
| 116 | 115 | $this->assign('type', 'name'); |
| 117 | 116 | $this->assign('hasResultset', false); |
| 118 | 117 | $this->assign('limit', 50); |
@@ -117,8 +117,7 @@ discard block |
||
| 117 | 117 | SessionAlert::success("Email template has been saved successfully."); |
| 118 | 118 | |
| 119 | 119 | $this->redirect('emailManagement'); |
| 120 | - } |
|
| 121 | - else { |
|
| 120 | + } else { |
|
| 122 | 121 | $this->assignCSRFToken(); |
| 123 | 122 | $this->assign('id', $template->getId()); |
| 124 | 123 | $this->assign('emailTemplate', $template); |
@@ -158,8 +157,7 @@ discard block |
||
| 158 | 157 | $template->setDefaultAction(EmailTemplate::ACTION_CREATED); |
| 159 | 158 | $template->setActive(true); |
| 160 | 159 | $template->setPreloadOnly(false); |
| 161 | - } |
|
| 162 | - else { |
|
| 160 | + } else { |
|
| 163 | 161 | $defaultAction = WebRequest::postString('defaultaction'); |
| 164 | 162 | switch ($defaultAction) { |
| 165 | 163 | case EmailTemplate::ACTION_NONE: |
@@ -212,8 +210,7 @@ discard block |
||
| 212 | 210 | SessionAlert::success("Email template has been saved successfully."); |
| 213 | 211 | |
| 214 | 212 | $this->redirect('emailManagement'); |
| 215 | - } |
|
| 216 | - else { |
|
| 213 | + } else { |
|
| 217 | 214 | $this->assignCSRFToken(); |
| 218 | 215 | $this->assign('id', -1); |
| 219 | 216 | $this->assign('emailTemplate', new EmailTemplate()); |
@@ -92,15 +92,13 @@ discard block |
||
| 92 | 92 | $queue->save(); |
| 93 | 93 | Logger::requestQueueCreated($database, $queue); |
| 94 | 94 | $this->redirect('queueManagement'); |
| 95 | - } |
|
| 96 | - else { |
|
| 95 | + } else { |
|
| 97 | 96 | $this->populateFromObject($queue); |
| 98 | 97 | |
| 99 | 98 | $this->assign('createMode', true); |
| 100 | 99 | $this->setTemplate('queue-management/edit.tpl'); |
| 101 | 100 | } |
| 102 | - } |
|
| 103 | - else { |
|
| 101 | + } else { |
|
| 104 | 102 | $this->assign('header', null); |
| 105 | 103 | $this->assign('displayName', null); |
| 106 | 104 | $this->assign('apiName', null); |
@@ -167,15 +165,13 @@ discard block |
||
| 167 | 165 | Logger::requestQueueEdited($database, $queue); |
| 168 | 166 | $queue->save(); |
| 169 | 167 | $this->redirect('queueManagement'); |
| 170 | - } |
|
| 171 | - else { |
|
| 168 | + } else { |
|
| 172 | 169 | $this->populateFromObject($queue); |
| 173 | 170 | |
| 174 | 171 | $this->assign('createMode', false); |
| 175 | 172 | $this->setTemplate('queue-management/edit.tpl'); |
| 176 | 173 | } |
| 177 | - } |
|
| 178 | - else { |
|
| 174 | + } else { |
|
| 179 | 175 | $this->populateFromObject($queue); |
| 180 | 176 | |
| 181 | 177 | $this->assign('createMode', false); |
@@ -55,8 +55,7 @@ discard block |
||
| 55 | 55 | $this->setTemplate($this->getRegistrationTemplate()); |
| 56 | 56 | $this->addJs("/vendor/dropbox/zxcvbn/dist/zxcvbn.js"); |
| 57 | 57 | } |
| 58 | - } |
|
| 59 | - else { |
|
| 58 | + } else { |
|
| 60 | 59 | $domain = WebRequest::getString('d'); |
| 61 | 60 | if ($domain === null) { |
| 62 | 61 | throw new ApplicationLogicException("No domain specified."); |
@@ -248,8 +247,7 @@ discard block |
||
| 248 | 247 | $authoriseUrl = $oauth->getRequestToken(); |
| 249 | 248 | WebRequest::setOAuthPartialLogin($user); |
| 250 | 249 | $this->redirectUrl($authoriseUrl); |
| 251 | - } |
|
| 252 | - else { |
|
| 250 | + } else { |
|
| 253 | 251 | // only notify if we're not using the oauth signup. |
| 254 | 252 | $this->getNotificationHelper()->userNew($user); |
| 255 | 253 | WebRequest::setLoggedInUser($user); |
@@ -42,8 +42,7 @@ discard block |
||
| 42 | 42 | if (WebRequest::wasPosted()) { |
| 43 | 43 | $request = $this->createNewRequest(null); |
| 44 | 44 | $this->handleFormPost($request); |
| 45 | - } |
|
| 46 | - else { |
|
| 45 | + } else { |
|
| 47 | 46 | $this->requestClientHints(); |
| 48 | 47 | $this->handleFormRefilling(); |
| 49 | 48 | |
@@ -77,8 +76,7 @@ discard block |
||
| 77 | 76 | if (WebRequest::wasPosted()) { |
| 78 | 77 | $request = $this->createNewRequest($form); |
| 79 | 78 | $this->handleFormPost($request); |
| 80 | - } |
|
| 81 | - else { |
|
| 79 | + } else { |
|
| 82 | 80 | $this->requestClientHints(); |
| 83 | 81 | $this->handleFormRefilling(); |
| 84 | 82 | |
@@ -106,8 +104,7 @@ discard block |
||
| 106 | 104 | |
| 107 | 105 | if ($form === null) { |
| 108 | 106 | $domain = 1; |
| 109 | - } |
|
| 110 | - else { |
|
| 107 | + } else { |
|
| 111 | 108 | $domain = $form->getDomain(); |
| 112 | 109 | $request->setOriginForm($form->getId()); |
| 113 | 110 | } |
@@ -285,8 +282,7 @@ discard block |
||
| 285 | 282 | if ($this->getSiteConfiguration()->getEmailConfirmationEnabled()) { |
| 286 | 283 | $this->saveAsEmailConfirmation($request, $comment); |
| 287 | 284 | $this->savePrivateData($request); |
| 288 | - } |
|
| 289 | - else { |
|
| 285 | + } else { |
|
| 290 | 286 | $this->saveWithoutEmailConfirmation($request, $comment); |
| 291 | 287 | $this->savePrivateData($request); |
| 292 | 288 | } |
@@ -320,11 +316,10 @@ discard block |
||
| 320 | 316 | |
| 321 | 317 | private function savePrivateData(Request $request) |
| 322 | 318 | { |
| 323 | - foreach ($this->getSiteConfiguration()->getAcceptClientHints() as $header) |
|
| 324 | - { |
|
| 319 | + foreach ($this->getSiteConfiguration()->getAcceptClientHints() as $header) { |
|
| 325 | 320 | $value = WebRequest::httpHeader($header); |
| 326 | 321 | |
| 327 | - if($value === null){ |
|
| 322 | + if($value === null) { |
|
| 328 | 323 | continue; |
| 329 | 324 | } |
| 330 | 325 | |
@@ -101,8 +101,7 @@ discard block |
||
| 101 | 101 | |
| 102 | 102 | SessionAlert::success('Comment has been saved successfully'); |
| 103 | 103 | $this->redirectBack($comment->getRequest()); |
| 104 | - } |
|
| 105 | - else { |
|
| 104 | + } else { |
|
| 106 | 105 | $this->assignCSRFToken(); |
| 107 | 106 | $this->assign('comment', $comment); |
| 108 | 107 | $this->assign('request', $request); |
@@ -171,8 +170,7 @@ discard block |
||
| 171 | 170 | |
| 172 | 171 | if ($source == 'flagged') { |
| 173 | 172 | $this->redirect('flaggedComments'); |
| 174 | - } |
|
| 175 | - else { |
|
| 173 | + } else { |
|
| 176 | 174 | $this->redirect('viewRequest', null, array('id' => $requestId)); |
| 177 | 175 | } |
| 178 | 176 | } |
@@ -129,8 +129,7 @@ discard block |
||
| 129 | 129 | |
| 130 | 130 | if ($logCount === 0) { |
| 131 | 131 | $this->assign('accountlog', array()); |
| 132 | - } |
|
| 133 | - else { |
|
| 132 | + } else { |
|
| 134 | 133 | list($users, $logData) = LogHelper::prepareLogsForTemplate($logs, $database, $this->getSiteConfiguration()); |
| 135 | 134 | |
| 136 | 135 | $this->assign("accountlog", $logData); |
@@ -151,8 +150,7 @@ discard block |
||
| 151 | 150 | if ($user->getForceIdentified() === null) { |
| 152 | 151 | $idVerifier = new IdentificationVerifier($this->getHttpHelper(), $this->getSiteConfiguration(), $this->getDatabase()); |
| 153 | 152 | $this->assign('identificationStatus', $idVerifier->isUserIdentified($user->getOnWikiName()) ? 'detected' : 'missing'); |
| 154 | - } |
|
| 155 | - else { |
|
| 153 | + } else { |
|
| 156 | 154 | $this->assign('identificationStatus', $user->getForceIdentified() == 1 ? 'forced-on' : 'forced-off'); |
| 157 | 155 | } |
| 158 | 156 | |