Completed
Pull Request — master (#218)
by Christopher
67:05 queued 62:34
created
public/old/tableView.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
 									 FROM eventTypes et
114 114
 									 WHERE id IN (SELECT e.type
115 115
 										 						FROM events e
116
-																WHERE '.$whereTwoMonth.'
116
+																WHERE '.$whereTwoMonth . '
117 117
 																AND e.removed = 0)
118 118
 									 ORDER BY name';
119 119
         $result = mysqli_query(db(), $filter_sql) or exit(mysqli_error(db()));
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
 <tr>
135 135
 	<td ><strong>Event</strong></td>
136 136
 	<?php
137
-    $sql = 'SELECT * FROM groups g ORDER BY '.$group_sorting_name;
137
+    $sql = 'SELECT * FROM groups g ORDER BY ' . $group_sorting_name;
138 138
     $result = mysqli_query(db(), $sql) or exit(mysqli_error(db()));
139 139
 
140 140
     while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) {
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
 
165 165
     if ($filter == '') {
166 166
         $sql .= '
167
-							AND '.$whereTwoMonth.'
167
+							AND '.$whereTwoMonth . '
168 168
 						ORDER BY
169 169
 							e.date';
170 170
     } elseif ($filter == 'all') {
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
     } elseif ($filter != '') {
175 175
         $sql .= "
176 176
 							AND e.type = '$filter'
177
-							AND ".$whereTwoMonth.'
177
+							AND " . $whereTwoMonth . '
178 178
 						ORDER BY
179 179
 							e.date';
180 180
     }
@@ -188,31 +188,31 @@  discard block
 block discarded – undo
188 188
         echo '<tr>';
189 189
         echo '<td >';
190 190
         setlocale(LC_TIME, $lang_locale); //de_DE
191
-        echo '<a href="event.php?id='.$row['id'].'">';
191
+        echo '<a href="event.php?id=' . $row['id'] . '">';
192 192
         echo strftime($time_format_short, strtotime($row['sundayDate'])); // %a, <strong>%e. %b</strong>, KW%V
193 193
         echo '</a>';
194 194
 
195 195
         //$row['sundayDate']
196 196
         if (!empty($row['eventType'])) {
197
-            echo '<br /><em>&nbsp;&nbsp;&nbsp;'.$row['eventType'].'</em>';
197
+            echo '<br /><em>&nbsp;&nbsp;&nbsp;' . $row['eventType'] . '</em>';
198 198
         }
199 199
         if (!empty($row['eventSubType'])) {
200
-            echo ' - <em>'.$row['eventSubType'].'</em>';
200
+            echo ' - <em>' . $row['eventSubType'] . '</em>';
201 201
         }
202 202
         if (!empty($row['eventLocation'])) {
203
-            echo '<br /><em>&nbsp;&nbsp;&nbsp;'.$row['eventLocation'].'</em>';
203
+            echo '<br /><em>&nbsp;&nbsp;&nbsp;' . $row['eventLocation'] . '</em>';
204 204
         }
205 205
         if (!empty($row['name'])) {
206
-            echo '<br /><em>&nbsp;&nbsp;&nbsp;'.$row['name'].'</em>';
206
+            echo '<br /><em>&nbsp;&nbsp;&nbsp;' . $row['name'] . '</em>';
207 207
         }
208 208
         if (!empty($row['eventGroup'])) {
209
-            echo '<br /><strong>&nbsp;&nbsp;&nbsp;'.$row['eventGroup'].'</strong>';
209
+            echo '<br /><strong>&nbsp;&nbsp;&nbsp;' . $row['eventGroup'] . '</strong>';
210 210
         }
211 211
         if (!empty($row['sermonTitle'])) {
212
-            echo ': '.$row['sermonTitle'];
212
+            echo ': ' . $row['sermonTitle'];
213 213
         }
214 214
         if (!empty($row['bibleVerse'])) {
215
-            echo ' <em>('.$row['bibleVerse'].')</em>';
215
+            echo ' <em>(' . $row['bibleVerse'] . ')</em>';
216 216
         }
217 217
         echo '</td>';
218 218
 
@@ -244,16 +244,16 @@  discard block
 block discarded – undo
244 244
                     if ($previousName == '') {
245 245
                         // new name
246 246
                         echo ($viewPeople['userId'] == $sessionUserId) ? '<strong class="me">' : '';
247
-                        echo $name.' <em>('.$viewPeople['role'];
247
+                        echo $name . ' <em>(' . $viewPeople['role'];
248 248
                     } elseif ($previousName != $name) {
249 249
                         echo ')</em>';
250 250
                         echo ($viewPeople['userId'] != $sessionUserId) ? '</strong>' : '';
251 251
                         echo '<br />'; // line break from previous name
252 252
                         // new name
253 253
                         echo ($viewPeople['userId'] == $sessionUserId) ? '<strong class="me">' : '';
254
-                        echo $name.' <em>('.$viewPeople['role'];
254
+                        echo $name . ' <em>(' . $viewPeople['role'];
255 255
                     } else {
256
-                        echo ', '.$viewPeople['role'];
256
+                        echo ', ' . $viewPeople['role'];
257 257
                     }
258 258
 
259 259
                     $peopleInEvent = true;
Please login to merge, or discard this patch.
public/old/emails.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
71 71
     if ($editskillID != '') {
72 72
         $sql = ("INSERT INTO eventPeople (eventID, skillID) VALUES ('$editeventID', '$editskillID')");
73 73
         if (!mysqli_query(db(), $sql)) {
74
-            exit('Error: '.mysqli_error(db()));
74
+            exit('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
 block discarded – undo
88 88
 
89 89
             $sql = ("INSERT INTO eventPeople (eventID, skillID) VALUES ('$editeventID', '$editskillID')");
90 90
             if (!mysqli_query(db(), $sql)) {
91
-                exit('Error: '.mysqli_error(db()));
91
+                exit('Error: ' . mysqli_error(db()));
92 92
             }
93 93
         }
94 94
 
Please login to merge, or discard this patch.
public/old/update.settings.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
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
 
@@ -59,20 +59,20 @@  discard block
 block discarded – undo
59 59
 if ($action == 'update') {
60 60
     //if ($language='de-de')
61 61
     if ($rowSettings['lang_locale'] == 'en_GB') {
62
-        executeDbSql("update settings set lang_locale = 'de_DE'");                     // de_DE
62
+        executeDbSql("update settings set lang_locale = 'de_DE'"); // de_DE
63 63
             executeDbSql("update settings set time_format_long = '%A, %e. %B %Y, %R Uhr, KW%V'"); // de_DE: %A, %e. %B %Y, %R Uhr, KW%V
64 64
             executeDbSql("update settings set time_format_normal = '%d.%m.%Y %H:%M '"); // de_DE: %d.%m.%Y %H:%M
65
-            executeDbSql("update settings set time_format_short = '%a, <strong>%e. %b</strong>, %R'");              // de_DE: %a, <strong>%e. %b</strong>, KW%V
65
+            executeDbSql("update settings set time_format_short = '%a, <strong>%e. %b</strong>, %R'"); // de_DE: %a, <strong>%e. %b</strong>, KW%V
66 66
             executeDbSql("update settings set time_zone = 'Europe/Berlin'"); //de_DE: Europe/Berlin
67 67
             executeDbSql("update settings set google_group_calendar = ''");
68 68
         executeDbSql("update settings set overviewemail = '{{Gottesdienst-Planung [MONTH] [YEAR]}}\r\nHallo zusammen,\r\n\r\nanbei die Gottesdienst-Planung fuer [MONTH] [YEAR]\r\n\r\n[OVERVIEW]\r\n\r\nBitte fruehzeitig Bescheid geben, wenn etwas NICHT passt, ansonsten gehe ich davon aus, dass ihr wie geplant koennt.\r\n\r\nAlles Gute und Gottes Segen f�r Euch und Euren Dienst.\r\nEuer Gottesdienst Orga-Team'");
69 69
     }
70 70
     //else
71 71
     if ($rowSettings['lang_locale'] == 'de_DE') {
72
-        executeDbSql("update settings set lang_locale = 'en_GB'");                     // de_DE
72
+        executeDbSql("update settings set lang_locale = 'en_GB'"); // de_DE
73 73
             executeDbSql("update settings set time_format_long = '%A, %B %e @ %I:%M %p'"); // de_DE: %A, %e. %B %Y, %R Uhr, KW%V
74 74
             executeDbSql("update settings set time_format_normal = '%m/%d/%y %I:%M %p'"); // de_DE: %d.%m.%Y %H:%M
75
-            executeDbSql("update settings set time_format_short = '%a, <strong>%b %e</strong>, %I:%M %p'");              // de_DE: %a, <strong>%e. %b</strong>, KW%V
75
+            executeDbSql("update settings set time_format_short = '%a, <strong>%b %e</strong>, %I:%M %p'"); // de_DE: %a, <strong>%e. %b</strong>, KW%V
76 76
             executeDbSql("update settings set time_zone = 'Europe/London'"); //de_DE: Europe/Berlin
77 77
             executeDbSql("update settings set google_group_calendar = ''");
78 78
         executeDbSql("update settings set overviewemail = 'Hello,\r\n\r\nIn this email you find the Rota for [MONTH] [YEAR].\r\n\r\n[OVERVIEW]\r\n\r\nPlease inform us as soon as possible, if you are not able to serve as scheduled.\r\n\r\nBe blessed.\r\nChurch Support Stuff'");
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
     $resultSettings = mysqli_query(db(), $sqlSettings) or exit(mysqli_error(db()));
85 85
     $rowSettings = mysqli_fetch_array($resultSettings, MYSQLI_ASSOC);
86 86
 
87
-    $updateNotification = 'Settings updated successfully to: '.$rowSettings['lang_locale'].' <br>&nbsp;<br>';
87
+    $updateNotification = 'Settings updated successfully to: ' . $rowSettings['lang_locale'] . ' <br>&nbsp;<br>';
88 88
 }
89 89
 
90 90
 $formatting = 'true';
@@ -96,8 +96,8 @@  discard block
 block discarded – undo
96 96
 	<hr>
97 97
 	This page has only beta status. <br>Please do only use it in testing environments!
98 98
 	<hr>
99
-	<?php echo 'Your web browser identifies your language as: '.$language; ?><br>
100
-	<?php echo 'Church Rota is set to use: '.$rowSettings['lang_locale']; ?><br>&nbsp;<br>
99
+	<?php echo 'Your web browser identifies your language as: ' . $language; ?><br>
100
+	<?php echo 'Church Rota is set to use: ' . $rowSettings['lang_locale']; ?><br>&nbsp;<br>
101 101
 	
102 102
 <?php
103 103
 if ($updateNotification == '') {
Please login to merge, or discard this patch.
public/old/createEvents.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
                                         while ($ob = mysqli_fetch_object($result)) {
91 91
                                             if (!(isset($type) && $ob->id == $type)) {
92 92
                                                 $defaultTime = strftime('%H:%M', strtotime($ob->defaultTime));
93
-                                                echo "<option value='".$ob->id."' title='".$ob->description."' data-time='".($defaultTime == '00:00' ? '' : $defaultTime)."' data-location='".(is_null($ob->defaultLocationId) ? '' : $ob->defaultLocationId)."'>".$ob->name.'</option>';
93
+                                                echo "<option value='" . $ob->id . "' title='" . $ob->description . "' data-time='" . ($defaultTime == '00:00' ? '' : $defaultTime) . "' data-location='" . (is_null($ob->defaultLocationId) ? '' : $ob->defaultLocationId) . "'>" . $ob->name . '</option>';
94 94
                                             }
95 95
                                         } ?>
96 96
 									</select>
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
                                         while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) {
117 117
                                             if (isset($subtype) && $row['id'] == $subtype) {
118 118
                                             } else {
119
-                                                echo "<option value='".$row['id']."' title='".$row['description']."'>".$row['name'].'</option>';
119
+                                                echo "<option value='" . $row['id'] . "' title='" . $row['description'] . "'>" . $row['name'] . '</option>';
120 120
                                             }
121 121
                                         } ?>
122 122
 									</select>
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
                                         while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) {
145 145
                                             if (isset($location) && $row['id'] == $location) {
146 146
                                             } else {
147
-                                                echo "<option value='".$row['id']."'>".$row['name'].'</option>';
147
+                                                echo "<option value='" . $row['id'] . "'>" . $row['name'] . '</option>';
148 148
                                             }
149 149
                                         } ?>
150 150
 									</select>
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
                                     while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) {
288 288
                                         if (isset($type) && $row['id'] == $type) {
289 289
                                         } else {
290
-                                            echo "<option value='".$row['id']."' title='".$row['description']."'>".$row['name'].'</option>';
290
+                                            echo "<option value='" . $row['id'] . "' title='" . $row['description'] . "'>" . $row['name'] . '</option>';
291 291
                                         }
292 292
                                     } ?>
293 293
 								</select>
Please login to merge, or discard this patch.
public/old/roles.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
     exit;
17 17
 }
18 18
 if (!isAdmin()) {
19
-    header('Location: error.php?no=100&page='.basename($_SERVER['SCRIPT_FILENAME']));
19
+    header('Location: error.php?no=100&page=' . basename($_SERVER['SCRIPT_FILENAME']));
20 20
     exit;
21 21
 }
22 22
 
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 if ($role && $assignTo) {
37 37
     $sql = "UPDATE roles r SET r.groupId = '$assignTo' WHERE r.id = '$role'";
38 38
     if (!mysqli_query(db(), $sql)) {
39
-        exit('Error: '.mysqli_error(db()));
39
+        exit('Error: ' . mysqli_error(db()));
40 40
     }
41 41
     header('Location: roles.php');
42 42
     exit;
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
         $sql = "INSERT INTO roles (name, description, rehersalId, groupId)
73 73
             VALUES ('$newrole', '$newrole', $rehersal, $groupId)";
74 74
         if (!mysqli_query(db(), $sql)) {
75
-            exit('Error: '.mysqli_error(db()));
75
+            exit('Error: ' . mysqli_error(db()));
76 76
         }
77 77
     } else {
78 78
         // Handle renaming of the roles
@@ -105,11 +105,11 @@  discard block
 block discarded – undo
105 105
     $i = 1;
106 106
     while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) {
107 107
         if ($type == 'option') {
108
-            $list = $list."<option value='".$row['id']."'>".$row['name'].'</option>';
108
+            $list = $list . "<option value='" . $row['id'] . "'>" . $row['name'] . '</option>';
109 109
         } elseif ($type == 'li') {
110
-            $list = $list.'<li>'.$row['name'].'</li>';
110
+            $list = $list . '<li>' . $row['name'] . '</li>';
111 111
         } elseif ($type == 'li-a') {
112
-            $list = $list."<li><a href='roles.php?role=".$roleId.'&assignto='.$row['id']."'>".$row['name'].'</a></li>';
112
+            $list = $list . "<li><a href='roles.php?role=" . $roleId . '&assignto=' . $row['id'] . "'>" . $row['name'] . '</a></li>';
113 113
         }
114 114
         $i++;
115 115
     }
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
             $group = $row['groupId'];
176 176
             $down = $group + 1;
177 177
             $up = $group - 1;
178
-            echo '<div><strong>'.$groupname.'</strong><br />';
178
+            echo '<div><strong>' . $groupname . '</strong><br />';
179 179
         }
180 180
         // Print text input box if a role exists for the group.
181 181
         // Allows user to update role names and move roles between groups
Please login to merge, or discard this patch.
public/old/cr_daily.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
         if ($availableCommits[0]['sha'] !== $commitHash) {
95 95
             $updateAvailable = true;
96 96
 
97
-            $email = siteSettings()->getOwner().' <'.siteSettings()->getAdminEmailAddress().'>';
97
+            $email = siteSettings()->getOwner() . ' <' . siteSettings()->getAdminEmailAddress() . '>';
98 98
             $message = <<<'MESSAGE'
99 99
 There is an update available for your installation of Rota.
100 100
 
@@ -116,23 +116,23 @@  discard block
 block discarded – undo
116 116
                     WHERE
117 117
                         date >= CURDATE()
118 118
                         AND date_format( date , "%y-%m-%d" )
119
-                                <= date_format( DATE_ADD(now(), INTERVAL '.$daysAlert.' DAY ) , "%y-%m-%d" )';
119
+                                <= date_format( DATE_ADD(now(), INTERVAL '.$daysAlert . ' DAY ) , "%y-%m-%d" )';
120 120
         $resultEvents = mysqli_query(db(), $sqlEvents) or exit(mysqli_error(db()));
121 121
         $i = 0;
122 122
         while ($rowEvents = mysqli_fetch_array($resultEvents, MYSQLI_ASSOC)) {
123 123
             $usersNotified = notifyEveryoneForEvent($rowEvents['id']);
124 124
             if (count($usersNotified) > 0) {
125
-                $out = $out.'Automatic notifications sent to users ('.implode(', ', $usersNotified).') for event '.$rowEvents['id'].' on '.$rowEvents['date'].".<br>\r\n";
125
+                $out = $out . 'Automatic notifications sent to users (' . implode(', ', $usersNotified) . ') for event ' . $rowEvents['id'] . ' on ' . $rowEvents['date'] . ".<br>\r\n";
126 126
             } else {
127
-                $out = $out.'No notifications sent for event '.$rowEvents['id'].' on '.$rowEvents['date'].".<br>\r\n";
127
+                $out = $out . 'No notifications sent for event ' . $rowEvents['id'] . ' on ' . $rowEvents['date'] . ".<br>\r\n";
128 128
             }
129 129
             $i = $i + 1;
130 130
         }
131 131
         if ($i == 0) {
132
-            $out = $out.'No events found to automatically notify for.';
132
+            $out = $out . 'No events found to automatically notify for.';
133 133
         }
134 134
     } else {
135
-        $out = $out.'Automatic notifications are disabled.';
135
+        $out = $out . 'Automatic notifications are disabled.';
136 136
     } ?>
137 137
 <html>
138 138
 	<body>
Please login to merge, or discard this patch.
public/old/includes/functions.event.php 1 patch
Spacing   +69 added lines, -69 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
     $sql = ("INSERT INTO eventPeople (eventId, userRoleId) VALUES ('$eventId', '$userRoleId')");
15 15
 
16 16
     if (!mysqli_query(db(), $sql)) {
17
-        exit('Error: '.mysqli_error(db()));
17
+        exit('Error: ' . mysqli_error(db()));
18 18
     }
19 19
 }
20 20
 
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 {
30 30
     $sql = "DELETE FROM eventPeople WHERE eventId = '$id' AND userRoleId = '$userRoleId'";
31 31
     if (!mysqli_query(db(), $sql)) {
32
-        exit('Error: '.mysqli_error(db()));
32
+        exit('Error: ' . mysqli_error(db()));
33 33
     }
34 34
 }
35 35
 
@@ -170,40 +170,40 @@  discard block
 block discarded – undo
170 170
 
171 171
     $ob = mysqli_fetch_object($result);
172 172
 
173
-    $subject = 'Swap requested: '.$ob->newUserName.' - '.$ob->eventDate;
174
-    $message = "Date:\t\t ".strftime($ob->time_format_long, strtotime($ob->eventDate))."\r\n".
175
-                "Requested by:\t\t ".$ob->requestedBy."\r\n".
176
-                "Swap from:\t\t ".$ob->oldUserName.' - '.$ob->oldRole."\r\n".
177
-                "Swap to:\t\t ".$ob->newUserName.' - '.$ob->newRole."\r\n".
178
-                "Accept:\t\t ".$ob->siteurl.'/swap.php?action='.'accept&swap='.$swapId.'&verify='.$verificationCode."\r\n "."\r\n".
179
-                "Decline:\t\t ".$ob->siteurl.'/swap.php?action='.'decline&swap='.$swapId.'&verify='.$verificationCode."\r\n "."\r\n";
173
+    $subject = 'Swap requested: ' . $ob->newUserName . ' - ' . $ob->eventDate;
174
+    $message = "Date:\t\t " . strftime($ob->time_format_long, strtotime($ob->eventDate)) . "\r\n" .
175
+                "Requested by:\t\t " . $ob->requestedBy . "\r\n" .
176
+                "Swap from:\t\t " . $ob->oldUserName . ' - ' . $ob->oldRole . "\r\n" .
177
+                "Swap to:\t\t " . $ob->newUserName . ' - ' . $ob->newRole . "\r\n" .
178
+                "Accept:\t\t " . $ob->siteurl . '/swap.php?action=' . 'accept&swap=' . $swapId . '&verify=' . $verificationCode . "\r\n " . "\r\n" .
179
+                "Decline:\t\t " . $ob->siteurl . '/swap.php?action=' . 'decline&swap=' . $swapId . '&verify=' . $verificationCode . "\r\n " . "\r\n";
180 180
 
181 181
     $from = $ob->siteadmin;
182 182
 
183
-    $linkToSwap = 'swap.php?swap='.$swapId;
183
+    $linkToSwap = 'swap.php?swap=' . $swapId;
184 184
 
185 185
     $sessionUserId = $_SESSION['userid'];
186 186
 
187 187
     if ($sessionUserId == $ob->oldUserId) {    // if old user requests swap
188 188
         // notify new user
189
-        $notificationMessage = $ob->oldUserFirstName.' requested a swap';
189
+        $notificationMessage = $ob->oldUserFirstName . ' requested a swap';
190 190
         $notificationId = createNotificationForUser($ob->newUserId, $notificationMessage, $message, 'swap', $linkToSwap);
191
-        createFacebookNotificationForUser($ob->newUserId, 'notification.php?id='.$notificationId, $notificationMessage);
191
+        createFacebookNotificationForUser($ob->newUserId, 'notification.php?id=' . $notificationId, $notificationMessage);
192 192
         sendMail(getEmailWithId($ob->newUserId), $subject, $message, $from);
193 193
     } elseif ($sessionUserId == $ob->newUserId) {    // if new user requests swap
194 194
         // notify old user
195
-        $notificationMessage = $ob->newUserFirstName.' requested a swap';
195
+        $notificationMessage = $ob->newUserFirstName . ' requested a swap';
196 196
         $notificationId = createNotificationForUser($ob->oldUserId, $notificationMessage, $message, 'swap', $linkToSwap);
197
-        createFacebookNotificationForUser($ob->oldUserId, 'notification.php?id='.$notificationId, $notificationMessage);
197
+        createFacebookNotificationForUser($ob->oldUserId, 'notification.php?id=' . $notificationId, $notificationMessage);
198 198
         sendMail(getEmailWithId($ob->oldUserId), $subject, $message, $from);
199 199
     } else { // notify both users
200 200
         $sessionUserFirstName = getFirstNameWithId($sessionUserId);
201
-        $notificationMessageOldUser = $sessionUserFirstName.' requested a swap for '.$ob->newUserFirstName;
202
-        $notificationMessageNewUser = $sessionUserFirstName.' requested a swap for '.$ob->oldUserFirstName;
201
+        $notificationMessageOldUser = $sessionUserFirstName . ' requested a swap for ' . $ob->newUserFirstName;
202
+        $notificationMessageNewUser = $sessionUserFirstName . ' requested a swap for ' . $ob->oldUserFirstName;
203 203
         $notificationIdOldUser = createNotificationForUser($ob->oldUserId, $notificationMessageOldUser, $message, 'swap', $linkToSwap);
204 204
         $notificationIdNewUser = createNotificationForUser($ob->newUserId, $notificationMessageNewUser, $message, 'swap', $linkToSwap);
205
-        createFacebookNotificationForUser($ob->oldUserId, 'notification.php?id='.$notificationIdOldUser, $notificationMessageOldUser);
206
-        createFacebookNotificationForUser($ob->newUserId, 'notification.php?id='.$notificationIdNewUser, $notificationMessageNewUser);
205
+        createFacebookNotificationForUser($ob->oldUserId, 'notification.php?id=' . $notificationIdOldUser, $notificationMessageOldUser);
206
+        createFacebookNotificationForUser($ob->newUserId, 'notification.php?id=' . $notificationIdNewUser, $notificationMessageNewUser);
207 207
         sendMail(getEmailWithId($ob->oldUserId), $subject, $message, $from);
208 208
         sendMail(getEmailWithId($ob->newUserId), $subject, $message, $from);
209 209
     }
@@ -233,60 +233,60 @@  discard block
 block discarded – undo
233 233
 
234 234
     $ob = mysqli_fetch_object($result);
235 235
 
236
-    $subject = 'Swap accepted: '.$ob->newUserName.' - '.$ob->eventDate;
237
-    $message = "The following swap has been accepted\r\n\r\n".
238
-                "Date:\t\t ".strftime($ob->time_format_long, strtotime($ob->eventDate))."\r\n".
239
-                "Requested by:\t\t ".$ob->requestedBy."\r\n".
240
-                "Swap from:\t\t ".$ob->oldUserName.' - '.$ob->oldRole."\r\n".
241
-                "Swap to:\t\t ".$ob->newUserName.' - '.$ob->newRole."\r\n";
236
+    $subject = 'Swap accepted: ' . $ob->newUserName . ' - ' . $ob->eventDate;
237
+    $message = "The following swap has been accepted\r\n\r\n" .
238
+                "Date:\t\t " . strftime($ob->time_format_long, strtotime($ob->eventDate)) . "\r\n" .
239
+                "Requested by:\t\t " . $ob->requestedBy . "\r\n" .
240
+                "Swap from:\t\t " . $ob->oldUserName . ' - ' . $ob->oldRole . "\r\n" .
241
+                "Swap to:\t\t " . $ob->newUserName . ' - ' . $ob->newRole . "\r\n";
242 242
     $from = $ob->siteadmin;
243 243
 
244
-    $linkToSwap = 'swap.php?swap='.$swapId;
244
+    $linkToSwap = 'swap.php?swap=' . $swapId;
245 245
 
246 246
     $sessionUserId = $_SESSION['userid'];
247 247
 
248 248
     if ($sessionUserId == $ob->oldUserId) {    // if old user accepted swap
249 249
         // notify new user
250
-        $notificationMessage = $ob->oldUserFirstName.' accepted a swap';
250
+        $notificationMessage = $ob->oldUserFirstName . ' accepted a swap';
251 251
         $notificationId = createNotificationForUser($ob->newUserId, $notificationMessage, $message, 'swap', $linkToSwap);
252
-        createFacebookNotificationForUser($ob->newUserId, 'notification.php?id='.$notificationId, $notificationMessage);
252
+        createFacebookNotificationForUser($ob->newUserId, 'notification.php?id=' . $notificationId, $notificationMessage);
253 253
         sendMail(getEmailWithId($ob->newUserId), $subject, $message, $from);
254 254
     } elseif ($sessionUserId == $ob->newUserId) {    // if new user accepted swap
255 255
         // notify old user
256
-        $notificationMessage = $ob->newUserFirstName.' accepted a swap';
256
+        $notificationMessage = $ob->newUserFirstName . ' accepted a swap';
257 257
         $notificationId = createNotificationForUser($ob->oldUserId, $notificationMessage, $message, 'swap', $linkToSwap);
258
-        createFacebookNotificationForUser($ob->oldUserId, 'notification.php?id='.$notificationId, $notificationMessage);
258
+        createFacebookNotificationForUser($ob->oldUserId, 'notification.php?id=' . $notificationId, $notificationMessage);
259 259
         sendMail(getEmailWithId($ob->oldUserId), $subject, $message, $from);
260 260
     } elseif (isset($_GET['token'])) { // if accepted by email URL with token
261 261
         // notify whoever requested swap
262 262
         if ($ob->newUserId == $ob->requestedBy) {
263
-            $notificationMessage = 'Swap accepted with '.$ob->oldUserFirstName;
263
+            $notificationMessage = 'Swap accepted with ' . $ob->oldUserFirstName;
264 264
             $notificationId = createNotificationForUser($ob->newUserId, $notificationMessage, $message, 'swap', $linkToSwap);
265
-            createFacebookNotificationForUser($ob->newUserId, 'notification.php?id='.$notificationId, $notificationMessage);
265
+            createFacebookNotificationForUser($ob->newUserId, 'notification.php?id=' . $notificationId, $notificationMessage);
266 266
             sendMail(getEmailWithId($ob->newUserId), $subject, $message, $from);
267 267
         } elseif ($ob->oldUserId == $ob->requestedBy) {
268
-            $notificationMessage = 'Swap accepted with '.$ob->newUserFirstName;
268
+            $notificationMessage = 'Swap accepted with ' . $ob->newUserFirstName;
269 269
             $notificationId = createNotificationForUser($ob->oldUserId, $notificationMessage, $message, 'swap', $linkToSwap);
270
-            createFacebookNotificationForUser($ob->oldUserId, 'notification.php?id='.$notificationId, $notificationMessage);
270
+            createFacebookNotificationForUser($ob->oldUserId, 'notification.php?id=' . $notificationId, $notificationMessage);
271 271
             sendMail(getEmailWithId($ob->oldUserId), $subject, $message, $from);
272 272
         } else { // notify both
273
-            $notificationMessageOldUser = 'Swap accepted with '.$ob->newUserFirstName;
274
-            $notificationMessageNewUser = 'Swap accepted with '.$ob->oldUserFirstName;
273
+            $notificationMessageOldUser = 'Swap accepted with ' . $ob->newUserFirstName;
274
+            $notificationMessageNewUser = 'Swap accepted with ' . $ob->oldUserFirstName;
275 275
             $notificationIdOldUser = createNotificationForUser($ob->oldUserId, $notificationMessageOldUser, $message, 'swap', $linkToSwap);
276 276
             $notificationIdNewUser = createNotificationForUser($ob->newUserId, $notificationMessageNewUser, $message, 'swap', $linkToSwap);
277
-            createFacebookNotificationForUser($ob->oldUserId, 'notification.php?id='.$notificationIdOldUser, $notificationMessage);
278
-            createFacebookNotificationForUser($ob->newUserId, 'notification.php?id='.$notificationIdNewUser, $notificationMessage);
277
+            createFacebookNotificationForUser($ob->oldUserId, 'notification.php?id=' . $notificationIdOldUser, $notificationMessage);
278
+            createFacebookNotificationForUser($ob->newUserId, 'notification.php?id=' . $notificationIdNewUser, $notificationMessage);
279 279
             sendMail(getEmailWithId($ob->oldUserId), $subject, $message, $from);
280 280
             sendMail(getEmailWithId($ob->newUserId), $subject, $message, $from);
281 281
         }
282 282
     } else { // notify both users
283 283
         $sessionUserFirstName = getFirstNameWithId($sessionUserId);
284
-        $notificationMessageOldUser = $sessionUserFirstName.' accepted a swap for '.$ob->newUserFirstName;
285
-        $notificationMessageNewUser = $sessionUserFirstName.' accepted a swap for '.$ob->oldUserFirstName;
284
+        $notificationMessageOldUser = $sessionUserFirstName . ' accepted a swap for ' . $ob->newUserFirstName;
285
+        $notificationMessageNewUser = $sessionUserFirstName . ' accepted a swap for ' . $ob->oldUserFirstName;
286 286
         $notificationIdOldUser = createNotificationForUser($ob->oldUserId, $notificationMessageOldUser, $message, 'swap', $linkToSwap);
287 287
         $notificationIdNewUser = createNotificationForUser($ob->newUserId, $notificationMessageNewUser, $message, 'swap', $linkToSwap);
288
-        createFacebookNotificationForUser($ob->oldUserId, 'notification.php?id='.$notificationIdOldUser, $notificationMessage);
289
-        createFacebookNotificationForUser($ob->newUserId, 'notification.php?id='.$notificationIdNewUser, $notificationMessage);
288
+        createFacebookNotificationForUser($ob->oldUserId, 'notification.php?id=' . $notificationIdOldUser, $notificationMessage);
289
+        createFacebookNotificationForUser($ob->newUserId, 'notification.php?id=' . $notificationIdNewUser, $notificationMessage);
290 290
         sendMail(getEmailWithId($ob->oldUserId), $subject, $message, $from);
291 291
         sendMail(getEmailWithId($ob->newUserId), $subject, $message, $from);
292 292
     }
@@ -315,39 +315,39 @@  discard block
 block discarded – undo
315 315
 
316 316
     $ob = mysqli_fetch_object($result);
317 317
 
318
-    $subject = 'Swap declined: '.$ob->newUserName.' - '.$ob->eventDate;
319
-    $message = "The following swap has been declined\r\n\r\n".
320
-                "Date:\t\t ".strftime($ob->time_format_long, strtotime($ob->eventDate))."\r\n".
321
-                "Requested by:\t\t ".$ob->requestedBy."\r\n".
322
-                "Swap from:\t\t ".$ob->oldUserName.' - '.$ob->oldRole."\r\n".
323
-                "Swap to:\t\t ".$ob->newUserName.' - '.$ob->newRole."\r\n";
318
+    $subject = 'Swap declined: ' . $ob->newUserName . ' - ' . $ob->eventDate;
319
+    $message = "The following swap has been declined\r\n\r\n" .
320
+                "Date:\t\t " . strftime($ob->time_format_long, strtotime($ob->eventDate)) . "\r\n" .
321
+                "Requested by:\t\t " . $ob->requestedBy . "\r\n" .
322
+                "Swap from:\t\t " . $ob->oldUserName . ' - ' . $ob->oldRole . "\r\n" .
323
+                "Swap to:\t\t " . $ob->newUserName . ' - ' . $ob->newRole . "\r\n";
324 324
 
325 325
     $from = $ob->siteadmin;
326 326
 
327
-    $linkToSwap = 'swap.php?swap='.$swapId;
327
+    $linkToSwap = 'swap.php?swap=' . $swapId;
328 328
 
329 329
     $sessionUserId = $_SESSION['userid'];
330 330
 
331 331
     if ($sessionUserId == $ob->oldUserId) {    // if old user declines swap
332 332
         // notify new user
333
-        $notificationMessage = $ob->oldUserFirstName.' declined a swap';
333
+        $notificationMessage = $ob->oldUserFirstName . ' declined a swap';
334 334
         $notificationId = createNotificationForUser($ob->newUserId, $notificationMessage, $message, 'swap', $linkToSwap);
335
-        createFacebookNotificationForUser($ob->newUserId, 'notification.php?id='.$notificationId, $notificationMessage);
335
+        createFacebookNotificationForUser($ob->newUserId, 'notification.php?id=' . $notificationId, $notificationMessage);
336 336
         sendMail(getEmailWithId($ob->newUserId), $subject, $message, $from);
337 337
     } elseif ($sessionUserId == $ob->newUserId) {    // if new user declines swap
338 338
         // notify old user
339
-        $notificationMessage = $ob->newUserFirstName.' declined a swap';
339
+        $notificationMessage = $ob->newUserFirstName . ' declined a swap';
340 340
         $notificationId = createNotificationForUser($ob->oldUserId, $notificationMessage, $message, 'swap', $linkToSwap);
341
-        createFacebookNotificationForUser($ob->newUserId, 'notification.php?id='.$notificationId, $notificationMessage);
341
+        createFacebookNotificationForUser($ob->newUserId, 'notification.php?id=' . $notificationId, $notificationMessage);
342 342
         sendMail(getEmailWithId($ob->oldUserId), $subject, $message, $from);
343 343
     } else { // notify both users
344 344
         $sessionUserFirstName = getFirstNameWithId($sessionUserId);
345
-        $notificationMessageOldUser = $sessionUserFirstName.' declined a swap for '.$ob->newUserFirstName;
346
-        $notificationMessageNewUser = $sessionUserFirstName.' declined a swap for '.$ob->oldUserFirstName;
345
+        $notificationMessageOldUser = $sessionUserFirstName . ' declined a swap for ' . $ob->newUserFirstName;
346
+        $notificationMessageNewUser = $sessionUserFirstName . ' declined a swap for ' . $ob->oldUserFirstName;
347 347
         $notificationIdOldUser = createNotificationForUser($ob->oldUserId, $notificationMessageOldUser, $message, 'swap', $linkToSwap);
348 348
         $notificationIdNewUser = createNotificationForUser($ob->newUserId, $notificationMessageNewUser, $message, 'swap', $linkToSwap);
349
-        createFacebookNotificationForUser($ob->oldUserId, 'notification.php?id='.$notificationIdOldUser, $notificationMessage);
350
-        createFacebookNotificationForUser($ob->newUserId, 'notification.php?id='.$notificationIdNewUser, $notificationMessage);
349
+        createFacebookNotificationForUser($ob->oldUserId, 'notification.php?id=' . $notificationIdOldUser, $notificationMessage);
350
+        createFacebookNotificationForUser($ob->newUserId, 'notification.php?id=' . $notificationIdNewUser, $notificationMessage);
351 351
         sendMail(getEmailWithId($ob->newUserId), $subject, $message, $from);
352 352
         sendMail(getEmailWithId($ob->oldUserId), $subject, $message, $from);
353 353
     }
@@ -496,7 +496,7 @@  discard block
 block discarded – undo
496 496
 
497 497
     $sql = "UPDATE eventGroups SET archived = true WHERE id = '$seriesId'";
498 498
     if (!mysqli_query(db(), $sql)) {
499
-        exit('Error: '.mysqli_error(db()));
499
+        exit('Error: ' . mysqli_error(db()));
500 500
     }
501 501
 }
502 502
 
@@ -505,13 +505,13 @@  discard block
 block discarded – undo
505 505
     $sql = "INSERT INTO bandMembers (bandId, userRoleId) VALUES ('$bandId', '$userRoleId')";
506 506
 
507 507
     if (!mysqli_query(db(), $sql)) {
508
-        exit('Error: '.mysqli_error(db()));
508
+        exit('Error: ' . mysqli_error(db()));
509 509
     }
510 510
 }
511 511
 
512 512
 function getEventUrl($eventId)
513 513
 {
514
-    return 'event.php?id='.$eventId;
514
+    return 'event.php?id=' . $eventId;
515 515
 }
516 516
 
517 517
 function getEventDetails($eventID, $separator, $type = 4, $apprev_description = true, $prefix = '')
@@ -551,9 +551,9 @@  discard block
 block discarded – undo
551 551
 						e.id = $eventID ";
552 552
 
553 553
     if ($type == 1) {
554
-        $sql = $sql."AND ((g.id in (10,11)) OR (g.id=2 and u.firstname='Team')) ";
554
+        $sql = $sql . "AND ((g.id in (10,11)) OR (g.id=2 and u.firstname='Team')) ";
555 555
     }
556
-    $sql = $sql.'ORDER BY e.id, g.id desc, role, firstname, lastname ';
556
+    $sql = $sql . 'ORDER BY e.id, g.id desc, role, firstname, lastname ';
557 557
 
558 558
     $result = mysqli_query(db(), $sql) or exit(mysqli_error(db()));
559 559
 
@@ -571,32 +571,32 @@  discard block
 block discarded – undo
571 571
 
572 572
         $firstname = $row['firstname'];
573 573
         if ($firstname != 'Team') {
574
-            $firstname = ltrim(substr($firstname, 0, 1).'.', '.');
574
+            $firstname = ltrim(substr($firstname, 0, 1) . '.', '.');
575 575
         }
576 576
 
577 577
         $lastname = $row['lastname'];
578 578
 
579
-        $returnValue = $returnValue.$separator;
579
+        $returnValue = $returnValue . $separator;
580 580
         switch ($type) {
581 581
             case 0:
582 582
                 //all persons of event
583 583
                 //break;    ->  no special handling, fallthrough to case 1
584 584
             case 1:
585 585
                 //only persons with groupID in 10,11,2  ->  handled in sql query
586
-                $returnValue = $returnValue.$prefix.ltrim($group.': ');
587
-                $returnValue = $returnValue.trim($firstname.' '.$lastname);
586
+                $returnValue = $returnValue . $prefix . ltrim($group . ': ');
587
+                $returnValue = $returnValue . trim($firstname . ' ' . $lastname);
588 588
                 break;
589 589
             case 2:
590 590
                 //only event date and event type
591
-                $returnValue = $returnValue.strftime($time_format_normal, strtotime($eventDate));
592
-                $returnValue = $returnValue.$separator;
593
-                $returnValue = $returnValue.$eventType;
591
+                $returnValue = $returnValue . strftime($time_format_normal, strtotime($eventDate));
592
+                $returnValue = $returnValue . $separator;
593
+                $returnValue = $returnValue . $eventType;
594 594
 
595 595
                 return trim(substr($returnValue, strlen($separator) - 1)); //ends while loop
596 596
                 break;
597 597
             case 4:
598 598
                 //only event type
599
-                $returnValue = $returnValue.$eventType;
599
+                $returnValue = $returnValue . $eventType;
600 600
 
601 601
                 return trim(substr($returnValue, strlen($separator) - 1)); //ends while loop
602 602
                 break;
Please login to merge, or discard this patch.
public/old/includes/functions.auth.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
         $_SESSION['db_is_logged_in'] = true;
18 18
         $_SESSION['isAdmin'] = $row['isAdmin']; // Set the admin status to be carried across this session
19 19
         $_SESSION['userid'] = $row['id'];
20
-        $_SESSION['name'] = $row['firstName'].' '.$row['lastName'];
20
+        $_SESSION['name'] = $row['firstName'] . ' ' . $row['lastName'];
21 21
         $_SESSION['isBandAdmin'] = $row['isBandAdmin']; // Set the band admin status to be carried across this session
22 22
         $_SESSION['isEventEditor'] = $row['isEventEditor']; // Set the event editor status to be carried across this session
23 23
         $_SESSION['onlyShowUserEvents'] = $users_start_with_myevents; // 1 if users_start_with_myevents is set in settings, can be changed by user during session
@@ -29,13 +29,13 @@  discard block
 block discarded – undo
29 29
 
30 30
         // admin section
31 31
         if ($_SESSION['isAdmin'] == 1) {
32
-            updateDatabase();                        //check for db updates
32
+            updateDatabase(); //check for db updates
33 33
             //$_SESSION['onlyShowUserEvents'] = '0';		//show all events for admin, regardless what settings say
34 34
         }
35 35
 
36 36
         // Update last login timestamp
37 37
         $currentTimestamp = date('Y-m-d H:i:s');
38
-        $sql = "UPDATE users SET lastLogin = '$currentTimestamp' WHERE id = '".$row['id']."'";
38
+        $sql = "UPDATE users SET lastLogin = '$currentTimestamp' WHERE id = '" . $row['id'] . "'";
39 39
         mysqli_query(db(), $sql) or exit(mysqli_error(db()));
40 40
 
41 41
         // redirect
@@ -44,11 +44,11 @@  discard block
 block discarded – undo
44 44
             $redirectFromSession = strip_tags($_SESSION['redirectUrl']);
45 45
             unset($_SESSION['redirectUrl']);
46 46
             // check is url is on same domain and prevents redirecting to logout page
47
-            if (strncmp(strtolower(siteSettings()->getSiteUrl().'/'), strtolower($redirectFromSession), (strlen(siteSettings()->getSiteUrl()) + 1)) == 0 && strpos($redirectFromSession, 'logout.php') === false) {
47
+            if (strncmp(strtolower(siteSettings()->getSiteUrl() . '/'), strtolower($redirectFromSession), (strlen(siteSettings()->getSiteUrl()) + 1)) == 0 && strpos($redirectFromSession, 'logout.php') === false) {
48 48
                 $redirectUrl = $redirectFromSession;
49 49
             }
50 50
         }
51
-        header('Location: '.$redirectUrl);
51
+        header('Location: ' . $redirectUrl);
52 52
         exit;
53 53
     }
54 54
 }
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
         }
270 270
     } else {
271 271
         $skillfinal = $rotaoutput;
@@ -284,7 +284,7 @@  discard block
 block discarded – undo
284 284
 function notifyIndividual($userID, $eventID, $skillID)
285 285
 {
286 286
     notifyEveryoneForEvent($eventID, $skillID, $userID);
287
-    $eventID = 0;  //disables following code through empty sql result
287
+    $eventID = 0; //disables following code through empty sql result
288 288
 
289 289
     $sql = "SELECT *,
290 290
 	(SELECT CONCAT(`firstname`, ' ', `lastname`) FROM users WHERE `users`.id = `skills`.`userID` ORDER BY `users`.firstname) AS `name`,
@@ -325,13 +325,13 @@  discard block
 block discarded – undo
325 325
             if (($row['eventRehearsal'] == '0') or ($row['eventRehearsalChange'] == '1')) {
326 326
                 $rehearsal = $row['norehearsalemail'];
327 327
             } else {
328
-                $rehearsal = $row['yesrehearsal'].' on '.$rehearsaldate.' at '.$location;
328
+                $rehearsal = $row['yesrehearsal'] . ' on ' . $rehearsaldate . ' at ' . $location;
329 329
             }
330 330
         }
331 331
 
332 332
         $skill = $row['category'];
333 333
         if ($row['joinedskill'] != '') {
334
-            $skill = $skill.' - '.$row['joinedskill'];
334
+            $skill = $skill . ' - ' . $row['joinedskill'];
335 335
         } else {
336 336
             // If there is no skill, then we don't need to mention this fact.
337 337
         }
@@ -347,7 +347,7 @@  discard block
 block discarded – undo
347 347
         $location = $row['eventLocationFormatted'];
348 348
         $rotaoutput = $skill;
349 349
         $to = $row['email'];
350
-        $subject = 'Rota reminder: '.$date;
350
+        $subject = 'Rota reminder: ' . $date;
351 351
 
352 352
         $message = emailTemplate($message, $name, $date, $location, $rehearsal, $rotaoutput, $username, $siteurl);
353 353
 
@@ -418,9 +418,9 @@  discard block
 block discarded – undo
418 418
 
419 419
                 $type = $ob->eventType;
420 420
 
421
-                $eventdetails = $eventrow['eventGroup'].': '.$eventrow['sermonTitle'];
421
+                $eventdetails = $eventrow['eventGroup'] . ': ' . $eventrow['sermonTitle'];
422 422
                 if (!empty($eventrow['bibleVerse'])) {
423
-                    $eventdetails .= ' ('.$eventrow['bibleVerse'].')';
423
+                    $eventdetails .= ' (' . $eventrow['bibleVerse'] . ')';
424 424
                 }
425 425
             }
426 426
 
@@ -444,7 +444,7 @@  discard block
 block discarded – undo
444 444
                 if (($roleRow['name'] == '') || ($roleRow['name'] == $roleRow['description'])) {
445 445
                     $roles[] = $roleRow['description'];
446 446
                 } else {
447
-                    $roles[] = $roleRow['description'].' - '.$roleRow['name'];
447
+                    $roles[] = $roleRow['description'] . ' - ' . $roleRow['name'];
448 448
                 }
449 449
             }
450 450
 
@@ -464,11 +464,11 @@  discard block
 block discarded – undo
464 464
             $message = siteSettings()->getNotificationEmail();
465 465
             $rotaoutput = implode(', ', $roles);
466 466
 
467
-            $to = $ob->name.' <'.$ob->email.'>';
468
-            $from = siteSettings()->getOwner().' <'.siteSettings()->getAdminEmailAddress().'>';
467
+            $to = $ob->name . ' <' . $ob->email . '>';
468
+            $from = siteSettings()->getOwner() . ' <' . siteSettings()->getAdminEmailAddress() . '>';
469 469
 
470 470
             //$subject = "Rota reminder: " . $date;
471
-            $subject = 'Reminder: '.implode(', ', $roles).' - '.$type.': '.$date;
471
+            $subject = 'Reminder: ' . implode(', ', $roles) . ' - ' . $type . ': ' . $date;
472 472
 
473 473
             $rotadetails = getEventDetails($eventId, "\r\n", 0, false, "\t");
474 474
 
@@ -503,7 +503,7 @@  discard block
 block discarded – undo
503 503
 							ep.notified = 1
504 504
 						WHERE
505 505
 							ep.eventId = '$eventId'
506
-							AND ur.userId IN (".implode(', ', $countarray).')';
506
+							AND ur.userId IN (" . implode(', ', $countarray) . ')';
507 507
 
508 508
         mysqli_query(db(), $sql) or exit(mysqli_error(db()));
509 509
     }
@@ -532,14 +532,14 @@  discard block
 block discarded – undo
532 532
     $user = mysqli_fetch_object($result);
533 533
 
534 534
     if (!$user->email) {
535
-        return 'No email address present for '.$user->firstName.' '.$user->lastName;
535
+        return 'No email address present for ' . $user->firstName . ' ' . $user->lastName;
536 536
     }
537 537
 
538 538
     if (!$user->recieveReminderEmails) {
539
-        return $user->firstName.' '.$user->lastName.' opted not to recieve reminder emails';
539
+        return $user->firstName . ' ' . $user->lastName . ' opted not to recieve reminder emails';
540 540
     }
541 541
 
542
-    $name = $user->firstName.' '.$user->lastName;
542
+    $name = $user->firstName . ' ' . $user->lastName;
543 543
 
544 544
     //line seperator for mails
545 545
     //rfc sais \r\n, but this makes trouble in outlook. several spaces plus \n works fine in outlook and thunderbird.
@@ -572,7 +572,7 @@  discard block
 block discarded – undo
572 572
     $eventDetails .= ' - ';
573 573
     $eventDetails .= "\r\n";
574 574
     $eventDetails .= $event->type;
575
-    $eventDetails .= $event->eventGroup.': '.$event->sermonTitle.' ('.$event->bibleVerse.')';
575
+    $eventDetails .= $event->eventGroup . ': ' . $event->sermonTitle . ' (' . $event->bibleVerse . ')';
576 576
     $eventDetails .= "\r\n";
577 577
     $eventDetails .= "\r\n";
578 578
 
@@ -596,7 +596,7 @@  discard block
 block discarded – undo
596 596
         'event.type'     => $event->type,
597 597
         'event.location' => $event->location,
598 598
 
599
-        'event.sermon'        => $event->eventGroup.': '.$event->sermonTitle.' ('.$event->bibleVerse.')',
599
+        'event.sermon'        => $event->eventGroup . ': ' . $event->sermonTitle . ' (' . $event->bibleVerse . ')',
600 600
         'event.sermon.name'   => $event->sermonTitle,
601 601
         'event.sermon.series' => $event->eventGroup,
602 602
         'event.sermon.verse'  => $event->bibleVerse,
@@ -610,8 +610,8 @@  discard block
 block discarded – undo
610 610
 
611 611
     //$message = str_replace("\r\n",$crlf,$message);
612 612
 
613
-    $to = $name.' <'.$user->email.'>';
614
-    $from = siteSettings()->getOwner().' <'.$siteSettings()->getAdminEmailAddress().'>';
613
+    $to = $name . ' <' . $user->email . '>';
614
+    $from = siteSettings()->getOwner() . ' <' . $siteSettings()->getAdminEmailAddress() . '>';
615 615
 
616 616
     $sent = false;
617 617
     $sent = sendMail($to, $subject, $message, $from);
@@ -619,10 +619,10 @@  discard block
 block discarded – undo
619 619
     if ($sent == true) {
620 620
         return true;
621 621
     } else {
622
-        return 'Error while sending mail to '.$user->firstName.' '.$user->lastName;
622
+        return 'Error while sending mail to ' . $user->firstName . ' ' . $user->lastName;
623 623
     }
624 624
 
625
-    return 'Unknown error for '.$user->firstName.' '.$user->lastName;
625
+    return 'Unknown error for ' . $user->firstName . ' ' . $user->lastName;
626 626
 }
627 627
 
628 628
 function getEventEmailSubject($eventId)
@@ -669,16 +669,16 @@  discard block
 block discarded – undo
669 669
     $result = mysqli_query(db(), $sql) or exit(mysqli_error(db()));
670 670
     $groupNames = '';
671 671
     while ($group = mysqli_fetch_object($result)) {
672
-        $groupNames .= $group->name.', ';
672
+        $groupNames .= $group->name . ', ';
673 673
     }
674 674
 
675 675
     if (isset($errors)) {
676
-        createNotificationForUser($_SESSION['userid'], 'Email sent with warnings', 'Email sent to '.$groupNames.' groups with errors: '.implode(', ', $errors), 'email');
676
+        createNotificationForUser($_SESSION['userid'], 'Email sent with warnings', 'Email sent to ' . $groupNames . ' groups with errors: ' . implode(', ', $errors), 'email');
677 677
 
678 678
         return $errors;
679 679
     }
680 680
 
681
-    createNotificationForUser($_SESSION['userid'], 'Group email sent', 'Email sent successfully to '.$groupNames, 'email');
681
+    createNotificationForUser($_SESSION['userid'], 'Group email sent', 'Email sent successfully to ' . $groupNames, 'email');
682 682
 
683 683
     return $true;
684 684
 }
@@ -730,16 +730,16 @@  discard block
 block discarded – undo
730 730
     $result = mysqli_query(db(), $sql) or exit(mysqli_error(db()));
731 731
     $groupNames = '';
732 732
     while ($group = mysqli_fetch_object($result)) {
733
-        $groupNames .= $group->name.', ';
733
+        $groupNames .= $group->name . ', ';
734 734
     }
735 735
 
736 736
     if (isset($errors)) {
737
-        createNotificationForUser($_SESSION['userid'], 'Email sent with warnings', 'Email sent to '.$groupNames." groups with errors: \n- ".implode("\n- ", $errors), 'email');
737
+        createNotificationForUser($_SESSION['userid'], 'Email sent with warnings', 'Email sent to ' . $groupNames . " groups with errors: \n- " . implode("\n- ", $errors), 'email');
738 738
 
739 739
         return $errors;
740 740
     }
741 741
 
742
-    createNotificationForUser($_SESSION['userid'], 'Group email sent', 'Email sent successfully to '.$groupNames, 'email');
742
+    createNotificationForUser($_SESSION['userid'], 'Group email sent', 'Email sent successfully to ' . $groupNames, 'email');
743 743
 
744 744
     return $true;
745 745
 }
@@ -755,14 +755,14 @@  discard block
 block discarded – undo
755 755
     $user = mysqli_fetch_object($result);
756 756
 
757 757
     if (!$user->email) {
758
-        return 'No email address present for '.$user->firstName.' '.$user->lastName;
758
+        return 'No email address present for ' . $user->firstName . ' ' . $user->lastName;
759 759
     }
760 760
 
761 761
     if (!$user->isOverviewRecipient) {
762
-        return $user->firstName.' '.$user->lastName.' opted not to recieve group emails';
762
+        return $user->firstName . ' ' . $user->lastName . ' opted not to recieve group emails';
763 763
     }
764 764
 
765
-    $name = $user->firstName.' '.$user->lastName;
765
+    $name = $user->firstName . ' ' . $user->lastName;
766 766
 
767 767
     //line seperator for mails
768 768
     //rfc sais \r\n, but this makes trouble in outlook. several spaces plus \n works fine in outlook and thunderbird.
@@ -825,8 +825,8 @@  discard block
 block discarded – undo
825 825
 
826 826
     //$message = str_replace("\r\n",$crlf,$message);
827 827
 
828
-    $to = $name.' <'.$user->email.'>';
829
-    $from = siteSettings()->getOwner().' <'.$siteadmin.'>';
828
+    $to = $name . ' <' . $user->email . '>';
829
+    $from = siteSettings()->getOwner() . ' <' . $siteadmin . '>';
830 830
 
831 831
     $sent = false;
832 832
     $sent = sendMail($to, $subject, $message, $from);
@@ -834,10 +834,10 @@  discard block
 block discarded – undo
834 834
     if ($sent == true) {
835 835
         return true;
836 836
     } else {
837
-        return 'Error while sending mail to '.$user->firstName.' '.$user->lastName;
837
+        return 'Error while sending mail to ' . $user->firstName . ' ' . $user->lastName;
838 838
     }
839 839
 
840
-    return 'Unknown error for '.$user->firstName.' '.$user->lastName;
840
+    return 'Unknown error for ' . $user->firstName . ' ' . $user->lastName;
841 841
 }
842 842
 
843 843
 // returns either true, or error message string
@@ -850,14 +850,14 @@  discard block
 block discarded – undo
850 850
     $user = mysqli_fetch_object($result);
851 851
 
852 852
     if (!$user->email) {
853
-        return 'No email address present for '.$user->firstName.' '.$user->lastName;
853
+        return 'No email address present for ' . $user->firstName . ' ' . $user->lastName;
854 854
     }
855 855
 
856 856
     if (!$user->isOverviewRecipient) {
857
-        return $user->firstName.' '.$user->lastName.' opted not to recieve group emails';
857
+        return $user->firstName . ' ' . $user->lastName . ' opted not to recieve group emails';
858 858
     }
859 859
 
860
-    $name = $user->firstName.' '.$user->lastName;
860
+    $name = $user->firstName . ' ' . $user->lastName;
861 861
 
862 862
     //line seperator for mails
863 863
     //rfc sais \r\n, but this makes trouble in outlook. several spaces plus \n works fine in outlook and thunderbird.
@@ -890,7 +890,7 @@  discard block
 block discarded – undo
890 890
     }
891 891
 
892 892
     if (!isset($events)) {
893
-        return $name.' has no events in the upcoming rota';
893
+        return $name . ' has no events in the upcoming rota';
894 894
     }
895 895
 
896 896
     $events = implode(', ', $events);
@@ -943,7 +943,7 @@  discard block
 block discarded – undo
943 943
 
944 944
         $eventDetails .= $row['joinedskills'];
945 945
         $eventDetails .= "\r\n";
946
-        $eventDetails .= 'Notes: '.$row['comment'];
946
+        $eventDetails .= 'Notes: ' . $row['comment'];
947 947
         $eventDetails .= "\r\n";
948 948
         $eventDetails .= "\r\n";
949 949
     }
@@ -959,8 +959,8 @@  discard block
 block discarded – undo
959 959
 
960 960
     //$message = str_replace("\r\n",$crlf,$message);
961 961
 
962
-    $to = $name.' <'.$user->email.'>';
963
-    $from = siteSettings()->getOwner().' <'.$siteadmin.'>';
962
+    $to = $name . ' <' . $user->email . '>';
963
+    $from = siteSettings()->getOwner() . ' <' . $siteadmin . '>';
964 964
 
965 965
     $sent = false;
966 966
     $sent = sendMail($to, $subject, $message, $from);
@@ -968,10 +968,10 @@  discard block
 block discarded – undo
968 968
     if ($sent == true) {
969 969
         return true;
970 970
     } else {
971
-        return 'Error while sending mail to '.$user->firstName.' '.$user->lastName;
971
+        return 'Error while sending mail to ' . $user->firstName . ' ' . $user->lastName;
972 972
     }
973 973
 
974
-    return 'Unknown error for '.$user->firstName.' '.$user->lastName;
974
+    return 'Unknown error for ' . $user->firstName . ' ' . $user->lastName;
975 975
 }
976 976
 
977 977
 function notifyAttack($fileName, $attackType, $attackerID)
@@ -986,10 +986,10 @@  discard block
 block discarded – undo
986 986
 
987 987
     while ($row = mysqli_fetch_array($userresult, MYSQLI_ASSOC)) {
988 988
         $subject = 'SECURITY-ALERT - Attack blocked successfully';
989
-        $message = "Type:\t\t ".$attackType."<br>\r\n".
990
-                    "Attacker:\t ".$row[name]."<br>\r\n".
991
-                    "Date:\t\t ".date('Y-m-d H:i:s')."<br>\r\n".
992
-                    "Script:\t\t ".$fileName."\r\n "."<br>\r\n";
989
+        $message = "Type:\t\t " . $attackType . "<br>\r\n" .
990
+                    "Attacker:\t " . $row[name] . "<br>\r\n" .
991
+                    "Date:\t\t " . date('Y-m-d H:i:s') . "<br>\r\n" .
992
+                    "Script:\t\t " . $fileName . "\r\n " . "<br>\r\n";
993 993
 
994 994
         //$headers = 'From: ' . $row['siteadmin'] . "\r\n" .
995 995
         //'Reply-To: ' . $row['siteadmin'] . "\r\n";
@@ -999,8 +999,8 @@  discard block
 block discarded – undo
999 999
         //mail($to, $subject, strip_tags($message), $headers);
1000 1000
         sendMail($to, $subject, strip_tags($message), $to);
1001 1001
 
1002
-        echo $subject.'<br><br>';
1003
-        echo $message.'<br>';
1002
+        echo $subject . '<br><br>';
1003
+        echo $message . '<br>';
1004 1004
         echo 'An email about this incident was sent to administrator!';
1005 1005
     }
1006 1006
 }
@@ -1015,11 +1015,11 @@  discard block
 block discarded – undo
1015 1015
     $userresult = mysqli_query(db(), $sql) or exit(mysqli_error(db()));
1016 1016
 
1017 1017
     while ($row = mysqli_fetch_array($userresult, MYSQLI_ASSOC)) {
1018
-        $subject = 'Info - '.$infoMsg.' - '.$row[name];
1019
-        $message = "Type:\t\t ".$infoMsg."<br>\r\n".
1020
-                    "User:\t\t ".$row[name]."<br>\r\n".
1021
-                    "Date:\t\t ".date('Y-m-d H:i:s')."<br>\r\n".
1022
-                    "Script:\t\t ".$fileName."\r\n "."<br>\r\n";
1018
+        $subject = 'Info - ' . $infoMsg . ' - ' . $row[name];
1019
+        $message = "Type:\t\t " . $infoMsg . "<br>\r\n" .
1020
+                    "User:\t\t " . $row[name] . "<br>\r\n" .
1021
+                    "Date:\t\t " . date('Y-m-d H:i:s') . "<br>\r\n" .
1022
+                    "Script:\t\t " . $fileName . "\r\n " . "<br>\r\n";
1023 1023
 
1024 1024
         //$headers = 'From: ' . $row['siteadmin'] . "\r\n" .
1025 1025
         //'Reply-To: ' . $row['siteadmin'] . "\r\n";
@@ -1036,7 +1036,7 @@  discard block
 block discarded – undo
1036 1036
     if (preg_match("/(\{\{)((.)+){1}(\}\})/", $message, $matches) == 1) {
1037 1037
         $defaultSubject = $matches[2];
1038 1038
         //$subject = str_replace(array("{{","}}"),"",$matches[0]);
1039
-        $message = str_replace($matches[1].$matches[2].$matches[4], '', $message);
1039
+        $message = str_replace($matches[1] . $matches[2] . $matches[4], '', $message);
1040 1040
         //$message = $matches[4];
1041 1041
 
1042 1042
         //$message = $message . "\r\n\r\n";
Please login to merge, or discard this patch.