@@ -48,8 +48,7 @@ |
||
| 48 | 48 | |
| 49 | 49 | if ($external) { |
| 50 | 50 | return $smarty->fetch("offline/external.tpl"); |
| 51 | - } |
|
| 52 | - else { |
|
| 51 | + } else { |
|
| 53 | 52 | $hideCulprit = true; |
| 54 | 53 | |
| 55 | 54 | // Use the provided message if possible |
@@ -340,8 +340,7 @@ discard block |
||
| 340 | 340 | if (count($pathInfo) === 0) { |
| 341 | 341 | // No pathInfo, so no page to load. Load the main page. |
| 342 | 342 | return $this->getDefaultRoute(); |
| 343 | - } |
|
| 344 | - elseif (count($pathInfo) === 1) { |
|
| 343 | + } elseif (count($pathInfo) === 1) { |
|
| 345 | 344 | // Exactly one path info segment, it's got to be a page. |
| 346 | 345 | $classSegment = $pathInfo[0]; |
| 347 | 346 | |
@@ -353,8 +352,7 @@ discard block |
||
| 353 | 352 | // Let's handle more than two, and collapse it down into two. |
| 354 | 353 | $requestedAction = array_pop($pathInfo); |
| 355 | 354 | $classSegment = implode('/', $pathInfo); |
| 356 | - } |
|
| 357 | - else { |
|
| 355 | + } else { |
|
| 358 | 356 | // Two path info segments. |
| 359 | 357 | $classSegment = $pathInfo[0]; |
| 360 | 358 | $requestedAction = $pathInfo[1]; |
@@ -383,8 +381,7 @@ discard block |
||
| 383 | 381 | $action = 'main'; |
| 384 | 382 | |
| 385 | 383 | return array($pageClass, $action); |
| 386 | - } |
|
| 387 | - else { |
|
| 384 | + } else { |
|
| 388 | 385 | // Doesn't exist in map. Fall back to 404 |
| 389 | 386 | $pageClass = Page404::class; |
| 390 | 387 | $action = "main"; |
@@ -413,16 +410,14 @@ discard block |
||
| 413 | 410 | $action = $requestedAction; |
| 414 | 411 | |
| 415 | 412 | return array($pageClass, $action); |
| 416 | - } |
|
| 417 | - else { |
|
| 413 | + } else { |
|
| 418 | 414 | // Valid page, invalid action. 404 our way out. |
| 419 | 415 | $pageClass = Page404::class; |
| 420 | 416 | $action = 'main'; |
| 421 | 417 | |
| 422 | 418 | return array($pageClass, $action); |
| 423 | 419 | } |
| 424 | - } |
|
| 425 | - else { |
|
| 420 | + } else { |
|
| 426 | 421 | // Class doesn't exist in map. Fall back to 404 |
| 427 | 422 | $pageClass = Page404::class; |
| 428 | 423 | $action = 'main'; |
@@ -40,13 +40,11 @@ |
||
| 40 | 40 | echo 'Error resolving hostname, it doesn\'t look like this domain exists.'; |
| 41 | 41 | die(); |
| 42 | 42 | } |
| 43 | - } |
|
| 44 | - else { |
|
| 43 | + } else { |
|
| 45 | 44 | $data = urlencode($data); |
| 46 | 45 | } |
| 47 | 46 | |
| 48 | 47 | echo '<script>window.location.href=' . json_encode(str_replace("%DATA%", $data, $toolList[$tool])) . '</script>'; |
| 49 | -} |
|
| 50 | -else { |
|
| 48 | +} else { |
|
| 51 | 49 | header("Location: " . $_SERVER["REQUEST_URI"] . "&round2=true"); |
| 52 | 50 | } |
@@ -22,8 +22,7 @@ discard block |
||
| 22 | 22 | && (get_class($input) === DateTime::class || get_class($input) === DateTimeImmutable::class) |
| 23 | 23 | ) { |
| 24 | 24 | $then = $input; |
| 25 | - } |
|
| 26 | - else { |
|
| 25 | + } else { |
|
| 27 | 26 | try { |
| 28 | 27 | $then = new DateTime($input); |
| 29 | 28 | } |
@@ -53,29 +52,21 @@ discard block |
||
| 53 | 52 | if ($secs <= 10) { |
| 54 | 53 | $output = "just now"; |
| 55 | 54 | $pluralise = false; |
| 56 | - } |
|
| 57 | - elseif ($secs > 10 && $secs < $minuteCut) { |
|
| 55 | + } elseif ($secs > 10 && $secs < $minuteCut) { |
|
| 58 | 56 | $output = round($secs / $second) . " second"; |
| 59 | - } |
|
| 60 | - elseif ($secs >= $minuteCut && $secs < $hourCut) { |
|
| 57 | + } elseif ($secs >= $minuteCut && $secs < $hourCut) { |
|
| 61 | 58 | $output = round($secs / $minute) . " minute"; |
| 62 | - } |
|
| 63 | - elseif ($secs >= $hourCut && $secs < $dayCut) { |
|
| 59 | + } elseif ($secs >= $hourCut && $secs < $dayCut) { |
|
| 64 | 60 | $output = round($secs / $hour) . " hour"; |
| 65 | - } |
|
| 66 | - elseif ($secs >= $dayCut && $secs < $weekCut) { |
|
| 61 | + } elseif ($secs >= $dayCut && $secs < $weekCut) { |
|
| 67 | 62 | $output = round($secs / $day) . " day"; |
| 68 | - } |
|
| 69 | - elseif ($secs >= $weekCut && $secs < $monthCut) { |
|
| 63 | + } elseif ($secs >= $weekCut && $secs < $monthCut) { |
|
| 70 | 64 | $output = round($secs / $week) . " week"; |
| 71 | - } |
|
| 72 | - elseif ($secs >= $monthCut && $secs < $yearCut) { |
|
| 65 | + } elseif ($secs >= $monthCut && $secs < $yearCut) { |
|
| 73 | 66 | $output = round($secs / $month) . " month"; |
| 74 | - } |
|
| 75 | - elseif ($secs >= $yearCut && $secs < $year * 10) { |
|
| 67 | + } elseif ($secs >= $yearCut && $secs < $year * 10) { |
|
| 76 | 68 | $output = round($secs / $year) . " year"; |
| 77 | - } |
|
| 78 | - else { |
|
| 69 | + } else { |
|
| 79 | 70 | $output = "a long time ago"; |
| 80 | 71 | $pluralise = false; |
| 81 | 72 | } |
@@ -94,8 +94,7 @@ |
||
| 94 | 94 | if (!$policyIsSet) { |
| 95 | 95 | $constructedPolicy .= "'none' "; |
| 96 | 96 | } |
| 97 | - } |
|
| 98 | - else { |
|
| 97 | + } else { |
|
| 99 | 98 | $constructedPolicy .= "'none' "; |
| 100 | 99 | } |
| 101 | 100 | |
@@ -90,12 +90,10 @@ |
||
| 90 | 90 | |
| 91 | 91 | if ($statement->execute()) { |
| 92 | 92 | $this->id = (int)$this->dbObject->lastInsertId(); |
| 93 | - } |
|
| 94 | - else { |
|
| 93 | + } else { |
|
| 95 | 94 | throw new Exception($statement->errorInfo()); |
| 96 | 95 | } |
| 97 | - } |
|
| 98 | - else { |
|
| 96 | + } else { |
|
| 99 | 97 | $statement = $this->dbObject->prepare(<<<SQL |
| 100 | 98 | UPDATE oauthidentity SET |
| 101 | 99 | iss = :iss |
@@ -130,8 +130,7 @@ discard block |
||
| 130 | 130 | { |
| 131 | 131 | if ($timeout === null) { |
| 132 | 132 | $this->timeout = null; |
| 133 | - } |
|
| 134 | - else { |
|
| 133 | + } else { |
|
| 135 | 134 | $this->timeout = $timeout->format('Y-m-d H:i:s'); |
| 136 | 135 | } |
| 137 | 136 | } |
@@ -188,12 +187,10 @@ discard block |
||
| 188 | 187 | |
| 189 | 188 | if ($statement->execute()) { |
| 190 | 189 | $this->id = (int)$this->dbObject->lastInsertId(); |
| 191 | - } |
|
| 192 | - else { |
|
| 190 | + } else { |
|
| 193 | 191 | throw new Exception($statement->errorInfo()); |
| 194 | 192 | } |
| 195 | - } |
|
| 196 | - else { |
|
| 193 | + } else { |
|
| 197 | 194 | // update |
| 198 | 195 | $statement = $this->dbObject->prepare(<<<SQL |
| 199 | 196 | UPDATE credential |
@@ -42,12 +42,10 @@ |
||
| 42 | 42 | |
| 43 | 43 | if ($statement->execute()) { |
| 44 | 44 | $this->id = (int)$this->dbObject->lastInsertId(); |
| 45 | - } |
|
| 46 | - else { |
|
| 45 | + } else { |
|
| 47 | 46 | throw new Exception($statement->errorInfo()); |
| 48 | 47 | } |
| 49 | - } |
|
| 50 | - else { |
|
| 48 | + } else { |
|
| 51 | 49 | // update |
| 52 | 50 | $statement = $this->dbObject->prepare(<<<SQL |
| 53 | 51 | UPDATE oauthtoken |
@@ -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()); |