@@ -34,7 +34,7 @@ |
||
34 | 34 | } |
35 | 35 | |
36 | 36 | if (!isAdmin()) { |
37 | - header('Location: error.php?no=100&page='.basename($_SERVER['SCRIPT_FILENAME'])); |
|
37 | + header('Location: error.php?no=100&page=' . basename($_SERVER['SCRIPT_FILENAME'])); |
|
38 | 38 | exit; |
39 | 39 | } |
40 | 40 |
@@ -435,8 +435,10 @@ |
||
435 | 435 | |
436 | 436 | echo '</li>'; |
437 | 437 | } |
438 | - echo '</ul>'; else: |
|
438 | + echo '</ul>'; else { |
|
439 | + : |
|
439 | 440 | echo '<p>No roles assigned to this event.'; |
441 | + } |
|
440 | 442 | endif; ?> |
441 | 443 | </div><!-- /.user-roles --> |
442 | 444 | </div><!-- /.box-body --> |
@@ -48,9 +48,9 @@ discard block |
||
48 | 48 | } else { |
49 | 49 | $urlFilters = ''; |
50 | 50 | if (isset($_SESSION['lastEventsFilter'])) { |
51 | - $urlFilters = '&filter='.$_SESSION['lastEventsFilter']; |
|
51 | + $urlFilters = '&filter=' . $_SESSION['lastEventsFilter']; |
|
52 | 52 | } |
53 | - header('Location: events.php?view=all'.$urlFilters); |
|
53 | + header('Location: events.php?view=all' . $urlFilters); |
|
54 | 54 | exit; |
55 | 55 | } |
56 | 56 | |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | session_destroy(); |
71 | 71 | header('Location: login.php'); |
72 | 72 | } else { |
73 | - header('Location: events.php?view='.$sessionUserID); |
|
73 | + header('Location: events.php?view=' . $sessionUserID); |
|
74 | 74 | exit; |
75 | 75 | } |
76 | 76 | } |
@@ -108,11 +108,11 @@ discard block |
||
108 | 108 | if ($editskillID != '') { |
109 | 109 | $sql = ("INSERT INTO eventPeople (eventId, userRoleId) VALUES ('$editeventID', '$editskillID')"); |
110 | 110 | if (!mysqli_query(db(), $sql)) { |
111 | - die('Error: '.mysqli_error(db())); |
|
111 | + die('Error: ' . mysqli_error(db())); |
|
112 | 112 | } |
113 | 113 | |
114 | 114 | // After we have inserted the data, we want to head back to the main page |
115 | - header('Location: index.php#section'.$editeventID); |
|
115 | + header('Location: index.php#section' . $editeventID); |
|
116 | 116 | exit; |
117 | 117 | } |
118 | 118 | |
@@ -125,12 +125,12 @@ discard block |
||
125 | 125 | |
126 | 126 | $sql = ("INSERT INTO eventPeople (eventId, userRoleId) VALUES ('$editeventID', '$editskillID')"); |
127 | 127 | if (!mysqli_query(db(), $sql)) { |
128 | - die('Error: '.mysqli_error(db())); |
|
128 | + die('Error: ' . mysqli_error(db())); |
|
129 | 129 | } |
130 | 130 | } |
131 | 131 | |
132 | 132 | // After we have inserted the data, we want to head back to the main page |
133 | - header('Location: index.php#section'.$editeventID); |
|
133 | + header('Location: index.php#section' . $editeventID); |
|
134 | 134 | exit; |
135 | 135 | } |
136 | 136 | } |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | $result = mysqli_query(db(), $mysqli_query) or die(mysqli_error(db())); |
177 | 177 | $row = mysqli_fetch_object($result); |
178 | 178 | |
179 | - echo $row->name.'s'; |
|
179 | + echo $row->name . 's'; |
|
180 | 180 | } elseif ($_SESSION['onlyShowUserEvents'] == '1') { |
181 | 181 | echo 'My Events'; |
182 | 182 | } else { |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | |
203 | 203 | <?php if (!empty($pendingSwaps) && $pendingSwaps > 0): |
204 | 204 | if ($pendingSwaps > 1) { |
205 | - $swapsMessage = $pendingSwaps.' swaps are pending approval. Emails have been sent to the people covering to approve the swaps.'; |
|
205 | + $swapsMessage = $pendingSwaps . ' swaps are pending approval. Emails have been sent to the people covering to approve the swaps.'; |
|
206 | 206 | } else { |
207 | 207 | $swapsMessage = 'A swap is pending approval. An email has been sent to the person covering to approve the swap.'; |
208 | 208 | } ?> |
@@ -268,7 +268,7 @@ discard block |
||
268 | 268 | WHERE e.type = '$filter' |
269 | 269 | AND e.date >= DATE(NOW()) |
270 | 270 | AND e.removed = 0 |
271 | - ORDER BY ".$dateOrderBy; |
|
271 | + ORDER BY " . $dateOrderBy; |
|
272 | 272 | } else { |
273 | 273 | $sql = "SELECT |
274 | 274 | DISTINCT e.id AS id, |
@@ -295,7 +295,7 @@ discard block |
||
295 | 295 | WHERE e.date >= DATE(NOW()) |
296 | 296 | AND ur.userId = '$view' |
297 | 297 | AND e.removed = 0 |
298 | - ORDER BY ".$dateOrderBy; |
|
298 | + ORDER BY " . $dateOrderBy; |
|
299 | 299 | } |
300 | 300 | $result = mysqli_query(db(), $sql) or die(mysqli_error(db())); |
301 | 301 | |
@@ -313,7 +313,7 @@ discard block |
||
313 | 313 | $newMonth = strftime('%B %Y', strtotime($row->sundayDate)); |
314 | 314 | if ($month != $newMonth) { |
315 | 315 | $month = $newMonth; |
316 | - echo '<li class="time-label"><span class="bg-green">'.$month.'</span></li>'; |
|
316 | + echo '<li class="time-label"><span class="bg-green">' . $month . '</span></li>'; |
|
317 | 317 | } |
318 | 318 | |
319 | 319 | // Event details?> |
@@ -327,9 +327,9 @@ discard block |
||
327 | 327 | <h4><?php |
328 | 328 | echo date('jS: ', strtotime($row->sundayDate)); |
329 | 329 | if ($eventName != '') { |
330 | - echo '<strong>'.$eventName.'</strong><br />'.$subType.' - <em>'.$type.'</em>'; |
|
330 | + echo '<strong>' . $eventName . '</strong><br />' . $subType . ' - <em>' . $type . '</em>'; |
|
331 | 331 | } else { |
332 | - echo $subType.' - <em>'.$type.'</em>'; |
|
332 | + echo $subType . ' - <em>' . $type . '</em>'; |
|
333 | 333 | } ?> |
334 | 334 | </h4> |
335 | 335 | </a> |
@@ -341,7 +341,7 @@ discard block |
||
341 | 341 | <?php //<p><strong>Rehearsal:</strong> <?php |
342 | 342 | //echo ($row->rehearsalDateFormatted = "0000-00-00 00:00:00") ? "none" : strftime(siteSettings()->time_format_normal,strtotime($row->rehearsalDateFormatted));</p>?> |
343 | 343 | |
344 | - <p><strong><?php echo $row->eventGroup ? $row->eventGroup.': ' : '' ?></strong><?php echo $row->sermonTitle ?> <?php echo $row->bibleVerse ? '('.$row->bibleVerse.')' : '' ?></p> |
|
344 | + <p><strong><?php echo $row->eventGroup ? $row->eventGroup . ': ' : '' ?></strong><?php echo $row->sermonTitle ?> <?php echo $row->bibleVerse ? '(' . $row->bibleVerse . ')' : '' ?></p> |
|
345 | 345 | |
346 | 346 | <p><strong>Location:</strong> <?php echo $row->eventLocation; ?></p> |
347 | 347 | |
@@ -407,16 +407,16 @@ discard block |
||
407 | 407 | } else { |
408 | 408 | echo '</ul>'; |
409 | 409 | } |
410 | - echo '<p><strong>'.$groupName.'</strong></p>'; |
|
410 | + echo '<p><strong>' . $groupName . '</strong></p>'; |
|
411 | 411 | echo '<ul>'; |
412 | 412 | } |
413 | 413 | |
414 | 414 | echo '<li>'; |
415 | - echo (isset($viewPeople->swap)) ? "<s><a class='text-danger' href='swap.php?swap=".$viewPeople->swap."'>" : ''; |
|
415 | + echo (isset($viewPeople->swap)) ? "<s><a class='text-danger' href='swap.php?swap=" . $viewPeople->swap . "'>" : ''; |
|
416 | 416 | echo $viewPeople->name; |
417 | 417 | |
418 | 418 | if ($viewPeople->rolename != '') { |
419 | - echo ' - <em>'.$viewPeople->rolename.'</em>'; |
|
419 | + echo ' - <em>' . $viewPeople->rolename . '</em>'; |
|
420 | 420 | } else { |
421 | 421 | // If there is no skill, we don't need to mention this. |
422 | 422 | } |
@@ -442,9 +442,9 @@ discard block |
||
442 | 442 | |
443 | 443 | <?php |
444 | 444 | if (isAdmin() || $userisBandAdmin || $userisEventEditor) { |
445 | - echo " <a class ='btn btn-primary' href='createEvent.php?action=edit&id=".$eventID."'><i class='fa fa-pencil'></i><span> Edit</span></a> "; /* Edit event */ |
|
446 | - echo " <a class ='btn btn-primary' href='createEvent.php?action=copy&id=".$eventID."'><i class='fa fa-pencil'></i><span> Copy</span></a> "; /* Edit event */ |
|
447 | - echo " <a class ='btn btn-primary' href='emailEvent.php?event=".$eventID."'><i class='fa fa-envelope-o'></i><span> Send email</span></a> "; /* Send email */ |
|
445 | + echo " <a class ='btn btn-primary' href='createEvent.php?action=edit&id=" . $eventID . "'><i class='fa fa-pencil'></i><span> Edit</span></a> "; /* Edit event */ |
|
446 | + echo " <a class ='btn btn-primary' href='createEvent.php?action=copy&id=" . $eventID . "'><i class='fa fa-pencil'></i><span> Copy</span></a> "; /* Edit event */ |
|
447 | + echo " <a class ='btn btn-primary' href='emailEvent.php?event=" . $eventID . "'><i class='fa fa-envelope-o'></i><span> Send email</span></a> "; /* Send email */ |
|
448 | 448 | } |
449 | 449 | if (isAdmin()) { |
450 | 450 | //echo "<a class='btn btn-primary' href='index.php?notifyEveryone=true&eventID=$eventID'><i class='fa fa-envelope-o'></i><span> Send email</span></a> "; /* Send email */ |
@@ -453,7 +453,7 @@ discard block |
||
453 | 453 | |
454 | 454 | echo "<ul class='dropdown-menu'>"; |
455 | 455 | |
456 | - echo "<li><button type='button' class='btn btn-danger btn-block' data-toggle='modal' data-target='#deleteModal".$eventID."'>Delete</button></li>"; /* Delete Event */ |
|
456 | + echo "<li><button type='button' class='btn btn-danger btn-block' data-toggle='modal' data-target='#deleteModal" . $eventID . "'>Delete</button></li>"; /* Delete Event */ |
|
457 | 457 | |
458 | 458 | echo '</ul>'; |
459 | 459 | } ?> |
@@ -14,7 +14,7 @@ |
||
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 |
@@ -30,24 +30,24 @@ |
||
30 | 30 | switch ($_POST['action']) { |
31 | 31 | case 'approve': |
32 | 32 | $userId = approvePendingUser($id); |
33 | - mailNewUser($userId); |
|
34 | - header('Location: addUser.php?action=edit&user='.$userId); |
|
35 | - break; |
|
33 | + mailNewUser($userId); |
|
34 | + header('Location: addUser.php?action=edit&user='.$userId); |
|
35 | + break; |
|
36 | 36 | case 'merge': |
37 | 37 | $existingUserId = $_POST['existingUser']; |
38 | - $existingUserId = filter_var($existingUserId, FILTER_SANITIZE_NUMBER_INT); |
|
39 | - mergePendingUserWithUserId($id, $existingUserId); |
|
40 | - mailNewUser($existingUserId); |
|
41 | - header('Location: addUser.php?action=edit&user='.$existingUserId); |
|
42 | - break; |
|
38 | + $existingUserId = filter_var($existingUserId, FILTER_SANITIZE_NUMBER_INT); |
|
39 | + mergePendingUserWithUserId($id, $existingUserId); |
|
40 | + mailNewUser($existingUserId); |
|
41 | + header('Location: addUser.php?action=edit&user='.$existingUserId); |
|
42 | + break; |
|
43 | 43 | case 'decline': |
44 | 44 | declinePendingUser($id); |
45 | - break; |
|
45 | + break; |
|
46 | 46 | |
47 | 47 | default: |
48 | 48 | // code... |
49 | 49 | break; |
50 | - } |
|
50 | + } |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | if (empty($id)) { |
@@ -28,25 +28,25 @@ |
||
28 | 28 | $id = filter_var($id, FILTER_SANITIZE_NUMBER_INT); |
29 | 29 | |
30 | 30 | switch ($_POST['action']) { |
31 | - case 'approve': |
|
32 | - $userId = approvePendingUser($id); |
|
33 | - mailNewUser($userId); |
|
34 | - header('Location: addUser.php?action=edit&user='.$userId); |
|
35 | - break; |
|
36 | - case 'merge': |
|
37 | - $existingUserId = $_POST['existingUser']; |
|
38 | - $existingUserId = filter_var($existingUserId, FILTER_SANITIZE_NUMBER_INT); |
|
39 | - mergePendingUserWithUserId($id, $existingUserId); |
|
40 | - mailNewUser($existingUserId); |
|
41 | - header('Location: addUser.php?action=edit&user='.$existingUserId); |
|
42 | - break; |
|
43 | - case 'decline': |
|
44 | - declinePendingUser($id); |
|
45 | - break; |
|
46 | - |
|
47 | - default: |
|
48 | - // code... |
|
49 | - break; |
|
31 | + case 'approve': |
|
32 | + $userId = approvePendingUser($id); |
|
33 | + mailNewUser($userId); |
|
34 | + header('Location: addUser.php?action=edit&user='.$userId); |
|
35 | + break; |
|
36 | + case 'merge': |
|
37 | + $existingUserId = $_POST['existingUser']; |
|
38 | + $existingUserId = filter_var($existingUserId, FILTER_SANITIZE_NUMBER_INT); |
|
39 | + mergePendingUserWithUserId($id, $existingUserId); |
|
40 | + mailNewUser($existingUserId); |
|
41 | + header('Location: addUser.php?action=edit&user='.$existingUserId); |
|
42 | + break; |
|
43 | + case 'decline': |
|
44 | + declinePendingUser($id); |
|
45 | + break; |
|
46 | + |
|
47 | + default: |
|
48 | + // code... |
|
49 | + break; |
|
50 | 50 | } |
51 | 51 | } |
52 | 52 |
@@ -14,7 +14,7 @@ discard block |
||
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 | |
@@ -31,14 +31,14 @@ discard block |
||
31 | 31 | case 'approve': |
32 | 32 | $userId = approvePendingUser($id); |
33 | 33 | mailNewUser($userId); |
34 | - header('Location: addUser.php?action=edit&user='.$userId); |
|
34 | + header('Location: addUser.php?action=edit&user=' . $userId); |
|
35 | 35 | break; |
36 | 36 | case 'merge': |
37 | 37 | $existingUserId = $_POST['existingUser']; |
38 | 38 | $existingUserId = filter_var($existingUserId, FILTER_SANITIZE_NUMBER_INT); |
39 | 39 | mergePendingUserWithUserId($id, $existingUserId); |
40 | 40 | mailNewUser($existingUserId); |
41 | - header('Location: addUser.php?action=edit&user='.$existingUserId); |
|
41 | + header('Location: addUser.php?action=edit&user=' . $existingUserId); |
|
42 | 42 | break; |
43 | 43 | case 'decline': |
44 | 44 | declinePendingUser($id); |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | <div class="box box-primary"> |
91 | 91 | <div class="box-header"> |
92 | 92 | <h2 class="box-title"> |
93 | - <?php echo $user->approved ? 'Approved' : ($user->declined ? 'Declined' : 'Pending') ?>: <?php echo $user->firstName.' '.$user->lastName ?> |
|
93 | + <?php echo $user->approved ? 'Approved' : ($user->declined ? 'Declined' : 'Pending') ?>: <?php echo $user->firstName . ' ' . $user->lastName ?> |
|
94 | 94 | </h2> |
95 | 95 | </div> |
96 | 96 | <div class="box-body"> |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | <?php |
132 | 132 | $users = allUsersNames(); |
133 | 133 | foreach ($users as $existingUser): ?> |
134 | - <option value="<?php echo $existingUser->id?>" <?php echo($existingUser->firstName == $user->firstName) && ($existingUser->lastName == $user->lastName) ? "selected='selected'" : '' ?>><?php echo $existingUser->firstName.' '.$existingUser->lastName ?></option> |
|
134 | + <option value="<?php echo $existingUser->id?>" <?php echo($existingUser->firstName == $user->firstName) && ($existingUser->lastName == $user->lastName) ? "selected='selected'" : '' ?>><?php echo $existingUser->firstName . ' ' . $existingUser->lastName ?></option> |
|
135 | 135 | <?php endforeach; ?> |
136 | 136 | </select> |
137 | 137 | </div> |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | } catch (\Exception $e) { |
35 | 35 | } |
36 | 36 | |
37 | -$url = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' ? 'https' : 'http').'://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; |
|
37 | +$url = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; |
|
38 | 38 | $url = substr($url, 0, -12); // remove "/install.php" from url |
39 | 39 | |
40 | 40 | if ($_SERVER['REQUEST_METHOD'] == 'POST') { |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | //exit; |
49 | 49 | $conn->exec($sql); |
50 | 50 | } catch (\Exception $e) { |
51 | - echo 'Error (code: '.$e->getCode().') adding tables to database: '.$e->getMessage(); |
|
51 | + echo 'Error (code: ' . $e->getCode() . ') adding tables to database: ' . $e->getMessage(); |
|
52 | 52 | exit; |
53 | 53 | } |
54 | 54 | |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | $lastname = $_POST['lastname']; |
59 | 59 | $lastname = trim(strip_tags($lastname)); |
60 | 60 | |
61 | - $username = strtolower($firstname).'.'.strtolower($lastname); |
|
61 | + $username = strtolower($firstname) . '.' . strtolower($lastname); |
|
62 | 62 | |
63 | 63 | $password = $_POST['password']; |
64 | 64 | |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | try { |
83 | 83 | $user->save(); |
84 | 84 | } catch (\Exception $e) { |
85 | - echo 'Error (code: '.$e->getCode().') adding user to database: '.$e->getMessage(); |
|
85 | + echo 'Error (code: ' . $e->getCode() . ') adding user to database: ' . $e->getMessage(); |
|
86 | 86 | exit; |
87 | 87 | } |
88 | 88 | |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | |
180 | 180 | $settings->save(); |
181 | 181 | |
182 | - header('Location: login.php?username='.$username); // Move to the home page of the admin section |
|
182 | + header('Location: login.php?username=' . $username); // Move to the home page of the admin section |
|
183 | 183 | exit; |
184 | 184 | } |
185 | 185 |
@@ -2,6 +2,6 @@ |
||
2 | 2 | |
3 | 3 | namespace TechWilk\Rota; |
4 | 4 | |
5 | -ini_set('display_errors', false); // set on for development, off for production |
|
5 | +ini_set('display_errors', false); // set on for development, off for production |
|
6 | 6 | ini_set('log_errors', true); |
7 | 7 | error_reporting(E_ALL); |
@@ -2,10 +2,10 @@ discard block |
||
2 | 2 | |
3 | 3 | namespace TechWilk\Rota; |
4 | 4 | |
5 | -include __DIR__.'/../../../config/database.php'; |
|
6 | -include __DIR__.'/../../../config/auth.php'; |
|
7 | -include __DIR__.'/../../../config/email.php'; |
|
8 | -include __DIR__.'/../../../config/recording.php'; |
|
5 | +include __DIR__ . '/../../../config/database.php'; |
|
6 | +include __DIR__ . '/../../../config/auth.php'; |
|
7 | +include __DIR__ . '/../../../config/email.php'; |
|
8 | +include __DIR__ . '/../../../config/recording.php'; |
|
9 | 9 | |
10 | 10 | // -- Setup database -- |
11 | 11 | |
@@ -17,10 +17,10 @@ discard block |
||
17 | 17 | } |
18 | 18 | |
19 | 19 | // Connect to the database server |
20 | -$dbh = @mysqli_connect($config['db']['host'], $config['db']['user'], $config['db']['pass']) or die('Connection to '.$config['db']['host']." with login '".$config['db']['user']."'/'$pwdMasked' failed."); |
|
20 | +$dbh = @mysqli_connect($config['db']['host'], $config['db']['user'], $config['db']['pass']) or die('Connection to ' . $config['db']['host'] . " with login '" . $config['db']['user'] . "'/'$pwdMasked' failed."); |
|
21 | 21 | |
22 | 22 | // Choose the right database |
23 | -$db = @mysqli_select_db($dbh, $config['db']['dbname']) or die("Connection made, but database '".$config['db']['dbname']."' was not found."); |
|
23 | +$db = @mysqli_select_db($dbh, $config['db']['dbname']) or die("Connection made, but database '" . $config['db']['dbname'] . "' was not found."); |
|
24 | 24 | |
25 | 25 | // allow config to be fetched in functions |
26 | 26 |
@@ -266,8 +266,10 @@ discard block |
||
266 | 266 | if (is_array($rotaoutput)): |
267 | 267 | foreach ($rotaoutput as $key => $skill): |
268 | 268 | $skillfinal = $skillfinal.$skill.' '; |
269 | - endforeach; else: |
|
269 | + endforeach; else { |
|
270 | + : |
|
270 | 271 | $skillfinal = $rotaoutput; |
272 | + } |
|
271 | 273 | endif; |
272 | 274 | $message = str_replace('[rotaoutput]', $skillfinal, $message); |
273 | 275 | $message = str_replace('[siteurl]', $siteurl, $message); |
@@ -445,8 +447,10 @@ discard block |
||
445 | 447 | $roles = []; |
446 | 448 | while ($roleRow = mysqli_fetch_array($roleResult, MYSQLI_ASSOC)) { |
447 | 449 | if (($roleRow['name'] == '') || ($roleRow['name'] == $roleRow['description'])): |
448 | - $roles[] = $roleRow['description']; else: |
|
450 | + $roles[] = $roleRow['description']; else { |
|
451 | + : |
|
449 | 452 | $roles[] = $roleRow['description'].' - '.$roleRow['name']; |
453 | + } |
|
450 | 454 | endif; |
451 | 455 | } |
452 | 456 |
@@ -27,12 +27,12 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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"; |
@@ -46,7 +46,7 @@ |
||
46 | 46 | '#(http://(www.)?youtube.com)?/(v/|watch\?v\=)([-|~_0-9A-Za-z]+)&?.*?#i', |
47 | 47 | '<iframe title="YouTube Video" width="560" height="340" src="http://www.youtube.com/embed/$4" frameborder="0" allowfullscreen></iframe>', |
48 | 48 | $string |
49 | - ); |
|
49 | + ); |
|
50 | 50 | |
51 | 51 | return $string; |
52 | 52 | } |