@@ -43,8 +43,7 @@ discard block |
||
| 43 | 43 | SessionAlert::success("Preferences updated!"); |
| 44 | 44 | |
| 45 | 45 | $this->redirect(''); |
| 46 | - } |
|
| 47 | - else { |
|
| 46 | + } else { |
|
| 48 | 47 | $this->assignCSRFToken(); |
| 49 | 48 | $this->setTemplate('preferences/prefs.tpl'); |
| 50 | 49 | $this->assign("enforceOAuth", $enforceOAuth); |
@@ -82,8 +81,7 @@ discard block |
||
| 82 | 81 | SessionAlert::success('Password changed successfully!'); |
| 83 | 82 | |
| 84 | 83 | $this->redirect('preferences'); |
| 85 | - } |
|
| 86 | - else { |
|
| 84 | + } else { |
|
| 87 | 85 | // not allowed to GET this. |
| 88 | 86 | $this->redirect('preferences'); |
| 89 | 87 | } |
@@ -33,7 +33,8 @@ discard block |
||
| 33 | 33 | $bans = Ban::getActiveBans(null, $this->getDatabase()); |
| 34 | 34 | |
| 35 | 35 | $userIds = array_map( |
| 36 | - function(Ban $entry) { |
|
| 36 | + function(Ban $entry) |
|
| 37 | + { |
|
| 37 | 38 | return $entry->getUser(); |
| 38 | 39 | }, |
| 39 | 40 | $bans); |
@@ -64,8 +65,7 @@ discard block |
||
| 64 | 65 | SessionAlert::error($ex->getMessage()); |
| 65 | 66 | $this->redirect("bans", "set"); |
| 66 | 67 | } |
| 67 | - } |
|
| 68 | - else { |
|
| 68 | + } else { |
|
| 69 | 69 | $this->handleGetMethodForSetBan(); |
| 70 | 70 | } |
| 71 | 71 | } |
@@ -103,8 +103,7 @@ discard block |
||
| 103 | 103 | $this->getNotificationHelper()->unbanned($ban, $unbanReason); |
| 104 | 104 | |
| 105 | 105 | $this->redirect('bans'); |
| 106 | - } |
|
| 107 | - else { |
|
| 106 | + } else { |
|
| 108 | 107 | $this->assignCSRFToken(); |
| 109 | 108 | $this->assign('ban', $ban); |
| 110 | 109 | $this->setTemplate('bans/unban.tpl'); |
@@ -122,19 +121,16 @@ discard block |
||
| 122 | 121 | |
| 123 | 122 | if (!$duration) { |
| 124 | 123 | throw new ApplicationLogicException('Invalid ban time'); |
| 125 | - } |
|
| 126 | - elseif (time() > $duration) { |
|
| 124 | + } elseif (time() > $duration) { |
|
| 127 | 125 | throw new ApplicationLogicException('Ban time has already expired!'); |
| 128 | 126 | } |
| 129 | 127 | |
| 130 | 128 | return $duration; |
| 131 | - } |
|
| 132 | - elseif ($duration === "-1") { |
|
| 129 | + } elseif ($duration === "-1") { |
|
| 133 | 130 | $duration = -1; |
| 134 | 131 | |
| 135 | 132 | return $duration; |
| 136 | - } |
|
| 137 | - else { |
|
| 133 | + } else { |
|
| 138 | 134 | $duration = WebRequest::postInt('duration') + time(); |
| 139 | 135 | |
| 140 | 136 | return $duration; |
@@ -36,7 +36,8 @@ discard block |
||
| 36 | 36 | $filterObjectType = null; |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | - $this->getTypeAheadHelper()->defineTypeAheadSource('username-typeahead', function() use ($database) { |
|
| 39 | + $this->getTypeAheadHelper()->defineTypeAheadSource('username-typeahead', function() use ($database) |
|
| 40 | + { |
|
| 40 | 41 | return UserSearchHelper::get($database)->fetchColumn('username'); |
| 41 | 42 | }); |
| 42 | 43 | |
@@ -116,8 +117,7 @@ discard block |
||
| 116 | 117 | if ($pageCount < $pageLimit) { |
| 117 | 118 | if ($pageData['lowpage'] == 1 && $pageData['hipage'] < $pageData['maxpage']) { |
| 118 | 119 | $pageData['hipage'] = min($pageLimit, $pageData['maxpage']); |
| 119 | - } |
|
| 120 | - elseif ($pageData['lowpage'] > 1 && $pageData['hipage'] == $pageData['maxpage']) { |
|
| 120 | + } elseif ($pageData['lowpage'] > 1 && $pageData['hipage'] == $pageData['maxpage']) { |
|
| 121 | 121 | $pageData['lowpage'] = max(1, $pageData['maxpage'] - $pageLimit + 1); |
| 122 | 122 | } |
| 123 | 123 | } |
@@ -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('requeststates', $requestStates); |
| 190 | 188 | $this->setTemplate('email-management/create.tpl'); |
@@ -29,8 +29,7 @@ |
||
| 29 | 29 | foreach ($teamData as $name => $item) { |
| 30 | 30 | if (count($item['Role']) == 0) { |
| 31 | 31 | $inactive[$name] = $item; |
| 32 | - } |
|
| 33 | - else { |
|
| 32 | + } else { |
|
| 34 | 33 | $active[$name] = $item; |
| 35 | 34 | } |
| 36 | 35 | } |
@@ -116,8 +116,7 @@ |
||
| 116 | 116 | $redirectDestination = WebRequest::clearPostLoginRedirect(); |
| 117 | 117 | if ($redirectDestination !== null && !$user->isNewUser()) { |
| 118 | 118 | $this->redirectUrl($redirectDestination); |
| 119 | - } |
|
| 120 | - else { |
|
| 119 | + } else { |
|
| 121 | 120 | $this->redirect('preferences', null, null, 'internal.php'); |
| 122 | 121 | } |
| 123 | 122 | } |
@@ -33,8 +33,7 @@ discard block |
||
| 33 | 33 | if ($config->getEmailConfirmationEnabled()) { |
| 34 | 34 | $query = "SELECT * FROM request WHERE status = :type AND emailconfirm = 'Confirmed' LIMIT :lim;"; |
| 35 | 35 | $totalQuery = "SELECT COUNT(id) FROM request WHERE status = :type AND emailconfirm = 'Confirmed';"; |
| 36 | - } |
|
| 37 | - else { |
|
| 36 | + } else { |
|
| 38 | 37 | $query = "SELECT * FROM request WHERE status = :type LIMIT :lim;"; |
| 39 | 38 | $totalQuery = "SELECT COUNT(id) FROM request WHERE status = :type;"; |
| 40 | 39 | } |
@@ -63,7 +62,8 @@ discard block |
||
| 63 | 62 | $totalRequestsStatement->closeCursor(); |
| 64 | 63 | |
| 65 | 64 | $userIds = array_map( |
| 66 | - function(Request $entry) { |
|
| 65 | + function(Request $entry) |
|
| 66 | + { |
|
| 67 | 67 | return $entry->getReserved(); |
| 68 | 68 | }, |
| 69 | 69 | $requests); |
@@ -44,8 +44,7 @@ discard block |
||
| 44 | 44 | $this->assign("declinedUsers", UserSearchHelper::get($database)->byStatus(User::STATUS_DECLINED)->fetch()); |
| 45 | 45 | |
| 46 | 46 | UserSearchHelper::get($database)->getRoleMap($roleMap); |
| 47 | - } |
|
| 48 | - else { |
|
| 47 | + } else { |
|
| 49 | 48 | $this->assign("showAll", false); |
| 50 | 49 | $this->assign("suspendedUsers", array()); |
| 51 | 50 | $this->assign("declinedUsers", array()); |
@@ -65,7 +64,8 @@ discard block |
||
| 65 | 64 | |
| 66 | 65 | $this->assign('roles', $roleMap); |
| 67 | 66 | |
| 68 | - $this->getTypeAheadHelper()->defineTypeAheadSource('username-typeahead', function() use ($database) { |
|
| 67 | + $this->getTypeAheadHelper()->defineTypeAheadSource('username-typeahead', function() use ($database) |
|
| 68 | + { |
|
| 69 | 69 | return UserSearchHelper::get($database)->fetchColumn('username'); |
| 70 | 70 | }); |
| 71 | 71 | |
@@ -166,8 +166,7 @@ discard block |
||
| 166 | 166 | |
| 167 | 167 | $this->redirect('statistics/users', 'detail', array('user' => $user->getId())); |
| 168 | 168 | return; |
| 169 | - } |
|
| 170 | - else { |
|
| 169 | + } else { |
|
| 171 | 170 | $this->assignCSRFToken(); |
| 172 | 171 | $this->setTemplate('usermanagement/roleedit.tpl'); |
| 173 | 172 | $this->assign('user', $user); |
@@ -228,8 +227,7 @@ discard block |
||
| 228 | 227 | $this->redirect('userManagement'); |
| 229 | 228 | |
| 230 | 229 | return; |
| 231 | - } |
|
| 232 | - else { |
|
| 230 | + } else { |
|
| 233 | 231 | $this->assignCSRFToken(); |
| 234 | 232 | $this->setTemplate('usermanagement/changelevel-reason.tpl'); |
| 235 | 233 | $this->assign('user', $user); |
@@ -289,8 +287,7 @@ discard block |
||
| 289 | 287 | $this->redirect('userManagement'); |
| 290 | 288 | |
| 291 | 289 | return; |
| 292 | - } |
|
| 293 | - else { |
|
| 290 | + } else { |
|
| 294 | 291 | $this->assignCSRFToken(); |
| 295 | 292 | $this->setTemplate('usermanagement/changelevel-reason.tpl'); |
| 296 | 293 | $this->assign('user', $user); |
@@ -344,8 +341,7 @@ discard block |
||
| 344 | 341 | $this->redirect("userManagement"); |
| 345 | 342 | |
| 346 | 343 | return; |
| 347 | - } |
|
| 348 | - else { |
|
| 344 | + } else { |
|
| 349 | 345 | $this->assignCSRFToken(); |
| 350 | 346 | $this->setTemplate("usermanagement/changelevel-reason.tpl"); |
| 351 | 347 | $this->assign("user", $user); |
@@ -425,8 +421,7 @@ discard block |
||
| 425 | 421 | $this->redirect("userManagement"); |
| 426 | 422 | |
| 427 | 423 | return; |
| 428 | - } |
|
| 429 | - else { |
|
| 424 | + } else { |
|
| 430 | 425 | $this->assignCSRFToken(); |
| 431 | 426 | $this->setTemplate('usermanagement/renameuser.tpl'); |
| 432 | 427 | $this->assign('user', $user); |
@@ -482,8 +477,7 @@ discard block |
||
| 482 | 477 | $this->redirect("userManagement"); |
| 483 | 478 | |
| 484 | 479 | return; |
| 485 | - } |
|
| 486 | - else { |
|
| 480 | + } else { |
|
| 487 | 481 | $this->assignCSRFToken(); |
| 488 | 482 | $this->setTemplate('usermanagement/edituser.tpl'); |
| 489 | 483 | $this->assign('user', $user); |
@@ -42,8 +42,7 @@ discard block |
||
| 42 | 42 | $this->doCustomClose($currentUser, $request, $database); |
| 43 | 43 | |
| 44 | 44 | $this->redirect(); |
| 45 | - } |
|
| 46 | - else { |
|
| 45 | + } else { |
|
| 47 | 46 | $this->assignCSRFToken(); |
| 48 | 47 | $this->showCustomCloseForm($database, $request); |
| 49 | 48 | } |
@@ -185,16 +184,14 @@ discard block |
||
| 185 | 184 | |
| 186 | 185 | // Send the mail after the save, since save can be rolled back |
| 187 | 186 | $this->sendMail($request, $messageBody, $currentUser, $ccMailingList); |
| 188 | - } |
|
| 189 | - else { |
|
| 187 | + } else { |
|
| 190 | 188 | if (array_key_exists($action, $availableRequestStates)) { |
| 191 | 189 | // Defer to other state |
| 192 | 190 | $this->deferRequest($request, $database, $action, $availableRequestStates, $messageBody); |
| 193 | 191 | |
| 194 | 192 | // Send the mail after the save, since save can be rolled back |
| 195 | 193 | $this->sendMail($request, $messageBody, $currentUser, $ccMailingList); |
| 196 | - } |
|
| 197 | - else { |
|
| 194 | + } else { |
|
| 198 | 195 | $request->setReserved(null); |
| 199 | 196 | $request->setUpdateVersion(WebRequest::postInt('updateversion')); |
| 200 | 197 | $request->save(); |
@@ -236,8 +233,7 @@ discard block |
||
| 236 | 233 | if ($action == EmailTemplate::CREATED) { |
| 237 | 234 | $logCloseType = 'custom-y'; |
| 238 | 235 | $notificationCloseType = "Custom, Created"; |
| 239 | - } |
|
| 240 | - else { |
|
| 236 | + } else { |
|
| 241 | 237 | $logCloseType = 'custom-n'; |
| 242 | 238 | $notificationCloseType = "Custom, Not Created"; |
| 243 | 239 | } |