@@ -23,35 +23,35 @@ |
||
| 23 | 23 | switch ($method) { |
| 24 | 24 | case 'revoke': |
| 25 | 25 | $id = $_POST['id']; |
| 26 | - $id = filter_var($id, FILTER_SANITIZE_NUMBER_INT); |
|
| 26 | + $id = filter_var($id, FILTER_SANITIZE_NUMBER_INT); |
|
| 27 | 27 | |
| 28 | - revokeCalendarToken($id); |
|
| 29 | - header('Location: calendarTokens.php'); |
|
| 30 | - break; |
|
| 28 | + revokeCalendarToken($id); |
|
| 29 | + header('Location: calendarTokens.php'); |
|
| 30 | + break; |
|
| 31 | 31 | |
| 32 | 32 | default: |
| 33 | 33 | // generate new URL |
| 34 | 34 | $format = $_POST['format']; |
| 35 | - $description = $_POST['description']; |
|
| 36 | - |
|
| 37 | - if (empty($format)) { |
|
| 38 | - $error = 'Format must be set'; |
|
| 39 | - break; |
|
| 40 | - } |
|
| 41 | - if (empty($description)) { |
|
| 42 | - $error = 'Device or software name cannot be empty'; |
|
| 43 | - break; |
|
| 44 | - } |
|
| 45 | - $count = CalendarTokenQuery::create()->filterByUserId($sessionUserId)->filterByDescription($description)->filterByRevoked(false)->count(); |
|
| 46 | - if ($count > 0) { |
|
| 47 | - $error = 'You already have a calendar for the same device or software name. Please revoke the existing token or use a different name.'; |
|
| 48 | - break; |
|
| 49 | - } |
|
| 50 | - |
|
| 51 | - $token = createCalendarToken($sessionUserId, $format, $description); |
|
| 52 | - $url = siteSettings()->getSiteUrl()."/calendar.php?user=$sessionUserId&format=$format&token=$token"; |
|
| 53 | - break; |
|
| 54 | - } |
|
| 35 | + $description = $_POST['description']; |
|
| 36 | + |
|
| 37 | + if (empty($format)) { |
|
| 38 | + $error = 'Format must be set'; |
|
| 39 | + break; |
|
| 40 | + } |
|
| 41 | + if (empty($description)) { |
|
| 42 | + $error = 'Device or software name cannot be empty'; |
|
| 43 | + break; |
|
| 44 | + } |
|
| 45 | + $count = CalendarTokenQuery::create()->filterByUserId($sessionUserId)->filterByDescription($description)->filterByRevoked(false)->count(); |
|
| 46 | + if ($count > 0) { |
|
| 47 | + $error = 'You already have a calendar for the same device or software name. Please revoke the existing token or use a different name.'; |
|
| 48 | + break; |
|
| 49 | + } |
|
| 50 | + |
|
| 51 | + $token = createCalendarToken($sessionUserId, $format, $description); |
|
| 52 | + $url = siteSettings()->getSiteUrl()."/calendar.php?user=$sessionUserId&format=$format&token=$token"; |
|
| 53 | + break; |
|
| 54 | + } |
|
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | // fetch existing calendar URLs |
@@ -21,36 +21,36 @@ |
||
| 21 | 21 | $method = $_POST['method']; |
| 22 | 22 | |
| 23 | 23 | switch ($method) { |
| 24 | - case 'revoke': |
|
| 25 | - $id = $_POST['id']; |
|
| 26 | - $id = filter_var($id, FILTER_SANITIZE_NUMBER_INT); |
|
| 24 | + case 'revoke': |
|
| 25 | + $id = $_POST['id']; |
|
| 26 | + $id = filter_var($id, FILTER_SANITIZE_NUMBER_INT); |
|
| 27 | 27 | |
| 28 | - revokeCalendarToken($id); |
|
| 29 | - header('Location: calendarTokens.php'); |
|
| 30 | - break; |
|
| 31 | - |
|
| 32 | - default: |
|
| 33 | - // generate new URL |
|
| 34 | - $format = $_POST['format']; |
|
| 35 | - $description = $_POST['description']; |
|
| 36 | - |
|
| 37 | - if (empty($format)) { |
|
| 38 | - $error = 'Format must be set'; |
|
| 39 | - break; |
|
| 40 | - } |
|
| 41 | - if (empty($description)) { |
|
| 42 | - $error = 'Device or software name cannot be empty'; |
|
| 28 | + revokeCalendarToken($id); |
|
| 29 | + header('Location: calendarTokens.php'); |
|
| 43 | 30 | break; |
| 44 | - } |
|
| 45 | - $count = CalendarTokenQuery::create()->filterByUserId($sessionUserId)->filterByDescription($description)->filterByRevoked(false)->count(); |
|
| 46 | - if ($count > 0) { |
|
| 47 | - $error = 'You already have a calendar for the same device or software name. Please revoke the existing token or use a different name.'; |
|
| 48 | - break; |
|
| 49 | - } |
|
| 50 | 31 | |
| 51 | - $token = createCalendarToken($sessionUserId, $format, $description); |
|
| 52 | - $url = siteSettings()->getSiteUrl()."/calendar.php?user=$sessionUserId&format=$format&token=$token"; |
|
| 53 | - break; |
|
| 32 | + default: |
|
| 33 | + // generate new URL |
|
| 34 | + $format = $_POST['format']; |
|
| 35 | + $description = $_POST['description']; |
|
| 36 | + |
|
| 37 | + if (empty($format)) { |
|
| 38 | + $error = 'Format must be set'; |
|
| 39 | + break; |
|
| 40 | + } |
|
| 41 | + if (empty($description)) { |
|
| 42 | + $error = 'Device or software name cannot be empty'; |
|
| 43 | + break; |
|
| 44 | + } |
|
| 45 | + $count = CalendarTokenQuery::create()->filterByUserId($sessionUserId)->filterByDescription($description)->filterByRevoked(false)->count(); |
|
| 46 | + if ($count > 0) { |
|
| 47 | + $error = 'You already have a calendar for the same device or software name. Please revoke the existing token or use a different name.'; |
|
| 48 | + break; |
|
| 49 | + } |
|
| 50 | + |
|
| 51 | + $token = createCalendarToken($sessionUserId, $format, $description); |
|
| 52 | + $url = siteSettings()->getSiteUrl()."/calendar.php?user=$sessionUserId&format=$format&token=$token"; |
|
| 53 | + break; |
|
| 54 | 54 | } |
| 55 | 55 | } |
| 56 | 56 | |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | $token = createCalendarToken($sessionUserId, $format, $description); |
| 52 | - $url = siteSettings()->getSiteUrl()."/calendar.php?user=$sessionUserId&format=$format&token=$token"; |
|
| 52 | + $url = siteSettings()->getSiteUrl() . "/calendar.php?user=$sessionUserId&format=$format&token=$token"; |
|
| 53 | 53 | break; |
| 54 | 54 | } |
| 55 | 55 | } |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | <?php echo empty($calendars) ? '<p>none</p>' : '' ?> |
| 129 | 129 | <?php foreach ($calendars as $calendar): ?> |
| 130 | 130 | <?php echo $calendar->revoked ? '<s>' : '' ?> |
| 131 | - <p><?php echo $calendar->description.' ('.$calendar->format.')'; ?></p> |
|
| 131 | + <p><?php echo $calendar->description . ' (' . $calendar->format . ')'; ?></p> |
|
| 132 | 132 | <?php if (!$calendar->revoked): ?> |
| 133 | 133 | <form action="#" method="post"> |
| 134 | 134 | <input type="hidden" name="method" value="revoke" /> |
@@ -51,7 +51,7 @@ |
||
| 51 | 51 | case 'everyone': |
| 52 | 52 | echo '<p>Function not complete, please wait while we finish writing it.</p><p>Apologies for any inconvinence.</p>'; |
| 53 | 53 | break; |
| 54 | - default: |
|
| 54 | + default: |
|
| 55 | 55 | echo '<p>Error: Insufficient parameters.</p>'; |
| 56 | 56 | echo '<p>Please inform the system administrator</p>'; |
| 57 | 57 | break; |
@@ -17,10 +17,10 @@ |
||
| 17 | 17 | $_SESSION['foo'] = 'bar'; |
| 18 | 18 | |
| 19 | 19 | $fb = new Facebook\Facebook([ |
| 20 | - 'app_id' => $config['auth']['facebook']['appId'], |
|
| 21 | - 'app_secret' => $config['auth']['facebook']['appSecret'], |
|
| 22 | - 'default_graph_version' => 'v2.2', |
|
| 23 | - ]); |
|
| 20 | + 'app_id' => $config['auth']['facebook']['appId'], |
|
| 21 | + 'app_secret' => $config['auth']['facebook']['appSecret'], |
|
| 22 | + 'default_graph_version' => 'v2.2', |
|
| 23 | + ]); |
|
| 24 | 24 | |
| 25 | 25 | $helper = $fb->getRedirectLoginHelper(); |
| 26 | 26 | |
@@ -25,6 +25,6 @@ |
||
| 25 | 25 | $helper = $fb->getRedirectLoginHelper(); |
| 26 | 26 | |
| 27 | 27 | $permissions = ['email']; // Optional permissions |
| 28 | -$loginUrl = $helper->getLoginUrl(siteSettings()->getSiteUrl().'/fb-callback.php', $permissions); |
|
| 28 | +$loginUrl = $helper->getLoginUrl(siteSettings()->getSiteUrl() . '/fb-callback.php', $permissions); |
|
| 29 | 29 | |
| 30 | -header('Location: '.$loginUrl); |
|
| 30 | +header('Location: ' . $loginUrl); |
|
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | exit; |
| 36 | 36 | } |
| 37 | 37 | if (!isAdmin()) { |
| 38 | - header('Location: error.php?no=100&page='.basename($_SERVER['SCRIPT_FILENAME'])); |
|
| 38 | + header('Location: error.php?no=100&page=' . basename($_SERVER['SCRIPT_FILENAME'])); |
|
| 39 | 39 | exit; |
| 40 | 40 | } |
| 41 | 41 | |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | if ($editskillID != '') { |
| 72 | 72 | $sql = ("INSERT INTO cr_eventPeople (eventID, skillID) VALUES ('$editeventID', '$editskillID')"); |
| 73 | 73 | if (!mysqli_query(db(), $sql)) { |
| 74 | - die('Error: '.mysqli_error(db())); |
|
| 74 | + die('Error: ' . mysqli_error(db())); |
|
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | // After we have inserted the data, we want to head back to the main page |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | |
| 89 | 89 | $sql = ("INSERT INTO cr_eventPeople (eventID, skillID) VALUES ('$editeventID', '$editskillID')"); |
| 90 | 90 | if (!mysqli_query(db(), $sql)) { |
| 91 | - die('Error: '.mysqli_error(db())); |
|
| 91 | + die('Error: ' . mysqli_error(db())); |
|
| 92 | 92 | } |
| 93 | 93 | } |
| 94 | 94 | |
@@ -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 | |
@@ -47,7 +47,7 @@ |
||
| 47 | 47 | break; |
| 48 | 48 | case 'unlink': |
| 49 | 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'); |
|
| 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 | 51 | break; |
| 52 | 52 | |
| 53 | 53 | default: |
@@ -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; ?> |
@@ -41,19 +41,19 @@ |
||
| 41 | 41 | switch ($platform) { |
| 42 | 42 | case 'facebook': |
| 43 | 43 | $_SESSION['fb-callback-url'] = 'fb-link.php'; |
| 44 | - header('Location: fb-login.php'); |
|
| 45 | - exit; |
|
| 46 | - } |
|
| 47 | - break; |
|
| 44 | + header('Location: fb-login.php'); |
|
| 45 | + exit; |
|
| 46 | + } |
|
| 47 | + break; |
|
| 48 | 48 | case 'unlink': |
| 49 | 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; |
|
| 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 | 52 | |
| 53 | 53 | default: |
| 54 | 54 | // code... |
| 55 | 55 | break; |
| 56 | - } |
|
| 56 | + } |
|
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | // list of possible social account links (names used as platform names in database) |
@@ -178,10 +178,10 @@ discard block |
||
| 178 | 178 | <div class="col-sm-8 col-md-8 col-lg-6"> |
| 179 | 179 | |
| 180 | 180 | <?php |
| 181 | - // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
| 182 | - // ~~~~~~~~ Events this week ~~~~~~~~ |
|
| 183 | - // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
| 184 | - ?> |
|
| 181 | + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
| 182 | + // ~~~~~~~~ Events this week ~~~~~~~~ |
|
| 183 | + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
| 184 | + ?> |
|
| 185 | 185 | |
| 186 | 186 | <h2>Events this week:</h2> |
| 187 | 187 | |
@@ -205,17 +205,17 @@ discard block |
||
| 205 | 205 | <div class="timeline-header"> |
| 206 | 206 | <a href="event.php?id=<?php echo $event->getId() ?>"> |
| 207 | 207 | <h4><?php |
| 208 | - echo $event->getDate('jS: '); |
|
| 209 | - $eventPeople = EventPersonQuery::create()->filterByEvent($event)->find(); |
|
| 210 | - $roles = []; |
|
| 211 | - foreach ($eventPeople as $eventPerson) { |
|
| 212 | - if ($eventPerson->getUserRole()->getUserId() == $user->getId()) { |
|
| 213 | - $roles[] = $eventPerson->getUserRole()->getRole()->getName(); |
|
| 214 | - } |
|
| 215 | - } |
|
| 216 | - $roles = implode(', ', $roles); |
|
| 217 | - echo $roles != '' ? $roles : 'No involvement'; |
|
| 218 | - ?> |
|
| 208 | + echo $event->getDate('jS: '); |
|
| 209 | + $eventPeople = EventPersonQuery::create()->filterByEvent($event)->find(); |
|
| 210 | + $roles = []; |
|
| 211 | + foreach ($eventPeople as $eventPerson) { |
|
| 212 | + if ($eventPerson->getUserRole()->getUserId() == $user->getId()) { |
|
| 213 | + $roles[] = $eventPerson->getUserRole()->getRole()->getName(); |
|
| 214 | + } |
|
| 215 | + } |
|
| 216 | + $roles = implode(', ', $roles); |
|
| 217 | + echo $roles != '' ? $roles : 'No involvement'; |
|
| 218 | + ?> |
|
| 219 | 219 | </h4> |
| 220 | 220 | </a> |
| 221 | 221 | <a class="label label-default" href="events.php?view=all&filter=<?php echo $event->getEventTypeId() ?>"><?php echo $event->getEventType()->getName() ?></a> |
@@ -268,7 +268,7 @@ discard block |
||
| 268 | 268 | <div class="modal-body"> |
| 269 | 269 | <?php |
| 270 | 270 | |
| 271 | - $sqlPeople = "SELECT |
|
| 271 | + $sqlPeople = "SELECT |
|
| 272 | 272 | CONCAT(u.firstname, ' ', u.lastname) AS `name`, |
| 273 | 273 | r.name AS `rolename`, |
| 274 | 274 | ep.notified AS `notified`, |
@@ -284,13 +284,13 @@ discard block |
||
| 284 | 284 | AND ep.removed = 0 |
| 285 | 285 | ORDER BY g.name, r.name"; |
| 286 | 286 | |
| 287 | - $resultPeople = mysqli_query(db(), $sqlPeople) or die(mysqli_error(db())); |
|
| 288 | - $groupName = ''; |
|
| 289 | - $groupId = 0; |
|
| 290 | - $identifier = '1'; |
|
| 291 | - $firstTime = true; |
|
| 287 | + $resultPeople = mysqli_query(db(), $sqlPeople) or die(mysqli_error(db())); |
|
| 288 | + $groupName = ''; |
|
| 289 | + $groupId = 0; |
|
| 290 | + $identifier = '1'; |
|
| 291 | + $firstTime = true; |
|
| 292 | 292 | |
| 293 | - if (mysqli_num_rows($resultPeople) > 0): |
|
| 293 | + if (mysqli_num_rows($resultPeople) > 0): |
|
| 294 | 294 | |
| 295 | 295 | ?> |
| 296 | 296 | <?php while ($viewPeople = mysqli_fetch_object($resultPeople)) { |
@@ -323,9 +323,9 @@ discard block |
||
| 323 | 323 | echo '</li>'; |
| 324 | 324 | } |
| 325 | 325 | echo '</ul>'; |
| 326 | - else: |
|
| 326 | + else: |
|
| 327 | 327 | echo '<p>No roles assigned to this event.'; |
| 328 | - endif; |
|
| 328 | + endif; |
|
| 329 | 329 | ?> |
| 330 | 330 | </div> |
| 331 | 331 | <div class="modal-footer"> |
@@ -359,10 +359,10 @@ discard block |
||
| 359 | 359 | |
| 360 | 360 | |
| 361 | 361 | <?php |
| 362 | - // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
| 363 | - // ~~~~~~~~~ User's events ~~~~~~~~~~ |
|
| 364 | - // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
| 365 | - ?> |
|
| 362 | + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
| 363 | + // ~~~~~~~~~ User's events ~~~~~~~~~~ |
|
| 364 | + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
| 365 | + ?> |
|
| 366 | 366 | |
| 367 | 367 | <h2>My events:</h2> |
| 368 | 368 | |
@@ -387,9 +387,9 @@ discard block |
||
| 387 | 387 | <div class="timeline-header"> |
| 388 | 388 | <a href="event.php?id=<?php echo $event->id ?>"> |
| 389 | 389 | <h4><?php |
| 390 | - echo date('jS: ', strtotime($event->date)); |
|
| 391 | - echo $event->roles; |
|
| 392 | - ?> |
|
| 390 | + echo date('jS: ', strtotime($event->date)); |
|
| 391 | + echo $event->roles; |
|
| 392 | + ?> |
|
| 393 | 393 | </h4> |
| 394 | 394 | </a> |
| 395 | 395 | <a class="label label-default" href="events.php?view=all&filter=<?php echo $event->eventTypeId ?>"><?php echo $event->eventType ?></a> |
@@ -445,7 +445,7 @@ discard block |
||
| 445 | 445 | <div class="modal-body"> |
| 446 | 446 | <?php |
| 447 | 447 | |
| 448 | - $sqlPeople = "SELECT |
|
| 448 | + $sqlPeople = "SELECT |
|
| 449 | 449 | CONCAT(u.firstname, ' ', u.lastname) AS `name`, |
| 450 | 450 | r.name AS `rolename`, |
| 451 | 451 | ep.notified AS `notified`, |
@@ -461,13 +461,13 @@ discard block |
||
| 461 | 461 | AND ep.removed = 0 |
| 462 | 462 | ORDER BY g.name, r.name"; |
| 463 | 463 | |
| 464 | - $resultPeople = mysqli_query(db(), $sqlPeople) or die(mysqli_error(db())); |
|
| 465 | - $groupName = ''; |
|
| 466 | - $groupId = 0; |
|
| 467 | - $identifier = '1'; |
|
| 468 | - $firstTime = true; |
|
| 464 | + $resultPeople = mysqli_query(db(), $sqlPeople) or die(mysqli_error(db())); |
|
| 465 | + $groupName = ''; |
|
| 466 | + $groupId = 0; |
|
| 467 | + $identifier = '1'; |
|
| 468 | + $firstTime = true; |
|
| 469 | 469 | |
| 470 | - if (mysqli_num_rows($resultPeople) > 0): |
|
| 470 | + if (mysqli_num_rows($resultPeople) > 0): |
|
| 471 | 471 | |
| 472 | 472 | ?> |
| 473 | 473 | <?php while ($viewPeople = mysqli_fetch_object($resultPeople)) { |
@@ -500,9 +500,9 @@ discard block |
||
| 500 | 500 | echo '</li>'; |
| 501 | 501 | } |
| 502 | 502 | echo '</ul>'; |
| 503 | - else: |
|
| 503 | + else: |
|
| 504 | 504 | echo '<p>No roles assigned to this event.'; |
| 505 | - endif; |
|
| 505 | + endif; |
|
| 506 | 506 | ?> |
| 507 | 507 | </div> |
| 508 | 508 | <div class="modal-footer"> |
@@ -537,10 +537,10 @@ discard block |
||
| 537 | 537 | <div class="col-sm-4 col-md-4 col-lg-6"> |
| 538 | 538 | |
| 539 | 539 | <?php |
| 540 | - // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
| 541 | - // ~~~~~~~ Remaining events ~~~~~~~~~ |
|
| 542 | - // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
| 543 | - ?> |
|
| 540 | + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
| 541 | + // ~~~~~~~ Remaining events ~~~~~~~~~ |
|
| 542 | + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
| 543 | + ?> |
|
| 544 | 544 | <?php if (isset($remainingEventsInGroups)): ?> |
| 545 | 545 | |
| 546 | 546 | <div class="row"> |
@@ -616,10 +616,10 @@ discard block |
||
| 616 | 616 | |
| 617 | 617 | |
| 618 | 618 | <?php |
| 619 | - // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
| 620 | - // ~~~~~~~~~ User details ~~~~~~~~~~~ |
|
| 621 | - // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
| 622 | - ?> |
|
| 619 | + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
| 620 | + // ~~~~~~~~~ User details ~~~~~~~~~~~ |
|
| 621 | + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
| 622 | + ?> |
|
| 623 | 623 | |
| 624 | 624 | <div class="box box-widget widget-user-2"> |
| 625 | 625 | <div class="widget-user-header bg-yellow"> |
@@ -222,7 +222,7 @@ discard block |
||
| 222 | 222 | </div><!-- /.timeline-header --> |
| 223 | 223 | |
| 224 | 224 | <div class="timeline-body"> |
| 225 | - <p><strong><?php echo $event->getEventGroup() ? $event->getEventGroup()->getName().': ' : '' ?></strong><?php echo $event->getSermonTitle() ?> <?php echo $event->getBibleVerse() ? '('.$event->getBibleVerse().')' : '' ?></p> |
|
| 225 | + <p><strong><?php echo $event->getEventGroup() ? $event->getEventGroup()->getName() . ': ' : '' ?></strong><?php echo $event->getSermonTitle() ?> <?php echo $event->getBibleVerse() ? '(' . $event->getBibleVerse() . ')' : '' ?></p> |
|
| 226 | 226 | <p><strong>Location:</strong> <?php echo $event->getLocation()->getName(); ?></p> |
| 227 | 227 | |
| 228 | 228 | <?php if ($event->getComment() != ''): ?> |
@@ -280,7 +280,7 @@ discard block |
||
| 280 | 280 | INNER JOIN cr_groups g ON g.id = r.groupId |
| 281 | 281 | INNER JOIN cr_users u ON u.id = ur.userId |
| 282 | 282 | INNER JOIN cr_eventPeople ep ON ep.userRoleId = ur.id |
| 283 | - WHERE ep.eventId = '".$event->getId()."' |
|
| 283 | + WHERE ep.eventId = '".$event->getId() . "' |
|
| 284 | 284 | AND ep.removed = 0 |
| 285 | 285 | ORDER BY g.name, r.name"; |
| 286 | 286 | |
@@ -305,16 +305,16 @@ discard block |
||
| 305 | 305 | } else { |
| 306 | 306 | echo '</ul>'; |
| 307 | 307 | } |
| 308 | - echo '<p><strong>'.$groupName.'</strong></p>'; |
|
| 308 | + echo '<p><strong>' . $groupName . '</strong></p>'; |
|
| 309 | 309 | echo '<ul>'; |
| 310 | 310 | } |
| 311 | 311 | |
| 312 | 312 | echo '<li>'; |
| 313 | - echo (isset($viewPeople->swap)) ? "<s><a class='text-danger' href='swap.php?swap=".$viewPeople->swap."'>" : ''; |
|
| 313 | + echo (isset($viewPeople->swap)) ? "<s><a class='text-danger' href='swap.php?swap=" . $viewPeople->swap . "'>" : ''; |
|
| 314 | 314 | echo $viewPeople->name; |
| 315 | 315 | |
| 316 | 316 | if ($viewPeople->rolename != '') { |
| 317 | - echo ' - <em>'.$viewPeople->rolename.'</em>'; |
|
| 317 | + echo ' - <em>' . $viewPeople->rolename . '</em>'; |
|
| 318 | 318 | } else { |
| 319 | 319 | // If there is no skill, we don't need to mention this. |
| 320 | 320 | } |
@@ -396,7 +396,7 @@ discard block |
||
| 396 | 396 | </div><!-- /.timeline-header --> |
| 397 | 397 | |
| 398 | 398 | <div class="timeline-body"> |
| 399 | - <p><strong><?php echo $event->eventGroup ? $event->eventGroup.': ' : '' ?></strong><?php echo $event->sermonTitle ?> <?php echo $event->bibleVerse ? '('.$event->bibleVerse.')' : '' ?></p> |
|
| 399 | + <p><strong><?php echo $event->eventGroup ? $event->eventGroup . ': ' : '' ?></strong><?php echo $event->sermonTitle ?> <?php echo $event->bibleVerse ? '(' . $event->bibleVerse . ')' : '' ?></p> |
|
| 400 | 400 | <p><strong>Location:</strong> <?php echo $event->eventLocation; ?></p> |
| 401 | 401 | |
| 402 | 402 | <?php if ($event->comment != ''): ?> |
@@ -457,7 +457,7 @@ discard block |
||
| 457 | 457 | INNER JOIN cr_groups g ON g.id = r.groupId |
| 458 | 458 | INNER JOIN cr_users u ON u.id = ur.userId |
| 459 | 459 | INNER JOIN cr_eventPeople ep ON ep.userRoleId = ur.id |
| 460 | - WHERE ep.eventId = '".$event->id."' |
|
| 460 | + WHERE ep.eventId = '".$event->id . "' |
|
| 461 | 461 | AND ep.removed = 0 |
| 462 | 462 | ORDER BY g.name, r.name"; |
| 463 | 463 | |
@@ -482,16 +482,16 @@ discard block |
||
| 482 | 482 | } else { |
| 483 | 483 | echo '</ul>'; |
| 484 | 484 | } |
| 485 | - echo '<p><strong>'.$groupName.'</strong></p>'; |
|
| 485 | + echo '<p><strong>' . $groupName . '</strong></p>'; |
|
| 486 | 486 | echo '<ul>'; |
| 487 | 487 | } |
| 488 | 488 | |
| 489 | 489 | echo '<li>'; |
| 490 | - echo (isset($viewPeople->swap)) ? "<s><a class='text-danger' href='swap.php?swap=".$viewPeople->swap."'>" : ''; |
|
| 490 | + echo (isset($viewPeople->swap)) ? "<s><a class='text-danger' href='swap.php?swap=" . $viewPeople->swap . "'>" : ''; |
|
| 491 | 491 | echo $viewPeople->name; |
| 492 | 492 | |
| 493 | 493 | if ($viewPeople->rolename != '') { |
| 494 | - echo ' - <em>'.$viewPeople->rolename.'</em>'; |
|
| 494 | + echo ' - <em>' . $viewPeople->rolename . '</em>'; |
|
| 495 | 495 | } else { |
| 496 | 496 | // If there is no skill, we don't need to mention this. |
| 497 | 497 | } |
@@ -562,7 +562,7 @@ discard block |
||
| 562 | 562 | "> |
| 563 | 563 | <?php echo timeInWordsWithTense($event->getDate()) ?> |
| 564 | 564 | </span> |
| 565 | - <?php else: ?> |
|
| 565 | + <?php else : ?> |
|
| 566 | 566 | <span class="pull-right badge bg-red"> |
| 567 | 567 | never |
| 568 | 568 | </span> |
@@ -627,7 +627,7 @@ discard block |
||
| 627 | 627 | <img class="img-circle" src="<?php echo getProfileImageUrl($_SESSION['userid'], 'large') ?>" alt="User Avatar"> |
| 628 | 628 | </div> |
| 629 | 629 | <!-- /.widget-user-image --> |
| 630 | - <h3 class="widget-user-username"><?php echo $user->getFirstName().' '.$user->getLastName() ?></h3> |
|
| 630 | + <h3 class="widget-user-username"><?php echo $user->getFirstName() . ' ' . $user->getLastName() ?></h3> |
|
| 631 | 631 | <h5 class="widget-user-desc">Account created <?php echo $user->getCreated('M. Y') ?></h5> |
| 632 | 632 | </div> |
| 633 | 633 | <div class="box-footer no-padding"> |
@@ -651,7 +651,7 @@ discard block |
||
| 651 | 651 | $userHasEmail = (strlen($user->getEmail()) > 3); |
| 652 | 652 | $emailRemindersEnabled = ($userHasEmail && true); // todo: add opt-out for email reminders |
| 653 | 653 | ?> |
| 654 | - 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> |
|
| 654 | + 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> |
|
| 655 | 655 | </a> |
| 656 | 656 | </li> |
| 657 | 657 | <li> |
@@ -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> |
@@ -9,7 +9,7 @@ discard block |
||
| 9 | 9 | |
| 10 | 10 | // ensure user is logged in |
| 11 | 11 | if (!(isset($_SESSION['is_logged_in']) || $_SESSION['db_is_logged_in'] == true)) { |
| 12 | - $_SESSION['redirectUrl'] = siteSettings()->getSiteUrl().'/termCard.php'; |
|
| 12 | + $_SESSION['redirectUrl'] = siteSettings()->getSiteUrl() . '/termCard.php'; |
|
| 13 | 13 | header('Location: login.php'); |
| 14 | 14 | } |
| 15 | 15 | |
@@ -42,12 +42,12 @@ discard block |
||
| 42 | 42 | |
| 43 | 43 | while ($ob = mysqli_fetch_object($result)) { |
| 44 | 44 | echo '<tr>'; |
| 45 | - echo '<td>'.date('j F', strtotime($ob->eventDate)).'</td>'; |
|
| 46 | - echo '<td>'.date('g:i a', strtotime($ob->eventDate)).'</td>'; |
|
| 47 | - echo '<td>'.$ob->eventName.'</td>'; |
|
| 48 | - echo '<td>'.$ob->eventSubType.'</td>'; |
|
| 49 | - echo '<td>'.$ob->sermonTitle; |
|
| 50 | - echo $ob->bibleVerse ? ' ('.$ob->bibleVerse.')</td>' : ''; |
|
| 45 | + echo '<td>' . date('j F', strtotime($ob->eventDate)) . '</td>'; |
|
| 46 | + echo '<td>' . date('g:i a', strtotime($ob->eventDate)) . '</td>'; |
|
| 47 | + echo '<td>' . $ob->eventName . '</td>'; |
|
| 48 | + echo '<td>' . $ob->eventSubType . '</td>'; |
|
| 49 | + echo '<td>' . $ob->sermonTitle; |
|
| 50 | + echo $ob->bibleVerse ? ' (' . $ob->bibleVerse . ')</td>' : ''; |
|
| 51 | 51 | echo '</tr>'; |
| 52 | 52 | } |
| 53 | 53 | echo '</table>'; |
@@ -8,7 +8,7 @@ discard block |
||
| 8 | 8 | session_start(); |
| 9 | 9 | |
| 10 | 10 | if (!(isset($_SESSION['is_logged_in']) || $_SESSION['db_is_logged_in'] == true)) { |
| 11 | - $_SESSION['redirectUrl'] = siteSettings()->getSiteUrl().'/addUser.php?'.$_SERVER['QUERY_STRING']; |
|
| 11 | + $_SESSION['redirectUrl'] = siteSettings()->getSiteUrl() . '/addUser.php?' . $_SERVER['QUERY_STRING']; |
|
| 12 | 12 | header('Location: login.php'); |
| 13 | 13 | exit; |
| 14 | 14 | } |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | $userRole = UserRoleQuery::create()->filterByUser($user)->filterByRoleId($roleId)->findOne(); |
| 57 | 57 | $userRole->setReserve(false); |
| 58 | 58 | $userRole->save(); |
| 59 | - header('Location: addUser.php?action=edit&user='.$user->getId()); |
|
| 59 | + header('Location: addUser.php?action=edit&user=' . $user->getId()); |
|
| 60 | 60 | exit; |
| 61 | 61 | |
| 62 | 62 | break; |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | $userRole = UserRoleQuery::create()->filterByUser($user)->filterByRoleId($roleId)->findOne(); |
| 68 | 68 | $userRole->setReserve(true); |
| 69 | 69 | $userRole->save(); |
| 70 | - header('Location: addUser.php?action=edit&user='.$user->getId()); |
|
| 70 | + header('Location: addUser.php?action=edit&user=' . $user->getId()); |
|
| 71 | 71 | exit; |
| 72 | 72 | break; |
| 73 | 73 | |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | } |
| 177 | 177 | } |
| 178 | 178 | if (isAdmin()) { |
| 179 | - header('Location: users.php#section'.$userId); |
|
| 179 | + header('Location: users.php#section' . $userId); |
|
| 180 | 180 | exit; |
| 181 | 181 | } |
| 182 | 182 | } |
@@ -261,7 +261,7 @@ discard block |
||
| 261 | 261 | // ordered in this way to build the page with contact details before permissions |
| 262 | 262 | if (!isAdmin()) { |
| 263 | 263 | if ($userId == $sessionUserID) { |
| 264 | - echo $firstname.' '.$lastname; |
|
| 264 | + echo $firstname . ' ' . $lastname; |
|
| 265 | 265 | $isCompromised = false; |
| 266 | 266 | } else { |
| 267 | 267 | notifyAttack(__FILE__, 'Impersonating Attack', $sessionUserID); |
@@ -407,7 +407,8 @@ discard block |
||
| 407 | 407 | <?php if ($userHasRole): ?> |
| 408 | 408 | <?php if ($isReserve): ?> |
| 409 | 409 | <a href="addUser.php?action=regular&user=<?php echo $user->getId() ?>&role=<?php echo $role->getId() ?>" class="text-green">make regular</a> |
| 410 | - <?php else: ?> |
|
| 410 | + <?php else { |
|
| 411 | + : ?> |
|
| 411 | 412 | <a href="addUser.php?action=reserve&user=<?php echo $user->getId() ?>&role=<?php echo $role->getId() ?>" class="text-orange">make reserve</a> |
| 412 | 413 | <?php endif ?> |
| 413 | 414 | <?php endif ?> |
@@ -437,7 +438,9 @@ discard block |
||
| 437 | 438 | <p><em>Contact the person in charge of your rota to alter your roles</em></p> |
| 438 | 439 | </div><!-- /.box-body --> |
| 439 | 440 | |
| 440 | - <?php endif; ?> |
|
| 441 | + <?php endif; |
|
| 442 | +} |
|
| 443 | +?> |
|
| 441 | 444 | |
| 442 | 445 | </fieldset> |
| 443 | 446 | <div class="box-footer"> |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | // If the form has been submitted, then we need to handle the data. |
| 85 | 85 | if ($_SERVER['REQUEST_METHOD'] == 'POST') { |
| 86 | 86 | |
| 87 | - // sanitise inputs |
|
| 87 | + // sanitise inputs |
|
| 88 | 88 | if (isAdmin()) { |
| 89 | 89 | $firstname = $_POST['firstname']; |
| 90 | 90 | $firstname = strip_tags($firstname); |
@@ -257,8 +257,8 @@ discard block |
||
| 257 | 257 | <div class="box-body"> |
| 258 | 258 | |
| 259 | 259 | <?php |
| 260 | - // if isAdmin() == false |
|
| 261 | - // ordered in this way to build the page with contact details before permissions |
|
| 260 | + // if isAdmin() == false |
|
| 261 | + // ordered in this way to build the page with contact details before permissions |
|
| 262 | 262 | if (!isAdmin()) { |
| 263 | 263 | if ($userId == $sessionUserID) { |
| 264 | 264 | echo $firstname.' '.$lastname; |
@@ -304,15 +304,15 @@ discard block |
||
| 304 | 304 | |
| 305 | 305 | <?php |
| 306 | 306 | |
| 307 | - if (isAdmin()) { |
|
| 308 | - ?> |
|
| 307 | + if (isAdmin()) { |
|
| 308 | + ?> |
|
| 309 | 309 | |
| 310 | 310 | <div class="checkbox"> |
| 311 | 311 | <label for="isAdmin"> |
| 312 | 312 | <input name="isAdmin" id="isAdmin" type="checkbox" value="1" <?php if ($userisAdmin == '1') { |
| 313 | - echo 'checked="checked"'; |
|
| 314 | - } elseif ($userisAdmin == '0') { |
|
| 315 | - } ?> /> |
|
| 313 | + echo 'checked="checked"'; |
|
| 314 | + } elseif ($userisAdmin == '0') { |
|
| 315 | + } ?> /> |
|
| 316 | 316 | Make them an ADMIN?: |
| 317 | 317 | </label> |
| 318 | 318 | </div> |
@@ -320,9 +320,9 @@ discard block |
||
| 320 | 320 | <div class="checkbox"> |
| 321 | 321 | <label for="isBandAdmin"> |
| 322 | 322 | <input class="checkbox" name="isBandAdmin" id="isBandAdmin" type="checkbox" value="1" <?php if ($userisBandAdmin == '1') { |
| 323 | - echo 'checked="checked"'; |
|
| 324 | - } elseif ($userisBandAdmin == '0') { |
|
| 325 | - } ?> /> |
|
| 323 | + echo 'checked="checked"'; |
|
| 324 | + } elseif ($userisBandAdmin == '0') { |
|
| 325 | + } ?> /> |
|
| 326 | 326 | Make them a BAND admin?: |
| 327 | 327 | </label> |
| 328 | 328 | </div> |
@@ -330,9 +330,9 @@ discard block |
||
| 330 | 330 | <div class="checkbox"> |
| 331 | 331 | <label for="isEventEditor"> |
| 332 | 332 | <input class="checkbox" name="isEventEditor" id="isEventEditor" type="checkbox" value="1" <?php if ($userIsEventEditor == '1') { |
| 333 | - echo 'checked="checked"'; |
|
| 334 | - } elseif ($userIsEventEditor == '0') { |
|
| 335 | - } ?> /> |
|
| 333 | + echo 'checked="checked"'; |
|
| 334 | + } elseif ($userIsEventEditor == '0') { |
|
| 335 | + } ?> /> |
|
| 336 | 336 | Make them an EVENT EDITOR?: |
| 337 | 337 | </label> |
| 338 | 338 | </div> |
@@ -340,14 +340,14 @@ discard block |
||
| 340 | 340 | <hr /> |
| 341 | 341 | |
| 342 | 342 | <?php |
| 343 | - } ?> |
|
| 343 | + } ?> |
|
| 344 | 344 | |
| 345 | 345 | <div class="checkbox"> |
| 346 | 346 | <label for="isOverviewRecipient"> |
| 347 | 347 | <input class="checkbox" <?php echo isAdmin() ? '' : 'disabled="disabled"' ?> name="isOverviewRecipient" id="isOverviewRecipient" type="checkbox" value="1" <?php if ($userIsOverviewRecipient == '1' || is_null($userIsOverviewRecipient)) { |
| 348 | - echo 'checked="checked"'; |
|
| 349 | - } elseif ($userIsOverviewRecipient == '0') { |
|
| 350 | - }?> /> |
|
| 348 | + echo 'checked="checked"'; |
|
| 349 | + } elseif ($userIsOverviewRecipient == '0') { |
|
| 350 | + }?> /> |
|
| 351 | 351 | Receive group emails?: |
| 352 | 352 | </label> |
| 353 | 353 | </div> |
@@ -355,9 +355,9 @@ discard block |
||
| 355 | 355 | <div class="checkbox"> |
| 356 | 356 | <label for="isReminderRecipient"> |
| 357 | 357 | <input class="checkbox" disabled= "disabled" name="isReminderRecipient" id="isReminderRecipient" type="checkbox" value="1" <?php if (true/*$userIsReminderRecipient == '1' || is_null($userIsReminderRecipient)*/) { |
| 358 | - echo 'checked="checked"'; |
|
| 359 | - } elseif (true/*$userIsReminderRecipient*/ == '0') { |
|
| 360 | - }?> /> |
|
| 358 | + echo 'checked="checked"'; |
|
| 359 | + } elseif (true/*$userIsReminderRecipient*/ == '0') { |
|
| 360 | + }?> /> |
|
| 361 | 361 | Receive email reminders?: (optional in future update to system) |
| 362 | 362 | </label> |
| 363 | 363 | </div> |
@@ -447,18 +447,18 @@ discard block |
||
| 447 | 447 | } else { |
| 448 | 448 | echo '<input class="btn btn-primary" type="submit" value="Add user" />'; |
| 449 | 449 | } |
| 450 | - ?> |
|
| 450 | + ?> |
|
| 451 | 451 | </div><!-- /.box-footer --> |
| 452 | 452 | </form> |
| 453 | 453 | </div> |
| 454 | 454 | </div> |
| 455 | 455 | <div id="right"> |
| 456 | 456 | <?php if (isAdmin()) { |
| 457 | - ?> |
|
| 457 | + ?> |
|
| 458 | 458 | |
| 459 | 459 | <div class="item"><a class="btn" href="users.php">View all users</a></div> |
| 460 | 460 | <?php |
| 461 | - } |
|
| 461 | + } |
|
| 462 | 462 | |
| 463 | 463 | if ($action == 'edit') { |
| 464 | 464 | ?> |
@@ -48,18 +48,18 @@ discard block |
||
| 48 | 48 | if ($postremove == 'true') { |
| 49 | 49 | removePost($postid); |
| 50 | 50 | if ($redirect == 'true') { |
| 51 | - header('Location: discussion.php?categoryid='.$parentid); |
|
| 51 | + header('Location: discussion.php?categoryid=' . $parentid); |
|
| 52 | 52 | } else { |
| 53 | - header('Location: discussiontopic.php?id='.$id.'&parentid='.$parentid); |
|
| 53 | + header('Location: discussiontopic.php?id=' . $id . '&parentid=' . $parentid); |
|
| 54 | 54 | } |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | if ($subscribe == 'true') { |
| 58 | 58 | subscribeto($userID, 0, $id); |
| 59 | - header('Location: discussiontopic.php?id='.$id.'&parentid='.$parentid); |
|
| 59 | + header('Location: discussiontopic.php?id=' . $id . '&parentid=' . $parentid); |
|
| 60 | 60 | } elseif ($subscribe == 'false') { |
| 61 | 61 | unsubscribefrom($subscription); |
| 62 | - header('Location: discussiontopic.php?id='.$id.'&parentid='.$parentid); |
|
| 62 | + header('Location: discussiontopic.php?id=' . $id . '&parentid=' . $parentid); |
|
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | // If the form has been sent, we need to handle the data. |
@@ -74,18 +74,18 @@ discard block |
||
| 74 | 74 | // If we are starting a new discussion |
| 75 | 75 | $sql = ("INSERT INTO cr_discussion (CategoryParent, userID, topic, topicName, date) VALUES ('$parentid', '$userID', '$discussion', '$discussiontopic', NOW())"); |
| 76 | 76 | if (!mysqli_query(db(), $sql)) { |
| 77 | - die('Error: '.mysqli_error(db())); |
|
| 77 | + die('Error: ' . mysqli_error(db())); |
|
| 78 | 78 | } |
| 79 | 79 | $type = 'category'; |
| 80 | 80 | notifySubscribers($parentid, $type, $userID); |
| 81 | - header('Location: discussion.php?categoryid='.$parentid); |
|
| 81 | + header('Location: discussion.php?categoryid=' . $parentid); |
|
| 82 | 82 | exit; |
| 83 | 83 | } else { |
| 84 | 84 | // Otherwise we reply in thread |
| 85 | 85 | $sql = ("INSERT INTO cr_discussion (topicParent, CategoryParent, userID, topic, date) |
| 86 | 86 | VALUES ('$id', '$parentid', '$userID', '$discussion', NOW())"); |
| 87 | 87 | if (!mysqli_query(db(), $sql)) { |
| 88 | - die('Error: '.mysqli_error(db())); |
|
| 88 | + die('Error: ' . mysqli_error(db())); |
|
| 89 | 89 | } |
| 90 | 90 | if ($subscribestatus == 'false') { |
| 91 | 91 | subscribeto($userID, 0, $id); |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | <div class="elementBackground"> |
| 139 | 139 | <h2><a name="addcategory"><?php echo $row['name']; ?></a> - <span class="postdate"><em><?php echo $row['dateFormatted']; ?></em></span> |
| 140 | 140 | <?php if (isAdmin()) { |
| 141 | - echo "<a href='discussiontopic.php?redirect=true&postremove=true&postid=".$row['id'].'&parentid='.$parentid."'><img src='graphics/close.png' /></a><br />"; |
|
| 141 | + echo "<a href='discussiontopic.php?redirect=true&postremove=true&postid=" . $row['id'] . '&parentid=' . $parentid . "'><img src='graphics/close.png' /></a><br />"; |
|
| 142 | 142 | } ?> |
| 143 | 143 | </h2> |
| 144 | 144 | <p><?php echo stripslashes($topic); ?></p> |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | <div class="elementBackground"> |
| 159 | 159 | <h2><a name="addcategory"><?php echo $row['name']; ?></a> - <span class="postdate"><em><?php echo $row['dateFormatted']; ?></em></span> |
| 160 | 160 | <?php if (isAdmin()) { |
| 161 | - echo "<a href='discussiontopic.php?postremove=true&postid=".$row['id'].'&parentid='.$parentid.'&id='.$id."'><img src='graphics/close.png' /></a>"; |
|
| 161 | + echo "<a href='discussiontopic.php?postremove=true&postid=" . $row['id'] . '&parentid=' . $parentid . '&id=' . $id . "'><img src='graphics/close.png' /></a>"; |
|
| 162 | 162 | } ?></h2> |
| 163 | 163 | <p><?php echo stripslashes($topic); ?></p> |
| 164 | 164 | </div> |
@@ -176,11 +176,11 @@ discard block |
||
| 176 | 176 | } |
| 177 | 177 | |
| 178 | 178 | if ($isSubscribed != '') { |
| 179 | - $subscribe = '<div class="item"><a href="discussiontopic.php?subscribe=false&subscription='.$isSubscribed.'&id='. |
|
| 180 | - $id.'&parentid='.$parentid.'">Unsubscribe from this post</a></div>'; |
|
| 179 | + $subscribe = '<div class="item"><a href="discussiontopic.php?subscribe=false&subscription=' . $isSubscribed . '&id=' . |
|
| 180 | + $id . '&parentid=' . $parentid . '">Unsubscribe from this post</a></div>'; |
|
| 181 | 181 | $subscribestatus = 'true'; |
| 182 | 182 | } else { |
| 183 | - $subscribe = '<div class="item"><a href="discussiontopic.php?subscribe=true&id='.$id.'&parentid='.$parentid.'"> |
|
| 183 | + $subscribe = '<div class="item"><a href="discussiontopic.php?subscribe=true&id=' . $id . '&parentid=' . $parentid . '"> |
|
| 184 | 184 | Subscribe to this post</a></div>'; |
| 185 | 185 | $subscribestatus = 'false'; |
| 186 | 186 | } |