From b91c9542dbba730bba30b94b80df00c3b2904e35 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Thu, 29 Apr 2021 19:02:39 +0000 Subject: [PATCH 1/2] Upgrade to GitHub-native Dependabot --- .github/dependabot.yml | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..25119a5b --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,8 @@ +version: 2 +updates: +- package-ecosystem: composer + directory: "/" + schedule: + interval: daily + open-pull-requests-limit: 10 + target-branch: develop From c728c89a02f12655e57bc66c185d36a88e013158 Mon Sep 17 00:00:00 2001 From: Christopher Wilkinson Date: Thu, 29 Apr 2021 19:02:49 +0000 Subject: [PATCH 2/2] Apply fixes from StyleCI --- generated-classes/TechWilk/Rota/User.php | 4 +- generated-conf/config.php | 44 +-- .../PropelMigration_1494860053.php | 8 +- public/api/v1/index.php | 86 +++--- public/old/cr_daily.php | 2 +- public/old/createEvent.php | 48 ++-- public/old/createEvents.php | 20 +- public/old/editRole.php | 12 +- public/old/editeventtype.php | 16 +- public/old/emailEvent.php | 11 +- public/old/emailGroup.php | 11 +- public/old/emails.php | 6 +- public/old/events.php | 109 ++++---- public/old/includes/config.php | 4 +- public/old/includes/footer.php | 8 +- public/old/includes/functions.auth.php | 4 +- public/old/includes/functions.calendars.php | 6 +- public/old/includes/functions.database.php | 18 +- public/old/includes/functions.discussion.php | 4 +- public/old/includes/functions.event.php | 36 +-- public/old/includes/functions.facebook.php | 8 +- public/old/includes/functions.mail.php | 86 +++--- .../old/includes/functions.notifications.php | 34 +-- public/old/includes/functions.php | 6 +- public/old/includes/functions.remove.php | 30 +-- public/old/includes/functions.roles.php | 24 +- public/old/includes/functions.users.php | 66 ++--- public/old/includes/header.php | 29 +- public/old/index.php | 254 +++++++++--------- public/old/license.php | 2 +- public/old/linkSocialAuth.php | 14 +- public/old/locations.php | 6 +- public/old/overview.php | 8 +- public/old/pendingAccounts.php | 14 +- .../samples/old/assets/posteddata.php | 6 +- public/old/recordingUpload.php | 17 +- public/old/roles.php | 8 +- public/old/series.php | 10 +- public/old/settings.php | 32 +-- public/old/statistics.php | 16 +- public/old/subTypes.php | 4 +- public/old/swap.php | 38 +-- public/old/swaps.php | 18 +- public/old/tableView.php | 12 +- public/old/update.settings.php | 4 +- .../samples/old/assets/posteddata.php | 6 +- src/classes/Authentication.php | 1 + src/classes/Controller/InstallController.php | 5 +- tests/Integration/BaseTestCase.php | 26 +- tests/Integration/InstallationTest.php | 1 - tests/Unit/BaseTestCase.php | 26 +- tests/Unit/CryptTest.php | 40 +-- tests/Unit/EmailAddressTest.php | 14 +- 53 files changed, 661 insertions(+), 661 deletions(-) diff --git a/generated-classes/TechWilk/Rota/User.php b/generated-classes/TechWilk/Rota/User.php index 8ec997a8..b7974835 100644 --- a/generated-classes/TechWilk/Rota/User.php +++ b/generated-classes/TechWilk/Rota/User.php @@ -70,8 +70,8 @@ public function setPassword($v) if (!password_verify($v, $this->password)) { $bcrypt_options = [ - 'cost' => 12, - ]; + 'cost' => 12, + ]; $this->password = password_hash($v, PASSWORD_BCRYPT, $bcrypt_options); $this->modifiedColumns[UserTableMap::COL_PASSWORD] = true; diff --git a/generated-conf/config.php b/generated-conf/config.php index 1195e3a7..dd115f76 100644 --- a/generated-conf/config.php +++ b/generated-conf/config.php @@ -7,18 +7,18 @@ $serviceContainer->setAdapterClass('default', 'mysql'); $manager = new \Propel\Runtime\Connection\ConnectionManagerSingle(); $manager->setConfiguration([ - 'classname' => 'Propel\\Runtime\\Connection\\ConnectionWrapper', - 'dsn' => 'mysql:host='.$config['db']['host'].';dbname='.$config['db']['dbname'], - 'user' => $config['db']['user'], - 'password' => $config['db']['pass'], - 'attributes' => [ - 'ATTR_EMULATE_PREPARES' => false, - 'ATTR_TIMEOUT' => 30, - ], - 'model_paths' => [ - 0 => 'src', - 1 => 'vendor', - ], + 'classname' => 'Propel\\Runtime\\Connection\\ConnectionWrapper', + 'dsn' => 'mysql:host='.$config['db']['host'].';dbname='.$config['db']['dbname'], + 'user' => $config['db']['user'], + 'password' => $config['db']['pass'], + 'attributes' => [ + 'ATTR_EMULATE_PREPARES' => false, + 'ATTR_TIMEOUT' => 30, + ], + 'model_paths' => [ + 0 => 'src', + 1 => 'vendor', + ], ]); $manager->setName('default'); $serviceContainer->setConnectionManager('default', $manager); @@ -26,16 +26,16 @@ $serviceContainer->setAdapterClass('test', 'sqlite'); $manager = new \Propel\Runtime\Connection\ConnectionManagerSingle(); $manager->setConfiguration([ - 'classname' => 'Propel\\Runtime\\Connection\\ConnectionWrapper', - 'dsn' => 'sqlite:/var/tmp/test.db', - 'attributes' => [ - 'ATTR_EMULATE_PREPARES' => false, - 'ATTR_TIMEOUT' => 30, - ], - 'model_paths' => [ - 0 => 'src', - 1 => 'vendor', - ], + 'classname' => 'Propel\\Runtime\\Connection\\ConnectionWrapper', + 'dsn' => 'sqlite:/var/tmp/test.db', + 'attributes' => [ + 'ATTR_EMULATE_PREPARES' => false, + 'ATTR_TIMEOUT' => 30, + ], + 'model_paths' => [ + 0 => 'src', + 1 => 'vendor', + ], ]); $manager->setName('test'); $serviceContainer->setConnectionManager('test', $manager); diff --git a/generated-migrations/PropelMigration_1494860053.php b/generated-migrations/PropelMigration_1494860053.php index 468dd151..9bfeb5cc 100644 --- a/generated-migrations/PropelMigration_1494860053.php +++ b/generated-migrations/PropelMigration_1494860053.php @@ -40,7 +40,7 @@ public function postDown(MigrationManager $manager) public function getUpSQL() { return [ - 'default' => ' + 'default' => ' # This is a fix for InnoDB in MySQL >= 4.1.x # It "suspends judgement" for fkey relationships until are tables are set. SET FOREIGN_KEY_CHECKS = 0; @@ -160,7 +160,7 @@ public function getUpSQL() # This restores the fkey checks, after having unset them earlier SET FOREIGN_KEY_CHECKS = 1; ', -]; + ]; } /** @@ -172,7 +172,7 @@ public function getUpSQL() public function getDownSQL() { return [ - 'default' => ' + 'default' => ' # This is a fix for InnoDB in MySQL >= 4.1.x # It "suspends judgement" for fkey relationships until are tables are set. SET FOREIGN_KEY_CHECKS = 0; @@ -270,6 +270,6 @@ public function getDownSQL() # This restores the fkey checks, after having unset them earlier SET FOREIGN_KEY_CHECKS = 1; ', -]; + ]; } } diff --git a/public/api/v1/index.php b/public/api/v1/index.php index 5fe8861e..72fdeeee 100644 --- a/public/api/v1/index.php +++ b/public/api/v1/index.php @@ -17,68 +17,66 @@ function isAdmin() } } -if (isAdmin()): +if (isAdmin()) { // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// Start of API -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Start of API + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -require_once __DIR__.'/../../../vendor/autoload.php'; + require_once __DIR__.'/../../../vendor/autoload.php'; -require_once __DIR__.'/../../../generated-conf/config.php'; + require_once __DIR__.'/../../../generated-conf/config.php'; -// Create and configure Slim app -$app = new \Slim\App(['settings' => $config]); + // Create and configure Slim app + $app = new \Slim\App(['settings' => $config]); -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// Containers for DI -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Containers for DI + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -$container = $app->getContainer(); + $container = $app->getContainer(); -$container['db'] = function ($c) { - $db_config = $c['settings']['db']; - $db = new Database($db_config); + $container['db'] = function ($c) { + $db_config = $c['settings']['db']; + $db = new Database($db_config); - return $db; -}; + return $db; + }; -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// Define app routes -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Define app routes + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// ~~~~~~~~~~~~~~~ Series ~~~~~~~~~~~~~~~ + // ~~~~~~~~~~~~~~~ Series ~~~~~~~~~~~~~~~ -$app->post('/series', function ($request, $response, $args) { - $postData = $request->getParsedBody(); + $app->post('/series', function ($request, $response, $args) { + $postData = $request->getParsedBody(); - $name = filter_var($postData['name'], FILTER_SANITIZE_STRING); - $description = filter_var($postData['description'], FILTER_SANITIZE_STRING); + $name = filter_var($postData['name'], FILTER_SANITIZE_STRING); + $description = filter_var($postData['description'], FILTER_SANITIZE_STRING); - $series = new EventGroup(); - $series->setName($name); - $series->setDescription($description); - $series->save(); + $series = new EventGroup(); + $series->setName($name); + $series->setDescription($description); + $series->save(); - $data = [ - 'data' => [ - 'id' => $series->getId(), - 'name' => $series->getName(), - 'description' => $series->getDescription(), - ], - ]; + $data = [ + 'data' => [ + 'id' => $series->getId(), + 'name' => $series->getName(), + 'description' => $series->getDescription(), + ], + ]; - return $response->withJson($data); -}); + return $response->withJson($data); + }); -// Run app -$app->run(); + // Run app + $app->run(); // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // End of very very very basic auth // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -else: -http_response_code(401); - -endif; +} else { + http_response_code(401); +} diff --git a/public/old/cr_daily.php b/public/old/cr_daily.php index 68d95f0d..c1f5e5d3 100755 --- a/public/old/cr_daily.php +++ b/public/old/cr_daily.php @@ -117,7 +117,7 @@ date >= CURDATE() AND date_format( date , "%y-%m-%d" ) <= date_format( DATE_ADD(now(), INTERVAL '.$daysAlert.' DAY ) , "%y-%m-%d" )'; - $resultEvents = mysqli_query(db(), $sqlEvents) or die(mysqli_error(db())); + $resultEvents = mysqli_query(db(), $sqlEvents) or exit(mysqli_error(db())); $i = 0; while ($rowEvents = mysqli_fetch_array($resultEvents, MYSQLI_ASSOC)) { $usersNotified = notifyEveryoneForEvent($rowEvents['id']); diff --git a/public/old/createEvent.php b/public/old/createEvent.php index 0ed4b2d9..39f7afa9 100755 --- a/public/old/createEvent.php +++ b/public/old/createEvent.php @@ -69,7 +69,7 @@ (SELECT name FROM eventSubTypes WHERE eventSubTypes.id = events.subType) AS subtypename, (SELECT name FROM eventGroups WHERE eventGroups.id = events.eventGroup) AS groupname FROM events WHERE id = '$eventID'"; - $result = mysqli_query(db(), $sql) or die(mysqli_error(db())); + $result = mysqli_query(db(), $sql) or exit(mysqli_error(db())); while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) { if ($action == 'edit') { @@ -145,11 +145,11 @@ if ($action == 'edit') { $sql = "UPDATE events SET date = '$date', rehearsalDate = '$rehersalDate', location = '$location', rehearsal = '$norehearsal', type = '$type', subType = '$subType', name = '$eventName', eventGroup = '$eventGroup', sermonTitle = '$sermonTitle', bibleVerse = '$bibleVerse' WHERE id = '$id'"; - mysqli_query(db(), $sql) or die(mysqli_error(db())); + mysqli_query(db(), $sql) or exit(mysqli_error(db())); } else { $sql = "INSERT INTO events (date, createdBy, rehearsalDate, type, subType, location, rehearsal, name, eventGroup, sermonTitle, bibleVerse) VALUES ('$date', '$sessionUserID','$rehersalDate', '$type', '$subType', '$location', '$norehearsal', '$eventName', '$eventGroup', '$sermonTitle', '$bibleVerse')"; - mysqli_query(db(), $sql) or die(mysqli_error(db())); + mysqli_query(db(), $sql) or exit(mysqli_error(db())); $id = mysqli_insert_id(db()); $eventID = mysqli_insert_id(db()); } @@ -172,7 +172,7 @@ //if ($userisBandAdmin) $sql = $sql . " AND userRoleId IN (SELECT id FROM userRoles WHERE groupid IN (2,3,4))"; //if ($userisEventEditor) $sql = $sql . " AND userRoleId IN (SELECT id FROM userRoles WHERE NOT (groupid IN (2,3,4)))"; - $result = mysqli_query(db(), $sql) or die(mysqli_error(db())); + $result = mysqli_query(db(), $sql) or exit(mysqli_error(db())); while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) { // We're going to put it all in a nice array called membersArray @@ -214,7 +214,7 @@ if ($userisEventEditor) { $delete_all_sql = $delete_all_sql.' and skillID in (select skillID from skills where not (groupid in (2,3,4)))'; } - mysqli_query(db(), $delete_all_sql) or die(mysqli_error(db())); + mysqli_query(db(), $delete_all_sql) or exit(mysqli_error(db())); } // redirect @@ -295,7 +295,7 @@ } ?> id == $type)) { $defaultTime = strftime('%H:%M', strtotime($ob->defaultTime)); @@ -320,7 +320,7 @@ } ?> "> joinWith('Group.Role')->joinWith('Role.UserRole')->find(); - foreach ($groups as $group): ?> + foreach ($groups as $group) { ?> getName() ?> - getRoles() as $role): ?> + getRoles() as $role) { ?>
- + - + +?>
@@ -86,13 +86,13 @@ } ?> id == $type)) { $defaultTime = strftime('%H:%M', strtotime($ob->defaultTime)); echo "'; } - } ?> + } ?>
@@ -111,14 +111,14 @@ } ?> ".$row['name'].''; } - } ?> + } ?> @@ -139,14 +139,14 @@ } ?> ".$row['name'].''; } - } ?> + } ?> @@ -282,14 +282,14 @@ ".$row['name'].''; } - } ?> + } ?>

Add Series

@@ -354,4 +354,4 @@ - + diff --git a/public/old/editRole.php b/public/old/editRole.php index 8576dc8d..5258744c 100755 --- a/public/old/editRole.php +++ b/public/old/editRole.php @@ -47,14 +47,14 @@ //$roleId = filter_var($roleId, FILTER_SANITIZE_NUMBER_INT); if (empty($users)) { $sql = "DELETE FROM userRoles WHERE roleId = '$roleId'"; - mysqli_query(db(), $sql) or die(mysqli_error(db())); + mysqli_query(db(), $sql) or exit(mysqli_error(db())); } else { $sqlPeople = "SELECT userId FROM userRoles WHERE roleId = '$roleId'"; - $resultPeople = mysqli_query(db(), $sqlPeople) or die('mysqli_error(db())'); + $resultPeople = mysqli_query(db(), $sqlPeople) or exit('mysqli_error(db())'); $existingUsers = []; while ($viewPeople = mysqli_fetch_array($resultPeople, MYSQLI_ASSOC)) { @@ -90,7 +90,7 @@ $sql = "SELECT * FROM roles WHERE id = '$roleId'"; -$result = mysqli_query(db(), $sql) or die(mysqli_error(db())); +$result = mysqli_query(db(), $sql) or exit(mysqli_error(db())); while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) { $id = $row['id']; @@ -105,7 +105,7 @@ FROM users u ORDER BY u.firstName"; -$result = mysqli_query(db(), $sqlPeople) or die(mysqli_error(db())); +$result = mysqli_query(db(), $sqlPeople) or exit(mysqli_error(db())); while ($viewPeople = mysqli_fetch_array($result, MYSQLI_ASSOC)) { $users[] = $viewPeople; @@ -146,7 +146,7 @@
- +
- +
- 0): ?> - + 0) { ?> +
- - + +
diff --git a/public/old/emailGroup.php b/public/old/emailGroup.php index 58eee33b..18999123 100644 --- a/public/old/emailGroup.php +++ b/public/old/emailGroup.php @@ -44,7 +44,6 @@ exit; } - $groups; foreach ($_POST['group'] as $group) { $groups[] = intval($group); } @@ -74,7 +73,7 @@ INNER JOIN userRoles ur ON ur.roleId = r.id GROUP BY g.id'; -$result = mysqli_query(db(), $sql) or die(mysqli_error(db())); +$result = mysqli_query(db(), $sql) or exit(mysqli_error(db())); while ($ob = mysqli_fetch_object($result)) { $groups[] = $ob; } @@ -110,13 +109,13 @@

Send to

- 0): ?> - + 0) { ?> +
- - + +
diff --git a/public/old/emails.php b/public/old/emails.php index d8c8b5af..eefc1cf4 100755 --- a/public/old/emails.php +++ b/public/old/emails.php @@ -71,7 +71,7 @@ if ($editskillID != '') { $sql = ("INSERT INTO eventPeople (eventID, skillID) VALUES ('$editeventID', '$editskillID')"); if (!mysqli_query(db(), $sql)) { - die('Error: '.mysqli_error(db())); + exit('Error: '.mysqli_error(db())); } // After we have inserted the data, we want to head back to the main page @@ -81,14 +81,14 @@ if ($editbandID != '') { $sqlbandMembers = "SELECT * FROM bandMembers WHERE bandID = '$editbandID'"; - $resultbandMembers = mysqli_query(db(), $sqlbandMembers) or die(mysqli_error(db())); + $resultbandMembers = mysqli_query(db(), $sqlbandMembers) or exit(mysqli_error(db())); while ($bandMember = mysqli_fetch_array($resultbandMembers, MYSQLI_ASSOC)) { $editskillID = $bandMember['skillID']; $sql = ("INSERT INTO eventPeople (eventID, skillID) VALUES ('$editeventID', '$editskillID')"); if (!mysqli_query(db(), $sql)) { - die('Error: '.mysqli_error(db())); + exit('Error: '.mysqli_error(db())); } } diff --git a/public/old/events.php b/public/old/events.php index 7b55ef91..d7dffea0 100755 --- a/public/old/events.php +++ b/public/old/events.php @@ -110,7 +110,7 @@ if ($editskillID != '') { $sql = ("INSERT INTO eventPeople (eventId, userRoleId) VALUES ('$editeventID', '$editskillID')"); if (!mysqli_query(db(), $sql)) { - die('Error: '.mysqli_error(db())); + exit('Error: '.mysqli_error(db())); } // After we have inserted the data, we want to head back to the main page @@ -120,14 +120,14 @@ if ($editbandID != '') { $sqlbandMembers = "SELECT * FROM bandMembers WHERE bandID = '$editbandID'"; - $resultbandMembers = mysqli_query(db(), $sqlbandMembers) or die(mysqli_error(db())); + $resultbandMembers = mysqli_query(db(), $sqlbandMembers) or exit(mysqli_error(db())); while ($bandMember = mysqli_fetch_object($resultbandMembers)) { $editskillID = $bandMember->skillID; $sql = ("INSERT INTO eventPeople (eventId, userRoleId) VALUES ('$editeventID', '$editskillID')"); if (!mysqli_query(db(), $sql)) { - die('Error: '.mysqli_error(db())); + exit('Error: '.mysqli_error(db())); } } @@ -158,7 +158,7 @@ if (isAdmin()) { $sql = 'SELECT COUNT(id) AS pendingSwaps FROM swaps WHERE accepted = 0 AND declined = 0'; - $results = mysqli_query(db(), $sql) or die(mysqli_error(db())); + $results = mysqli_query(db(), $sql) or exit(mysqli_error(db())); $ob = mysqli_fetch_object($results); $pendingSwaps = $ob->pendingSwaps; @@ -175,7 +175,7 @@ echo 'All Events'; } elseif ($filter != '') { $mysqli_query = "SELECT DISTINCT name FROM eventTypes WHERE id = $filter"; - $result = mysqli_query(db(), $mysqli_query) or die(mysqli_error(db())); + $result = mysqli_query(db(), $mysqli_query) or exit(mysqli_error(db())); $row = mysqli_fetch_object($result); echo $row->name.'s'; @@ -202,27 +202,28 @@ } - 0): - if ($pendingSwaps > 1) { - $swapsMessage = $pendingSwaps.' swaps are pending approval. Emails have been sent to the people covering to approve the swaps.'; - } else { - $swapsMessage = 'A swap is pending approval. An email has been sent to the person covering to approve the swap.'; - } ?> + 0) { + if ($pendingSwaps > 1) { + $swapsMessage = $pendingSwaps.' swaps are pending approval. Emails have been sent to the people covering to approve the swaps.'; + } else { + $swapsMessage = 'A swap is pending approval. An email has been sent to the person covering to approve the swap.'; + } ?>

Swaps pending approval

view 1 ? 'swaps' : 'swap' ?>

- + - +

Status

- +
@@ -299,7 +300,7 @@ AND e.removed = 0 ORDER BY ".$dateOrderBy; } - $result = mysqli_query(db(), $sql) or die(mysqli_error(db())); + $result = mysqli_query(db(), $sql) or exit(mysqli_error(db())); $month = ''; ?>
    @@ -388,47 +389,47 @@ AND ep.removed = 0 ORDER BY g.name, r.name"; - $resultPeople = mysqli_query(db(), $sqlPeople) or die(mysqli_error(db())); + $resultPeople = mysqli_query(db(), $sqlPeople) or exit(mysqli_error(db())); $groupName = ''; $groupId = 0; $identifier = '1'; $firstTime = true; - if (mysqli_num_rows($resultPeople) > 0): - - ?> + if (mysqli_num_rows($resultPeople) > 0) { + ?> group == $groupId) { - // Do nothing, because they are all in the same group - } else { - // Update the group heading - $groupId = $viewPeople->group; - $groupName = $viewPeople->groupName; - if ($firstTime) { - $firstTime = false; - } else { - echo '
'; - } - echo '

'.$groupName.'

'; - echo ''; else: - echo '

No roles assigned to this event.'; - endif; ?> + if ($viewPeople->group == $groupId) { + // Do nothing, because they are all in the same group + } else { + // Update the group heading + $groupId = $viewPeople->group; + $groupName = $viewPeople->groupName; + if ($firstTime) { + $firstTime = false; + } else { + echo ''; + } + echo '

'.$groupName.'

'; + echo ''; + } else { + echo '

No roles assigned to this event.'; + } ?>

@@ -118,9 +118,11 @@ - + - + seen == false) { $unseen += 1; } - } - ?> + } ?>
  • @@ -357,12 +356,12 @@ */ - if (isset($_SESSION['userid'])): ?> + if (isset($_SESSION['userid'])) { ?> - +
  • @@ -475,7 +474,7 @@ WHERE date >= DATE(NOW()) AND events.removed = 0) ORDER BY name'; - $result = mysqli_query(db(), $filter_sql) or die(mysqli_error(db())); + $result = mysqli_query(db(), $filter_sql) or exit(mysqli_error(db())); while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) { ?> @@ -491,11 +490,11 @@
  • > View All
  • - +
  • > Add Event
  • - + > Settings - +
  • >Login
  • - + diff --git a/public/old/index.php b/public/old/index.php index 6e5ba7b3..b2bdbf73 100644 --- a/public/old/index.php +++ b/public/old/index.php @@ -50,7 +50,7 @@ ORDER BY e.date "; -$result = mysqli_query(db(), $sql) or die(mysqli_error(db())); +$result = mysqli_query(db(), $sql) or exit(mysqli_error(db())); $month = ''; $userEvents = []; @@ -70,7 +70,7 @@ if (isAdmin()) { $sql = 'SELECT COUNT(id) AS pendingSwaps FROM swaps WHERE accepted = 0 AND declined = 0'; - $results = mysqli_query(db(), $sql) or die(mysqli_error(db())); + $results = mysqli_query(db(), $sql) or exit(mysqli_error(db())); $ob = mysqli_fetch_object($results); $pendingSwaps = $ob->pendingSwaps; @@ -104,14 +104,14 @@
    - +

    Status

    - +
    @@ -127,7 +127,7 @@
    - 0): ?> + 0) { ?>
    @@ -138,7 +138,7 @@
    - +
    @@ -150,14 +150,14 @@
    Rota Ends getDate()) ?> - add events + add events
    + if ((isAdmin()) || ($logged_in_show_snapshot_button == '1')) { ?> - + @@ -186,18 +186,18 @@

    Events this week:

    - 0): ?> + 0) { ?> '; - } - echo '

    '.$groupName.'

    '; - echo ''; - else: - echo '

    No roles assigned to this event.'; - endif; + if ($viewPeople->group == $groupId) { + // Do nothing, because they are all in the same group + } else { + // Update the group heading + $groupId = $viewPeople->group; + $groupName = $viewPeople->groupName; + if ($firstTime) { + $firstTime = false; + } else { + echo ''; + } + echo '

    '.$groupName.'

    '; + echo ''; + } else { + echo '

    No roles assigned to this event.'; + } ?>

    - + - +

    There are no events this week. View all events

    - + My events: - 0): ?> + 0) { ?> '; - } - echo '

    '.$groupName.'

    '; - echo ''; - else: - echo '

    No roles assigned to this event.'; - endif; + if ($viewPeople->group == $groupId) { + // Do nothing, because they are all in the same group + } else { + // Update the group heading + $groupId = $viewPeople->group; + $groupName = $viewPeople->groupName; + if ($firstTime) { + $firstTime = false; + } else { + echo ''; + } + echo '

    '.$groupName.'

    '; + echo ''; + } else { + echo '

    No roles assigned to this event.'; + } ?>

    - + - +

    You have no events on the upcoming rota. View all events

    - + @@ -544,7 +542,7 @@ // ~~~~~~~ Remaining events ~~~~~~~~~ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ?> - +
    @@ -554,25 +552,25 @@
    - +

    getName() ?> useEventPersonQuery()->useUserRoleQuery()->useRoleQuery()->filterByGroup($group)->endUse()->endUse()->endUse()->orderByDate('desc')->findOne() ?> - + getDate()) ?> - + never - +

    - +
    @@ -586,10 +584,10 @@ @@ -615,7 +613,7 @@ - + Roles:count() ?>
      count() > 0 ? '' : '
    • No roles
    • ' ?> - +
    • getRole()->getGroup()->getName() ?>: getRole()->getName() ?> getReserve() ? ' (reserve)' : '' ?>
    • - +
    diff --git a/public/old/license.php b/public/old/license.php index b0245221..389e3103 100755 --- a/public/old/license.php +++ b/public/old/license.php @@ -22,7 +22,7 @@ You should have received a copy of the GNU General Public License along with Church Rota. If not, see . */ -include 'includes/header.php'; ?> +include 'includes/header.php'; ?>

    License

                        GNU GENERAL PUBLIC LICENSE
    diff --git a/public/old/linkSocialAuth.php b/public/old/linkSocialAuth.php index c97c2dca..ac5face1 100644 --- a/public/old/linkSocialAuth.php +++ b/public/old/linkSocialAuth.php @@ -88,37 +88,37 @@
    - +

    Social login has not been enabled.

    Speak with your site administrator if you think this feature should be enabled.

    - + - +

    - +
    - +
    - +
    - +

    - +
    @@ -116,9 +116,9 @@ '.$sentSuccess.'
    '; - endif; + } ?> diff --git a/public/old/pendingAccounts.php b/public/old/pendingAccounts.php index c5f45243..3533dda9 100644 --- a/public/old/pendingAccounts.php +++ b/public/old/pendingAccounts.php @@ -59,7 +59,7 @@ // setup page $sql = "SELECT socialId, firstName, lastName, email, approved, declined, source FROM pendingUsers WHERE id = $id"; -$result = mysqli_query(db(), $sql) or die(mysqli_error(db())); +$result = mysqli_query(db(), $sql) or exit(mysqli_error(db())); $user = mysqli_fetch_object($result); if (!($user->approved == true || $user->declined == true)) { @@ -102,7 +102,7 @@

    Source: source ?>

    - + - + - +

    Merge with existing user

    @@ -132,9 +132,9 @@
    @@ -143,6 +143,6 @@ - + diff --git a/public/old/plugins/ckeditor/samples/old/assets/posteddata.php b/public/old/plugins/ckeditor/samples/old/assets/posteddata.php index 2d7e01f9..dfb57dec 100755 --- a/public/old/plugins/ckeditor/samples/old/assets/posteddata.php +++ b/public/old/plugins/ckeditor/samples/old/assets/posteddata.php @@ -4,7 +4,7 @@ Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or http://ckeditor.com/license */ -?> +?> @@ -35,7 +35,7 @@ $value = htmlspecialchars(stripslashes((string) $value)); } else { $value = htmlspecialchars((string) $value); - } ?> + } ?>
    @@ -43,7 +43,7 @@ +?> - 0): ?> + 0) { ?> - +
    @@ -232,7 +232,7 @@ $whereAnd = 'r.id = '.$role->roleId; } $sql = 'SELECT ur.id, u.firstName, u.lastName, r.name FROM users u INNER JOIN userRoles ur ON ur.userId = u.id INNER JOIN roles r ON r.id = ur.roleId WHERE u.id <> '.$role->userId.' AND '.$whereAnd.' ORDER BY lastName, firstName, r.name'; - $result = mysqli_query(db(), $sql) or die(mysqli_error(db())); + $result = mysqli_query(db(), $sql) or exit(mysqli_error(db())); while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) { ?> @@ -248,11 +248,11 @@
    - + - 0): ?> + 0) { ?> - +
    @@ -271,16 +271,16 @@
    - + - +

    There are no roles in the event you are skilled to cover.

    If you need adding to the rota, speak to an admin.

    - + diff --git a/public/old/swaps.php b/public/old/swaps.php index 261c745c..aca9d191 100644 --- a/public/old/swaps.php +++ b/public/old/swaps.php @@ -79,7 +79,7 @@
    - + getEventPerson()->getEvent() ?>
    @@ -101,24 +101,24 @@

    - getId()); $canDeclineSwap = canDeclineSwap($swap->getId()); ?> - + - +
    - +
    diff --git a/public/old/tableView.php b/public/old/tableView.php index 9a7eaa5d..573612e3 100755 --- a/public/old/tableView.php +++ b/public/old/tableView.php @@ -58,7 +58,7 @@ $sqlSettings = 'SELECT * FROM settings'; - $resultSettings = mysqli_query(db(), $sqlSettings) or die(mysqli_error(db())); + $resultSettings = mysqli_query(db(), $sqlSettings) or exit(mysqli_error(db())); $rowSettings = mysqli_fetch_array($resultSettings, MYSQLI_ASSOC); $lang_locale = $rowSettings['lang_locale']; $time_format_short = $rowSettings['time_format_short']; @@ -83,7 +83,7 @@ } $sql = 'SELECT count(*) AS colcount FROM groups g'; - $result = mysqli_query(db(), $sql) or die(mysqli_error(db())); + $result = mysqli_query(db(), $sql) or exit(mysqli_error(db())); $row = mysqli_fetch_array($result, MYSQLI_ASSOC); $colCnt = $row['colcount'] + 2; @@ -116,7 +116,7 @@ WHERE '.$whereTwoMonth.' AND e.removed = 0) ORDER BY name'; - $result = mysqli_query(db(), $filter_sql) or die(mysqli_error(db())); + $result = mysqli_query(db(), $filter_sql) or exit(mysqli_error(db())); while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) { ?> @@ -135,7 +135,7 @@ Event '; @@ -179,7 +179,7 @@ e.date'; } - $result = mysqli_query(db(), $sql) or die(mysqli_error(db())); + $result = mysqli_query(db(), $sql) or exit(mysqli_error(db())); while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) { $eventID = $row['id']; $preacher = ''; @@ -234,7 +234,7 @@ for ($i = 0; $i < count($categoryID); $i++) { $peopleInEvent = false; echo ''; - $resultPeople = mysqli_query(db(), $sqlPeople) or die(mysqli_error(db())); + $resultPeople = mysqli_query(db(), $sqlPeople) or exit(mysqli_error(db())); $previousName = ''; while ($viewPeople = mysqli_fetch_array($resultPeople, MYSQLI_ASSOC)) { $groupID = $viewPeople['groupId']; diff --git a/public/old/update.settings.php b/public/old/update.settings.php index e018f1f9..c8062ab0 100755 --- a/public/old/update.settings.php +++ b/public/old/update.settings.php @@ -53,7 +53,7 @@ function detectBrowserLanguage() $language = detectBrowserLanguage(); $sqlSettings = 'select * from settings'; -$resultSettings = mysqli_query(db(), $sqlSettings) or die(mysqli_error(db())); +$resultSettings = mysqli_query(db(), $sqlSettings) or exit(mysqli_error(db())); $rowSettings = mysqli_fetch_array($resultSettings, MYSQLI_ASSOC); if ($action == 'update') { @@ -81,7 +81,7 @@ function detectBrowserLanguage() //notifyInfo(__FILE__,"settings updated",$_SESSION['userid']); $sqlSettings = 'select * from settings'; - $resultSettings = mysqli_query(db(), $sqlSettings) or die(mysqli_error(db())); + $resultSettings = mysqli_query(db(), $sqlSettings) or exit(mysqli_error(db())); $rowSettings = mysqli_fetch_array($resultSettings, MYSQLI_ASSOC); $updateNotification = 'Settings updated successfully to: '.$rowSettings['lang_locale'].'
     
    '; diff --git a/public/plugins/ckeditor/samples/old/assets/posteddata.php b/public/plugins/ckeditor/samples/old/assets/posteddata.php index 2d7e01f9..dfb57dec 100755 --- a/public/plugins/ckeditor/samples/old/assets/posteddata.php +++ b/public/plugins/ckeditor/samples/old/assets/posteddata.php @@ -4,7 +4,7 @@ Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or http://ckeditor.com/license */ -?> +?> @@ -35,7 +35,7 @@ $value = htmlspecialchars(stripslashes((string) $value)); } else { $value = htmlspecialchars((string) $value); - } ?> + } ?>
    @@ -43,7 +43,7 @@ +?>