@@ -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 cr_users WHERE `cr_users`.id = `cr_skills`.`userID` ORDER BY `cr_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 | |
@@ -421,9 +421,9 @@ discard block |
||
| 421 | 421 | $comment = '-'; |
| 422 | 422 | } |
| 423 | 423 | |
| 424 | - $eventdetails = $eventrow['eventGroup'].': '.$eventrow['sermonTitle']; |
|
| 424 | + $eventdetails = $eventrow['eventGroup'] . ': ' . $eventrow['sermonTitle']; |
|
| 425 | 425 | if (!empty($eventrow['bibleVerse'])) { |
| 426 | - $eventdetails .= ' ('.$eventrow['bibleVerse'].')'; |
|
| 426 | + $eventdetails .= ' (' . $eventrow['bibleVerse'] . ')'; |
|
| 427 | 427 | } |
| 428 | 428 | } |
| 429 | 429 | |
@@ -446,7 +446,7 @@ discard block |
||
| 446 | 446 | while ($roleRow = mysqli_fetch_array($roleResult, MYSQLI_ASSOC)) { |
| 447 | 447 | if (($roleRow['name'] == '') || ($roleRow['name'] == $roleRow['description'])): |
| 448 | 448 | $roles[] = $roleRow['description']; else: |
| 449 | - $roles[] = $roleRow['description'].' - '.$roleRow['name']; |
|
| 449 | + $roles[] = $roleRow['description'] . ' - ' . $roleRow['name']; |
|
| 450 | 450 | endif; |
| 451 | 451 | } |
| 452 | 452 | |
@@ -466,11 +466,11 @@ discard block |
||
| 466 | 466 | $message = siteSettings()->getNotificationEmail(); |
| 467 | 467 | $rotaoutput = implode(', ', $roles); |
| 468 | 468 | |
| 469 | - $to = $ob->name.' <'.$ob->email.'>'; |
|
| 470 | - $from = siteSettings()->getOwner().' <'.siteSettings()->getAdminEmailAddress().'>'; |
|
| 469 | + $to = $ob->name . ' <' . $ob->email . '>'; |
|
| 470 | + $from = siteSettings()->getOwner() . ' <' . siteSettings()->getAdminEmailAddress() . '>'; |
|
| 471 | 471 | |
| 472 | 472 | //$subject = "Rota reminder: " . $date; |
| 473 | - $subject = 'Reminder: '.implode(', ', $roles).' - '.$type.': '.$date; |
|
| 473 | + $subject = 'Reminder: ' . implode(', ', $roles) . ' - ' . $type . ': ' . $date; |
|
| 474 | 474 | |
| 475 | 475 | $rotadetails = getEventDetails($eventId, "\r\n", 0, false, "\t"); |
| 476 | 476 | |
@@ -506,7 +506,7 @@ discard block |
||
| 506 | 506 | ep.notified = 1 |
| 507 | 507 | WHERE |
| 508 | 508 | ep.eventId = '$eventId' |
| 509 | - AND ur.userId IN (".implode(', ', $countarray).')'; |
|
| 509 | + AND ur.userId IN (" . implode(', ', $countarray) . ')'; |
|
| 510 | 510 | |
| 511 | 511 | mysqli_query(db(), $sql) or die(mysqli_error(db())); |
| 512 | 512 | } |
@@ -535,14 +535,14 @@ discard block |
||
| 535 | 535 | $user = mysqli_fetch_object($result); |
| 536 | 536 | |
| 537 | 537 | if (!$user->email) { |
| 538 | - return 'No email address present for '.$user->firstName.' '.$user->lastName; |
|
| 538 | + return 'No email address present for ' . $user->firstName . ' ' . $user->lastName; |
|
| 539 | 539 | } |
| 540 | 540 | |
| 541 | 541 | if (!$user->recieveReminderEmails) { |
| 542 | - return $user->firstName.' '.$user->lastName.' opted not to recieve reminder emails'; |
|
| 542 | + return $user->firstName . ' ' . $user->lastName . ' opted not to recieve reminder emails'; |
|
| 543 | 543 | } |
| 544 | 544 | |
| 545 | - $name = $user->firstName.' '.$user->lastName; |
|
| 545 | + $name = $user->firstName . ' ' . $user->lastName; |
|
| 546 | 546 | |
| 547 | 547 | //line seperator for mails |
| 548 | 548 | //rfc sais \r\n, but this makes trouble in outlook. several spaces plus \n works fine in outlook and thunderbird. |
@@ -576,9 +576,9 @@ discard block |
||
| 576 | 576 | $eventDetails .= ' - '; |
| 577 | 577 | $eventDetails .= "\r\n"; |
| 578 | 578 | $eventDetails .= $event->type; |
| 579 | - $eventDetails .= $event->eventGroup.': '.$event->sermonTitle.' ('.$event->bibleVerse.')'; |
|
| 579 | + $eventDetails .= $event->eventGroup . ': ' . $event->sermonTitle . ' (' . $event->bibleVerse . ')'; |
|
| 580 | 580 | $eventDetails .= "\r\n"; |
| 581 | - $eventDetails .= 'Notes: '.$event->comment; |
|
| 581 | + $eventDetails .= 'Notes: ' . $event->comment; |
|
| 582 | 582 | $eventDetails .= "\r\n"; |
| 583 | 583 | $eventDetails .= "\r\n"; |
| 584 | 584 | |
@@ -603,7 +603,7 @@ discard block |
||
| 603 | 603 | 'event.location' => $event->location, |
| 604 | 604 | 'event.comment' => $event->comment, |
| 605 | 605 | |
| 606 | - 'event.sermon' => $event->eventGroup.': '.$event->sermonTitle.' ('.$event->bibleVerse.')', |
|
| 606 | + 'event.sermon' => $event->eventGroup . ': ' . $event->sermonTitle . ' (' . $event->bibleVerse . ')', |
|
| 607 | 607 | 'event.sermon.name' => $event->sermonTitle, |
| 608 | 608 | 'event.sermon.series' => $event->eventGroup, |
| 609 | 609 | 'event.sermon.verse' => $event->bibleVerse, |
@@ -617,8 +617,8 @@ discard block |
||
| 617 | 617 | |
| 618 | 618 | //$message = str_replace("\r\n",$crlf,$message); |
| 619 | 619 | |
| 620 | - $to = $name.' <'.$user->email.'>'; |
|
| 621 | - $from = siteSettings()->getOwner().' <'.$siteSettings()->getAdminEmailAddress().'>'; |
|
| 620 | + $to = $name . ' <' . $user->email . '>'; |
|
| 621 | + $from = siteSettings()->getOwner() . ' <' . $siteSettings()->getAdminEmailAddress() . '>'; |
|
| 622 | 622 | |
| 623 | 623 | $sent = false; |
| 624 | 624 | $sent = sendMail($to, $subject, $message, $from); |
@@ -626,10 +626,10 @@ discard block |
||
| 626 | 626 | if ($sent == true) { |
| 627 | 627 | return true; |
| 628 | 628 | } else { |
| 629 | - return 'Error while sending mail to '.$user->firstName.' '.$user->lastName; |
|
| 629 | + return 'Error while sending mail to ' . $user->firstName . ' ' . $user->lastName; |
|
| 630 | 630 | } |
| 631 | 631 | |
| 632 | - return 'Unknown error for '.$user->firstName.' '.$user->lastName; |
|
| 632 | + return 'Unknown error for ' . $user->firstName . ' ' . $user->lastName; |
|
| 633 | 633 | } |
| 634 | 634 | |
| 635 | 635 | function getEventEmailSubject($eventId) |
@@ -676,16 +676,16 @@ discard block |
||
| 676 | 676 | $result = mysqli_query(db(), $sql) or die(mysqli_error(db())); |
| 677 | 677 | $groupNames = ''; |
| 678 | 678 | while ($group = mysqli_fetch_object($result)) { |
| 679 | - $groupNames .= $group->name.', '; |
|
| 679 | + $groupNames .= $group->name . ', '; |
|
| 680 | 680 | } |
| 681 | 681 | |
| 682 | 682 | if (isset($errors)) { |
| 683 | - createNotificationForUser($_SESSION['userid'], 'Email sent with warnings', 'Email sent to '.$groupNames.' groups with errors: '.implode(', ', $errors), 'email'); |
|
| 683 | + createNotificationForUser($_SESSION['userid'], 'Email sent with warnings', 'Email sent to ' . $groupNames . ' groups with errors: ' . implode(', ', $errors), 'email'); |
|
| 684 | 684 | |
| 685 | 685 | return $errors; |
| 686 | 686 | } |
| 687 | 687 | |
| 688 | - createNotificationForUser($_SESSION['userid'], 'Group email sent', 'Email sent successfully to '.$groupNames, 'email'); |
|
| 688 | + createNotificationForUser($_SESSION['userid'], 'Group email sent', 'Email sent successfully to ' . $groupNames, 'email'); |
|
| 689 | 689 | |
| 690 | 690 | return $true; |
| 691 | 691 | } |
@@ -737,16 +737,16 @@ discard block |
||
| 737 | 737 | $result = mysqli_query(db(), $sql) or die(mysqli_error(db())); |
| 738 | 738 | $groupNames = ''; |
| 739 | 739 | while ($group = mysqli_fetch_object($result)) { |
| 740 | - $groupNames .= $group->name.', '; |
|
| 740 | + $groupNames .= $group->name . ', '; |
|
| 741 | 741 | } |
| 742 | 742 | |
| 743 | 743 | if (isset($errors)) { |
| 744 | - createNotificationForUser($_SESSION['userid'], 'Email sent with warnings', 'Email sent to '.$groupNames." groups with errors: \n- ".implode("\n- ", $errors), 'email'); |
|
| 744 | + createNotificationForUser($_SESSION['userid'], 'Email sent with warnings', 'Email sent to ' . $groupNames . " groups with errors: \n- " . implode("\n- ", $errors), 'email'); |
|
| 745 | 745 | |
| 746 | 746 | return $errors; |
| 747 | 747 | } |
| 748 | 748 | |
| 749 | - createNotificationForUser($_SESSION['userid'], 'Group email sent', 'Email sent successfully to '.$groupNames, 'email'); |
|
| 749 | + createNotificationForUser($_SESSION['userid'], 'Group email sent', 'Email sent successfully to ' . $groupNames, 'email'); |
|
| 750 | 750 | |
| 751 | 751 | return $true; |
| 752 | 752 | } |
@@ -762,14 +762,14 @@ discard block |
||
| 762 | 762 | $user = mysqli_fetch_object($result); |
| 763 | 763 | |
| 764 | 764 | if (!$user->email) { |
| 765 | - return 'No email address present for '.$user->firstName.' '.$user->lastName; |
|
| 765 | + return 'No email address present for ' . $user->firstName . ' ' . $user->lastName; |
|
| 766 | 766 | } |
| 767 | 767 | |
| 768 | 768 | if (!$user->isOverviewRecipient) { |
| 769 | - return $user->firstName.' '.$user->lastName.' opted not to recieve group emails'; |
|
| 769 | + return $user->firstName . ' ' . $user->lastName . ' opted not to recieve group emails'; |
|
| 770 | 770 | } |
| 771 | 771 | |
| 772 | - $name = $user->firstName.' '.$user->lastName; |
|
| 772 | + $name = $user->firstName . ' ' . $user->lastName; |
|
| 773 | 773 | |
| 774 | 774 | //line seperator for mails |
| 775 | 775 | //rfc sais \r\n, but this makes trouble in outlook. several spaces plus \n works fine in outlook and thunderbird. |
@@ -816,7 +816,7 @@ discard block |
||
| 816 | 816 | |
| 817 | 817 | $eventDetails .= $ob->roles; |
| 818 | 818 | $eventDetails .= "\r\n"; |
| 819 | - $eventDetails .= 'Notes: '.$ob->comment; |
|
| 819 | + $eventDetails .= 'Notes: ' . $ob->comment; |
|
| 820 | 820 | $eventDetails .= "\r\n"; |
| 821 | 821 | $eventDetails .= "\r\n"; |
| 822 | 822 | |
@@ -835,8 +835,8 @@ discard block |
||
| 835 | 835 | |
| 836 | 836 | //$message = str_replace("\r\n",$crlf,$message); |
| 837 | 837 | |
| 838 | - $to = $name.' <'.$user->email.'>'; |
|
| 839 | - $from = siteSettings()->getOwner().' <'.$siteadmin.'>'; |
|
| 838 | + $to = $name . ' <' . $user->email . '>'; |
|
| 839 | + $from = siteSettings()->getOwner() . ' <' . $siteadmin . '>'; |
|
| 840 | 840 | |
| 841 | 841 | $sent = false; |
| 842 | 842 | $sent = sendMail($to, $subject, $message, $from); |
@@ -844,10 +844,10 @@ discard block |
||
| 844 | 844 | if ($sent == true) { |
| 845 | 845 | return true; |
| 846 | 846 | } else { |
| 847 | - return 'Error while sending mail to '.$user->firstName.' '.$user->lastName; |
|
| 847 | + return 'Error while sending mail to ' . $user->firstName . ' ' . $user->lastName; |
|
| 848 | 848 | } |
| 849 | 849 | |
| 850 | - return 'Unknown error for '.$user->firstName.' '.$user->lastName; |
|
| 850 | + return 'Unknown error for ' . $user->firstName . ' ' . $user->lastName; |
|
| 851 | 851 | } |
| 852 | 852 | |
| 853 | 853 | // returns either true, or error message string |
@@ -860,14 +860,14 @@ discard block |
||
| 860 | 860 | $user = mysqli_fetch_object($result); |
| 861 | 861 | |
| 862 | 862 | if (!$user->email) { |
| 863 | - return 'No email address present for '.$user->firstName.' '.$user->lastName; |
|
| 863 | + return 'No email address present for ' . $user->firstName . ' ' . $user->lastName; |
|
| 864 | 864 | } |
| 865 | 865 | |
| 866 | 866 | if (!$user->isOverviewRecipient) { |
| 867 | - return $user->firstName.' '.$user->lastName.' opted not to recieve group emails'; |
|
| 867 | + return $user->firstName . ' ' . $user->lastName . ' opted not to recieve group emails'; |
|
| 868 | 868 | } |
| 869 | 869 | |
| 870 | - $name = $user->firstName.' '.$user->lastName; |
|
| 870 | + $name = $user->firstName . ' ' . $user->lastName; |
|
| 871 | 871 | |
| 872 | 872 | //line seperator for mails |
| 873 | 873 | //rfc sais \r\n, but this makes trouble in outlook. several spaces plus \n works fine in outlook and thunderbird. |
@@ -900,7 +900,7 @@ discard block |
||
| 900 | 900 | } |
| 901 | 901 | |
| 902 | 902 | if (!isset($events)) { |
| 903 | - return $name.' has no events in the upcoming rota'; |
|
| 903 | + return $name . ' has no events in the upcoming rota'; |
|
| 904 | 904 | } |
| 905 | 905 | |
| 906 | 906 | $events = implode(', ', $events); |
@@ -955,7 +955,7 @@ discard block |
||
| 955 | 955 | |
| 956 | 956 | $eventDetails .= $row['joinedskills']; |
| 957 | 957 | $eventDetails .= "\r\n"; |
| 958 | - $eventDetails .= 'Notes: '.$row['comment']; |
|
| 958 | + $eventDetails .= 'Notes: ' . $row['comment']; |
|
| 959 | 959 | $eventDetails .= "\r\n"; |
| 960 | 960 | $eventDetails .= "\r\n"; |
| 961 | 961 | } |
@@ -971,8 +971,8 @@ discard block |
||
| 971 | 971 | |
| 972 | 972 | //$message = str_replace("\r\n",$crlf,$message); |
| 973 | 973 | |
| 974 | - $to = $name.' <'.$user->email.'>'; |
|
| 975 | - $from = siteSettings()->getOwner().' <'.$siteadmin.'>'; |
|
| 974 | + $to = $name . ' <' . $user->email . '>'; |
|
| 975 | + $from = siteSettings()->getOwner() . ' <' . $siteadmin . '>'; |
|
| 976 | 976 | |
| 977 | 977 | $sent = false; |
| 978 | 978 | $sent = sendMail($to, $subject, $message, $from); |
@@ -980,10 +980,10 @@ discard block |
||
| 980 | 980 | if ($sent == true) { |
| 981 | 981 | return true; |
| 982 | 982 | } else { |
| 983 | - return 'Error while sending mail to '.$user->firstName.' '.$user->lastName; |
|
| 983 | + return 'Error while sending mail to ' . $user->firstName . ' ' . $user->lastName; |
|
| 984 | 984 | } |
| 985 | 985 | |
| 986 | - return 'Unknown error for '.$user->firstName.' '.$user->lastName; |
|
| 986 | + return 'Unknown error for ' . $user->firstName . ' ' . $user->lastName; |
|
| 987 | 987 | } |
| 988 | 988 | |
| 989 | 989 | function notifyAttack($fileName, $attackType, $attackerID) |
@@ -998,10 +998,10 @@ discard block |
||
| 998 | 998 | |
| 999 | 999 | while ($row = mysqli_fetch_array($userresult, MYSQLI_ASSOC)) { |
| 1000 | 1000 | $subject = 'SECURITY-ALERT - Attack blocked successfully'; |
| 1001 | - $message = "Type:\t\t ".$attackType."<br>\r\n". |
|
| 1002 | - "Attacker:\t ".$row[name]."<br>\r\n". |
|
| 1003 | - "Date:\t\t ".date('Y-m-d H:i:s')."<br>\r\n". |
|
| 1004 | - "Script:\t\t ".$fileName."\r\n "."<br>\r\n"; |
|
| 1001 | + $message = "Type:\t\t " . $attackType . "<br>\r\n" . |
|
| 1002 | + "Attacker:\t " . $row[name] . "<br>\r\n" . |
|
| 1003 | + "Date:\t\t " . date('Y-m-d H:i:s') . "<br>\r\n" . |
|
| 1004 | + "Script:\t\t " . $fileName . "\r\n " . "<br>\r\n"; |
|
| 1005 | 1005 | |
| 1006 | 1006 | //$headers = 'From: ' . $row['siteadmin'] . "\r\n" . |
| 1007 | 1007 | //'Reply-To: ' . $row['siteadmin'] . "\r\n"; |
@@ -1011,8 +1011,8 @@ discard block |
||
| 1011 | 1011 | //mail($to, $subject, strip_tags($message), $headers); |
| 1012 | 1012 | sendMail($to, $subject, strip_tags($message), $to); |
| 1013 | 1013 | |
| 1014 | - echo $subject.'<br><br>'; |
|
| 1015 | - echo $message.'<br>'; |
|
| 1014 | + echo $subject . '<br><br>'; |
|
| 1015 | + echo $message . '<br>'; |
|
| 1016 | 1016 | echo 'An email about this incident was sent to administrator!'; |
| 1017 | 1017 | } |
| 1018 | 1018 | } |
@@ -1027,11 +1027,11 @@ discard block |
||
| 1027 | 1027 | $userresult = mysqli_query(db(), $sql) or die(mysqli_error(db())); |
| 1028 | 1028 | |
| 1029 | 1029 | while ($row = mysqli_fetch_array($userresult, MYSQLI_ASSOC)) { |
| 1030 | - $subject = 'Info - '.$infoMsg.' - '.$row[name]; |
|
| 1031 | - $message = "Type:\t\t ".$infoMsg."<br>\r\n". |
|
| 1032 | - "User:\t\t ".$row[name]."<br>\r\n". |
|
| 1033 | - "Date:\t\t ".date('Y-m-d H:i:s')."<br>\r\n". |
|
| 1034 | - "Script:\t\t ".$fileName."\r\n "."<br>\r\n"; |
|
| 1030 | + $subject = 'Info - ' . $infoMsg . ' - ' . $row[name]; |
|
| 1031 | + $message = "Type:\t\t " . $infoMsg . "<br>\r\n" . |
|
| 1032 | + "User:\t\t " . $row[name] . "<br>\r\n" . |
|
| 1033 | + "Date:\t\t " . date('Y-m-d H:i:s') . "<br>\r\n" . |
|
| 1034 | + "Script:\t\t " . $fileName . "\r\n " . "<br>\r\n"; |
|
| 1035 | 1035 | |
| 1036 | 1036 | //$headers = 'From: ' . $row['siteadmin'] . "\r\n" . |
| 1037 | 1037 | //'Reply-To: ' . $row['siteadmin'] . "\r\n"; |
@@ -1048,7 +1048,7 @@ discard block |
||
| 1048 | 1048 | if (preg_match("/(\{\{)((.)+){1}(\}\})/", $message, $matches) == 1) { |
| 1049 | 1049 | $defaultSubject = $matches[2]; |
| 1050 | 1050 | //$subject = str_replace(array("{{","}}"),"",$matches[0]); |
| 1051 | - $message = str_replace($matches[1].$matches[2].$matches[4], '', $message); |
|
| 1051 | + $message = str_replace($matches[1] . $matches[2] . $matches[4], '', $message); |
|
| 1052 | 1052 | //$message = $matches[4]; |
| 1053 | 1053 | |
| 1054 | 1054 | //$message = $message . "\r\n\r\n"; |
@@ -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 cr_eventPeople (eventId, userRoleId) VALUES ('$editeventID', '$editskillID')"); |
| 110 | 110 | if (!mysqli_query(db(), $sql)) { |
| 111 | - die('Error: '.mysqli_error(db())); |
|
| 111 | + die('Error: ' . mysqli_error(db())); |
|
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 | // After we have inserted the data, we want to head back to the main page |
| 115 | - header('Location: index.php#section'.$editeventID); |
|
| 115 | + header('Location: index.php#section' . $editeventID); |
|
| 116 | 116 | exit; |
| 117 | 117 | } |
| 118 | 118 | |
@@ -125,12 +125,12 @@ discard block |
||
| 125 | 125 | |
| 126 | 126 | $sql = ("INSERT INTO cr_eventPeople (eventId, userRoleId) VALUES ('$editeventID', '$editskillID')"); |
| 127 | 127 | if (!mysqli_query(db(), $sql)) { |
| 128 | - die('Error: '.mysqli_error(db())); |
|
| 128 | + die('Error: ' . mysqli_error(db())); |
|
| 129 | 129 | } |
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | // After we have inserted the data, we want to head back to the main page |
| 133 | - header('Location: index.php#section'.$editeventID); |
|
| 133 | + header('Location: index.php#section' . $editeventID); |
|
| 134 | 134 | exit; |
| 135 | 135 | } |
| 136 | 136 | } |
@@ -176,7 +176,7 @@ discard block |
||
| 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 | } ?> |
@@ -270,7 +270,7 @@ discard block |
||
| 270 | 270 | WHERE e.type = '$filter' |
| 271 | 271 | AND e.date >= DATE(NOW()) |
| 272 | 272 | AND e.removed = 0 |
| 273 | - ORDER BY ".$dateOrderBy; |
|
| 273 | + ORDER BY " . $dateOrderBy; |
|
| 274 | 274 | } else { |
| 275 | 275 | $sql = "SELECT |
| 276 | 276 | DISTINCT e.id AS id, |
@@ -298,7 +298,7 @@ discard block |
||
| 298 | 298 | WHERE e.date >= DATE(NOW()) |
| 299 | 299 | AND ur.userId = '$view' |
| 300 | 300 | AND e.removed = 0 |
| 301 | - ORDER BY ".$dateOrderBy; |
|
| 301 | + ORDER BY " . $dateOrderBy; |
|
| 302 | 302 | } |
| 303 | 303 | $result = mysqli_query(db(), $sql) or die(mysqli_error(db())); |
| 304 | 304 | |
@@ -316,7 +316,7 @@ discard block |
||
| 316 | 316 | $newMonth = strftime('%B %Y', strtotime($row->sundayDate)); |
| 317 | 317 | if ($month != $newMonth) { |
| 318 | 318 | $month = $newMonth; |
| 319 | - echo '<li class="time-label"><span class="bg-green">'.$month.'</span></li>'; |
|
| 319 | + echo '<li class="time-label"><span class="bg-green">' . $month . '</span></li>'; |
|
| 320 | 320 | } |
| 321 | 321 | |
| 322 | 322 | // Event details ?> |
@@ -330,9 +330,9 @@ discard block |
||
| 330 | 330 | <h4><?php |
| 331 | 331 | echo date('jS: ', strtotime($row->sundayDate)); |
| 332 | 332 | if ($eventName != '') { |
| 333 | - echo '<strong>'.$eventName.'</strong><br />'.$subType.' - <em>'.$type.'</em>'; |
|
| 333 | + echo '<strong>' . $eventName . '</strong><br />' . $subType . ' - <em>' . $type . '</em>'; |
|
| 334 | 334 | } else { |
| 335 | - echo $subType.' - <em>'.$type.'</em>'; |
|
| 335 | + echo $subType . ' - <em>' . $type . '</em>'; |
|
| 336 | 336 | } ?> |
| 337 | 337 | </h4> |
| 338 | 338 | </a> |
@@ -344,7 +344,7 @@ discard block |
||
| 344 | 344 | <?php //<p><strong>Rehearsal:</strong> <?php |
| 345 | 345 | //echo ($row->rehearsalDateFormatted = "0000-00-00 00:00:00") ? "none" : strftime(siteSettings()->time_format_normal,strtotime($row->rehearsalDateFormatted));</p>?> |
| 346 | 346 | |
| 347 | - <p><strong><?php echo $row->eventGroup ? $row->eventGroup.': ' : '' ?></strong><?php echo $row->sermonTitle ?> <?php echo $row->bibleVerse ? '('.$row->bibleVerse.')' : '' ?></p> |
|
| 347 | + <p><strong><?php echo $row->eventGroup ? $row->eventGroup . ': ' : '' ?></strong><?php echo $row->sermonTitle ?> <?php echo $row->bibleVerse ? '(' . $row->bibleVerse . ')' : '' ?></p> |
|
| 348 | 348 | |
| 349 | 349 | <p><strong>Location:</strong> <?php echo $row->eventLocation; ?></p> |
| 350 | 350 | |
@@ -416,16 +416,16 @@ discard block |
||
| 416 | 416 | } else { |
| 417 | 417 | echo '</ul>'; |
| 418 | 418 | } |
| 419 | - echo '<p><strong>'.$groupName.'</strong></p>'; |
|
| 419 | + echo '<p><strong>' . $groupName . '</strong></p>'; |
|
| 420 | 420 | echo '<ul>'; |
| 421 | 421 | } |
| 422 | 422 | |
| 423 | 423 | echo '<li>'; |
| 424 | - echo (isset($viewPeople->swap)) ? "<s><a class='text-danger' href='swap.php?swap=".$viewPeople->swap."'>" : ''; |
|
| 424 | + echo (isset($viewPeople->swap)) ? "<s><a class='text-danger' href='swap.php?swap=" . $viewPeople->swap . "'>" : ''; |
|
| 425 | 425 | echo $viewPeople->name; |
| 426 | 426 | |
| 427 | 427 | if ($viewPeople->rolename != '') { |
| 428 | - echo ' - <em>'.$viewPeople->rolename.'</em>'; |
|
| 428 | + echo ' - <em>' . $viewPeople->rolename . '</em>'; |
|
| 429 | 429 | } else { |
| 430 | 430 | // If there is no skill, we don't need to mention this. |
| 431 | 431 | } |
@@ -451,9 +451,9 @@ discard block |
||
| 451 | 451 | |
| 452 | 452 | <?php |
| 453 | 453 | if (isAdmin() || $userisBandAdmin || $userisEventEditor) { |
| 454 | - echo " <a class ='btn btn-primary' href='createEvent.php?action=edit&id=".$eventID."'><i class='fa fa-pencil'></i><span> Edit</span></a> "; /* Edit event */ |
|
| 455 | - echo " <a class ='btn btn-primary' href='createEvent.php?action=copy&id=".$eventID."'><i class='fa fa-pencil'></i><span> Copy</span></a> "; /* Edit event */ |
|
| 456 | - echo " <a class ='btn btn-primary' href='emailEvent.php?event=".$eventID."'><i class='fa fa-envelope-o'></i><span> Send email</span></a> "; /* Send email */ |
|
| 454 | + echo " <a class ='btn btn-primary' href='createEvent.php?action=edit&id=" . $eventID . "'><i class='fa fa-pencil'></i><span> Edit</span></a> "; /* Edit event */ |
|
| 455 | + echo " <a class ='btn btn-primary' href='createEvent.php?action=copy&id=" . $eventID . "'><i class='fa fa-pencil'></i><span> Copy</span></a> "; /* Edit event */ |
|
| 456 | + echo " <a class ='btn btn-primary' href='emailEvent.php?event=" . $eventID . "'><i class='fa fa-envelope-o'></i><span> Send email</span></a> "; /* Send email */ |
|
| 457 | 457 | } |
| 458 | 458 | if (isAdmin()) { |
| 459 | 459 | //echo "<a class='btn btn-primary' href='index.php?notifyEveryone=true&eventID=$eventID'><i class='fa fa-envelope-o'></i><span> Send email</span></a> "; /* Send email */ |
@@ -462,7 +462,7 @@ discard block |
||
| 462 | 462 | |
| 463 | 463 | echo "<ul class='dropdown-menu'>"; |
| 464 | 464 | |
| 465 | - echo "<li><button type='button' class='btn btn-danger btn-block' data-toggle='modal' data-target='#deleteModal".$eventID."'>Delete</button></li>"; /* Delete Event */ |
|
| 465 | + echo "<li><button type='button' class='btn btn-danger btn-block' data-toggle='modal' data-target='#deleteModal" . $eventID . "'>Delete</button></li>"; /* Delete Event */ |
|
| 466 | 466 | |
| 467 | 467 | echo '</ul>'; |
| 468 | 468 | } ?> |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | // If the form has been submitted, then we need to handle the data. |
| 85 | 85 | if ($_SERVER['REQUEST_METHOD'] == 'POST') { |
| 86 | 86 | |
| 87 | - // sanitise inputs |
|
| 87 | + // sanitise inputs |
|
| 88 | 88 | if (isAdmin()) { |
| 89 | 89 | $firstname = $_POST['firstname']; |
| 90 | 90 | $firstname = strip_tags($firstname); |
@@ -257,8 +257,8 @@ discard block |
||
| 257 | 257 | <div class="box-body"> |
| 258 | 258 | |
| 259 | 259 | <?php |
| 260 | - // if isAdmin() == false |
|
| 261 | - // ordered in this way to build the page with contact details before permissions |
|
| 260 | + // if isAdmin() == false |
|
| 261 | + // ordered in this way to build the page with contact details before permissions |
|
| 262 | 262 | if (!isAdmin()) { |
| 263 | 263 | if ($userId == $sessionUserID) { |
| 264 | 264 | echo $firstname.' '.$lastname; |
@@ -304,15 +304,15 @@ discard block |
||
| 304 | 304 | |
| 305 | 305 | <?php |
| 306 | 306 | |
| 307 | - if (isAdmin()) { |
|
| 308 | - ?> |
|
| 307 | + if (isAdmin()) { |
|
| 308 | + ?> |
|
| 309 | 309 | |
| 310 | 310 | <div class="checkbox"> |
| 311 | 311 | <label for="isAdmin"> |
| 312 | 312 | <input name="isAdmin" id="isAdmin" type="checkbox" value="1" <?php if ($userisAdmin == '1') { |
| 313 | - echo 'checked="checked"'; |
|
| 314 | - } elseif ($userisAdmin == '0') { |
|
| 315 | - } ?> /> |
|
| 313 | + echo 'checked="checked"'; |
|
| 314 | + } elseif ($userisAdmin == '0') { |
|
| 315 | + } ?> /> |
|
| 316 | 316 | Make them an ADMIN?: |
| 317 | 317 | </label> |
| 318 | 318 | </div> |
@@ -320,9 +320,9 @@ discard block |
||
| 320 | 320 | <div class="checkbox"> |
| 321 | 321 | <label for="isBandAdmin"> |
| 322 | 322 | <input class="checkbox" name="isBandAdmin" id="isBandAdmin" type="checkbox" value="1" <?php if ($userisBandAdmin == '1') { |
| 323 | - echo 'checked="checked"'; |
|
| 324 | - } elseif ($userisBandAdmin == '0') { |
|
| 325 | - } ?> /> |
|
| 323 | + echo 'checked="checked"'; |
|
| 324 | + } elseif ($userisBandAdmin == '0') { |
|
| 325 | + } ?> /> |
|
| 326 | 326 | Make them a BAND admin?: |
| 327 | 327 | </label> |
| 328 | 328 | </div> |
@@ -330,9 +330,9 @@ discard block |
||
| 330 | 330 | <div class="checkbox"> |
| 331 | 331 | <label for="isEventEditor"> |
| 332 | 332 | <input class="checkbox" name="isEventEditor" id="isEventEditor" type="checkbox" value="1" <?php if ($userIsEventEditor == '1') { |
| 333 | - echo 'checked="checked"'; |
|
| 334 | - } elseif ($userIsEventEditor == '0') { |
|
| 335 | - } ?> /> |
|
| 333 | + echo 'checked="checked"'; |
|
| 334 | + } elseif ($userIsEventEditor == '0') { |
|
| 335 | + } ?> /> |
|
| 336 | 336 | Make them an EVENT EDITOR?: |
| 337 | 337 | </label> |
| 338 | 338 | </div> |
@@ -340,14 +340,14 @@ discard block |
||
| 340 | 340 | <hr /> |
| 341 | 341 | |
| 342 | 342 | <?php |
| 343 | - } ?> |
|
| 343 | + } ?> |
|
| 344 | 344 | |
| 345 | 345 | <div class="checkbox"> |
| 346 | 346 | <label for="isOverviewRecipient"> |
| 347 | 347 | <input class="checkbox" <?php echo isAdmin() ? '' : 'disabled="disabled"' ?> name="isOverviewRecipient" id="isOverviewRecipient" type="checkbox" value="1" <?php if ($userIsOverviewRecipient == '1' || is_null($userIsOverviewRecipient)) { |
| 348 | - echo 'checked="checked"'; |
|
| 349 | - } elseif ($userIsOverviewRecipient == '0') { |
|
| 350 | - }?> /> |
|
| 348 | + echo 'checked="checked"'; |
|
| 349 | + } elseif ($userIsOverviewRecipient == '0') { |
|
| 350 | + }?> /> |
|
| 351 | 351 | Receive group emails?: |
| 352 | 352 | </label> |
| 353 | 353 | </div> |
@@ -355,9 +355,9 @@ discard block |
||
| 355 | 355 | <div class="checkbox"> |
| 356 | 356 | <label for="isReminderRecipient"> |
| 357 | 357 | <input class="checkbox" disabled= "disabled" name="isReminderRecipient" id="isReminderRecipient" type="checkbox" value="1" <?php if (true/*$userIsReminderRecipient == '1' || is_null($userIsReminderRecipient)*/) { |
| 358 | - echo 'checked="checked"'; |
|
| 359 | - } elseif (true/*$userIsReminderRecipient*/ == '0') { |
|
| 360 | - }?> /> |
|
| 358 | + echo 'checked="checked"'; |
|
| 359 | + } elseif (true/*$userIsReminderRecipient*/ == '0') { |
|
| 360 | + }?> /> |
|
| 361 | 361 | Receive email reminders?: (optional in future update to system) |
| 362 | 362 | </label> |
| 363 | 363 | </div> |
@@ -447,18 +447,18 @@ discard block |
||
| 447 | 447 | } else { |
| 448 | 448 | echo '<input class="btn btn-primary" type="submit" value="Add user" />'; |
| 449 | 449 | } |
| 450 | - ?> |
|
| 450 | + ?> |
|
| 451 | 451 | </div><!-- /.box-footer --> |
| 452 | 452 | </form> |
| 453 | 453 | </div> |
| 454 | 454 | </div> |
| 455 | 455 | <div id="right"> |
| 456 | 456 | <?php if (isAdmin()) { |
| 457 | - ?> |
|
| 457 | + ?> |
|
| 458 | 458 | |
| 459 | 459 | <div class="item"><a class="btn" href="users.php">View all users</a></div> |
| 460 | 460 | <?php |
| 461 | - } |
|
| 461 | + } |
|
| 462 | 462 | |
| 463 | 463 | if ($action == 'edit') { |
| 464 | 464 | ?> |
@@ -27,10 +27,10 @@ |
||
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | $fb = new Facebook\Facebook([ |
| 30 | - 'app_id' => $config['auth']['facebook']['appId'], |
|
| 31 | - 'app_secret' => $config['auth']['facebook']['appSecret'], |
|
| 32 | - 'default_graph_version' => 'v2.2', |
|
| 33 | - ]); |
|
| 30 | + 'app_id' => $config['auth']['facebook']['appId'], |
|
| 31 | + 'app_secret' => $config['auth']['facebook']['appSecret'], |
|
| 32 | + 'default_graph_version' => 'v2.2', |
|
| 33 | + ]); |
|
| 34 | 34 | |
| 35 | 35 | $accessToken = $_SESSION['fb_access_token']; |
| 36 | 36 | $_SESSION['foo'] = 'bar'; |
@@ -41,10 +41,10 @@ discard block |
||
| 41 | 41 | // Returns a `Facebook\FacebookResponse` object |
| 42 | 42 | $response = $fb->get('/me?fields=id,name,email', $accessToken); |
| 43 | 43 | } catch (Facebook\Exceptions\FacebookResponseException $e) { |
| 44 | - echo 'Graph returned an error: '.$e->getMessage(); |
|
| 44 | + echo 'Graph returned an error: ' . $e->getMessage(); |
|
| 45 | 45 | exit; |
| 46 | 46 | } catch (Facebook\Exceptions\FacebookSDKException $e) { |
| 47 | - echo 'Facebook SDK returned an error: '.$e->getMessage(); |
|
| 47 | + echo 'Facebook SDK returned an error: ' . $e->getMessage(); |
|
| 48 | 48 | exit; |
| 49 | 49 | } |
| 50 | 50 | |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | <label class="fa fa-envelope-o" for="email"><span class="hidden">Email address</span></label> |
| 92 | 92 | <input name="email" id="email" type="text" class="form__input" placeholder="Email address" value="<?php echo $user->getEmail(); ?>" required> |
| 93 | 93 | </div> |
| 94 | - <?php if (!empty($message)): echo '<p>'.$message.'</p>'; endif; ?> |
|
| 94 | + <?php if (!empty($message)): echo '<p>' . $message . '</p>'; endif; ?> |
|
| 95 | 95 | <div class="form__field"> |
| 96 | 96 | <input type="submit" value="Request access"> |
| 97 | 97 | </div> |
@@ -142,10 +142,10 @@ |
||
| 142 | 142 | </form> |
| 143 | 143 | </div><!-- /.box --> |
| 144 | 144 | <?php |
| 145 | - if (isAdmin()) { |
|
| 146 | - ?> |
|
| 145 | + if (isAdmin()) { |
|
| 146 | + ?> |
|
| 147 | 147 | <div id="right"> |
| 148 | 148 | <div class="item"><a href="settings.php">Back to settings</a></div> |
| 149 | 149 | <?php |
| 150 | - } ?> |
|
| 150 | + } ?> |
|
| 151 | 151 | <?php include 'includes/footer.php'; ?> |
@@ -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 | |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | if ($role && $assignTo) { |
| 35 | 35 | $sql = "UPDATE cr_roles r SET r.groupId = '$assignTo' WHERE r.id = '$role'"; |
| 36 | 36 | if (!mysqli_query(db(), $sql)) { |
| 37 | - die('Error: '.mysqli_error(db())); |
|
| 37 | + die('Error: ' . mysqli_error(db())); |
|
| 38 | 38 | } |
| 39 | 39 | header('Location: roles.php'); |
| 40 | 40 | exit; |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | $sql = "INSERT INTO cr_roles (name, description, rehersalId, groupId) |
| 71 | 71 | VALUES ('$newrole', '$newrole', $rehersal, $groupId)"; |
| 72 | 72 | if (!mysqli_query(db(), $sql)) { |
| 73 | - die('Error: '.mysqli_error(db())); |
|
| 73 | + die('Error: ' . mysqli_error(db())); |
|
| 74 | 74 | } |
| 75 | 75 | } elseif ($method == 'newgroup') { |
| 76 | 76 | $groupId = $_POST['groups']; |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | $sql = "INSERT INTO cr_groups (name, description) |
| 87 | 87 | VALUES ('$newgroup', '$newgroup')"; |
| 88 | 88 | if (!mysqli_query(db(), $sql)) { |
| 89 | - die('Error: '.mysqli_error(db())); |
|
| 89 | + die('Error: ' . mysqli_error(db())); |
|
| 90 | 90 | } |
| 91 | 91 | } else { |
| 92 | 92 | // Handle renaming of the roles |
@@ -119,11 +119,11 @@ discard block |
||
| 119 | 119 | $i = 1; |
| 120 | 120 | while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) { |
| 121 | 121 | if ($type == 'option') { |
| 122 | - $list = $list."<option value='".$row['id']."'>".$row['name'].'</option>'; |
|
| 122 | + $list = $list . "<option value='" . $row['id'] . "'>" . $row['name'] . '</option>'; |
|
| 123 | 123 | } elseif ($type == 'li') { |
| 124 | - $list = $list.'<li>'.$row['name'].'</li>'; |
|
| 124 | + $list = $list . '<li>' . $row['name'] . '</li>'; |
|
| 125 | 125 | } elseif ($type == 'li-a') { |
| 126 | - $list = $list."<li><a href='roles.php?role=".$roleId.'&assignto='.$row['id']."'>".$row['name'].'</a></li>'; |
|
| 126 | + $list = $list . "<li><a href='roles.php?role=" . $roleId . '&assignto=' . $row['id'] . "'>" . $row['name'] . '</a></li>'; |
|
| 127 | 127 | } |
| 128 | 128 | $i++; |
| 129 | 129 | } |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | $group = $row['groupId']; |
| 190 | 190 | $down = $group + 1; |
| 191 | 191 | $up = $group - 1; |
| 192 | - echo '<div><strong>'.$groupname.'</strong><br />'; |
|
| 192 | + echo '<div><strong>' . $groupname . '</strong><br />'; |
|
| 193 | 193 | } |
| 194 | 194 | // Print text input box if a role exists for the group. |
| 195 | 195 | // Allows user to update role names and move roles between groups |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | } ?></h2> |
| 149 | 149 | <p><strong>Posted:</strong> <?php echo $row['dateFormatted']; ?> <strong>by</strong> <?php echo $row['name']; ?></p> |
| 150 | 150 | <?php |
| 151 | - $latestpostsql = "SELECT *, |
|
| 151 | + $latestpostsql = "SELECT *, |
|
| 152 | 152 | (SELECT CONCAT(`firstname`, ' ', `lastname`) FROM cr_users WHERE `cr_users`.id = `cr_discussion`.`userID` ) AS `name`, |
| 153 | 153 | (SELECT id FROM cr_discussion WHERE cr_discussion.CategoryParent = '$areaid' ORDER BY cr_discussion.id DESC LIMIT 0,1) AS `postid`, |
| 154 | 154 | (SELECT DATE_FORMAT(date,'%W, %M %e @ %h:%i %p') FROM cr_discussion WHERE cr_discussion.CategoryParent = '$areaid' ORDER BY cr_discussion.id DESC |
@@ -212,7 +212,7 @@ discard block |
||
| 212 | 212 | </div> |
| 213 | 213 | <?php |
| 214 | 214 | } // End the admin loop |
| 215 | - ?> |
|
| 215 | + ?> |
|
| 216 | 216 | <div id="right"> |
| 217 | 217 | <?php echo $subscribe; |
| 218 | 218 | |
@@ -52,10 +52,10 @@ discard block |
||
| 52 | 52 | |
| 53 | 53 | if ($subscribe == 'true') { |
| 54 | 54 | subscribeto($userID, $areaid, 0); |
| 55 | - header('Location: discussion.php?categoryid='.$areaid); |
|
| 55 | + header('Location: discussion.php?categoryid=' . $areaid); |
|
| 56 | 56 | } elseif ($subscribe == 'false') { |
| 57 | 57 | unsubscribefrom($subscription); |
| 58 | - header('Location: discussion.php?categoryid='.$areaid); |
|
| 58 | + header('Location: discussion.php?categoryid=' . $areaid); |
|
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | // If the form has been sent, we need to handle the data. |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | |
| 67 | 67 | $sql = ("INSERT INTO cr_discussionCategories(name, description, parent) VALUES ('$categoryname', '$categorydescription', '$categoryparent')"); |
| 68 | 68 | if (!mysqli_query(db(), $sql)) { |
| 69 | - die('Error: '.mysqli_error(db())); |
|
| 69 | + die('Error: ' . mysqli_error(db())); |
|
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | // After we have inserted the data, we want to head back to the main page |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | $categoryName = $row['name']; |
| 91 | 91 | |
| 92 | 92 | // The following function lists the parents here to save a SQL query later |
| 93 | - $listParents = $listParents."<option value='".$categoryID."'>".$categoryName.'</option>'; ?> |
|
| 93 | + $listParents = $listParents . "<option value='" . $categoryID . "'>" . $categoryName . '</option>'; ?> |
|
| 94 | 94 | <div class="elementBackground highlight"> |
| 95 | 95 | <h2><a href="discussion.php?categoryid=<?php echo $categoryID; ?>"><?php echo $row['name']; ?></a> <?php |
| 96 | 96 | if (isAdmin()) { |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | } else { |
| 111 | 111 | $topicName = $row['topicName']; |
| 112 | 112 | } ?> |
| 113 | - <p><strong>Latest post:</strong> <?php echo $topicName.' <strong>by</strong> '.$row['firstName']; ?></p> |
|
| 113 | + <p><strong>Latest post:</strong> <?php echo $topicName . ' <strong>by</strong> ' . $row['firstName']; ?></p> |
|
| 114 | 114 | <?php |
| 115 | 115 | } ?> |
| 116 | 116 | |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | <div class="elementBackground"> |
| 145 | 145 | <h2><a href="discussiontopic.php?id=<?php echo $row['id']; ?>&parentid=<?php echo $categoryID; ?>"><?php echo $row['topicName']; ?></a> |
| 146 | 146 | <?php if (isAdmin()) { |
| 147 | - echo "<a href='discussion.php?discussionremove=true&categoryid=".$row['id']."'><img src='graphics/close.png' /></a>"; |
|
| 147 | + echo "<a href='discussion.php?discussionremove=true&categoryid=" . $row['id'] . "'><img src='graphics/close.png' /></a>"; |
|
| 148 | 148 | } ?></h2> |
| 149 | 149 | <p><strong>Posted:</strong> <?php echo $row['dateFormatted']; ?> <strong>by</strong> <?php echo $row['name']; ?></p> |
| 150 | 150 | <?php |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | |
| 162 | 162 | while ($latestpostrow = mysqli_fetch_array($latestpostresult, MYSQLI_ASSOC)) { |
| 163 | 163 | ?> |
| 164 | - <p><strong>Latest post:</strong> <?php echo $latestpostrow['firstName'].' <strong>on</strong> '.$latestpostrow['topicDate']; ?></p> |
|
| 164 | + <p><strong>Latest post:</strong> <?php echo $latestpostrow['firstName'] . ' <strong>on</strong> ' . $latestpostrow['topicDate']; ?></p> |
|
| 165 | 165 | <?php |
| 166 | 166 | } ?> |
| 167 | 167 | </div> |
@@ -178,10 +178,10 @@ discard block |
||
| 178 | 178 | } |
| 179 | 179 | |
| 180 | 180 | if ($isSubscribed != '') { |
| 181 | - $subscribe = '<div class="item"><a href="discussion.php?subscribe=false&subscription='.$isSubscribed.'&categoryid='. |
|
| 182 | - $areaid.'">Unsubscribe from this area</a></div>'; |
|
| 181 | + $subscribe = '<div class="item"><a href="discussion.php?subscribe=false&subscription=' . $isSubscribed . '&categoryid=' . |
|
| 182 | + $areaid . '">Unsubscribe from this area</a></div>'; |
|
| 183 | 183 | } else { |
| 184 | - $subscribe = '<div class="item"><a href="discussion.php?subscribe=true&categoryid='.$areaid.'">Subscribe to this area</a></div>'; |
|
| 184 | + $subscribe = '<div class="item"><a href="discussion.php?subscribe=true&categoryid=' . $areaid . '">Subscribe to this area</a></div>'; |
|
| 185 | 185 | } |
| 186 | 186 | } ?> |
| 187 | 187 | <?php |
@@ -15,10 +15,10 @@ |
||
| 15 | 15 | session_start(); |
| 16 | 16 | |
| 17 | 17 | $fb = new Facebook\Facebook([ |
| 18 | - 'app_id' => $config['auth']['facebook']['appId'], |
|
| 19 | - 'app_secret' => $config['auth']['facebook']['appSecret'], |
|
| 20 | - 'default_graph_version' => 'v2.2', |
|
| 21 | - ]); |
|
| 18 | + 'app_id' => $config['auth']['facebook']['appId'], |
|
| 19 | + 'app_secret' => $config['auth']['facebook']['appSecret'], |
|
| 20 | + 'default_graph_version' => 'v2.2', |
|
| 21 | + ]); |
|
| 22 | 22 | |
| 23 | 23 | $helper = $fb->getRedirectLoginHelper(); |
| 24 | 24 | |
@@ -26,21 +26,21 @@ discard block |
||
| 26 | 26 | $accessToken = $helper->getAccessToken(); |
| 27 | 27 | } catch (Facebook\Exceptions\FacebookResponseException $e) { |
| 28 | 28 | // When Graph returns an error |
| 29 | - echo 'Graph returned an error: '.$e->getMessage(); |
|
| 29 | + echo 'Graph returned an error: ' . $e->getMessage(); |
|
| 30 | 30 | exit; |
| 31 | 31 | } catch (Facebook\Exceptions\FacebookSDKException $e) { |
| 32 | 32 | // When validation fails or other local issues |
| 33 | - echo 'Facebook SDK returned an error: '.$e->getMessage(); |
|
| 33 | + echo 'Facebook SDK returned an error: ' . $e->getMessage(); |
|
| 34 | 34 | exit; |
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | if (!isset($accessToken)) { |
| 38 | 38 | if ($helper->getError()) { |
| 39 | 39 | header('HTTP/1.0 401 Unauthorized'); |
| 40 | - echo 'Error: '.$helper->getError()."\n"; |
|
| 41 | - echo 'Error Code: '.$helper->getErrorCode()."\n"; |
|
| 42 | - echo 'Error Reason: '.$helper->getErrorReason()."\n"; |
|
| 43 | - echo 'Error Description: '.$helper->getErrorDescription()."\n"; |
|
| 40 | + echo 'Error: ' . $helper->getError() . "\n"; |
|
| 41 | + echo 'Error Code: ' . $helper->getErrorCode() . "\n"; |
|
| 42 | + echo 'Error Reason: ' . $helper->getErrorReason() . "\n"; |
|
| 43 | + echo 'Error Description: ' . $helper->getErrorDescription() . "\n"; |
|
| 44 | 44 | } else { |
| 45 | 45 | header('HTTP/1.0 400 Bad Request'); |
| 46 | 46 | echo 'Bad request'; |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | try { |
| 66 | 66 | $accessToken = $oAuth2Client->getLongLivedAccessToken($accessToken); |
| 67 | 67 | } catch (Facebook\Exceptions\FacebookSDKException $e) { |
| 68 | - echo '<p>Error getting long-lived access token: '.$helper->getMessage()."</p>\n\n"; |
|
| 68 | + echo '<p>Error getting long-lived access token: ' . $helper->getMessage() . "</p>\n\n"; |
|
| 69 | 69 | exit; |
| 70 | 70 | } |
| 71 | 71 | } |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | } else { |
| 79 | 79 | $redirUrl = 'fb-signup.php'; |
| 80 | 80 | } |
| 81 | -header('Location: '.$redirUrl); |
|
| 81 | +header('Location: ' . $redirUrl); |
|
| 82 | 82 | |
| 83 | 83 | // User is logged in with a long-lived access token. |
| 84 | 84 | // You can redirect them to a members-only page. |
@@ -54,8 +54,8 @@ discard block |
||
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | // After we have inserted the data, we want to head back to the main users page |
| 57 | - header('Location: locations.php'); // Move to the home page of the admin section |
|
| 58 | - exit; |
|
| 57 | + header('Location: locations.php'); // Move to the home page of the admin section |
|
| 58 | + exit; |
|
| 59 | 59 | } |
| 60 | 60 | } |
| 61 | 61 | |
@@ -121,10 +121,10 @@ discard block |
||
| 121 | 121 | </form> |
| 122 | 122 | </div><!-- /.box --> |
| 123 | 123 | <?php |
| 124 | - if (isAdmin()) { |
|
| 125 | - ?> |
|
| 124 | + if (isAdmin()) { |
|
| 125 | + ?> |
|
| 126 | 126 | <div id="right"> |
| 127 | 127 | <div class="item"><a href="settings.php">Back to settings</a></div> |
| 128 | 128 | <?php |
| 129 | - } ?> |
|
| 129 | + } ?> |
|
| 130 | 130 | <?php include 'includes/footer.php'; ?> |
@@ -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 | |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | $sql = "UPDATE cr_locations SET name = '$name' WHERE id = '$editid'"; |
| 40 | 40 | } |
| 41 | 41 | if (!mysqli_query(db(), $sql)) { |
| 42 | - die('Error: '.mysqli_error(db())); |
|
| 42 | + die('Error: ' . mysqli_error(db())); |
|
| 43 | 43 | } |
| 44 | 44 | } else { |
| 45 | 45 | $newlocation = $_POST['newlocation']; |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | |
| 51 | 51 | $sql = ("INSERT INTO cr_locations (name) VALUES ('$newlocation')"); |
| 52 | 52 | if (!mysqli_query(db(), $sql)) { |
| 53 | - die('Error: '.mysqli_error(db())); |
|
| 53 | + die('Error: ' . mysqli_error(db())); |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | // After we have inserted the data, we want to head back to the main users page |
@@ -95,8 +95,8 @@ discard block |
||
| 95 | 95 | |
| 96 | 96 | while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) { |
| 97 | 97 | $locationID = $row['id']; |
| 98 | - echo "<span id='".$locationID."' class='edit'>".$row['name'].'</span> '; |
|
| 99 | - echo " <a href='locations.php?locationremove=true&locationID=".$locationID."'><i class='fa fa-close'></i></a><br />"; |
|
| 98 | + echo "<span id='" . $locationID . "' class='edit'>" . $row['name'] . '</span> '; |
|
| 99 | + echo " <a href='locations.php?locationremove=true&locationID=" . $locationID . "'><i class='fa fa-close'></i></a><br />"; |
|
| 100 | 100 | } ?> |
| 101 | 101 | </div><!-- /.box-body --> |
| 102 | 102 | </div><!-- /.box --> |