From 5a4f6ea8bf15dee0f942657caf5157020605dd0f Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 19 Jan 2021 05:26:15 +0000 Subject: [PATCH 1/2] Bump slim/csrf from 0.8.3 to 1.1.0 Bumps [slim/csrf](https://github.com/slimphp/Slim-Csrf) from 0.8.3 to 1.1.0. - [Release notes](https://github.com/slimphp/Slim-Csrf/releases) - [Changelog](https://github.com/slimphp/Slim-Csrf/blob/master/CHANGELOG.md) - [Commits](https://github.com/slimphp/Slim-Csrf/compare/0.8.3...1.1.0) Signed-off-by: dependabot-preview[bot] --- composer.json | 2 +- composer.lock | 359 ++++++++++++++++++++------------------------------ 2 files changed, 142 insertions(+), 219 deletions(-) diff --git a/composer.json b/composer.json index ecfe95da..a74cb461 100644 --- a/composer.json +++ b/composer.json @@ -36,7 +36,7 @@ "oscarotero/psr7-middlewares": "^3.20", "php-http/curl-client": "^1.6", "propel/propel": "~2.0@dev", - "slim/csrf": "^0.8.2", + "slim/csrf": "^1.1.0", "slim/slim": "^3.0", "slim/twig-view": "^2.2", "techwilk/twig-linewrap": "^1.0", diff --git a/composer.lock b/composer.lock index d1e3cdcc..422fe8ca 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "e0b211d308d7cf20e3bf529c4374c471", + "content-hash": "ee5b958e6af9cf2b9361a14c035936df", "packages": [ { "name": "aptoma/twig-markdown", @@ -867,55 +867,6 @@ "abandoned": "middlewares/*", "time": "2017-09-28T21:21:24+00:00" }, - { - "name": "paragonie/random_compat", - "version": "v2.0.17", - "source": { - "type": "git", - "url": "https://github.com/paragonie/random_compat.git", - "reference": "29af24f25bab834fcbb38ad2a69fa93b867e070d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/paragonie/random_compat/zipball/29af24f25bab834fcbb38ad2a69fa93b867e070d", - "reference": "29af24f25bab834fcbb38ad2a69fa93b867e070d", - "shasum": "" - }, - "require": { - "php": ">=5.2.0" - }, - "require-dev": { - "phpunit/phpunit": "4.*|5.*" - }, - "suggest": { - "ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes." - }, - "type": "library", - "autoload": { - "files": [ - "lib/random.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Paragon Initiative Enterprises", - "email": "security@paragonie.com", - "homepage": "https://paragonie.com" - } - ], - "description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7", - "keywords": [ - "csprng", - "polyfill", - "pseudorandom", - "random" - ], - "time": "2018-07-04T16:31:37+00:00" - }, { "name": "php-http/client-common", "version": "1.10.0", @@ -1646,6 +1597,9 @@ "request", "response" ], + "support": { + "source": "https://github.com/php-fig/http-factory/tree/master" + }, "time": "2019-04-30T12:38:16+00:00" }, { @@ -1696,8 +1650,125 @@ "request", "response" ], + "support": { + "source": "https://github.com/php-fig/http-message/tree/master" + }, "time": "2016-08-06T14:39:51+00:00" }, + { + "name": "psr/http-server-handler", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-server-handler.git", + "reference": "aff2f80e33b7f026ec96bb42f63242dc50ffcae7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-server-handler/zipball/aff2f80e33b7f026ec96bb42f63242dc50ffcae7", + "reference": "aff2f80e33b7f026ec96bb42f63242dc50ffcae7", + "shasum": "" + }, + "require": { + "php": ">=7.0", + "psr/http-message": "^1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Server\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP server-side request handler", + "keywords": [ + "handler", + "http", + "http-interop", + "psr", + "psr-15", + "psr-7", + "request", + "response", + "server" + ], + "support": { + "issues": "https://github.com/php-fig/http-server-handler/issues", + "source": "https://github.com/php-fig/http-server-handler/tree/master" + }, + "time": "2018-10-30T16:46:14+00:00" + }, + { + "name": "psr/http-server-middleware", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-server-middleware.git", + "reference": "2296f45510945530b9dceb8bcedb5cb84d40c5f5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-server-middleware/zipball/2296f45510945530b9dceb8bcedb5cb84d40c5f5", + "reference": "2296f45510945530b9dceb8bcedb5cb84d40c5f5", + "shasum": "" + }, + "require": { + "php": ">=7.0", + "psr/http-message": "^1.0", + "psr/http-server-handler": "^1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Server\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP server-side middleware", + "keywords": [ + "http", + "http-interop", + "middleware", + "psr", + "psr-15", + "psr-7", + "request", + "response" + ], + "support": { + "issues": "https://github.com/php-fig/http-server-middleware/issues", + "source": "https://github.com/php-fig/http-server-middleware/tree/master" + }, + "time": "2018-10-30T17:12:04+00:00" + }, { "name": "psr/log", "version": "1.1.2", @@ -1787,26 +1858,29 @@ }, { "name": "slim/csrf", - "version": "0.8.3", + "version": "1.1.0", "source": { "type": "git", "url": "https://github.com/slimphp/Slim-Csrf.git", - "reference": "5f2bcf5d89adf86dc0455a32bea84d912ab466a7" + "reference": "fd03c9ed0aaf62c85bbb775aae2126a69e8a5f72" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/slimphp/Slim-Csrf/zipball/5f2bcf5d89adf86dc0455a32bea84d912ab466a7", - "reference": "5f2bcf5d89adf86dc0455a32bea84d912ab466a7", + "url": "https://api.github.com/repos/slimphp/Slim-Csrf/zipball/fd03c9ed0aaf62c85bbb775aae2126a69e8a5f72", + "reference": "fd03c9ed0aaf62c85bbb775aae2126a69e8a5f72", "shasum": "" }, "require": { - "paragonie/random_compat": "^1.1|^2.0|^9.99", - "php": ">=5.5.0", - "psr/http-message": "^1.0" + "php": "^7.1", + "psr/http-factory": "^1.0", + "psr/http-message": "^1.0", + "psr/http-server-handler": "^1.0", + "psr/http-server-middleware": "^1.0" }, "require-dev": { - "phpunit/phpunit": "^4.0", - "slim/slim": "~3.0" + "phpspec/prophecy": "^1.10", + "phpunit/phpunit": "^7.5", + "squizlabs/php_codesniffer": "^3.5.8" }, "type": "library", "autoload": { @@ -1825,7 +1899,7 @@ "homepage": "http://joshlockhart.com" } ], - "description": "Slim Framework 3 CSRF protection middleware", + "description": "Slim Framework 4 CSRF protection PSR-15 middleware", "homepage": "http://slimframework.com", "keywords": [ "csrf", @@ -1833,7 +1907,11 @@ "middleware", "slim" ], - "time": "2018-08-22T16:12:18+00:00" + "support": { + "issues": "https://github.com/slimphp/Slim-Csrf/issues", + "source": "https://github.com/slimphp/Slim-Csrf/tree/1.1.0" + }, + "time": "2021-01-08T00:36:54+00:00" }, { "name": "slim/slim", @@ -2947,102 +3025,6 @@ ], "time": "2019-10-21T16:45:58+00:00" }, - { - "name": "guzzle/guzzle", - "version": "v3.9.3", - "source": { - "type": "git", - "url": "https://github.com/guzzle/guzzle3.git", - "reference": "0645b70d953bc1c067bbc8d5bc53194706b628d9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle3/zipball/0645b70d953bc1c067bbc8d5bc53194706b628d9", - "reference": "0645b70d953bc1c067bbc8d5bc53194706b628d9", - "shasum": "" - }, - "require": { - "ext-curl": "*", - "php": ">=5.3.3", - "symfony/event-dispatcher": "~2.1" - }, - "replace": { - "guzzle/batch": "self.version", - "guzzle/cache": "self.version", - "guzzle/common": "self.version", - "guzzle/http": "self.version", - "guzzle/inflection": "self.version", - "guzzle/iterator": "self.version", - "guzzle/log": "self.version", - "guzzle/parser": "self.version", - "guzzle/plugin": "self.version", - "guzzle/plugin-async": "self.version", - "guzzle/plugin-backoff": "self.version", - "guzzle/plugin-cache": "self.version", - "guzzle/plugin-cookie": "self.version", - "guzzle/plugin-curlauth": "self.version", - "guzzle/plugin-error-response": "self.version", - "guzzle/plugin-history": "self.version", - "guzzle/plugin-log": "self.version", - "guzzle/plugin-md5": "self.version", - "guzzle/plugin-mock": "self.version", - "guzzle/plugin-oauth": "self.version", - "guzzle/service": "self.version", - "guzzle/stream": "self.version" - }, - "require-dev": { - "doctrine/cache": "~1.3", - "monolog/monolog": "~1.0", - "phpunit/phpunit": "3.7.*", - "psr/log": "~1.0", - "symfony/class-loader": "~2.1", - "zendframework/zend-cache": "2.*,<2.3", - "zendframework/zend-log": "2.*,<2.3" - }, - "suggest": { - "guzzlehttp/guzzle": "Guzzle 5 has moved to a new package name. The package you have installed, Guzzle 3, is deprecated." - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.9-dev" - } - }, - "autoload": { - "psr-0": { - "Guzzle": "src/", - "Guzzle\\Tests": "tests/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - }, - { - "name": "Guzzle Community", - "homepage": "https://github.com/guzzle/guzzle/contributors" - } - ], - "description": "PHP HTTP client. This library is deprecated in favor of https://packagist.org/packages/guzzlehttp/guzzle", - "homepage": "http://guzzlephp.org/", - "keywords": [ - "client", - "curl", - "framework", - "http", - "http client", - "rest", - "web service" - ], - "abandoned": "guzzlehttp/guzzle", - "time": "2015-03-18T18:23:50+00:00" - }, { "name": "myclabs/deep-copy", "version": "1.9.3", @@ -4392,66 +4374,6 @@ "homepage": "https://github.com/sebastianbergmann/version", "time": "2016-10-03T07:35:21+00:00" }, - { - "name": "symfony/event-dispatcher", - "version": "v2.8.32", - "source": { - "type": "git", - "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "b59aacf238fadda50d612c9de73b74751872a903" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/b59aacf238fadda50d612c9de73b74751872a903", - "reference": "b59aacf238fadda50d612c9de73b74751872a903", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "require-dev": { - "psr/log": "~1.0", - "symfony/config": "^2.0.5|~3.0.0", - "symfony/dependency-injection": "~2.6|~3.0.0", - "symfony/expression-language": "~2.6|~3.0.0", - "symfony/stopwatch": "~2.3|~3.0.0" - }, - "suggest": { - "symfony/dependency-injection": "", - "symfony/http-kernel": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.8-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\EventDispatcher\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony EventDispatcher Component", - "homepage": "https://symfony.com", - "time": "2017-11-05T15:25:56+00:00" - }, { "name": "symfony/stopwatch", "version": "v3.4.22", @@ -4553,5 +4475,6 @@ "platform-dev": [], "platform-overrides": { "php": "7.1.0" - } + }, + "plugin-api-version": "2.0.0" } From 73c6c74ecee6e35d0a36defcd614fcdf7f7b3f72 Mon Sep 17 00:00:00 2001 From: Christopher Wilkinson Date: Tue, 19 Jan 2021 05:26:24 +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/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/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 | 16 ++-- 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/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 | 36 ++++---- public/old/swaps.php | 16 ++-- public/old/tableView.php | 12 +-- .../samples/old/assets/posteddata.php | 6 +- src/classes/Controller/InstallController.php | 5 +- tests/Integration/BaseTestCase.php | 26 +++--- tests/Unit/BaseTestCase.php | 26 +++--- tests/Unit/CryptTest.php | 40 ++++----- tests/Unit/EmailAddressTest.php | 14 +-- 47 files changed, 465 insertions(+), 462 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) { ?>
- + - + - +
- +
- 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/includes/config.php b/public/old/includes/config.php index b9efcc93..b217b2e4 100644 --- a/public/old/includes/config.php +++ b/public/old/includes/config.php @@ -17,10 +17,10 @@ } // Connect to the database server -$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."); +$dbh = @mysqli_connect($config['db']['host'], $config['db']['user'], $config['db']['pass']) or exit('Connection to '.$config['db']['host']." with login '".$config['db']['user']."'/'$pwdMasked' failed."); // Choose the right database -$db = @mysqli_select_db($dbh, $config['db']['dbname']) or die("Connection made, but database '".$config['db']['dbname']."' was not found."); +$db = @mysqli_select_db($dbh, $config['db']['dbname']) or exit("Connection made, but database '".$config['db']['dbname']."' was not found."); // allow config to be fetched in functions diff --git a/public/old/includes/footer.php b/public/old/includes/footer.php index 621c8d96..9fa5ab27 100755 --- a/public/old/includes/footer.php +++ b/public/old/includes/footer.php @@ -21,7 +21,7 @@ along with Church Rota. If not, see . */ -?> +?>
@@ -118,9 +118,11 @@ - + - + seen == false) { $unseen += 1; } - } - ?> + } ?>
  • @@ -357,12 +356,12 @@ */ - if (isset($_SESSION['userid'])): ?> + if (isset($_SESSION['userid'])) { ?> - +
  • @@ -470,7 +469,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)) { ?> @@ -486,11 +485,11 @@
  • > View All
  • - +
  • > Add Event
  • - + > Settings - +
  • >Login
  • - + 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 9426c8d8..aca9d191 100644 --- a/public/old/swaps.php +++ b/public/old/swaps.php @@ -79,7 +79,7 @@
    - + getEventPerson()->getEvent() ?>
    @@ -105,20 +105,20 @@ $canAcceptSwap = canAcceptSwap($swap->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/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 @@ +?>