Completed
Push — master ( 4f2f75...b03ed7 )
by Christopher
06:52 queued 15s
created
public/old/events.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -48,9 +48,9 @@  discard block
 block discarded – undo
48 48
 } else {
49 49
     $urlFilters = '';
50 50
     if (isset($_SESSION['lastEventsFilter'])) {
51
-        $urlFilters = '&filter='.$_SESSION['lastEventsFilter'];
51
+        $urlFilters = '&filter=' . $_SESSION['lastEventsFilter'];
52 52
     }
53
-    header('Location: events.php?view=all'.$urlFilters);
53
+    header('Location: events.php?view=all' . $urlFilters);
54 54
     exit;
55 55
 }
56 56
 
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
         session_destroy();
71 71
         header('Location: login.php');
72 72
     } else {
73
-        header('Location: events.php?view='.$sessionUserID);
73
+        header('Location: events.php?view=' . $sessionUserID);
74 74
         exit;
75 75
     }
76 76
 }
@@ -108,11 +108,11 @@  discard block
 block discarded – undo
108 108
     if ($editskillID != '') {
109 109
         $sql = ("INSERT INTO cr_eventPeople (eventId, userRoleId) VALUES ('$editeventID', '$editskillID')");
110 110
         if (!mysqli_query(db(), $sql)) {
111
-            die('Error: '.mysqli_error(db()));
111
+            die('Error: ' . mysqli_error(db()));
112 112
         }
113 113
 
114 114
         // After we have inserted the data, we want to head back to the main page
115
-        header('Location: index.php#section'.$editeventID);
115
+        header('Location: index.php#section' . $editeventID);
116 116
         exit;
117 117
     }
118 118
 
@@ -125,12 +125,12 @@  discard block
 block discarded – undo
125 125
 
126 126
             $sql = ("INSERT INTO cr_eventPeople (eventId, userRoleId) VALUES ('$editeventID', '$editskillID')");
127 127
             if (!mysqli_query(db(), $sql)) {
128
-                die('Error: '.mysqli_error(db()));
128
+                die('Error: ' . mysqli_error(db()));
129 129
             }
130 130
         }
131 131
 
132 132
         // After we have inserted the data, we want to head back to the main page
133
-        header('Location: index.php#section'.$editeventID);
133
+        header('Location: index.php#section' . $editeventID);
134 134
         exit;
135 135
     }
136 136
 }
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
                     $result = mysqli_query(db(), $mysqli_query) or die(mysqli_error(db()));
177 177
                     $row = mysqli_fetch_object($result);
178 178
 
179
-                    echo $row->name.'s';
179
+                    echo $row->name . 's';
180 180
                 } elseif ($_SESSION['onlyShowUserEvents'] == '1') {
181 181
                     echo 'My Events';
182 182
                 } else {
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
 			
203 203
 			<?php if (!empty($pendingSwaps) && $pendingSwaps > 0):
204 204
                 if ($pendingSwaps > 1) {
205
-                    $swapsMessage = $pendingSwaps.' swaps are pending approval. Emails have been sent to the people covering to approve the swaps.';
205
+                    $swapsMessage = $pendingSwaps . ' swaps are pending approval. Emails have been sent to the people covering to approve the swaps.';
206 206
                 } else {
207 207
                     $swapsMessage = 'A swap is pending approval. An email has been sent to the person covering to approve the swap.';
208 208
                 } ?>
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
 							WHERE e.type = '$filter'
271 271
 							AND e.date >= DATE(NOW())
272 272
 							AND e.removed = 0
273
-							ORDER BY ".$dateOrderBy;
273
+							ORDER BY " . $dateOrderBy;
274 274
     } else {
275 275
         $sql = "SELECT
276 276
 							DISTINCT e.id AS id,
@@ -298,7 +298,7 @@  discard block
 block discarded – undo
298 298
 							WHERE e.date >= DATE(NOW())
299 299
 							AND ur.userId = '$view'
300 300
 							AND e.removed = 0
301
-							ORDER BY ".$dateOrderBy;
301
+							ORDER BY " . $dateOrderBy;
302 302
     }
303 303
     $result = mysqli_query(db(), $sql) or die(mysqli_error(db()));
304 304
 
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
         $newMonth = strftime('%B %Y', strtotime($row->sundayDate));
317 317
         if ($month != $newMonth) {
318 318
             $month = $newMonth;
319
-            echo '<li class="time-label"><span class="bg-green">'.$month.'</span></li>';
319
+            echo '<li class="time-label"><span class="bg-green">' . $month . '</span></li>';
320 320
         }
321 321
 
322 322
         // Event details?>
@@ -330,9 +330,9 @@  discard block
 block discarded – undo
330 330
 						<h4><?php
331 331
                             echo date('jS: ', strtotime($row->sundayDate));
332 332
         if ($eventName != '') {
333
-            echo '<strong>'.$eventName.'</strong><br />'.$subType.' - <em>'.$type.'</em>';
333
+            echo '<strong>' . $eventName . '</strong><br />' . $subType . ' - <em>' . $type . '</em>';
334 334
         } else {
335
-            echo $subType.' - <em>'.$type.'</em>';
335
+            echo $subType . ' - <em>' . $type . '</em>';
336 336
         } ?>
337 337
 						</h4>
338 338
 					</a>
@@ -344,7 +344,7 @@  discard block
 block discarded – undo
344 344
 				<?php //<p><strong>Rehearsal:</strong> <?php
345 345
                 //echo ($row->rehearsalDateFormatted = "0000-00-00 00:00:00") ? "none" : strftime(siteSettings()->time_format_normal,strtotime($row->rehearsalDateFormatted));</p>?>
346 346
 					
347
-				<p><strong><?php echo $row->eventGroup ? $row->eventGroup.': ' : '' ?></strong><?php echo $row->sermonTitle ?> <?php echo $row->bibleVerse ? '('.$row->bibleVerse.')' : '' ?></p>
347
+				<p><strong><?php echo $row->eventGroup ? $row->eventGroup . ': ' : '' ?></strong><?php echo $row->sermonTitle ?> <?php echo $row->bibleVerse ? '(' . $row->bibleVerse . ')' : '' ?></p>
348 348
 				
349 349
 				<p><strong>Location:</strong> <?php echo $row->eventLocation; ?></p>
350 350
 				
@@ -416,16 +416,16 @@  discard block
 block discarded – undo
416 416
                                 } else {
417 417
                                     echo '</ul>';
418 418
                                 }
419
-                                echo '<p><strong>'.$groupName.'</strong></p>';
419
+                                echo '<p><strong>' . $groupName . '</strong></p>';
420 420
                                 echo '<ul>';
421 421
                             }
422 422
 
423 423
                             echo '<li>';
424
-                            echo (isset($viewPeople->swap)) ? "<s><a class='text-danger' href='swap.php?swap=".$viewPeople->swap."'>" : '';
424
+                            echo (isset($viewPeople->swap)) ? "<s><a class='text-danger' href='swap.php?swap=" . $viewPeople->swap . "'>" : '';
425 425
                             echo $viewPeople->name;
426 426
 
427 427
                             if ($viewPeople->rolename != '') {
428
-                                echo ' - <em>'.$viewPeople->rolename.'</em>';
428
+                                echo ' - <em>' . $viewPeople->rolename . '</em>';
429 429
                             } else {
430 430
                                 // If there is no skill, we don't need to mention this.
431 431
                             }
@@ -451,9 +451,9 @@  discard block
 block discarded – undo
451 451
 
452 452
 				<?php
453 453
                 if (isAdmin() || $userisBandAdmin || $userisEventEditor) {
454
-                    echo " <a class ='btn btn-primary' href='createEvent.php?action=edit&id=".$eventID."'><i class='fa fa-pencil'></i><span> &nbsp;Edit</span></a> "; /* Edit event */
455
-                    echo " <a class ='btn btn-primary' href='createEvent.php?action=copy&id=".$eventID."'><i class='fa fa-pencil'></i><span> &nbsp;Copy</span></a> "; /* Edit event */
456
-                    echo " <a class ='btn btn-primary' href='emailEvent.php?event=".$eventID."'><i class='fa fa-envelope-o'></i><span> &nbsp;Send email</span></a> "; /* Send email */
454
+                    echo " <a class ='btn btn-primary' href='createEvent.php?action=edit&id=" . $eventID . "'><i class='fa fa-pencil'></i><span> &nbsp;Edit</span></a> "; /* Edit event */
455
+                    echo " <a class ='btn btn-primary' href='createEvent.php?action=copy&id=" . $eventID . "'><i class='fa fa-pencil'></i><span> &nbsp;Copy</span></a> "; /* Edit event */
456
+                    echo " <a class ='btn btn-primary' href='emailEvent.php?event=" . $eventID . "'><i class='fa fa-envelope-o'></i><span> &nbsp;Send email</span></a> "; /* Send email */
457 457
                 }
458 458
         if (isAdmin()) {
459 459
             //echo "<a class='btn btn-primary' href='index.php?notifyEveryone=true&eventID=$eventID'><i class='fa fa-envelope-o'></i><span> &nbsp;Send email</span></a> "; /* Send email */
@@ -462,7 +462,7 @@  discard block
 block discarded – undo
462 462
 
463 463
             echo "<ul class='dropdown-menu'>";
464 464
 
465
-            echo "<li><button type='button' class='btn btn-danger btn-block' data-toggle='modal' data-target='#deleteModal".$eventID."'>Delete</button></li>"; /* Delete Event */
465
+            echo "<li><button type='button' class='btn btn-danger btn-block' data-toggle='modal' data-target='#deleteModal" . $eventID . "'>Delete</button></li>"; /* Delete Event */
466 466
 
467 467
             echo '</ul>';
468 468
         } ?>
Please login to merge, or discard this patch.
src/classes/Controller/UserController.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 
98 98
     public function getUserEditForm(ServerRequestInterface $request, ResponseInterface $response, $args)
99 99
     {
100
-        $this->logger->info("Fetch user GET '/user/".$args['id']."/edit'");
100
+        $this->logger->info("Fetch user GET '/user/" . $args['id'] . "/edit'");
101 101
         $u = UserQuery::create()->findPK($args['id']);
102 102
 
103 103
         if (is_null($u)) {
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
 
113 113
     public function getUser(ServerRequestInterface $request, ResponseInterface $response, $args)
114 114
     {
115
-        $this->logger->info("Fetch user GET '/user/".$args['id']."'");
115
+        $this->logger->info("Fetch user GET '/user/" . $args['id'] . "'");
116 116
         $u = UserQuery::create()->findPK($args['id']);
117 117
 
118 118
         if (is_null($u)) {
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
 
128 128
     public function getUserWidgetOnly(ServerRequestInterface $request, ResponseInterface $response, $args)
129 129
     {
130
-        $this->logger->info("Fetch user GET '/user/".$args['id']."'");
130
+        $this->logger->info("Fetch user GET '/user/" . $args['id'] . "'");
131 131
         $u = UserQuery::create()->findPK($args['id']);
132 132
 
133 133
         if (is_null($u)) {
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
 
143 143
     public function getUserPasswordForm(ServerRequestInterface $request, ResponseInterface $response, $args)
144 144
     {
145
-        $this->logger->info("Fetch user GET '/user/".$args['id']."/password'");
145
+        $this->logger->info("Fetch user GET '/user/" . $args['id'] . "/password'");
146 146
         $u = UserQuery::create()->findPK($args['id']);
147 147
 
148 148
         if (is_null($u)) {
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
 
158 158
     public function postUserPasswordChange(ServerRequestInterface $request, ResponseInterface $response, $args)
159 159
     {
160
-        $this->logger->info("Create user POST '/user/".$args['id']."/password'");
160
+        $this->logger->info("Create user POST '/user/" . $args['id'] . "/password'");
161 161
 
162 162
         $data = $request->getParsedBody();
163 163
 
Please login to merge, or discard this patch.
src/classes/Controller/AuthController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 
79 79
     public function getLoginAuth(ServerRequestInterface $request, ResponseInterface $response, $args)
80 80
     {
81
-        $this->logger->info("Login auth GET '/login/".$args['provider']."'");
81
+        $this->logger->info("Login auth GET '/login/" . $args['provider'] . "'");
82 82
 
83 83
         // login
84 84
         $authUrl = $this->auth->getCallbackUrl($this->router);
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
 
89 89
     public function getLoginCallback(ServerRequestInterface $request, ResponseInterface $response, $args)
90 90
     {
91
-        $this->logger->info("Login auth GET '/login/".$args['provider']."/callback'");
91
+        $this->logger->info("Login auth GET '/login/" . $args['provider'] . "/callback'");
92 92
 
93 93
         // login
94 94
         try {
Please login to merge, or discard this patch.
src/classes/AuthProvider/Callback/FacebookAuth.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 
44 44
         $path = $this->router->pathFor('login-callback', ['provider' => $this->getAuthProviderSlug()]);
45 45
 
46
-        $url = $this->baseUrl.$path;
46
+        $url = $this->baseUrl . $path;
47 47
 
48 48
         return $helper->getLoginUrl($url, $this->permissions);
49 49
     }
@@ -56,12 +56,12 @@  discard block
 block discarded – undo
56 56
             $accessToken = $helper->getAccessToken();
57 57
         } catch (FacebookResponseException $e) {
58 58
             // When Graph returns an error
59
-            echo 'Graph returned an error: '.$e->getMessage();
59
+            echo 'Graph returned an error: ' . $e->getMessage();
60 60
 
61 61
             return false;
62 62
         } catch (FacebookSDKException $e) {
63 63
             // When validation fails or other local issues
64
-            echo 'Facebook SDK returned an error: '.$e->getMessage();
64
+            echo 'Facebook SDK returned an error: ' . $e->getMessage();
65 65
 
66 66
             return false;
67 67
         }
@@ -69,10 +69,10 @@  discard block
 block discarded – undo
69 69
         if (!isset($accessToken)) {
70 70
             if ($helper->getError()) {
71 71
                 header('HTTP/1.0 401 Unauthorized');
72
-                echo 'Error: '.$helper->getError()."\n";
73
-                echo 'Error Code: '.$helper->getErrorCode()."\n";
74
-                echo 'Error Reason: '.$helper->getErrorReason()."\n";
75
-                echo 'Error Description: '.$helper->getErrorDescription()."\n";
72
+                echo 'Error: ' . $helper->getError() . "\n";
73
+                echo 'Error Code: ' . $helper->getErrorCode() . "\n";
74
+                echo 'Error Reason: ' . $helper->getErrorReason() . "\n";
75
+                echo 'Error Description: ' . $helper->getErrorDescription() . "\n";
76 76
             } else {
77 77
                 header('HTTP/1.0 400 Bad Request');
78 78
                 echo 'Bad request';
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
             try {
99 99
                 $accessToken = $oAuth2Client->getLongLivedAccessToken($accessToken);
100 100
             } catch (FacebookSDKException $e) {
101
-                echo '<p>Error getting long-lived access token: '.$helper->getMessage()."</p>\n\n";
101
+                echo '<p>Error getting long-lived access token: ' . $helper->getMessage() . "</p>\n\n";
102 102
 
103 103
                 return false;
104 104
             }
@@ -122,10 +122,10 @@  discard block
 block discarded – undo
122 122
             // Returns a `Facebook\FacebookResponse` object
123 123
             $response = $this->facebook->get('/me?fields=id,name,email', $accessToken);
124 124
         } catch (Facebook\Exceptions\FacebookResponseException $e) {
125
-            echo 'Graph returned an error: '.$e->getMessage();
125
+            echo 'Graph returned an error: ' . $e->getMessage();
126 126
             exit;
127 127
         } catch (Facebook\Exceptions\FacebookSDKException $e) {
128
-            echo 'Facebook SDK returned an error: '.$e->getMessage();
128
+            echo 'Facebook SDK returned an error: ' . $e->getMessage();
129 129
             exit;
130 130
         }
131 131
 
Please login to merge, or discard this patch.
src/dependencies.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 $container = $app->getContainer();
20 20
 
21 21
 // TWIG view renderer
22
-$container['view'] = function ($c) {
22
+$container['view'] = function($c) {
23 23
     $settings = $c->get('settings')['renderer'];
24 24
     $view = new Twig($settings['template_path'], [
25 25
         'cache' => false, // or 'path/to/cache'
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
     $env = $view->getEnvironment();
42 42
     $env->addGlobal('site', new Site());
43 43
     $env->addGlobal('currenturl', $c->get('request')->getUri());
44
-    $env->addGlobal('currentpath', $c->get('request')->getUri()->getBasePath().'/'.$c->get('request')->getUri()->getPath());
44
+    $env->addGlobal('currentpath', $c->get('request')->getUri()->getBasePath() . '/' . $c->get('request')->getUri()->getPath());
45 45
 
46 46
     if (isset($_SESSION['userId'])) {
47 47
         $u = UserQuery::create()->findPk($_SESSION['userId']);
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 };
55 55
 
56 56
 // monolog
57
-$container['logger'] = function ($c) {
57
+$container['logger'] = function($c) {
58 58
     $settings = $c->get('settings')['logger'];
59 59
     $logger = new Monolog\Logger($settings['name']);
60 60
     $logger->pushProcessor(new Monolog\Processor\UidProcessor());
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
     return $logger;
64 64
 };
65 65
 
66
-$container['auth'] = function ($c) {
66
+$container['auth'] = function($c) {
67 67
     $authConfig = getConfig()['auth'];
68 68
 
69 69
     // full domain e.g. https://example.com
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
             break;
82 82
 
83 83
         case 'onebody':
84
-            $url = $authConfig['onebody']['url'].'/';
84
+            $url = $authConfig['onebody']['url'] . '/';
85 85
             $email = new EmailAddress($authConfig['onebody']['email']);
86 86
             $apiKey = $authConfig['onebody']['apiKey'];
87 87
 
Please login to merge, or discard this patch.
src/classes/Controller/GroupController.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 {
13 13
     public function getGroup(ServerRequestInterface $request, ResponseInterface $response, $args)
14 14
     {
15
-        $this->logger->info("Fetch group GET '/group/".$args['id']."'");
15
+        $this->logger->info("Fetch group GET '/group/" . $args['id'] . "'");
16 16
         $events = EventQuery::create()
17 17
             ->useEventPersonQuery()
18 18
                 ->useUserRoleQuery()
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 
39 39
     public function getGroupRoles(ServerRequestInterface $request, ResponseInterface $response, $args)
40 40
     {
41
-        $this->logger->info("Fetch group roles GET '/group/".$args['id']."/roles'");
41
+        $this->logger->info("Fetch group roles GET '/group/" . $args['id'] . "/roles'");
42 42
         $events = EventQuery::create()
43 43
             ->useEventPersonQuery()
44 44
                 ->useUserRoleQuery()
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
                 ->findPk($args['id']);
61 61
 
62 62
         // temporary redirect
63
-        return $response->withStatus(302)->withHeader('Location', $this->router->pathFor('home').'old/roles.php');
63
+        return $response->withStatus(302)->withHeader('Location', $this->router->pathFor('home') . 'old/roles.php');
64 64
 
65 65
         return $this->view->render($response, 'group-roles.twig', ['events' => $events, 'group' => $group]);
66 66
     }
Please login to merge, or discard this patch.
src/routes.php 1 patch
Spacing   +54 added lines, -54 removed lines patch added patch discarded remove patch
@@ -20,35 +20,35 @@  discard block
 block discarded – undo
20 20
 // USER
21 21
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
22 22
 
23
-$app->group('/user', function () {
24
-    $this->get('s', UserController::class.':getAllUsers')->setName('users');
23
+$app->group('/user', function() {
24
+    $this->get('s', UserController::class . ':getAllUsers')->setName('users');
25 25
 
26
-    $this->get('/{id}/widget-only', UserController::class.':getUserWidgetOnly')->setName('user-widget-only');
26
+    $this->get('/{id}/widget-only', UserController::class . ':getUserWidgetOnly')->setName('user-widget-only');
27 27
 
28
-    $this->get('/new', UserController::class.':getNewUserForm')->setName('user-new');
29
-    $this->get('/{id}/edit', UserController::class.':getUserEditForm')->setName('user-edit');
30
-    $this->get('/{id}/password', UserController::class.':getUserPasswordForm')->setName('user-password');
28
+    $this->get('/new', UserController::class . ':getNewUserForm')->setName('user-new');
29
+    $this->get('/{id}/edit', UserController::class . ':getUserEditForm')->setName('user-edit');
30
+    $this->get('/{id}/password', UserController::class . ':getUserPasswordForm')->setName('user-password');
31 31
 
32
-    $this->get('/me', UserController::class.':getCurrentUser')->setName('user-me');
33
-    $this->get('/{id}', UserController::class.':getUser')->setName('user');
32
+    $this->get('/me', UserController::class . ':getCurrentUser')->setName('user-me');
33
+    $this->get('/{id}', UserController::class . ':getUser')->setName('user');
34 34
 
35
-    $this->post('[/{id}]', UserController::class.':postUser')->setName('user-post');
36
-    $this->post('/{id}/password', UserController::class.':postUserPasswordChange')->setName('user-password-post');
35
+    $this->post('[/{id}]', UserController::class . ':postUser')->setName('user-post');
36
+    $this->post('/{id}/password', UserController::class . ':postUserPasswordChange')->setName('user-password-post');
37 37
 
38 38
     // roles
39
-    $this->get('/{id}/roles', RoleController::class.':getAssignRolesForm')->setName('user-roles');
40
-    $this->post('/{id}/roles', RoleController::class.':postUserAssignRoles')->setName('user-assign-post');
39
+    $this->get('/{id}/roles', RoleController::class . ':getAssignRolesForm')->setName('user-roles');
40
+    $this->post('/{id}/roles', RoleController::class . ':postUserAssignRoles')->setName('user-assign-post');
41 41
 
42 42
     // availability
43
-    $this->get('/{id}/availability', AvailabilityController::class.':getAvailabilityForm')->setName('user-availability');
44
-    $this->post('/{id}/availability', AvailabilityController::class.':postAvailability')->setName('user-availability-post');
43
+    $this->get('/{id}/availability', AvailabilityController::class . ':getAvailabilityForm')->setName('user-availability');
44
+    $this->post('/{id}/availability', AvailabilityController::class . ':postAvailability')->setName('user-availability-post');
45 45
 
46 46
     // calendar
47
-    $this->group('/me/calendar', function () {
48
-        $this->get('s', CalendarController::class.':getCalendarTokens')->setName('user-calendars');
49
-        $this->get('/new', CalendarController::class.':getNewCalendarForm')->setName('user-calendars');
50
-        $this->get('/{id}/revoke', CalendarController::class.':getRevokeCalendar')->setName('user-calendar-revoke');
51
-        $this->post('/new', CalendarController::class.':postNewCalendar')->setName('user-calendar-new-post');
47
+    $this->group('/me/calendar', function() {
48
+        $this->get('s', CalendarController::class . ':getCalendarTokens')->setName('user-calendars');
49
+        $this->get('/new', CalendarController::class . ':getNewCalendarForm')->setName('user-calendars');
50
+        $this->get('/{id}/revoke', CalendarController::class . ':getRevokeCalendar')->setName('user-calendar-revoke');
51
+        $this->post('/new', CalendarController::class . ':postNewCalendar')->setName('user-calendar-new-post');
52 52
     });
53 53
 });
54 54
 
@@ -56,95 +56,95 @@  discard block
 block discarded – undo
56 56
 // EVENT
57 57
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
58 58
 
59
-$app->group('/event', function () {
60
-    $this->get('s', EventController::class.':getAllEvents')->setName('events');
61
-    $this->get('s/type/{id}', EventController::class.':getAllEventsWithType')->setName('events-eventtype');
62
-    $this->get('s/subtype/{id}', EventController::class.':getAllEventsWithSubType')->setName('events-eventsubtype');
59
+$app->group('/event', function() {
60
+    $this->get('s', EventController::class . ':getAllEvents')->setName('events');
61
+    $this->get('s/type/{id}', EventController::class . ':getAllEventsWithType')->setName('events-eventtype');
62
+    $this->get('s/subtype/{id}', EventController::class . ':getAllEventsWithSubType')->setName('events-eventsubtype');
63 63
 
64
-    $this->get('s/print/preachers', EventController::class.':getAllEventsToPrint')->setName('events-print');
64
+    $this->get('s/print/preachers', EventController::class . ':getAllEventsToPrint')->setName('events-print');
65 65
 
66
-    $this->get('/new', EventController::class.':getNewEventForm')->setName('event-new');
67
-    $this->get('/{id}/edit', EventController::class.':getEventEditForm')->setName('event-edit');
68
-    $this->get('/{id}/copy', EventController::class.':getEventCopyForm')->setName('event-copy');
69
-    $this->get('/{id}/assign', EventController::class.':getEventAssignForm')->setName('event-assign');
66
+    $this->get('/new', EventController::class . ':getNewEventForm')->setName('event-new');
67
+    $this->get('/{id}/edit', EventController::class . ':getEventEditForm')->setName('event-edit');
68
+    $this->get('/{id}/copy', EventController::class . ':getEventCopyForm')->setName('event-copy');
69
+    $this->get('/{id}/assign', EventController::class . ':getEventAssignForm')->setName('event-assign');
70 70
 
71
-    $this->get('/{id}', EventController::class.':getEvent')->setName('event');
71
+    $this->get('/{id}', EventController::class . ':getEvent')->setName('event');
72 72
 
73
-    $this->post('[/{id}]', EventController::class.':postEvent')->setName('event-post');
74
-    $this->post('/{id}/assign', EventController::class.':postEventAssign')->setName('event-assign-post');
73
+    $this->post('[/{id}]', EventController::class . ':postEvent')->setName('event-post');
74
+    $this->post('/{id}/assign', EventController::class . ':postEventAssign')->setName('event-assign-post');
75 75
 });
76 76
 
77 77
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
78 78
 // RESOURCE
79 79
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
80 80
 
81
-$app->group('/resource', function () {
82
-    $this->get('s', ResourceController::class.':getAllResources')->setName('resources');
81
+$app->group('/resource', function() {
82
+    $this->get('s', ResourceController::class . ':getAllResources')->setName('resources');
83 83
 
84
-    $this->get('[/new]', ResourceController::class.':getNewResourceForm')->setName('resource-new');
85
-    $this->get('/{id}/edit', ResourceController::class.':getResourceEditForm')->setName('resource-edit');
84
+    $this->get('[/new]', ResourceController::class . ':getNewResourceForm')->setName('resource-new');
85
+    $this->get('/{id}/edit', ResourceController::class . ':getResourceEditForm')->setName('resource-edit');
86 86
 
87
-    $this->get('/{id}', ResourceController::class.':getResourceFile')->setName('resource');
87
+    $this->get('/{id}', ResourceController::class . ':getResourceFile')->setName('resource');
88 88
 
89
-    $this->post('[/{id}]', ResourceController::class.':postResource')->setName('resource-post');
89
+    $this->post('[/{id}]', ResourceController::class . ':postResource')->setName('resource-post');
90 90
 });
91 91
 
92 92
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
93 93
 // ROLES & GROUPS
94 94
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
95 95
 
96
-$app->group('/group', function () {
97
-    $this->get('/{id}', GroupController::class.':getGroup')->setName('group');
98
-    $this->get('/{id}/roles', GroupController::class.':getGroupRoles')->setName('group-roles');
96
+$app->group('/group', function() {
97
+    $this->get('/{id}', GroupController::class . ':getGroup')->setName('group');
98
+    $this->get('/{id}/roles', GroupController::class . ':getGroupRoles')->setName('group-roles');
99 99
 });
100 100
 
101 101
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
102 102
 // AUTH
103 103
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
104 104
 
105
-$app->get('/login', AuthController::class.':getLoginForm')->setName('login');
105
+$app->get('/login', AuthController::class . ':getLoginForm')->setName('login');
106 106
 
107
-$app->get('/login/{provider}', AuthController::class.':getLoginAuth')->setName('login-auth');
108
-$app->get('/login/{provider}/callback', AuthController::class.':getLoginCallback')->setName('login-callback');
109
-$app->get('/signup', PendingUserController::class.':getSignUpForm')->setName('sign-up');
110
-$app->get('/signup/cancel', PendingUserController::class.':getSignUpCancel')->setName('sign-up-cancel');
107
+$app->get('/login/{provider}', AuthController::class . ':getLoginAuth')->setName('login-auth');
108
+$app->get('/login/{provider}/callback', AuthController::class . ':getLoginCallback')->setName('login-callback');
109
+$app->get('/signup', PendingUserController::class . ':getSignUpForm')->setName('sign-up');
110
+$app->get('/signup/cancel', PendingUserController::class . ':getSignUpCancel')->setName('sign-up-cancel');
111 111
 
112
-$app->get('/logout', AuthController::class.':getLogout')->setName('logout');
112
+$app->get('/logout', AuthController::class . ':getLogout')->setName('logout');
113 113
 
114
-$app->post('/login', AuthController::class.':postLogin')->setName('login-post');
115
-$app->post('/signup', PendingUserController::class.':postSignUp')->setName('sign-up-post');
114
+$app->post('/login', AuthController::class . ':postLogin')->setName('login-post');
115
+$app->post('/signup', PendingUserController::class . ':postSignUp')->setName('sign-up-post');
116 116
 
117 117
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
118 118
 // NOTIFICATIONS
119 119
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
120 120
 
121
-$app->get('/notification/{id}[/{referrer}]', NotificationController::class.':getNotificationClick')->setName('notification');
121
+$app->get('/notification/{id}[/{referrer}]', NotificationController::class . ':getNotificationClick')->setName('notification');
122 122
 
123 123
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
124 124
 // CALENDAR
125 125
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
126 126
 
127
-$app->get('/calendar/{token}.{format}', CalendarController::class.':getRenderedCalendar')->setName('user-calendar');
127
+$app->get('/calendar/{token}.{format}', CalendarController::class . ':getRenderedCalendar')->setName('user-calendar');
128 128
 
129 129
 // legacy
130
-$app->get('/calendar.php', CalendarController::class.':getLegacyRenderedCalendar')->setName('user-calendar');
130
+$app->get('/calendar.php', CalendarController::class . ':getLegacyRenderedCalendar')->setName('user-calendar');
131 131
 
132 132
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
133 133
 // OTHER
134 134
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
135 135
 
136
-$app->get('/settings', function ($request, $response, $args) {
136
+$app->get('/settings', function($request, $response, $args) {
137 137
     // Sample log message
138 138
     $this->logger->info("Fetch settings GET '/settings'");
139 139
 
140 140
     return $this->view->render($response, 'settings.twig', []);
141 141
 })->setName('settings');
142 142
 
143
-$app->get('/token', function ($request, $response, $args) {
143
+$app->get('/token', function($request, $response, $args) {
144 144
     return $response->getBody()->write(Crypt::generateToken(30));
145 145
 })->setName('token');
146 146
 
147
-$app->get('/', function ($request, $response, $args) {
147
+$app->get('/', function($request, $response, $args) {
148 148
     // Sample log message
149 149
     $this->logger->info("Fetch home GET '/'");
150 150
 
Please login to merge, or discard this patch.
public/old/index.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
             </div><!-- /.timeline-header -->
222 222
 
223 223
             <div class="timeline-body">
224
-              <p><strong><?php echo $event->getEventGroup() ? $event->getEventGroup()->getName().': ' : '' ?></strong><?php echo $event->getSermonTitle() ?> <?php echo $event->getBibleVerse() ? '('.$event->getBibleVerse().')' : '' ?></p>
224
+              <p><strong><?php echo $event->getEventGroup() ? $event->getEventGroup()->getName() . ': ' : '' ?></strong><?php echo $event->getSermonTitle() ?> <?php echo $event->getBibleVerse() ? '(' . $event->getBibleVerse() . ')' : '' ?></p>
225 225
               <p><strong>Location:</strong> <?php echo $event->getLocation()->getName(); ?></p>
226 226
 
227 227
               <?php if ($event->getComments()): ?>
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
                                   INNER JOIN cr_groups g ON g.id = r.groupId
282 282
                                   INNER JOIN cr_users u ON u.id = ur.userId
283 283
                                   INNER JOIN cr_eventPeople ep ON ep.userRoleId = ur.id
284
-                                WHERE ep.eventId = '".$event->getId()."'
284
+                                WHERE ep.eventId = '".$event->getId() . "'
285 285
                                   AND ep.removed = 0
286 286
                                 ORDER BY g.name, r.name";
287 287
 
@@ -306,16 +306,16 @@  discard block
 block discarded – undo
306 306
                             } else {
307 307
                                 echo '</ul>';
308 308
                             }
309
-                            echo '<p><strong>'.$groupName.'</strong></p>';
309
+                            echo '<p><strong>' . $groupName . '</strong></p>';
310 310
                             echo '<ul>';
311 311
                         }
312 312
 
313 313
                         echo '<li>';
314
-                        echo (isset($viewPeople->swap)) ? "<s><a class='text-danger' href='swap.php?swap=".$viewPeople->swap."'>" : '';
314
+                        echo (isset($viewPeople->swap)) ? "<s><a class='text-danger' href='swap.php?swap=" . $viewPeople->swap . "'>" : '';
315 315
                         echo $viewPeople->name;
316 316
 
317 317
                         if ($viewPeople->rolename != '') {
318
-                            echo ' - <em>'.$viewPeople->rolename.'</em>';
318
+                            echo ' - <em>' . $viewPeople->rolename . '</em>';
319 319
                         } else {
320 320
                             // If there is no skill, we don't need to mention this.
321 321
                         }
@@ -397,7 +397,7 @@  discard block
 block discarded – undo
397 397
             </div><!-- /.timeline-header -->
398 398
 
399 399
             <div class="timeline-body">
400
-              <p><strong><?php echo $event->eventGroup ? $event->eventGroup.': ' : '' ?></strong><?php echo $event->sermonTitle ?> <?php echo $event->bibleVerse ? '('.$event->bibleVerse.')' : '' ?></p>
400
+              <p><strong><?php echo $event->eventGroup ? $event->eventGroup . ': ' : '' ?></strong><?php echo $event->sermonTitle ?> <?php echo $event->bibleVerse ? '(' . $event->bibleVerse . ')' : '' ?></p>
401 401
               <p><strong>Location:</strong> <?php echo $event->eventLocation; ?></p>
402 402
 
403 403
               <?php if ($event->comment != ''): ?>
@@ -458,7 +458,7 @@  discard block
 block discarded – undo
458 458
                                   INNER JOIN cr_groups g ON g.id = r.groupId
459 459
                                   INNER JOIN cr_users u ON u.id = ur.userId
460 460
                                   INNER JOIN cr_eventPeople ep ON ep.userRoleId = ur.id
461
-                                WHERE ep.eventId = '".$event->id."'
461
+                                WHERE ep.eventId = '".$event->id . "'
462 462
                                   AND ep.removed = 0
463 463
                                 ORDER BY g.name, r.name";
464 464
 
@@ -483,16 +483,16 @@  discard block
 block discarded – undo
483 483
                             } else {
484 484
                                 echo '</ul>';
485 485
                             }
486
-                            echo '<p><strong>'.$groupName.'</strong></p>';
486
+                            echo '<p><strong>' . $groupName . '</strong></p>';
487 487
                             echo '<ul>';
488 488
                         }
489 489
 
490 490
                         echo '<li>';
491
-                        echo (isset($viewPeople->swap)) ? "<s><a class='text-danger' href='swap.php?swap=".$viewPeople->swap."'>" : '';
491
+                        echo (isset($viewPeople->swap)) ? "<s><a class='text-danger' href='swap.php?swap=" . $viewPeople->swap . "'>" : '';
492 492
                         echo $viewPeople->name;
493 493
 
494 494
                         if ($viewPeople->rolename != '') {
495
-                            echo ' - <em>'.$viewPeople->rolename.'</em>';
495
+                            echo ' - <em>' . $viewPeople->rolename . '</em>';
496 496
                         } else {
497 497
                             // If there is no skill, we don't need to mention this.
498 498
                         }
@@ -563,7 +563,7 @@  discard block
 block discarded – undo
563 563
                   ">
564 564
                   <?php echo timeInWordsWithTense($event->getDate()) ?>
565 565
                 </span>
566
-                <?php else: ?>
566
+                <?php else : ?>
567 567
                 <span class="pull-right badge bg-red">
568 568
                   never
569 569
                 </span>
@@ -628,7 +628,7 @@  discard block
 block discarded – undo
628 628
             <img class="img-circle" src="<?php echo getProfileImageUrl($_SESSION['userid'], 'large') ?>" alt="User Avatar">
629 629
           </div>
630 630
           <!-- /.widget-user-image -->
631
-          <h3 class="widget-user-username"><?php echo $user->getFirstName().' '.$user->getLastName() ?></h3>
631
+          <h3 class="widget-user-username"><?php echo $user->getFirstName() . ' ' . $user->getLastName() ?></h3>
632 632
           <h5 class="widget-user-desc">Account created <?php echo $user->getCreated('M. Y') ?></h5>
633 633
         </div>
634 634
         <div class="box-footer no-padding">
@@ -652,7 +652,7 @@  discard block
 block discarded – undo
652 652
                 $userHasEmail = (strlen($user->getEmail()) > 3);
653 653
                 $emailRemindersEnabled = ($userHasEmail && true); // todo: add opt-out for email reminders
654 654
                 ?>
655
-                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
+                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>
656 656
               </a>
657 657
             </li>
658 658
             <li>
Please login to merge, or discard this patch.
public/old/includes/functions.mail.php 1 patch
Spacing   +80 added lines, -80 removed lines patch added patch discarded remove patch
@@ -27,12 +27,12 @@  discard block
 block discarded – undo
27 27
 {
28 28
     $dbMailId = mailToDb($to, $subject, $message, $from, $bcc);
29 29
 
30
-    $subject = '[rota] '.$subject;
30
+    $subject = '[rota] ' . $subject;
31 31
 
32 32
     $message .= "\n\n";
33
-    $message .= siteSettings()->getOwner()."\n";
34
-    $message .= 'Mail generated with ChurchRota V.'.siteSettings()->getVersion()."\n";
35
-    $message .= siteSettings()->getSiteUrl()."\n";
33
+    $message .= siteSettings()->getOwner() . "\n";
34
+    $message .= 'Mail generated with ChurchRota V.' . siteSettings()->getVersion() . "\n";
35
+    $message .= siteSettings()->getSiteUrl() . "\n";
36 36
 
37 37
     $mailSentOk = false;
38 38
 
@@ -76,14 +76,14 @@  discard block
 block discarded – undo
76 76
     //rfc sais \r\n, but this makes trouble in outlook. several spaces plus \n works fine in outlook and thunderbird.
77 77
     //spaces to suppress automatic removal of "unnecessary linefeeds" in outlook 2003
78 78
     $crlf = "      \n";
79
-    $message = str_replace("\r\n", $crlf, $message);  //replace crlf's
79
+    $message = str_replace("\r\n", $crlf, $message); //replace crlf's
80 80
 
81 81
     //--------------------------------------------------------------------------------
82
-    $headers = 'From: '.$from.$crlf.
83
-    'Reply-To: '.$from.$crlf.
84
-    'Mime-Version: 1.0'.$crlf.
85
-    'Content-Type: text/plain; charset=ISO-8859-1'.$crlf;
86
-    'Content-Transfer-Encoding: quoted-printable'.$crlf;
82
+    $headers = 'From: ' . $from . $crlf .
83
+    'Reply-To: ' . $from . $crlf .
84
+    'Mime-Version: 1.0' . $crlf .
85
+    'Content-Type: text/plain; charset=ISO-8859-1' . $crlf;
86
+    'Content-Transfer-Encoding: quoted-printable' . $crlf;
87 87
     $headerSimple = $headers;
88 88
 
89 89
     //--------------------------------------------------------------------------------
@@ -92,8 +92,8 @@  discard block
 block discarded – undo
92 92
     $to = str_replace(';', ',', $to);
93 93
 
94 94
     if ($mail_dbg) {
95
-        $subject = ' - Mail Debug: '.$subject;   //debug output
96
-        $message .= $crlf.'To: '.$to.$crlf;   //debug move to to end of message
95
+        $subject = ' - Mail Debug: ' . $subject; //debug output
96
+        $message .= $crlf . 'To: ' . $to . $crlf; //debug move to to end of message
97 97
     }
98 98
 
99 99
     //--------------------------------------------------------------------------------
@@ -105,13 +105,13 @@  discard block
 block discarded – undo
105 105
     foreach ($teile as $adr) {
106 106
         if (preg_replace("/([a-zA-Z0-9._%+-]+)(@)([a-zA-Z0-9.-]+)(\.)([a-zA-Z]+)/i", '# # #', trim($adr)) == '# # #') {
107 107
             if ($mail_dbg) {
108
-                $message .= 'Bcc: '.trim($adr).$crlf;
108
+                $message .= 'Bcc: ' . trim($adr) . $crlf;
109 109
             } else {
110
-                $headers .= 'Bcc: '.trim($adr).$crlf;
110
+                $headers .= 'Bcc: ' . trim($adr) . $crlf;
111 111
             }
112 112
             $i = $i + 1;
113 113
         } else {
114
-            $bcc_err .= $adr.$crlf;
114
+            $bcc_err .= $adr . $crlf;
115 115
             $err .= +1;
116 116
         }
117 117
     }
@@ -144,10 +144,10 @@  discard block
 block discarded – undo
144 144
         if ($mailOk) {
145 145
             //mail($from, "[ChurchRota] Mail status - OK", "address ok: " . $i, $headerSimple);
146 146
         } else {
147
-            mail($from, '[Rota] Mail status - ERROR', 'to: '.$to.$crlf.'address ok: '.$i.$crlf.'address errors: '.$err.$crlf.$bcc_err, $headerSimple);
147
+            mail($from, '[Rota] Mail status - ERROR', 'to: ' . $to . $crlf . 'address ok: ' . $i . $crlf . 'address errors: ' . $err . $crlf . $bcc_err, $headerSimple);
148 148
 
149 149
             return false;
150
-            logFailedMailWithId($dbMailId, 'address ok: '.$i.$crlf.'address errors: '.$err.$crlf.$bcc_err, $headerSimple);
150
+            logFailedMailWithId($dbMailId, 'address ok: ' . $i . $crlf . 'address errors: ' . $err . $crlf . $bcc_err, $headerSimple);
151 151
         }
152 152
     }
153 153
 
@@ -204,9 +204,9 @@  discard block
 block discarded – undo
204 204
         }
205 205
         $categoryname = $row['categoryname'];
206 206
         $to = $row['email'];
207
-        $subject = 'New post: '.$objectname;
207
+        $subject = 'New post: ' . $objectname;
208 208
 
209
-        $finalmessage = 'Dear '.$postname."\n \n".$message.$objectname."\n \n".
209
+        $finalmessage = 'Dear ' . $postname . "\n \n" . $message . $objectname . "\n \n" .
210 210
         'To see the post, please login using your username and password';
211 211
 
212 212
         sendMail($to, $subject, $finalmessage, $row['siteadmin']);
@@ -226,19 +226,19 @@  discard block
 block discarded – undo
226 226
 
227 227
     $message = siteSettings()->getNewUserMessage();
228 228
 
229
-    $name = $user->firstName.' '.$user->lastName;
229
+    $name = $user->firstName . ' ' . $user->lastName;
230 230
     $message = str_replace('[name]', $name, $message);
231 231
     $message = str_replace('[username]', $user->username, $message);
232 232
     $message = str_replace('[password]', $password, $message);
233 233
     $message = str_replace('[siteurl]', siteSettings()->getSiteUrl(), $message);
234 234
 
235
-    $subject = 'Account created for '.$name;
235
+    $subject = 'Account created for ' . $name;
236 236
 
237
-    $to = $name.' <'.$user->email.'>';
238
-    $from = siteSettings()->getOwner().' <'.siteSettings()->getAdminEmailAddress().'>';
237
+    $to = $name . ' <' . $user->email . '>';
238
+    $from = siteSettings()->getOwner() . ' <' . siteSettings()->getAdminEmailAddress() . '>';
239 239
 
240 240
     sendMail($to, $subject, $message, $from);
241
-    sendMail($from, 'ADMIN COPY: '.$subject, $message, $from);
241
+    sendMail($from, 'ADMIN COPY: ' . $subject, $message, $from);
242 242
 }
243 243
 
244 244
 function parseEmailTemplate($message, $values)
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
     $values['siteemail'] = siteSettings()->getAdminEmailAddress();
250 250
 
251 251
     foreach ($values as $template_field => $value) {
252
-        $message = str_ireplace('['.$template_field.']', trim($value), $message);
252
+        $message = str_ireplace('[' . $template_field . ']', trim($value), $message);
253 253
     }
254 254
     $message = trim($message);
255 255
 
@@ -265,7 +265,7 @@  discard block
 block discarded – undo
265 265
     $message = str_replace('[rehearsal]', $rehearsal, $message);
266 266
     if (is_array($rotaoutput)):
267 267
         foreach ($rotaoutput as $key => $skill):
268
-            $skillfinal = $skillfinal.$skill.' ';
268
+            $skillfinal = $skillfinal . $skill . ' ';
269 269
     endforeach; else:
270 270
         $skillfinal = $rotaoutput;
271 271
     endif;
@@ -283,7 +283,7 @@  discard block
 block discarded – undo
283 283
 function notifyIndividual($userID, $eventID, $skillID)
284 284
 {
285 285
     notifyEveryoneForEvent($eventID, $skillID, $userID);
286
-    $eventID = 0;  //disables following code through empty sql result
286
+    $eventID = 0; //disables following code through empty sql result
287 287
 
288 288
     $sql = "SELECT *,
289 289
 	(SELECT CONCAT(`firstname`, ' ', `lastname`) FROM cr_users WHERE `cr_users`.id = `cr_skills`.`userID` ORDER BY `cr_users`.firstname) AS `name`,
@@ -324,13 +324,13 @@  discard block
 block discarded – undo
324 324
             if (($row['eventRehearsal'] == '0') or ($row['eventRehearsalChange'] == '1')) {
325 325
                 $rehearsal = $row['norehearsalemail'];
326 326
             } else {
327
-                $rehearsal = $row['yesrehearsal'].' on '.$rehearsaldate.' at '.$location;
327
+                $rehearsal = $row['yesrehearsal'] . ' on ' . $rehearsaldate . ' at ' . $location;
328 328
             }
329 329
         }
330 330
 
331 331
         $skill = $row['category'];
332 332
         if ($row['joinedskill'] != '') {
333
-            $skill = $skill.' - '.$row['joinedskill'];
333
+            $skill = $skill . ' - ' . $row['joinedskill'];
334 334
         } else {
335 335
             // If there is no skill, then we don't need to mention this fact.
336 336
         }
@@ -346,7 +346,7 @@  discard block
 block discarded – undo
346 346
         $location = $row['eventLocationFormatted'];
347 347
         $rotaoutput = $skill;
348 348
         $to = $row['email'];
349
-        $subject = 'Rota reminder: '.$date;
349
+        $subject = 'Rota reminder: ' . $date;
350 350
 
351 351
         $message = emailTemplate($message, $name, $date, $location, $rehearsal, $rotaoutput, $username, $siteurl);
352 352
 
@@ -417,9 +417,9 @@  discard block
 block discarded – undo
417 417
 
418 418
                 $type = $ob->eventType;
419 419
 
420
-                $eventdetails = $eventrow['eventGroup'].': '.$eventrow['sermonTitle'];
420
+                $eventdetails = $eventrow['eventGroup'] . ': ' . $eventrow['sermonTitle'];
421 421
                 if (!empty($eventrow['bibleVerse'])) {
422
-                    $eventdetails .= ' ('.$eventrow['bibleVerse'].')';
422
+                    $eventdetails .= ' (' . $eventrow['bibleVerse'] . ')';
423 423
                 }
424 424
             }
425 425
 
@@ -442,7 +442,7 @@  discard block
 block discarded – undo
442 442
             while ($roleRow = mysqli_fetch_array($roleResult, MYSQLI_ASSOC)) {
443 443
                 if (($roleRow['name'] == '') || ($roleRow['name'] == $roleRow['description'])):
444 444
                     $roles[] = $roleRow['description']; else:
445
-                    $roles[] = $roleRow['description'].' - '.$roleRow['name'];
445
+                    $roles[] = $roleRow['description'] . ' - ' . $roleRow['name'];
446 446
                 endif;
447 447
             }
448 448
 
@@ -462,11 +462,11 @@  discard block
 block discarded – undo
462 462
             $message = siteSettings()->getNotificationEmail();
463 463
             $rotaoutput = implode(', ', $roles);
464 464
 
465
-            $to = $ob->name.' <'.$ob->email.'>';
466
-            $from = siteSettings()->getOwner().' <'.siteSettings()->getAdminEmailAddress().'>';
465
+            $to = $ob->name . ' <' . $ob->email . '>';
466
+            $from = siteSettings()->getOwner() . ' <' . siteSettings()->getAdminEmailAddress() . '>';
467 467
 
468 468
             //$subject = "Rota reminder: " . $date;
469
-            $subject = 'Reminder: '.implode(', ', $roles).' - '.$type.': '.$date;
469
+            $subject = 'Reminder: ' . implode(', ', $roles) . ' - ' . $type . ': ' . $date;
470 470
 
471 471
             $rotadetails = getEventDetails($eventId, "\r\n", 0, false, "\t");
472 472
 
@@ -501,7 +501,7 @@  discard block
 block discarded – undo
501 501
 							ep.notified = 1
502 502
 						WHERE
503 503
 							ep.eventId = '$eventId'
504
-							AND ur.userId IN (".implode(', ', $countarray).')';
504
+							AND ur.userId IN (" . implode(', ', $countarray) . ')';
505 505
 
506 506
         mysqli_query(db(), $sql) or die(mysqli_error(db()));
507 507
     }
@@ -530,14 +530,14 @@  discard block
 block discarded – undo
530 530
     $user = mysqli_fetch_object($result);
531 531
 
532 532
     if (!$user->email) {
533
-        return 'No email address present for '.$user->firstName.' '.$user->lastName;
533
+        return 'No email address present for ' . $user->firstName . ' ' . $user->lastName;
534 534
     }
535 535
 
536 536
     if (!$user->recieveReminderEmails) {
537
-        return $user->firstName.' '.$user->lastName.' opted not to recieve reminder emails';
537
+        return $user->firstName . ' ' . $user->lastName . ' opted not to recieve reminder emails';
538 538
     }
539 539
 
540
-    $name = $user->firstName.' '.$user->lastName;
540
+    $name = $user->firstName . ' ' . $user->lastName;
541 541
 
542 542
     //line seperator for mails
543 543
     //rfc sais \r\n, but this makes trouble in outlook. several spaces plus \n works fine in outlook and thunderbird.
@@ -570,7 +570,7 @@  discard block
 block discarded – undo
570 570
     $eventDetails .= ' - ';
571 571
     $eventDetails .= "\r\n";
572 572
     $eventDetails .= $event->type;
573
-    $eventDetails .= $event->eventGroup.': '.$event->sermonTitle.' ('.$event->bibleVerse.')';
573
+    $eventDetails .= $event->eventGroup . ': ' . $event->sermonTitle . ' (' . $event->bibleVerse . ')';
574 574
     $eventDetails .= "\r\n";
575 575
     $eventDetails .= "\r\n";
576 576
 
@@ -594,7 +594,7 @@  discard block
 block discarded – undo
594 594
         'event.type'     => $event->type,
595 595
         'event.location' => $event->location,
596 596
 
597
-        'event.sermon'        => $event->eventGroup.': '.$event->sermonTitle.' ('.$event->bibleVerse.')',
597
+        'event.sermon'        => $event->eventGroup . ': ' . $event->sermonTitle . ' (' . $event->bibleVerse . ')',
598 598
         'event.sermon.name'   => $event->sermonTitle,
599 599
         'event.sermon.series' => $event->eventGroup,
600 600
         'event.sermon.verse'  => $event->bibleVerse,
@@ -608,8 +608,8 @@  discard block
 block discarded – undo
608 608
 
609 609
     //$message = str_replace("\r\n",$crlf,$message);
610 610
 
611
-    $to = $name.' <'.$user->email.'>';
612
-    $from = siteSettings()->getOwner().' <'.$siteSettings()->getAdminEmailAddress().'>';
611
+    $to = $name . ' <' . $user->email . '>';
612
+    $from = siteSettings()->getOwner() . ' <' . $siteSettings()->getAdminEmailAddress() . '>';
613 613
 
614 614
     $sent = false;
615 615
     $sent = sendMail($to, $subject, $message, $from);
@@ -617,10 +617,10 @@  discard block
 block discarded – undo
617 617
     if ($sent == true) {
618 618
         return true;
619 619
     } else {
620
-        return 'Error while sending mail to '.$user->firstName.' '.$user->lastName;
620
+        return 'Error while sending mail to ' . $user->firstName . ' ' . $user->lastName;
621 621
     }
622 622
 
623
-    return 'Unknown error for '.$user->firstName.' '.$user->lastName;
623
+    return 'Unknown error for ' . $user->firstName . ' ' . $user->lastName;
624 624
 }
625 625
 
626 626
 function getEventEmailSubject($eventId)
@@ -667,16 +667,16 @@  discard block
 block discarded – undo
667 667
     $result = mysqli_query(db(), $sql) or die(mysqli_error(db()));
668 668
     $groupNames = '';
669 669
     while ($group = mysqli_fetch_object($result)) {
670
-        $groupNames .= $group->name.', ';
670
+        $groupNames .= $group->name . ', ';
671 671
     }
672 672
 
673 673
     if (isset($errors)) {
674
-        createNotificationForUser($_SESSION['userid'], 'Email sent with warnings', 'Email sent to '.$groupNames.' groups with errors: '.implode(', ', $errors), 'email');
674
+        createNotificationForUser($_SESSION['userid'], 'Email sent with warnings', 'Email sent to ' . $groupNames . ' groups with errors: ' . implode(', ', $errors), 'email');
675 675
 
676 676
         return $errors;
677 677
     }
678 678
 
679
-    createNotificationForUser($_SESSION['userid'], 'Group email sent', 'Email sent successfully to '.$groupNames, 'email');
679
+    createNotificationForUser($_SESSION['userid'], 'Group email sent', 'Email sent successfully to ' . $groupNames, 'email');
680 680
 
681 681
     return $true;
682 682
 }
@@ -728,16 +728,16 @@  discard block
 block discarded – undo
728 728
     $result = mysqli_query(db(), $sql) or die(mysqli_error(db()));
729 729
     $groupNames = '';
730 730
     while ($group = mysqli_fetch_object($result)) {
731
-        $groupNames .= $group->name.', ';
731
+        $groupNames .= $group->name . ', ';
732 732
     }
733 733
 
734 734
     if (isset($errors)) {
735
-        createNotificationForUser($_SESSION['userid'], 'Email sent with warnings', 'Email sent to '.$groupNames." groups with errors: \n- ".implode("\n- ", $errors), 'email');
735
+        createNotificationForUser($_SESSION['userid'], 'Email sent with warnings', 'Email sent to ' . $groupNames . " groups with errors: \n- " . implode("\n- ", $errors), 'email');
736 736
 
737 737
         return $errors;
738 738
     }
739 739
 
740
-    createNotificationForUser($_SESSION['userid'], 'Group email sent', 'Email sent successfully to '.$groupNames, 'email');
740
+    createNotificationForUser($_SESSION['userid'], 'Group email sent', 'Email sent successfully to ' . $groupNames, 'email');
741 741
 
742 742
     return $true;
743 743
 }
@@ -753,14 +753,14 @@  discard block
 block discarded – undo
753 753
     $user = mysqli_fetch_object($result);
754 754
 
755 755
     if (!$user->email) {
756
-        return 'No email address present for '.$user->firstName.' '.$user->lastName;
756
+        return 'No email address present for ' . $user->firstName . ' ' . $user->lastName;
757 757
     }
758 758
 
759 759
     if (!$user->isOverviewRecipient) {
760
-        return $user->firstName.' '.$user->lastName.' opted not to recieve group emails';
760
+        return $user->firstName . ' ' . $user->lastName . ' opted not to recieve group emails';
761 761
     }
762 762
 
763
-    $name = $user->firstName.' '.$user->lastName;
763
+    $name = $user->firstName . ' ' . $user->lastName;
764 764
 
765 765
     //line seperator for mails
766 766
     //rfc sais \r\n, but this makes trouble in outlook. several spaces plus \n works fine in outlook and thunderbird.
@@ -823,8 +823,8 @@  discard block
 block discarded – undo
823 823
 
824 824
     //$message = str_replace("\r\n",$crlf,$message);
825 825
 
826
-    $to = $name.' <'.$user->email.'>';
827
-    $from = siteSettings()->getOwner().' <'.$siteadmin.'>';
826
+    $to = $name . ' <' . $user->email . '>';
827
+    $from = siteSettings()->getOwner() . ' <' . $siteadmin . '>';
828 828
 
829 829
     $sent = false;
830 830
     $sent = sendMail($to, $subject, $message, $from);
@@ -832,10 +832,10 @@  discard block
 block discarded – undo
832 832
     if ($sent == true) {
833 833
         return true;
834 834
     } else {
835
-        return 'Error while sending mail to '.$user->firstName.' '.$user->lastName;
835
+        return 'Error while sending mail to ' . $user->firstName . ' ' . $user->lastName;
836 836
     }
837 837
 
838
-    return 'Unknown error for '.$user->firstName.' '.$user->lastName;
838
+    return 'Unknown error for ' . $user->firstName . ' ' . $user->lastName;
839 839
 }
840 840
 
841 841
 // returns either true, or error message string
@@ -848,14 +848,14 @@  discard block
 block discarded – undo
848 848
     $user = mysqli_fetch_object($result);
849 849
 
850 850
     if (!$user->email) {
851
-        return 'No email address present for '.$user->firstName.' '.$user->lastName;
851
+        return 'No email address present for ' . $user->firstName . ' ' . $user->lastName;
852 852
     }
853 853
 
854 854
     if (!$user->isOverviewRecipient) {
855
-        return $user->firstName.' '.$user->lastName.' opted not to recieve group emails';
855
+        return $user->firstName . ' ' . $user->lastName . ' opted not to recieve group emails';
856 856
     }
857 857
 
858
-    $name = $user->firstName.' '.$user->lastName;
858
+    $name = $user->firstName . ' ' . $user->lastName;
859 859
 
860 860
     //line seperator for mails
861 861
     //rfc sais \r\n, but this makes trouble in outlook. several spaces plus \n works fine in outlook and thunderbird.
@@ -888,7 +888,7 @@  discard block
 block discarded – undo
888 888
     }
889 889
 
890 890
     if (!isset($events)) {
891
-        return $name.' has no events in the upcoming rota';
891
+        return $name . ' has no events in the upcoming rota';
892 892
     }
893 893
 
894 894
     $events = implode(', ', $events);
@@ -941,7 +941,7 @@  discard block
 block discarded – undo
941 941
 
942 942
         $eventDetails .= $row['joinedskills'];
943 943
         $eventDetails .= "\r\n";
944
-        $eventDetails .= 'Notes: '.$row['comment'];
944
+        $eventDetails .= 'Notes: ' . $row['comment'];
945 945
         $eventDetails .= "\r\n";
946 946
         $eventDetails .= "\r\n";
947 947
     }
@@ -957,8 +957,8 @@  discard block
 block discarded – undo
957 957
 
958 958
     //$message = str_replace("\r\n",$crlf,$message);
959 959
 
960
-    $to = $name.' <'.$user->email.'>';
961
-    $from = siteSettings()->getOwner().' <'.$siteadmin.'>';
960
+    $to = $name . ' <' . $user->email . '>';
961
+    $from = siteSettings()->getOwner() . ' <' . $siteadmin . '>';
962 962
 
963 963
     $sent = false;
964 964
     $sent = sendMail($to, $subject, $message, $from);
@@ -966,10 +966,10 @@  discard block
 block discarded – undo
966 966
     if ($sent == true) {
967 967
         return true;
968 968
     } else {
969
-        return 'Error while sending mail to '.$user->firstName.' '.$user->lastName;
969
+        return 'Error while sending mail to ' . $user->firstName . ' ' . $user->lastName;
970 970
     }
971 971
 
972
-    return 'Unknown error for '.$user->firstName.' '.$user->lastName;
972
+    return 'Unknown error for ' . $user->firstName . ' ' . $user->lastName;
973 973
 }
974 974
 
975 975
 function notifyAttack($fileName, $attackType, $attackerID)
@@ -984,10 +984,10 @@  discard block
 block discarded – undo
984 984
 
985 985
     while ($row = mysqli_fetch_array($userresult, MYSQLI_ASSOC)) {
986 986
         $subject = 'SECURITY-ALERT - Attack blocked successfully';
987
-        $message = "Type:\t\t ".$attackType."<br>\r\n".
988
-                    "Attacker:\t ".$row[name]."<br>\r\n".
989
-                    "Date:\t\t ".date('Y-m-d H:i:s')."<br>\r\n".
990
-                    "Script:\t\t ".$fileName."\r\n "."<br>\r\n";
987
+        $message = "Type:\t\t " . $attackType . "<br>\r\n" .
988
+                    "Attacker:\t " . $row[name] . "<br>\r\n" .
989
+                    "Date:\t\t " . date('Y-m-d H:i:s') . "<br>\r\n" .
990
+                    "Script:\t\t " . $fileName . "\r\n " . "<br>\r\n";
991 991
 
992 992
         //$headers = 'From: ' . $row['siteadmin'] . "\r\n" .
993 993
         //'Reply-To: ' . $row['siteadmin'] . "\r\n";
@@ -997,8 +997,8 @@  discard block
 block discarded – undo
997 997
         //mail($to, $subject, strip_tags($message), $headers);
998 998
         sendMail($to, $subject, strip_tags($message), $to);
999 999
 
1000
-        echo $subject.'<br><br>';
1001
-        echo $message.'<br>';
1000
+        echo $subject . '<br><br>';
1001
+        echo $message . '<br>';
1002 1002
         echo 'An email about this incident was sent to administrator!';
1003 1003
     }
1004 1004
 }
@@ -1013,11 +1013,11 @@  discard block
 block discarded – undo
1013 1013
     $userresult = mysqli_query(db(), $sql) or die(mysqli_error(db()));
1014 1014
 
1015 1015
     while ($row = mysqli_fetch_array($userresult, MYSQLI_ASSOC)) {
1016
-        $subject = 'Info - '.$infoMsg.' - '.$row[name];
1017
-        $message = "Type:\t\t ".$infoMsg."<br>\r\n".
1018
-                    "User:\t\t ".$row[name]."<br>\r\n".
1019
-                    "Date:\t\t ".date('Y-m-d H:i:s')."<br>\r\n".
1020
-                    "Script:\t\t ".$fileName."\r\n "."<br>\r\n";
1016
+        $subject = 'Info - ' . $infoMsg . ' - ' . $row[name];
1017
+        $message = "Type:\t\t " . $infoMsg . "<br>\r\n" .
1018
+                    "User:\t\t " . $row[name] . "<br>\r\n" .
1019
+                    "Date:\t\t " . date('Y-m-d H:i:s') . "<br>\r\n" .
1020
+                    "Script:\t\t " . $fileName . "\r\n " . "<br>\r\n";
1021 1021
 
1022 1022
         //$headers = 'From: ' . $row['siteadmin'] . "\r\n" .
1023 1023
         //'Reply-To: ' . $row['siteadmin'] . "\r\n";
@@ -1034,7 +1034,7 @@  discard block
 block discarded – undo
1034 1034
     if (preg_match("/(\{\{)((.)+){1}(\}\})/", $message, $matches) == 1) {
1035 1035
         $defaultSubject = $matches[2];
1036 1036
         //$subject = str_replace(array("{{","}}"),"",$matches[0]);
1037
-        $message = str_replace($matches[1].$matches[2].$matches[4], '', $message);
1037
+        $message = str_replace($matches[1] . $matches[2] . $matches[4], '', $message);
1038 1038
         //$message = $matches[4];
1039 1039
 
1040 1040
         //$message = $message . "\r\n\r\n";
Please login to merge, or discard this patch.