@@ -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 |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | } |
76 | 76 | |
77 | 77 | // After we have inserted the data, we want to head back to the main page |
78 | - header('Location: index.php'); |
|
78 | + header('Location: index.php'); |
|
79 | 79 | exit; |
80 | 80 | } |
81 | 81 | |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | } |
94 | 94 | |
95 | 95 | // After we have inserted the data, we want to head back to the main page |
96 | - header('Location: index.php'); |
|
96 | + header('Location: index.php'); |
|
97 | 97 | exit; |
98 | 98 | } |
99 | 99 | } |
@@ -27,12 +27,12 @@ discard block |
||
27 | 27 | // link or unlink |
28 | 28 | if ($_SERVER['REQUEST_METHOD'] == 'POST') { |
29 | 29 | // ensure user is accessing correct data |
30 | - if (isAdmin() && isset($_POST['id'])) { |
|
31 | - $id = $_POST['id']; |
|
32 | - $id = filter_var($id, FILTER_SANITIZE_NUMBER_INT); |
|
33 | - } else { |
|
34 | - $id = $_SESSION['userid']; |
|
35 | - } |
|
30 | + if (isAdmin() && isset($_POST['id'])) { |
|
31 | + $id = $_POST['id']; |
|
32 | + $id = filter_var($id, FILTER_SANITIZE_NUMBER_INT); |
|
33 | + } else { |
|
34 | + $id = $_SESSION['userid']; |
|
35 | + } |
|
36 | 36 | |
37 | 37 | $platform = strtolower($_POST['platform']); |
38 | 38 | |
@@ -41,19 +41,19 @@ discard block |
||
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"> |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | ini_set('log_errors', true); |
9 | 9 | error_reporting(E_ALL); |
10 | 10 | |
11 | - date_default_timezone_set('Europe/London'); |
|
11 | + date_default_timezone_set('Europe/London'); |
|
12 | 12 | |
13 | 13 | // Include files, including the database connection |
14 | 14 | include 'includes/config.php'; |
@@ -24,10 +24,10 @@ discard block |
||
24 | 24 | } require_once 'vendor/autoload.php'; |
25 | 25 | |
26 | 26 | $fb = new Facebook\Facebook([ |
27 | - 'app_id' => $config['auth']['facebook']['appId'], |
|
28 | - 'app_secret' => $config['auth']['facebook']['appSecret'], |
|
29 | - 'default_graph_version' => 'v2.2', |
|
30 | - ]); |
|
27 | + 'app_id' => $config['auth']['facebook']['appId'], |
|
28 | + 'app_secret' => $config['auth']['facebook']['appSecret'], |
|
29 | + 'default_graph_version' => 'v2.2', |
|
30 | + ]); |
|
31 | 31 | |
32 | 32 | $accessToken = $_SESSION['fb_access_token']; |
33 | 33 | |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | |
36 | 36 | try { |
37 | 37 | // Returns a `Facebook\FacebookResponse` object |
38 | - $response = $fb->get('/me?fields=id,name,email', $accessToken); |
|
38 | + $response = $fb->get('/me?fields=id,name,email', $accessToken); |
|
39 | 39 | } catch (Facebook\Exceptions\FacebookResponseException $e) { |
40 | 40 | echo 'Graph returned an error: '.$e->getMessage(); |
41 | 41 | exit; |
@@ -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); |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | |
103 | 103 | $roles = $_POST['roles']; |
104 | 104 | |
105 | - // sanitise checkbox |
|
105 | + // sanitise checkbox |
|
106 | 106 | $isAdminLocal = isset($_POST['isAdmin']) ? '1' : '0'; |
107 | 107 | $userIsOverviewRecipient = isset($_POST['isOverviewRecipient']) ? '1' : '0'; |
108 | 108 | $userisBandAdmin = isset($_POST['isBandAdmin']) ? '1' : '0'; |
@@ -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; |
@@ -305,15 +305,15 @@ discard block |
||
305 | 305 | |
306 | 306 | <?php |
307 | 307 | |
308 | - if (isAdmin()) { |
|
309 | - ?> |
|
308 | + if (isAdmin()) { |
|
309 | + ?> |
|
310 | 310 | |
311 | 311 | <div class="checkbox"> |
312 | 312 | <label for="isAdmin"> |
313 | 313 | <input name="isAdmin" id="isAdmin" type="checkbox" value="1" <?php if ($userisAdmin == '1') { |
314 | - echo 'checked="checked"'; |
|
315 | - } elseif ($userisAdmin == '0') { |
|
316 | - } ?> /> |
|
314 | + echo 'checked="checked"'; |
|
315 | + } elseif ($userisAdmin == '0') { |
|
316 | + } ?> /> |
|
317 | 317 | Make them an ADMIN?: |
318 | 318 | </label> |
319 | 319 | </div> |
@@ -321,9 +321,9 @@ discard block |
||
321 | 321 | <div class="checkbox"> |
322 | 322 | <label for="isBandAdmin"> |
323 | 323 | <input class="checkbox" name="isBandAdmin" id="isBandAdmin" type="checkbox" value="1" <?php if ($userisBandAdmin == '1') { |
324 | - echo 'checked="checked"'; |
|
325 | - } elseif ($userisBandAdmin == '0') { |
|
326 | - } ?> /> |
|
324 | + echo 'checked="checked"'; |
|
325 | + } elseif ($userisBandAdmin == '0') { |
|
326 | + } ?> /> |
|
327 | 327 | Make them a BAND admin?: |
328 | 328 | </label> |
329 | 329 | </div> |
@@ -331,9 +331,9 @@ discard block |
||
331 | 331 | <div class="checkbox"> |
332 | 332 | <label for="isEventEditor"> |
333 | 333 | <input class="checkbox" name="isEventEditor" id="isEventEditor" type="checkbox" value="1" <?php if ($userIsEventEditor == '1') { |
334 | - echo 'checked="checked"'; |
|
335 | - } elseif ($userIsEventEditor == '0') { |
|
336 | - } ?> /> |
|
334 | + echo 'checked="checked"'; |
|
335 | + } elseif ($userIsEventEditor == '0') { |
|
336 | + } ?> /> |
|
337 | 337 | Make them an EVENT EDITOR?: |
338 | 338 | </label> |
339 | 339 | </div> |
@@ -341,14 +341,14 @@ discard block |
||
341 | 341 | <hr /> |
342 | 342 | |
343 | 343 | <?php |
344 | - } ?> |
|
344 | + } ?> |
|
345 | 345 | |
346 | 346 | <div class="checkbox"> |
347 | 347 | <label for="isOverviewRecipient"> |
348 | 348 | <input class="checkbox" <?php echo isAdmin() ? '' : 'disabled="disabled"' ?> name="isOverviewRecipient" id="isOverviewRecipient" type="checkbox" value="1" <?php if ($userIsOverviewRecipient == '1' || is_null($userIsOverviewRecipient)) { |
349 | - echo 'checked="checked"'; |
|
350 | - } elseif ($userIsOverviewRecipient == '0') { |
|
351 | - }?> /> |
|
349 | + echo 'checked="checked"'; |
|
350 | + } elseif ($userIsOverviewRecipient == '0') { |
|
351 | + }?> /> |
|
352 | 352 | Receive group emails?: |
353 | 353 | </label> |
354 | 354 | </div> |
@@ -356,9 +356,9 @@ discard block |
||
356 | 356 | <div class="checkbox"> |
357 | 357 | <label for="isReminderRecipient"> |
358 | 358 | <input class="checkbox" disabled= "disabled" name="isReminderRecipient" id="isReminderRecipient" type="checkbox" value="1" <?php if (true/*$userIsReminderRecipient == '1' || is_null($userIsReminderRecipient)*/) { |
359 | - echo 'checked="checked"'; |
|
360 | - } elseif (true/*$userIsReminderRecipient*/ == '0') { |
|
361 | - }?> /> |
|
359 | + echo 'checked="checked"'; |
|
360 | + } elseif (true/*$userIsReminderRecipient*/ == '0') { |
|
361 | + }?> /> |
|
362 | 362 | Receive email reminders?: (optional in future update to system) |
363 | 363 | </label> |
364 | 364 | </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 | ?> |
@@ -52,8 +52,8 @@ |
||
52 | 52 | } |
53 | 53 | |
54 | 54 | // After we have inserted the data, we want to head back to the main users page |
55 | - header('Location: bandskills.php'); // Move to the home page of the admin section |
|
56 | - exit; |
|
55 | + header('Location: bandskills.php'); // Move to the home page of the admin section |
|
56 | + exit; |
|
57 | 57 | } |
58 | 58 | include 'includes/header.php'; |
59 | 59 | ?> |
@@ -5,18 +5,18 @@ |
||
5 | 5 | include 'includes/config.php'; |
6 | 6 | include 'includes/functions.php'; |
7 | 7 | |
8 | - // you have to open the session first |
|
9 | - session_start(); |
|
8 | + // you have to open the session first |
|
9 | + session_start(); |
|
10 | 10 | |
11 | 11 | //if ($debug) notifyInfo(__FILE__,"logout",$_SESSION['userid']); //only_for_testing// |
12 | 12 | if ($debug) { |
13 | 13 | insertStatistics('user', __FILE__, 'logout'); |
14 | 14 | } |
15 | 15 | |
16 | - //remove all the variables in the session |
|
17 | - session_unset(); |
|
16 | + //remove all the variables in the session |
|
17 | + session_unset(); |
|
18 | 18 | |
19 | - // destroy the session |
|
20 | - session_destroy(); |
|
19 | + // destroy the session |
|
20 | + session_destroy(); |
|
21 | 21 | |
22 | - header('Location: login.php'); |
|
22 | + header('Location: login.php'); |