@@ -419,7 +419,9 @@ |
||
| 419 | 419 | // End of very very very basic auth |
| 420 | 420 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 421 | 421 | |
| 422 | -else: |
|
| 422 | +else { |
|
| 423 | + : |
|
| 423 | 424 | http_response_code(401); |
| 425 | +} |
|
| 424 | 426 | |
| 425 | 427 | endif; |
@@ -114,8 +114,10 @@ |
||
| 114 | 114 | </form> |
| 115 | 115 | |
| 116 | 116 | <?php |
| 117 | - else: |
|
| 117 | + else { |
|
| 118 | + : |
|
| 118 | 119 | echo '<div class="box-body">'.$sentSuccess.'</div>'; |
| 120 | + } |
|
| 119 | 121 | endif; |
| 120 | 122 | ?> |
| 121 | 123 | </div> |
@@ -64,21 +64,21 @@ discard block |
||
| 64 | 64 | case 'accept': |
| 65 | 65 | if (canAcceptSwap($swapId) || $verify == verificationCodeForSwap($swapId)) { |
| 66 | 66 | switch (acceptSwap($swapId)) { |
| 67 | - case '1': |
|
| 68 | - $message = 'Swap Successful'; |
|
| 69 | - break; |
|
| 70 | - case '2': |
|
| 71 | - $message = 'Swap already accepted.'; |
|
| 72 | - break; |
|
| 73 | - case '3': |
|
| 74 | - $message = 'Swap already declined.'; |
|
| 75 | - break; |
|
| 76 | - case '4': |
|
| 77 | - $message = 'Swap already reverted.'; |
|
| 78 | - break; |
|
| 79 | - default: |
|
| 80 | - $err = 'Technical issue - please inform system administrator'; |
|
| 81 | - break; |
|
| 67 | + case '1': |
|
| 68 | + $message = 'Swap Successful'; |
|
| 69 | + break; |
|
| 70 | + case '2': |
|
| 71 | + $message = 'Swap already accepted.'; |
|
| 72 | + break; |
|
| 73 | + case '3': |
|
| 74 | + $message = 'Swap already declined.'; |
|
| 75 | + break; |
|
| 76 | + case '4': |
|
| 77 | + $message = 'Swap already reverted.'; |
|
| 78 | + break; |
|
| 79 | + default: |
|
| 80 | + $err = 'Technical issue - please inform system administrator'; |
|
| 81 | + break; |
|
| 82 | 82 | } |
| 83 | 83 | } else { |
| 84 | 84 | $err = 'Swap Already Actioned or Verification Code Invalid'; |
@@ -87,15 +87,15 @@ discard block |
||
| 87 | 87 | case 'decline': |
| 88 | 88 | if (canDeclineSwap($swapId) || $verify == verificationCodeForSwap($swapId)) { |
| 89 | 89 | switch (declineSwap($swapId)) { |
| 90 | - case '1': |
|
| 91 | - $message = 'Swap declined'; |
|
| 92 | - break; |
|
| 93 | - case '2': |
|
| 94 | - $message = 'Swap already declined.'; |
|
| 95 | - break; |
|
| 96 | - default: |
|
| 97 | - $err = 'Technical issue - please inform system administrator'; |
|
| 98 | - break; |
|
| 90 | + case '1': |
|
| 91 | + $message = 'Swap declined'; |
|
| 92 | + break; |
|
| 93 | + case '2': |
|
| 94 | + $message = 'Swap already declined.'; |
|
| 95 | + break; |
|
| 96 | + default: |
|
| 97 | + $err = 'Technical issue - please inform system administrator'; |
|
| 98 | + break; |
|
| 99 | 99 | } |
| 100 | 100 | } else { |
| 101 | 101 | $err = 'Swap Already Actioned or Verification Code Invalid'; |
@@ -271,14 +271,17 @@ |
||
| 271 | 271 | |
| 272 | 272 | <?php endforeach; ?> |
| 273 | 273 | |
| 274 | - <?php else: ?> |
|
| 274 | + <?php else { |
|
| 275 | + : ?> |
|
| 275 | 276 | <?php // event has no roles the user can cover?> |
| 276 | 277 | |
| 277 | 278 | <div class="alert alert-warning"> |
| 278 | 279 | <h4><i class="icon fa fa-info"></i>There are no roles in the event you are skilled to cover.</h4> |
| 279 | 280 | <p>If you need adding to the rota, speak to an admin.</p> |
| 280 | 281 | </div> |
| 281 | - <?php endif; ?> |
|
| 282 | + <?php endif; |
|
| 283 | +} |
|
| 284 | +?> |
|
| 282 | 285 | |
| 283 | 286 | |
| 284 | 287 | <?php include 'includes/footer.php'; ?> |
@@ -567,7 +567,8 @@ discard block |
||
| 567 | 567 | <?php if (!$userRole->getReserve()): ?> |
| 568 | 568 | <?php $isInEvent = in_array($userRole->getId(), $usersInEvent) ?> |
| 569 | 569 | <option value="<?php echo $userRole->getId() ?>" <?php echo $isInEvent ? 'selected="selected"' : '' ?>><?php echo $userRole->getUser()->getFirstName().' '.$userRole->getUser()->getLastName() ?></option> |
| 570 | - <?php else: ?> |
|
| 570 | + <?php else { |
|
| 571 | + : ?> |
|
| 571 | 572 | <?php $countReserve += 1 ?> |
| 572 | 573 | <?php endif //!userRole->getReserve?> |
| 573 | 574 | <?php endforeach //users?> |
@@ -646,4 +647,6 @@ discard block |
||
| 646 | 647 | </div><!-- /.createSeries --> |
| 647 | 648 | |
| 648 | 649 | |
| 649 | -<?php include 'includes/footer.php'; ?> |
|
| 650 | +<?php include 'includes/footer.php'; |
|
| 651 | +} |
|
| 652 | +?> |
|
@@ -435,8 +435,10 @@ |
||
| 435 | 435 | |
| 436 | 436 | echo '</li>'; |
| 437 | 437 | } |
| 438 | - echo '</ul>'; else: |
|
| 438 | + echo '</ul>'; else { |
|
| 439 | + : |
|
| 439 | 440 | echo '<p>No roles assigned to this event.'; |
| 441 | + } |
|
| 440 | 442 | endif; ?> |
| 441 | 443 | </div><!-- /.user-roles --> |
| 442 | 444 | </div><!-- /.box-body --> |
@@ -28,25 +28,25 @@ |
||
| 28 | 28 | $id = filter_var($id, FILTER_SANITIZE_NUMBER_INT); |
| 29 | 29 | |
| 30 | 30 | switch ($_POST['action']) { |
| 31 | - case 'approve': |
|
| 32 | - $userId = approvePendingUser($id); |
|
| 33 | - mailNewUser($userId); |
|
| 34 | - header('Location: addUser.php?action=edit&user='.$userId); |
|
| 35 | - break; |
|
| 36 | - case 'merge': |
|
| 37 | - $existingUserId = $_POST['existingUser']; |
|
| 38 | - $existingUserId = filter_var($existingUserId, FILTER_SANITIZE_NUMBER_INT); |
|
| 39 | - mergePendingUserWithUserId($id, $existingUserId); |
|
| 40 | - mailNewUser($existingUserId); |
|
| 41 | - header('Location: addUser.php?action=edit&user='.$existingUserId); |
|
| 42 | - break; |
|
| 43 | - case 'decline': |
|
| 44 | - declinePendingUser($id); |
|
| 45 | - break; |
|
| 46 | - |
|
| 47 | - default: |
|
| 48 | - // code... |
|
| 49 | - break; |
|
| 31 | + case 'approve': |
|
| 32 | + $userId = approvePendingUser($id); |
|
| 33 | + mailNewUser($userId); |
|
| 34 | + header('Location: addUser.php?action=edit&user='.$userId); |
|
| 35 | + break; |
|
| 36 | + case 'merge': |
|
| 37 | + $existingUserId = $_POST['existingUser']; |
|
| 38 | + $existingUserId = filter_var($existingUserId, FILTER_SANITIZE_NUMBER_INT); |
|
| 39 | + mergePendingUserWithUserId($id, $existingUserId); |
|
| 40 | + mailNewUser($existingUserId); |
|
| 41 | + header('Location: addUser.php?action=edit&user='.$existingUserId); |
|
| 42 | + break; |
|
| 43 | + case 'decline': |
|
| 44 | + declinePendingUser($id); |
|
| 45 | + break; |
|
| 46 | + |
|
| 47 | + default: |
|
| 48 | + // code... |
|
| 49 | + break; |
|
| 50 | 50 | } |
| 51 | 51 | } |
| 52 | 52 | |
@@ -266,8 +266,10 @@ discard block |
||
| 266 | 266 | if (is_array($rotaoutput)): |
| 267 | 267 | foreach ($rotaoutput as $key => $skill): |
| 268 | 268 | $skillfinal = $skillfinal.$skill.' '; |
| 269 | - endforeach; else: |
|
| 269 | + endforeach; else { |
|
| 270 | + : |
|
| 270 | 271 | $skillfinal = $rotaoutput; |
| 272 | + } |
|
| 271 | 273 | endif; |
| 272 | 274 | $message = str_replace('[rotaoutput]', $skillfinal, $message); |
| 273 | 275 | $message = str_replace('[siteurl]', $siteurl, $message); |
@@ -445,8 +447,10 @@ discard block |
||
| 445 | 447 | $roles = []; |
| 446 | 448 | while ($roleRow = mysqli_fetch_array($roleResult, MYSQLI_ASSOC)) { |
| 447 | 449 | if (($roleRow['name'] == '') || ($roleRow['name'] == $roleRow['description'])): |
| 448 | - $roles[] = $roleRow['description']; else: |
|
| 450 | + $roles[] = $roleRow['description']; else { |
|
| 451 | + : |
|
| 449 | 452 | $roles[] = $roleRow['description'].' - '.$roleRow['name']; |
| 453 | + } |
|
| 450 | 454 | endif; |
| 451 | 455 | } |
| 452 | 456 | |
@@ -37,22 +37,22 @@ |
||
| 37 | 37 | $platform = strtolower($_POST['platform']); |
| 38 | 38 | |
| 39 | 39 | switch ($_POST['action']) { |
| 40 | - case 'link': |
|
| 41 | - switch ($platform) { |
|
| 40 | + case 'link': |
|
| 41 | + switch ($platform) { |
|
| 42 | 42 | case 'facebook': |
| 43 | 43 | $_SESSION['fb-callback-url'] = 'fb-link.php'; |
| 44 | 44 | header('Location: fb-login.php'); |
| 45 | 45 | exit; |
| 46 | - } |
|
| 47 | - break; |
|
| 48 | - case 'unlink': |
|
| 49 | - removeSocialAuthFromUserWithId($id, $platform); |
|
| 50 | - createNotificationForUser($id, ucfirst($platform).' account unlinked', 'You have successfully unlinked your Facebook account. Login via Facebook is now disabled for your account. Feel free to relink your account at any time.', 'account', 'linkSocialAuth.php'); |
|
| 51 | - break; |
|
| 52 | - |
|
| 53 | - default: |
|
| 54 | - // code... |
|
| 46 | + } |
|
| 55 | 47 | break; |
| 48 | + case 'unlink': |
|
| 49 | + removeSocialAuthFromUserWithId($id, $platform); |
|
| 50 | + createNotificationForUser($id, ucfirst($platform).' account unlinked', 'You have successfully unlinked your Facebook account. Login via Facebook is now disabled for your account. Feel free to relink your account at any time.', 'account', 'linkSocialAuth.php'); |
|
| 51 | + break; |
|
| 52 | + |
|
| 53 | + default: |
|
| 54 | + // code... |
|
| 55 | + break; |
|
| 56 | 56 | } |
| 57 | 57 | } |
| 58 | 58 | |
@@ -106,14 +106,17 @@ |
||
| 106 | 106 | <input type="hidden" name="action" value="unlink" /> |
| 107 | 107 | <button class="btn btn-danger">Unlink</button> |
| 108 | 108 | </form> |
| 109 | - <?php else: ?> |
|
| 109 | + <?php else { |
|
| 110 | + : ?> |
|
| 110 | 111 | <form action="#" method="post"> |
| 111 | 112 | <input type="hidden" name="id" value="<?php echo $id ?>" /> |
| 112 | 113 | <input type="hidden" name="platform" value="<?php echo $platform ?>" /> |
| 113 | 114 | <input type="hidden" name="action" value="link" /> |
| 114 | 115 | <button class="btn btn-primary">Link</button> |
| 115 | 116 | </form> |
| 116 | - <?php endif; ?> |
|
| 117 | + <?php endif; |
|
| 118 | +} |
|
| 119 | +?> |
|
| 117 | 120 | </div> |
| 118 | 121 | </div> |
| 119 | 122 | <?php endforeach; ?> |
@@ -323,8 +323,10 @@ discard block |
||
| 323 | 323 | echo '</li>'; |
| 324 | 324 | } |
| 325 | 325 | echo '</ul>'; |
| 326 | - else: |
|
| 326 | + else { |
|
| 327 | + : |
|
| 327 | 328 | echo '<p>No roles assigned to this event.'; |
| 329 | + } |
|
| 328 | 330 | endif; |
| 329 | 331 | ?> |
| 330 | 332 | </div> |
@@ -353,7 +355,8 @@ discard block |
||
| 353 | 355 | <a href="events.php?view=all" class="btn btn-primary">view all events</a> |
| 354 | 356 | </div> |
| 355 | 357 | |
| 356 | - <?php else: ?> |
|
| 358 | + <?php else { |
|
| 359 | + : ?> |
|
| 357 | 360 | <p>There are no events this week. <a href="events.php?view=all">View all events</a></p> |
| 358 | 361 | <?php endif ?> |
| 359 | 362 | |
@@ -374,6 +377,7 @@ discard block |
||
| 374 | 377 | |
| 375 | 378 | <?php // Month separators |
| 376 | 379 | $newMonth = strftime('%B %Y', strtotime($event->date)); |
| 380 | +} |
|
| 377 | 381 | if ($month != $newMonth): |
| 378 | 382 | $month = $newMonth; |
| 379 | 383 | ?> |
@@ -500,8 +504,10 @@ discard block |
||
| 500 | 504 | echo '</li>'; |
| 501 | 505 | } |
| 502 | 506 | echo '</ul>'; |
| 503 | - else: |
|
| 507 | + else { |
|
| 508 | + : |
|
| 504 | 509 | echo '<p>No roles assigned to this event.'; |
| 510 | + } |
|
| 505 | 511 | endif; |
| 506 | 512 | ?> |
| 507 | 513 | </div> |
@@ -527,7 +533,8 @@ discard block |
||
| 527 | 533 | <?php endforeach ?> |
| 528 | 534 | </ul> |
| 529 | 535 | |
| 530 | - <?php else: ?> |
|
| 536 | + <?php else { |
|
| 537 | + : ?> |
|
| 531 | 538 | <p>You have no events on the upcoming rota. <a href="events.php">View all events</a></p> |
| 532 | 539 | <?php endif ?> |
| 533 | 540 | |
@@ -649,6 +656,7 @@ discard block |
||
| 649 | 656 | <a href="addUser.php?action=edit"> |
| 650 | 657 | <?php |
| 651 | 658 | $userHasEmail = (strlen($user->getEmail()) > 3); |
| 659 | +} |
|
| 652 | 660 | $emailRemindersEnabled = ($userHasEmail && true); // todo: add opt-out for email reminders |
| 653 | 661 | ?> |
| 654 | 662 | Email Reminders <span class="pull-right badge bg-<?php echo $emailRemindersEnabled ? 'green' : 'red' ?>"><?php echo $emailRemindersEnabled ? siteSettings()->getDaysToAlert().' days before' : ($userHasEmail ? 'Disabled' : 'No email address') ?></span> |