Completed
Push — master ( 35b26f...5d8acc )
by Christopher
29s
created
public/old/subTypes.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
     exit;
15 15
 }
16 16
 if (!isAdmin()) {
17
-    header('Location: error.php?no=100&page='.basename($_SERVER['SCRIPT_FILENAME']));
17
+    header('Location: error.php?no=100&page=' . basename($_SERVER['SCRIPT_FILENAME']));
18 18
     exit;
19 19
 }
20 20
 
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 
38 38
         $sql = ("INSERT INTO eventSubTypes (name, description) VALUES ('$name', '$description')");
39 39
         if (!mysqli_query(db(), $sql)) {
40
-            die('Error: '.mysqli_error(db()));
40
+            die('Error: ' . mysqli_error(db()));
41 41
         }
42 42
     } else {
43 43
         // Otherwise we are dealing with edits, not new stuff
@@ -88,10 +88,10 @@  discard block
 block discarded – undo
88 88
     $result = mysqli_query(db(), $sql) or die(mysqli_error(db()));
89 89
 
90 90
     while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) {
91
-        echo '<input type="hidden" name="formindex[]" value="'.$row['id'].'" />';
92
-        echo "<input name='name[]' value='".$row['name']."' />";
91
+        echo '<input type="hidden" name="formindex[]" value="' . $row['id'] . '" />';
92
+        echo "<input name='name[]' value='" . $row['name'] . "' />";
93 93
 
94
-        echo " <a href='subTypes.php?method=remove&subType=".$row['id']."'><i class='fa fa-times'></i></a><br />";
94
+        echo " <a href='subTypes.php?method=remove&subType=" . $row['id'] . "'><i class='fa fa-times'></i></a><br />";
95 95
     } ?>
96 96
    </div><!-- /.box-body -->
97 97
    <div class="box-footer">
Please login to merge, or discard this patch.
public/old/createEvent.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 if (($userisBandAdmin) || ($userisEventEditor) || (isAdmin())) {
46 46
     // Just continue the code
47 47
 } else {
48
-    header('Location: error.php?no=100&page='.basename($_SERVER['SCRIPT_FILENAME']));
48
+    header('Location: error.php?no=100&page=' . basename($_SERVER['SCRIPT_FILENAME']));
49 49
 }
50 50
 
51 51
 if ($userisBandAdmin) {
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
         $location = $row['location'];
83 83
         $locationname = $row['locationname'];
84 84
         if ($action == 'edit') {
85
-            $formaction = '?action=edit&id='.$id;
85
+            $formaction = '?action=edit&id=' . $id;
86 86
         } else {
87 87
             $formaction = '';
88 88
         }
@@ -136,8 +136,8 @@  discard block
 block discarded – undo
136 136
 
137 137
     // convert format of date
138 138
     $date = str_replace('/', '-', $date); // ensure it isn't read as mm/dd/yyyy
139
-    $date = strftime('%Y-%m-%d', strtotime($date.' 00:00:00'));
140
-    $date = $date.' '.$time.':00';
139
+    $date = strftime('%Y-%m-%d', strtotime($date . ' 00:00:00'));
140
+    $date = $date . ' ' . $time . ':00';
141 141
     $date = mysqli_real_escape_string(db(), $date);
142 142
 
143 143
     if ($action == 'edit') {
@@ -207,10 +207,10 @@  discard block
 block discarded – undo
207 207
         //if ($userisBandAdmin) $delete_all_sql = $delete_all_sql . " and skillID in (select skillID from skills where groupid=2)";
208 208
         //if ($userisEventEditor) $delete_all_sql = $delete_all_sql . " and skillID in (select skillID from skills where groupid!=2)";
209 209
         if ($userisBandAdmin) {
210
-            $delete_all_sql = $delete_all_sql.' and skillID in (select skillID from skills where groupid in (2,3,4))';
210
+            $delete_all_sql = $delete_all_sql . ' and skillID in (select skillID from skills where groupid in (2,3,4))';
211 211
         }
212 212
         if ($userisEventEditor) {
213
-            $delete_all_sql = $delete_all_sql.' and skillID in (select skillID from skills where not (groupid in (2,3,4)))';
213
+            $delete_all_sql = $delete_all_sql . ' and skillID in (select skillID from skills where not (groupid in (2,3,4)))';
214 214
         }
215 215
         mysqli_query(db(), $delete_all_sql) or die(mysqli_error(db()));
216 216
     }
@@ -218,9 +218,9 @@  discard block
 block discarded – undo
218 218
     // redirect
219 219
     if (isset($_SESSION['lastEventsFilter'])) {
220 220
         $type = $_SESSION['lastEventsFilter'];
221
-        header('Location: events.php?view=all&filter='.$type.'#event'.$eventID);
221
+        header('Location: events.php?view=all&filter=' . $type . '#event' . $eventID);
222 222
     } else {
223
-        header('Location: events.php?view=all#event'.$eventID);
223
+        header('Location: events.php?view=all#event' . $eventID);
224 224
     }
225 225
     exit;
226 226
 }
@@ -297,7 +297,7 @@  discard block
 block discarded – undo
297 297
                                         while ($ob = mysqli_fetch_object($result)) {
298 298
                                             if (!(isset($type) && $ob->id == $type)) {
299 299
                                                 $defaultTime = strftime('%H:%M', strtotime($ob->defaultTime));
300
-                                                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>';
300
+                                                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>';
301 301
                                             }
302 302
                                         } ?>
303 303
 									</select>
@@ -323,7 +323,7 @@  discard block
 block discarded – undo
323 323
                                         while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) {
324 324
                                             if (isset($subtype) && $row['id'] == $subtype) {
325 325
                                             } else {
326
-                                                echo "<option value='".$row['id']."' title='".$row['description']."'>".$row['name'].'</option>';
326
+                                                echo "<option value='" . $row['id'] . "' title='" . $row['description'] . "'>" . $row['name'] . '</option>';
327 327
                                             }
328 328
                                         } ?>
329 329
 									</select>
@@ -351,7 +351,7 @@  discard block
 block discarded – undo
351 351
                                         while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) {
352 352
                                             if (isset($location) && $row['id'] == $location) {
353 353
                                             } else {
354
-                                                echo "<option value='".$row['id']."'>".$row['name'].'</option>';
354
+                                                echo "<option value='" . $row['id'] . "'>" . $row['name'] . '</option>';
355 355
                                             }
356 356
                                         } ?>
357 357
 									</select>
@@ -482,7 +482,7 @@  discard block
 block discarded – undo
482 482
                                     while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) {
483 483
                                         if (isset($type) && $row['id'] == $type) {
484 484
                                         } else {
485
-                                            echo "<option value='".$row['id']."' title='".$row['description']."'>".$row['name'].'</option>';
485
+                                            echo "<option value='" . $row['id'] . "' title='" . $row['description'] . "'>" . $row['name'] . '</option>';
486 486
                                         }
487 487
                                     } ?>
488 488
 								</select>
@@ -552,8 +552,8 @@  discard block
 block discarded – undo
552 552
 										<?php foreach ($role->getUserRoles() as $userRole): ?>
553 553
 											<?php if (!$userRole->getReserve()): ?>
554 554
 											<?php $isInEvent = in_array($userRole->getId(), $usersInEvent) ?>
555
-											<option value="<?php echo $userRole->getId() ?>" <?php echo $isInEvent ? 'selected="selected"' : '' ?>><?php echo $userRole->getUser()->getFirstName().' '.$userRole->getUser()->getLastName() ?></option>
556
-											<?php else: ?>
555
+											<option value="<?php echo $userRole->getId() ?>" <?php echo $isInEvent ? 'selected="selected"' : '' ?>><?php echo $userRole->getUser()->getFirstName() . ' ' . $userRole->getUser()->getLastName() ?></option>
556
+											<?php else : ?>
557 557
 											<?php $countReserve += 1 ?>
558 558
 											<?php endif //!userRole->getReserve?>
559 559
 										<?php endforeach //users?>
@@ -563,7 +563,7 @@  discard block
 block discarded – undo
563 563
 										<?php foreach ($role->getUserRoles() as $userRole): ?>
564 564
 											<?php if ($userRole->getReserve()): ?>
565 565
 											<?php $isInEvent = in_array($userRole->getId(), $usersInEvent) ?>
566
-											<option value="<?php echo $userRole->getId() ?>" <?php echo $isInEvent ? 'selected="selected"' : '' ?>><?php echo $userRole->getUser()->getFirstName().' '.$userRole->getUser()->getLastName() ?></option>
566
+											<option value="<?php echo $userRole->getId() ?>" <?php echo $isInEvent ? 'selected="selected"' : '' ?>><?php echo $userRole->getUser()->getFirstName() . ' ' . $userRole->getUser()->getLastName() ?></option>
567 567
 											<?php endif ?>
568 568
 										<?php endforeach //users?>
569 569
 										</optgroup>
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
-            die('Error: '.mysqli_error(db()));
74
+            die('Error: ' . mysqli_error(db()));
75 75
         }
76 76
 
77 77
         // After we have inserted the data, we want to head back to the main page
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
 
89 89
             $sql = ("INSERT INTO eventPeople (eventID, skillID) VALUES ('$editeventID', '$editskillID')");
90 90
             if (!mysqli_query(db(), $sql)) {
91
-                die('Error: '.mysqli_error(db()));
91
+                die('Error: ' . mysqli_error(db()));
92 92
             }
93 93
         }
94 94
 
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 users WHERE `users`.id = `skills`.`userID` ORDER BY `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.
public/old/includes/functions.database.php 1 patch
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -26,14 +26,14 @@  discard block
 block discarded – undo
26 26
 function executeDbSql($sql)
27 27
 {
28 28
     if (!mysqli_query(db(), $sql)) {
29
-        die('Error: '.mysqli_error(db()).', SQL: '.$sql);
29
+        die('Error: ' . mysqli_error(db()) . ', SQL: ' . $sql);
30 30
     }
31 31
 }
32 32
 
33 33
 function updateDatabase()
34 34
 {
35 35
     $sql = 'SELECT VERSION( ) AS mysqli_version';
36
-    $result = mysqli_query(db(), $sql) or die('MySQL-Error: '.mysqli_error(db()));
36
+    $result = mysqli_query(db(), $sql) or die('MySQL-Error: ' . mysqli_error(db()));
37 37
     $dbv = mysqli_fetch_array($result, MYSQLI_ASSOC);
38 38
     $mysqli_version = $dbv['mysqli_version'];
39 39
     //echo $mysqli_version."<br>";
@@ -87,41 +87,41 @@  discard block
 block discarded – undo
87 87
             executeDbSql("alter table users add(isOverviewRecipient char(2) NOT NULL DEFAULT '0')");
88 88
             executeDbSql('alter table groups add(short_name char(2))');
89 89
 
90
-            executeDbSql("update settings set lang_locale = 'en_GB'");                     // de_DE
90
+            executeDbSql("update settings set lang_locale = 'en_GB'"); // de_DE
91 91
             executeDbSql('update settings set event_sorting_latest = 0');
92 92
             executeDbSql('update settings set snapshot_show_two_month = 0');
93 93
             executeDbSql('update settings set snapshot_reduce_skills_by_group = 0');
94 94
             executeDbSql('update settings set logged_in_show_snapshot_button = 0');
95 95
             executeDbSql("update settings set time_format_long = '%A, %B %e @ %I:%M %p'"); // de_DE: %A, %e. %B %Y, %R Uhr, KW%V
96 96
             executeDbSql("update settings set time_format_normal = '%m/%d/%y %I:%M %p'"); // de_DE: %d.%m.%Y %H:%M
97
-            executeDbSql("update settings set time_format_short = '%a, <strong>%b %e</strong>, %I:%M %p'");              // de_DE: %a, <strong>%e. %b</strong>, KW%V
97
+            executeDbSql("update settings set time_format_short = '%a, <strong>%b %e</strong>, %I:%M %p'"); // de_DE: %a, <strong>%e. %b</strong>, KW%V
98 98
             executeDbSql("update settings set version = '2.1.0'");
99 99
             executeDbSql('update settings set users_start_with_myevents = 0');
100 100
             executeDbSql("update settings set time_zone = 'Europe/London'"); //de_DE: Europe/Berlin
101 101
             executeDbSql("update settings set google_group_calendar = ''");
102 102
             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'");
103 103
 
104
-            notifyInfo(__FILE__, 'db-update='.$version.'->2.1.0', $_SESSION['userid']);
104
+            notifyInfo(__FILE__, 'db-update=' . $version . '->2.1.0', $_SESSION['userid']);
105 105
         case '2.1.0':
106 106
             executeDbSql('create table settings_bkp2_1_0 as select * from settings');
107 107
             executeDbSql('alter table settings add(group_sorting_name int(1))');
108 108
             executeDbSql("update settings set version = '2.1.1'");
109
-            notifyInfo(__FILE__, 'db-update='.$version.'->2.1.1', $_SESSION['userid']);
109
+            notifyInfo(__FILE__, 'db-update=' . $version . '->2.1.1', $_SESSION['userid']);
110 110
         case '2.1.1':
111 111
             executeDbSql("update settings set version = '2.1.2'");
112
-            notifyInfo(__FILE__, 'db-update='.$version.'->2.1.2', $_SESSION['userid']);
112
+            notifyInfo(__FILE__, 'db-update=' . $version . '->2.1.2', $_SESSION['userid']);
113 113
         case '2.1.2':
114 114
             executeDbSql("alter table settings add(debug_mode int(1) DEFAULT '0')");
115
-            executeDbSql('update settings set group_sorting_name = 0');  //was a workaround, fixed in V2.2.1
115
+            executeDbSql('update settings set group_sorting_name = 0'); //was a workaround, fixed in V2.2.1
116 116
 
117 117
             executeDbSql("update settings set version = '2.2.0'");
118
-            notifyInfo(__FILE__, 'db-update='.$version.'->2.2.0', $_SESSION['userid']);
118
+            notifyInfo(__FILE__, 'db-update=' . $version . '->2.2.0', $_SESSION['userid']);
119 119
         case '2.2.0':
120 120
             executeDbSql("alter table users add(isBandAdmin char(2) NOT NULL DEFAULT '0')");
121 121
             executeDbSql('update settings set group_sorting_name = 0'); //due to an error reset it again
122 122
 
123 123
             executeDbSql("update settings set version = '2.2.1'");
124
-            notifyInfo(__FILE__, 'db-update='.$version.'->2.2.1', $_SESSION['userid']);
124
+            notifyInfo(__FILE__, 'db-update=' . $version . '->2.2.1', $_SESSION['userid']);
125 125
         case '2.2.1':
126 126
                 $sql = "CREATE TABLE IF NOT EXISTS `statistics` (
127 127
 				  `id` int(11) NOT NULL AUTO_INCREMENT,
@@ -137,21 +137,21 @@  discard block
 block discarded – undo
137 137
             executeDbSql($sql);
138 138
 
139 139
             executeDbSql("update settings set version = '2.3.0'");
140
-            notifyInfo(__FILE__, 'db-update='.$version.'->2.3.0', $_SESSION['userid']);
140
+            notifyInfo(__FILE__, 'db-update=' . $version . '->2.3.0', $_SESSION['userid']);
141 141
             insertStatistics('system', __FILE__, 'db-update', '2.3.0', $version);
142 142
         case '2.3.0':
143 143
             executeDbSql("alter table users add(isEventEditor char(2) NOT NULL DEFAULT '0')");
144 144
 
145 145
             executeDbSql("update settings set version = '2.3.1'");
146
-            notifyInfo(__FILE__, 'db-update='.$version.'->2.3.1', $_SESSION['userid']);
146
+            notifyInfo(__FILE__, 'db-update=' . $version . '->2.3.1', $_SESSION['userid']);
147 147
             insertStatistics('system', __FILE__, 'db-update', '2.3.1', $version);
148 148
         case '2.3.1':
149 149
             executeDbSql("update settings set version = '2.3.2'");
150
-            notifyInfo(__FILE__, 'db-update='.$version.'->2.3.2', $_SESSION['userid']);
150
+            notifyInfo(__FILE__, 'db-update=' . $version . '->2.3.2', $_SESSION['userid']);
151 151
             insertStatistics('system', __FILE__, 'db-update', '2.3.2', $version);
152 152
         case '2.3.2':
153 153
             executeDbSql("update settings set version = '2.3.3'");
154
-            notifyInfo(__FILE__, 'db-update='.$version.'->2.3.3', $_SESSION['userid']);
154
+            notifyInfo(__FILE__, 'db-update=' . $version . '->2.3.3', $_SESSION['userid']);
155 155
             insertStatistics('system', __FILE__, 'db-update', '2.3.3', $version);
156 156
         case '2.3.3':
157 157
             if (substr($mysqli_version, 0, 1) == 5) {
@@ -199,33 +199,33 @@  discard block
 block discarded – undo
199 199
                     );
200 200
             }
201 201
             executeDbSql("update settings set version = '2.3.4'");
202
-            notifyInfo(__FILE__, 'db-update='.$version.'->2.3.4', $_SESSION['userid']);
202
+            notifyInfo(__FILE__, 'db-update=' . $version . '->2.3.4', $_SESSION['userid']);
203 203
             insertStatistics('system', __FILE__, 'db-update', '2.3.4', $version);
204 204
         case '2.3.4':
205 205
             executeDbSql("update settings set version = '2.3.5'");
206
-            notifyInfo(__FILE__, 'db-update='.$version.'->2.3.5', $_SESSION['userid']);
206
+            notifyInfo(__FILE__, 'db-update=' . $version . '->2.3.5', $_SESSION['userid']);
207 207
             insertStatistics('system', __FILE__, 'db-update', '2.3.5', $version);
208 208
         case '2.3.5':
209 209
             executeDbSql("update settings set version = '2.4.0'");
210
-            notifyInfo(__FILE__, 'db-update='.$version.'->2.4.0', $_SESSION['userid']);
210
+            notifyInfo(__FILE__, 'db-update=' . $version . '->2.4.0', $_SESSION['userid']);
211 211
             insertStatistics('system', __FILE__, 'db-update', '2.4.0', $version);
212 212
         case '2.4.0':
213 213
             executeDbSql("update settings set version = '2.4.1'");
214
-            notifyInfo(__FILE__, 'db-update='.$version.'->2.4.1', $_SESSION['userid']);
214
+            notifyInfo(__FILE__, 'db-update=' . $version . '->2.4.1', $_SESSION['userid']);
215 215
             insertStatistics('system', __FILE__, 'db-update', '2.4.1', $version);
216 216
         case '2.4.1':
217 217
             executeDbSql('alter table settings add(days_to_alert int(2) DEFAULT 5) ');
218 218
             executeDbSql("alter table settings add(token varchar(100) DEFAULT '') ");
219 219
             executeDbSql("update settings set version = '2.4.2'");
220
-            notifyInfo(__FILE__, 'db-update='.$version.'->2.4.2', $_SESSION['userid']);
220
+            notifyInfo(__FILE__, 'db-update=' . $version . '->2.4.2', $_SESSION['userid']);
221 221
             insertStatistics('system', __FILE__, 'db-update', '2.4.2', $version);
222 222
         case '2.4.2':
223 223
             executeDbSql("update settings set version = '2.4.3'");
224
-            notifyInfo(__FILE__, 'db-update='.$version.'->2.4.3', $_SESSION['userid']);
224
+            notifyInfo(__FILE__, 'db-update=' . $version . '->2.4.3', $_SESSION['userid']);
225 225
             insertStatistics('system', __FILE__, 'db-update', '2.4.3', $version);
226 226
         case '2.4.3':
227 227
             executeDbSql("update settings set version = '2.4.4'");
228
-            notifyInfo(__FILE__, 'db-update='.$version.'->2.4.4', $_SESSION['userid']);
228
+            notifyInfo(__FILE__, 'db-update=' . $version . '->2.4.4', $_SESSION['userid']);
229 229
             insertStatistics('system', __FILE__, 'db-update', '2.4.4', $version);
230 230
         case '2.4.4':
231 231
             if (substr($mysqli_version, 0, 1) == 5) {
@@ -274,27 +274,27 @@  discard block
 block discarded – undo
274 274
                 );
275 275
             }
276 276
             executeDbSql("update settings set version = '2.4.5'");
277
-            notifyInfo(__FILE__, 'db-update='.$version.'->2.4.5', $_SESSION['userid']);
277
+            notifyInfo(__FILE__, 'db-update=' . $version . '->2.4.5', $_SESSION['userid']);
278 278
             insertStatistics('system', __FILE__, 'db-update', '2.4.5', $version);
279 279
         case '2.4.5':
280 280
             executeDbSql("update settings set version = '2.5.0'");
281
-            notifyInfo(__FILE__, 'db-update='.$version.'->2.5.0', $_SESSION['userid']);
281
+            notifyInfo(__FILE__, 'db-update=' . $version . '->2.5.0', $_SESSION['userid']);
282 282
             insertStatistics('system', __FILE__, 'db-update', '2.5.0', $version);
283 283
         case '2.5.0':
284 284
             executeDbSql("update settings set version = '2.5.1'");
285
-            notifyInfo(__FILE__, 'db-update='.$version.'->2.5.1', $_SESSION['userid']);
285
+            notifyInfo(__FILE__, 'db-update=' . $version . '->2.5.1', $_SESSION['userid']);
286 286
             insertStatistics('system', __FILE__, 'db-update', '2.5.1', $version);
287 287
         case '2.5.1':
288 288
             executeDbSql("update settings set version = '2.5.2'");
289
-            notifyInfo(__FILE__, 'db-update='.$version.'->2.5.2', $_SESSION['userid']);
289
+            notifyInfo(__FILE__, 'db-update=' . $version . '->2.5.2', $_SESSION['userid']);
290 290
             insertStatistics('system', __FILE__, 'db-update', '2.5.2', $version);
291 291
         case '2.5.2':
292 292
             executeDbSql("update settings set version = '2.5.3'");
293
-            notifyInfo(__FILE__, 'db-update='.$version.'->2.5.3', $_SESSION['userid']);
293
+            notifyInfo(__FILE__, 'db-update=' . $version . '->2.5.3', $_SESSION['userid']);
294 294
             insertStatistics('system', __FILE__, 'db-update', '2.5.3', $version);
295 295
         case '2.5.3':
296 296
             executeDbSql("update settings set version = '2.6.0'");
297
-            notifyInfo(__FILE__, 'db-update='.$version.'->2.6.0', $_SESSION['userid']);
297
+            notifyInfo(__FILE__, 'db-update=' . $version . '->2.6.0', $_SESSION['userid']);
298 298
             insertStatistics('system', __FILE__, 'db-update', '2.6.0', $version);
299 299
         case '2.6.0':
300 300
             $sql = "ALTER TABLE users
@@ -370,7 +370,7 @@  discard block
 block discarded – undo
370 370
             executeDbSql($sql);
371 371
             executeDbSql("update settings set version = '3.0.0-pre1'");
372 372
 
373
-            notifyInfo(__FILE__, 'db-update='.$version.'->3.0.0-pre1', $_SESSION['userid']);
373
+            notifyInfo(__FILE__, 'db-update=' . $version . '->3.0.0-pre1', $_SESSION['userid']);
374 374
             insertStatistics('system', __FILE__, 'db-update', '3.0.0-pre1', $version);
375 375
         case '3.0.0-pre1':
376 376
             $sql = "CREATE TABLE IF NOT EXISTS notifications (
Please login to merge, or discard this patch.
public/old/recordingUpload.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 // only load page if functionality enabled
20 20
 if (siteConfig()['recording']['type'] != 'locomotivecms') {
21 21
     echo '<p>This feature is not enabled</p>';
22
-    echo '<p><a href='.siteSettings()->getSiteUrl().'>&lt; back to homepage</a></p>';
22
+    echo '<p><a href=' . siteSettings()->getSiteUrl() . '>&lt; back to homepage</a></p>';
23 23
     exit;
24 24
 }
25 25
 
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 
28 28
 $client = new Client([
29 29
     // Base URI is used with relative requests
30
-    'base_uri' => siteConfig()['recording']['locomotivecms']['url'].'/locomotive/api/',
30
+    'base_uri' => siteConfig()['recording']['locomotivecms']['url'] . '/locomotive/api/',
31 31
     // You can set any number of default request options.
32 32
     'timeout' => 2.0,
33 33
 ]);
@@ -52,6 +52,6 @@  discard block
 block discarded – undo
52 52
     var_dump($response);
53 53
 } else {
54 54
     echo '<p>Unable to connect to main site</p>';
55
-    echo '<p><a href='.siteSettings()->getSiteUrl().'>&lt; back to homepage</a></p>';
55
+    echo '<p><a href=' . siteSettings()->getSiteUrl() . '>&lt; back to homepage</a></p>';
56 56
     exit;
57 57
 }
Please login to merge, or discard this patch.
public/old/settings.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
 
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
 		skin='$skin'";
168 168
 
169 169
     if (!mysqli_query(db(), $sql)) {
170
-        die('Error: '.mysqli_error(db()));
170
+        die('Error: ' . mysqli_error(db()));
171 171
     }
172 172
     header('Location: settings.php');
173 173
 }
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
 	<!-- Content Header (Page header) -->
195 195
 	<section class="content-header">
196 196
 		<h1>Settings
197
-			<?php echo '<small>v'.$row['version'].'</small>'; ?>
197
+			<?php echo '<small>v' . $row['version'] . '</small>'; ?>
198 198
 		</h1>
199 199
 		<ol class="breadcrumb">
200 200
 			<li><a href="<?php echo siteSettings()->getSiteUrl() ?>"><i class="fa fa-dashboard"></i> Home</a></li>
Please login to merge, or discard this patch.
src/dependencies.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 $container = $app->getContainer();
22 22
 
23 23
 // TWIG view renderer
24
-$container['view'] = function ($c) {
24
+$container['view'] = function($c) {
25 25
     $settings = $c->get('settings')['renderer'];
26 26
     $view = new Twig($settings['template_path'], [
27 27
         'cache' => false, // or 'path/to/cache'
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
     $env = $view->getEnvironment();
47 47
     $env->addGlobal('site', new Site());
48 48
     $env->addGlobal('currenturl', $c->get('request')->getUri());
49
-    $env->addGlobal('currentpath', $c->get('request')->getUri()->getBasePath().'/'.$c->get('request')->getUri()->getPath());
49
+    $env->addGlobal('currentpath', $c->get('request')->getUri()->getBasePath() . '/' . $c->get('request')->getUri()->getPath());
50 50
 
51 51
     if (isset($_SESSION['userId'])) {
52 52
         $u = UserQuery::create()->findPk($_SESSION['userId']);
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 };
60 60
 
61 61
 // monolog
62
-$container['logger'] = function ($c) {
62
+$container['logger'] = function($c) {
63 63
     $settings = $c->get('settings')['logger'];
64 64
     $logger = new Monolog\Logger($settings['name']);
65 65
     $logger->pushProcessor(new Monolog\Processor\UidProcessor());
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
     return $logger;
69 69
 };
70 70
 
71
-$container['auth'] = function ($c) {
71
+$container['auth'] = function($c) {
72 72
     $authConfig = getConfig()['auth'];
73 73
 
74 74
     // full domain e.g. https://example.com
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
             break;
87 87
 
88 88
         case 'onebody':
89
-            $url = $authConfig['onebody']['url'].'/';
89
+            $url = $authConfig['onebody']['url'] . '/';
90 90
             $email = new EmailAddress($authConfig['onebody']['email']);
91 91
             $apiKey = $authConfig['onebody']['apiKey'];
92 92
 
@@ -116,6 +116,6 @@  discard block
 block discarded – undo
116 116
     return new Authentication($c, $authProvider, $allowedRoutes);
117 117
 };
118 118
 
119
-$container['csrf'] = function ($c) {
119
+$container['csrf'] = function($c) {
120 120
     return new Guard();
121 121
 };
Please login to merge, or discard this patch.
src/middleware.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@
 block discarded – undo
8 8
 // Application middleware
9 9
 
10 10
 // 4) add route information to twig
11
-$app->add(function (Request $request, Response $response, callable $next) {
11
+$app->add(function(Request $request, Response $response, callable $next) {
12 12
     $route = $request->getAttribute('route');
13 13
 
14 14
     // return NotFound for non existent route
Please login to merge, or discard this patch.