diff --git a/composer.lock b/composer.lock index 20505546a..2a27d7605 100644 --- a/composer.lock +++ b/composer.lock @@ -54,16 +54,16 @@ }, { "name": "cakephp/cakephp", - "version": "3.8.6", + "version": "3.8.7", "source": { "type": "git", "url": "https://github.com/cakephp/cakephp.git", - "reference": "34833a0c02fc1fc21e27ceb69cf7b4f7c131a3cc" + "reference": "bf96319a3688c191742d4a3a1680740abef1b371" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cakephp/cakephp/zipball/34833a0c02fc1fc21e27ceb69cf7b4f7c131a3cc", - "reference": "34833a0c02fc1fc21e27ceb69cf7b4f7c131a3cc", + "url": "https://api.github.com/repos/cakephp/cakephp/zipball/bf96319a3688c191742d4a3a1680740abef1b371", + "reference": "bf96319a3688c191742d4a3a1680740abef1b371", "shasum": "" }, "require": { @@ -139,30 +139,29 @@ "rapid-development", "validation" ], - "time": "2019-11-07T01:11:43+00:00" + "time": "2019-12-08T02:59:05+00:00" }, { "name": "cakephp/chronos", - "version": "1.2.8", + "version": "1.3.0", "source": { "type": "git", "url": "https://github.com/cakephp/chronos.git", - "reference": "0292f06e8cc23fc82f0574889da2d8bf27b613c1" + "reference": "ba2bab98849e7bf29b02dd634ada49ab36472959" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cakephp/chronos/zipball/0292f06e8cc23fc82f0574889da2d8bf27b613c1", - "reference": "0292f06e8cc23fc82f0574889da2d8bf27b613c1", + "url": "https://api.github.com/repos/cakephp/chronos/zipball/ba2bab98849e7bf29b02dd634ada49ab36472959", + "reference": "ba2bab98849e7bf29b02dd634ada49ab36472959", "shasum": "" }, "require": { - "php": "^5.5.9|^7" + "php": ">=5.6" }, "require-dev": { "athletic/athletic": "~0.1", "cakephp/cakephp-codesniffer": "^3.0", "phpbench/phpbench": "@dev", - "phpstan/phpstan": "^0.6.4", "phpunit/phpunit": "<6.0 || ^7.0" }, "type": "library", @@ -196,20 +195,20 @@ "datetime", "time" ], - "time": "2019-06-17T15:19:18+00:00" + "time": "2019-11-30T02:33:19+00:00" }, { "name": "cakephp/migrations", - "version": "2.4.0", + "version": "2.4.1", "source": { "type": "git", "url": "https://github.com/cakephp/migrations.git", - "reference": "643e54e627e876c10b5ffa1c706a6819aa6a70b9" + "reference": "1532530fd06d453668e7e32cf9fc3246d7f377cb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cakephp/migrations/zipball/643e54e627e876c10b5ffa1c706a6819aa6a70b9", - "reference": "643e54e627e876c10b5ffa1c706a6819aa6a70b9", + "url": "https://api.github.com/repos/cakephp/migrations/zipball/1532530fd06d453668e7e32cf9fc3246d7f377cb", + "reference": "1532530fd06d453668e7e32cf9fc3246d7f377cb", "shasum": "" }, "require": { @@ -221,7 +220,7 @@ "require-dev": { "cakephp/bake": "^1.7.0", "cakephp/cakephp": "^3.6.0", - "cakephp/cakephp-codesniffer": "^3.0", + "cakephp/cakephp-codesniffer": "dev-master", "phpunit/phpunit": "^5.7.14|^6.0" }, "suggest": { @@ -243,13 +242,13 @@ "homepage": "https://github.com/cakephp/migrations/graphs/contributors" } ], - "description": "Database Migration plugin for CakePHP 3.0 based on Phinx", + "description": "Database Migration plugin for CakePHP based on Phinx", "homepage": "https://github.com/cakephp/migrations", "keywords": [ "cakephp", "migrations" ], - "time": "2019-11-10T15:12:59+00:00" + "time": "2019-12-13T05:04:15+00:00" }, { "name": "cakephp/plugin-installer", @@ -708,16 +707,16 @@ }, { "name": "robmorgan/phinx", - "version": "0.11.1", + "version": "0.11.3", "source": { "type": "git", "url": "https://github.com/cakephp/phinx.git", - "reference": "a6cced878695d26396b26dfd62ce300aea07de05" + "reference": "3c6a171b0455225cf42716dc4864feb620da716f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cakephp/phinx/zipball/a6cced878695d26396b26dfd62ce300aea07de05", - "reference": "a6cced878695d26396b26dfd62ce300aea07de05", + "url": "https://api.github.com/repos/cakephp/phinx/zipball/3c6a171b0455225cf42716dc4864feb620da716f", + "reference": "3c6a171b0455225cf42716dc4864feb620da716f", "shasum": "" }, "require": { @@ -726,9 +725,9 @@ "cakephp/database": "^3.6", "cakephp/datasource": "^3.6", "php": ">=5.6", - "symfony/config": "^3.4|^4.0", - "symfony/console": "^3.4|^4.0", - "symfony/yaml": "^3.4|^4.0" + "symfony/config": "^3.4|^4.0|^5.0", + "symfony/console": "^3.4|^4.0|^5.0", + "symfony/yaml": "^3.4|^4.0|^5.0" }, "require-dev": { "cakephp/cakephp-codesniffer": "^3.0", @@ -781,36 +780,36 @@ "migrations", "phinx" ], - "time": "2019-08-28T12:24:19+00:00" + "time": "2019-12-12T16:53:38+00:00" }, { "name": "symfony/config", - "version": "v4.4.0", + "version": "v5.0.1", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "f08e1c48e1f05d07c32f2d8599ed539e62105beb" + "reference": "c0773efcc2c940ffbc4c34a0dba2836f2cf6dc9c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/f08e1c48e1f05d07c32f2d8599ed539e62105beb", - "reference": "f08e1c48e1f05d07c32f2d8599ed539e62105beb", + "url": "https://api.github.com/repos/symfony/config/zipball/c0773efcc2c940ffbc4c34a0dba2836f2cf6dc9c", + "reference": "c0773efcc2c940ffbc4c34a0dba2836f2cf6dc9c", "shasum": "" }, "require": { - "php": "^7.1.3", - "symfony/filesystem": "^3.4|^4.0|^5.0", + "php": "^7.2.5", + "symfony/filesystem": "^4.4|^5.0", "symfony/polyfill-ctype": "~1.8" }, "conflict": { - "symfony/finder": "<3.4" + "symfony/finder": "<4.4" }, "require-dev": { - "symfony/event-dispatcher": "^3.4|^4.0|^5.0", - "symfony/finder": "^3.4|^4.0|^5.0", - "symfony/messenger": "^4.1|^5.0", + "symfony/event-dispatcher": "^4.4|^5.0", + "symfony/finder": "^4.4|^5.0", + "symfony/messenger": "^4.4|^5.0", "symfony/service-contracts": "^1.1|^2", - "symfony/yaml": "^3.4|^4.0|^5.0" + "symfony/yaml": "^4.4|^5.0" }, "suggest": { "symfony/yaml": "To use the yaml reference dumper" @@ -818,7 +817,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.4-dev" + "dev-master": "5.0-dev" } }, "autoload": { @@ -845,20 +844,20 @@ ], "description": "Symfony Config Component", "homepage": "https://symfony.com", - "time": "2019-11-16T15:22:42+00:00" + "time": "2019-12-01T10:51:15+00:00" }, { "name": "symfony/console", - "version": "v4.4.0", + "version": "v4.4.1", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "35d9077f495c6d184d9930f7a7ecbd1ad13c7ab8" + "reference": "f0aea3df20d15635b3cb9730ca5eea1c65b7f201" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/35d9077f495c6d184d9930f7a7ecbd1ad13c7ab8", - "reference": "35d9077f495c6d184d9930f7a7ecbd1ad13c7ab8", + "url": "https://api.github.com/repos/symfony/console/zipball/f0aea3df20d15635b3cb9730ca5eea1c65b7f201", + "reference": "f0aea3df20d15635b3cb9730ca5eea1c65b7f201", "shasum": "" }, "require": { @@ -921,20 +920,20 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2019-11-13T07:39:40+00:00" + "time": "2019-12-01T10:06:17+00:00" }, { "name": "symfony/filesystem", - "version": "v4.4.0", + "version": "v4.4.1", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "d12b01cba60be77b583c9af660007211e3909854" + "reference": "40c2606131d56eff6f193b6e2ceb92414653b591" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/d12b01cba60be77b583c9af660007211e3909854", - "reference": "d12b01cba60be77b583c9af660007211e3909854", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/40c2606131d56eff6f193b6e2ceb92414653b591", + "reference": "40c2606131d56eff6f193b6e2ceb92414653b591", "shasum": "" }, "require": { @@ -971,11 +970,11 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2019-11-12T14:51:11+00:00" + "time": "2019-11-26T23:16:41+00:00" }, { "name": "symfony/polyfill-ctype", - "version": "v1.13.0", + "version": "v1.13.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", @@ -1033,7 +1032,7 @@ }, { "name": "symfony/polyfill-mbstring", - "version": "v1.13.0", + "version": "v1.13.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", @@ -1092,7 +1091,7 @@ }, { "name": "symfony/polyfill-php73", - "version": "v1.13.0", + "version": "v1.13.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php73.git", @@ -1150,20 +1149,20 @@ }, { "name": "symfony/service-contracts", - "version": "v2.0.0", + "version": "v2.0.1", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "9d99e1556417bf227a62e14856d630672bf10eaf" + "reference": "144c5e51266b281231e947b51223ba14acf1a749" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/9d99e1556417bf227a62e14856d630672bf10eaf", - "reference": "9d99e1556417bf227a62e14856d630672bf10eaf", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/144c5e51266b281231e947b51223ba14acf1a749", + "reference": "144c5e51266b281231e947b51223ba14acf1a749", "shasum": "" }, "require": { - "php": "^7.2.9", + "php": "^7.2.5", "psr/container": "^1.0" }, "suggest": { @@ -1204,31 +1203,31 @@ "interoperability", "standards" ], - "time": "2019-11-09T09:18:34+00:00" + "time": "2019-11-18T17:27:11+00:00" }, { "name": "symfony/yaml", - "version": "v4.4.0", + "version": "v5.0.1", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "76de473358fe802578a415d5bb43c296cf09d211" + "reference": "51b684480184fa767b97e28eaca67664e48dd3e9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/76de473358fe802578a415d5bb43c296cf09d211", - "reference": "76de473358fe802578a415d5bb43c296cf09d211", + "url": "https://api.github.com/repos/symfony/yaml/zipball/51b684480184fa767b97e28eaca67664e48dd3e9", + "reference": "51b684480184fa767b97e28eaca67664e48dd3e9", "shasum": "" }, "require": { - "php": "^7.1.3", + "php": "^7.2.5", "symfony/polyfill-ctype": "~1.8" }, "conflict": { - "symfony/console": "<3.4" + "symfony/console": "<4.4" }, "require-dev": { - "symfony/console": "^3.4|^4.0|^5.0" + "symfony/console": "^4.4|^5.0" }, "suggest": { "symfony/console": "For validating YAML files using the lint command" @@ -1236,7 +1235,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.4-dev" + "dev-master": "5.0-dev" } }, "autoload": { @@ -1263,7 +1262,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2019-11-12T14:51:11+00:00" + "time": "2019-11-18T17:27:11+00:00" }, { "name": "zendframework/zend-diactoros", @@ -1502,16 +1501,16 @@ }, { "name": "cakephp/bake", - "version": "1.11.2", + "version": "1.12.0", "source": { "type": "git", "url": "https://github.com/cakephp/bake.git", - "reference": "8598c3326541a16aa7b003ce322c44a34f90ad85" + "reference": "33e8ee8419ba36c13fa4074c208c93352b5530cf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cakephp/bake/zipball/8598c3326541a16aa7b003ce322c44a34f90ad85", - "reference": "8598c3326541a16aa7b003ce322c44a34f90ad85", + "url": "https://api.github.com/repos/cakephp/bake/zipball/33e8ee8419ba36c13fa4074c208c93352b5530cf", + "reference": "33e8ee8419ba36c13fa4074c208c93352b5530cf", "shasum": "" }, "require": { @@ -1527,7 +1526,7 @@ "type": "cakephp-plugin", "autoload": { "psr-4": { - "Bake\\": "src" + "Bake\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -1546,20 +1545,20 @@ "bake", "cakephp" ], - "time": "2019-07-30T02:08:16+00:00" + "time": "2019-12-07T20:34:43+00:00" }, { "name": "cakephp/cakephp-codesniffer", - "version": "3.2.1", + "version": "3.3.0", "source": { "type": "git", "url": "https://github.com/cakephp/cakephp-codesniffer.git", - "reference": "65ce18f4959d89f0bcbd8d1517734c68606a8186" + "reference": "7998a191e787fd5b68cb635d7050cb0d7b55e1a1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cakephp/cakephp-codesniffer/zipball/65ce18f4959d89f0bcbd8d1517734c68606a8186", - "reference": "65ce18f4959d89f0bcbd8d1517734c68606a8186", + "url": "https://api.github.com/repos/cakephp/cakephp-codesniffer/zipball/7998a191e787fd5b68cb635d7050cb0d7b55e1a1", + "reference": "7998a191e787fd5b68cb635d7050cb0d7b55e1a1", "shasum": "" }, "require": { @@ -1591,7 +1590,7 @@ "codesniffer", "framework" ], - "time": "2019-11-20T03:45:19+00:00" + "time": "2019-12-07T03:02:34+00:00" }, { "name": "cakephp/debug_kit", @@ -1655,16 +1654,16 @@ }, { "name": "composer/ca-bundle", - "version": "1.2.4", + "version": "1.2.5", "source": { "type": "git", "url": "https://github.com/composer/ca-bundle.git", - "reference": "10bb96592168a0f8e8f6dcde3532d9fa50b0b527" + "reference": "62e8fc2dc550e5d6d8c9360c7721662670f58149" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/ca-bundle/zipball/10bb96592168a0f8e8f6dcde3532d9fa50b0b527", - "reference": "10bb96592168a0f8e8f6dcde3532d9fa50b0b527", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/62e8fc2dc550e5d6d8c9360c7721662670f58149", + "reference": "62e8fc2dc550e5d6d8c9360c7721662670f58149", "shasum": "" }, "require": { @@ -1675,7 +1674,7 @@ "require-dev": { "phpunit/phpunit": "^4.8.35 || ^5.7 || 6.5 - 8", "psr/log": "^1.0", - "symfony/process": "^2.5 || ^3.0 || ^4.0" + "symfony/process": "^2.5 || ^3.0 || ^4.0 || ^5.0" }, "type": "library", "extra": { @@ -1707,7 +1706,7 @@ "ssl", "tls" ], - "time": "2019-08-30T08:44:50+00:00" + "time": "2019-12-11T14:44:42+00:00" }, { "name": "composer/composer", @@ -1957,25 +1956,25 @@ }, { "name": "dnoegel/php-xdg-base-dir", - "version": "0.1", + "version": "v0.1.1", "source": { "type": "git", "url": "https://github.com/dnoegel/php-xdg-base-dir.git", - "reference": "265b8593498b997dc2d31e75b89f053b5cc9621a" + "reference": "8f8a6e48c5ecb0f991c2fdcf5f154a47d85f9ffd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/dnoegel/php-xdg-base-dir/zipball/265b8593498b997dc2d31e75b89f053b5cc9621a", - "reference": "265b8593498b997dc2d31e75b89f053b5cc9621a", + "url": "https://api.github.com/repos/dnoegel/php-xdg-base-dir/zipball/8f8a6e48c5ecb0f991c2fdcf5f154a47d85f9ffd", + "reference": "8f8a6e48c5ecb0f991c2fdcf5f154a47d85f9ffd", "shasum": "" }, "require": { "php": ">=5.3.2" }, "require-dev": { - "phpunit/phpunit": "@stable" + "phpunit/phpunit": "~7.0|~6.0|~5.0|~4.8.35" }, - "type": "project", + "type": "library", "autoload": { "psr-4": { "XdgBaseDir\\": "src/" @@ -1986,7 +1985,7 @@ "MIT" ], "description": "implementation of xdg base directory specification for php", - "time": "2014-10-24T07:27:01+00:00" + "time": "2019-12-04T15:06:13+00:00" }, { "name": "doctrine/instantiator", @@ -2421,16 +2420,16 @@ }, { "name": "myclabs/deep-copy", - "version": "1.9.3", + "version": "1.9.4", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "007c053ae6f31bba39dfa19a7726f56e9763bbea" + "reference": "579bb7356d91f9456ccd505f24ca8b667966a0a7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/007c053ae6f31bba39dfa19a7726f56e9763bbea", - "reference": "007c053ae6f31bba39dfa19a7726f56e9763bbea", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/579bb7356d91f9456ccd505f24ca8b667966a0a7", + "reference": "579bb7356d91f9456ccd505f24ca8b667966a0a7", "shasum": "" }, "require": { @@ -2465,7 +2464,7 @@ "object", "object graph" ], - "time": "2019-08-09T12:45:53+00:00" + "time": "2019-12-15T19:12:40+00:00" }, { "name": "nikic/php-parser", @@ -3229,20 +3228,20 @@ }, { "name": "psy/psysh", - "version": "v0.9.11", + "version": "v0.9.12", "source": { "type": "git", "url": "https://github.com/bobthecow/psysh.git", - "reference": "75d9ac1c16db676de27ab554a4152b594be4748e" + "reference": "90da7f37568aee36b116a030c5f99c915267edd4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/bobthecow/psysh/zipball/75d9ac1c16db676de27ab554a4152b594be4748e", - "reference": "75d9ac1c16db676de27ab554a4152b594be4748e", + "url": "https://api.github.com/repos/bobthecow/psysh/zipball/90da7f37568aee36b116a030c5f99c915267edd4", + "reference": "90da7f37568aee36b116a030c5f99c915267edd4", "shasum": "" }, "require": { - "dnoegel/php-xdg-base-dir": "0.1", + "dnoegel/php-xdg-base-dir": "0.1.*", "ext-json": "*", "ext-tokenizer": "*", "jakub-onderka/php-console-highlighter": "0.3.*|0.4.*", @@ -3299,7 +3298,7 @@ "interactive", "shell" ], - "time": "2019-11-27T22:44:29+00:00" + "time": "2019-12-06T14:19:43+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", @@ -3955,16 +3954,16 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "3.5.2", + "version": "3.5.3", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "65b12cdeaaa6cd276d4c3033a95b9b88b12701e7" + "reference": "557a1fc7ac702c66b0bbfe16ab3d55839ef724cb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/65b12cdeaaa6cd276d4c3033a95b9b88b12701e7", - "reference": "65b12cdeaaa6cd276d4c3033a95b9b88b12701e7", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/557a1fc7ac702c66b0bbfe16ab3d55839ef724cb", + "reference": "557a1fc7ac702c66b0bbfe16ab3d55839ef724cb", "shasum": "" }, "require": { @@ -4002,11 +4001,11 @@ "phpcs", "standards" ], - "time": "2019-10-28T04:36:32+00:00" + "time": "2019-12-04T04:46:47+00:00" }, { "name": "symfony/finder", - "version": "v4.4.0", + "version": "v4.4.1", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", @@ -4055,16 +4054,16 @@ }, { "name": "symfony/process", - "version": "v4.4.0", + "version": "v4.4.1", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "75ad33d9b6f25325ebc396d68ad86fd74bcfbb06" + "reference": "51c0135ef3f44c5803b33dc60e96bf4f77752726" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/75ad33d9b6f25325ebc396d68ad86fd74bcfbb06", - "reference": "75ad33d9b6f25325ebc396d68ad86fd74bcfbb06", + "url": "https://api.github.com/repos/symfony/process/zipball/51c0135ef3f44c5803b33dc60e96bf4f77752726", + "reference": "51c0135ef3f44c5803b33dc60e96bf4f77752726", "shasum": "" }, "require": { @@ -4100,20 +4099,20 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2019-10-28T20:30:34+00:00" + "time": "2019-11-28T13:33:56+00:00" }, { "name": "symfony/var-dumper", - "version": "v5.0.0", + "version": "v5.0.1", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "956b8b6e4c52186695f592286414601abfcec284" + "reference": "a4862009387721e155be6dc115061f42ee209205" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/956b8b6e4c52186695f592286414601abfcec284", - "reference": "956b8b6e4c52186695f592286414601abfcec284", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/a4862009387721e155be6dc115061f42ee209205", + "reference": "a4862009387721e155be6dc115061f42ee209205", "shasum": "" }, "require": { @@ -4175,7 +4174,7 @@ "debug", "dump" ], - "time": "2019-11-18T17:27:11+00:00" + "time": "2019-11-28T14:20:16+00:00" }, { "name": "theseer/tokenizer", diff --git a/src/Controller/AdminErrorsController.php b/src/Controller/AdminErrorsController.php new file mode 100644 index 000000000..a9688008e --- /dev/null +++ b/src/Controller/AdminErrorsController.php @@ -0,0 +1,111 @@ +paginate = [ + 'contain' => ['StateUsers'] + ]; + $adminErrors = $this->paginate($this->AdminErrors); + + $this->set(compact('adminErrors')); + } + + /** + * View method + * + * @param string|null $id Admin Error id. + * @return \Cake\Http\Response|null + * @throws \Cake\Datasource\Exception\RecordNotFoundException When record not found. + */ + public function view($id = null) + { + $adminError = $this->AdminErrors->get($id, [ + 'contain' => ['StateUsers'] + ]); + + $this->set('adminError', $adminError); + } + + /** + * Add method + * + * @return \Cake\Http\Response|null Redirects on successful add, renders view otherwise. + */ + public function add() + { + $adminError = $this->AdminErrors->newEntity(); + if ($this->request->is('post')) { + $adminError = $this->AdminErrors->patchEntity($adminError, $this->request->getData()); + if ($this->AdminErrors->save($adminError)) { + $this->Flash->success(__('The admin error has been saved.')); + + return $this->redirect(['action' => 'index']); + } + $this->Flash->error(__('The admin error could not be saved. Please, try again.')); + } + $stateUsers = $this->AdminErrors->StateUsers->find('list', ['limit' => 200]); + $this->set(compact('adminError', 'stateUsers')); + } + + /** + * Edit method + * + * @param string|null $id Admin Error id. + * @return \Cake\Http\Response|null Redirects on successful edit, renders view otherwise. + * @throws \Cake\Datasource\Exception\RecordNotFoundException When record not found. + */ + public function edit($id = null) + { + $adminError = $this->AdminErrors->get($id, [ + 'contain' => [] + ]); + if ($this->request->is(['patch', 'post', 'put'])) { + $adminError = $this->AdminErrors->patchEntity($adminError, $this->request->getData()); + if ($this->AdminErrors->save($adminError)) { + $this->Flash->success(__('The admin error has been saved.')); + + return $this->redirect(['action' => 'index']); + } + $this->Flash->error(__('The admin error could not be saved. Please, try again.')); + } + $stateUsers = $this->AdminErrors->StateUsers->find('list', ['limit' => 200]); + $this->set(compact('adminError', 'stateUsers')); + } + + /** + * Delete method + * + * @param string|null $id Admin Error id. + * @return \Cake\Http\Response|null Redirects to index. + * @throws \Cake\Datasource\Exception\RecordNotFoundException When record not found. + */ + public function delete($id = null) + { + $this->request->allowMethod(['post', 'delete']); + $adminError = $this->AdminErrors->get($id); + if ($this->AdminErrors->delete($adminError)) { + $this->Flash->success(__('The admin error has been deleted.')); + } else { + $this->Flash->error(__('The admin error could not be deleted. Please, try again.')); + } + + return $this->redirect(['action' => 'index']); + } +} diff --git a/src/Controller/Component/JsonRequestClientComponent.php b/src/Controller/Component/JsonRequestClientComponent.php new file mode 100644 index 000000000..169f7a56b --- /dev/null +++ b/src/Controller/Component/JsonRequestClientComponent.php @@ -0,0 +1,60 @@ + 'error', 'type' => 'parameter error', 'msg' => 'session_id isn\'t numeric']; + } + if(!is_numeric($user_balance) || intval($user_balance) < 0) { + return ['state' => 'error', 'type' => 'parameter error', 'msg' => 'user_balance invalid']; + } + if(!$this->is_base64($base64Message)) { + return ['state' => 'error', 'type' => 'parameter error', 'msg' => 'base64Message contain invalid base64 characters']; + } + $http = new Client(); + + $transactionbody = json_encode([ + 'session_id' => $session_id, + 'transaction_base64' => $base64Message, + 'balance' => $user_balance + ]); + $response = $http->post($this->getLoginServerUrl() . '/checkTransaction', $transactionbody, ['type' => 'json']); + $responseStatus = $response->getStatusCode(); + if($responseStatus != 200) { + return ['state' => 'error', 'type' => 'request error', 'msg' => 'server response status code isn\'t 200', 'details' => $responseStatus]; + } + //$responseType = $response->getType(); + //if($responseType != 'application/json') { +// return ['state' => 'error', 'type' => 'request error', 'msg' => 'server response isn\'t json', 'details' => $responseType]; +// } + $json = $response->getJson(); + if($json == null) { + return ['state' => 'error', 'type' => 'request error', 'msg' => 'server response isn\'t valid json', 'details' => $responseType]; + } + return ['state' => 'success', 'data' => $json]; + } + + static public function getLoginServerUrl() + { + $loginServer = Configure::read('LoginServer'); + return $loginServer['host'] . ':' . $loginServer['port']; + } + + static public function is_base64($s) + { + return (bool) preg_match('/^[a-zA-Z0-9\/\r\n+]*={0,2}$/', $s); + } + +} diff --git a/src/Controller/TransactionCreationsController.php b/src/Controller/TransactionCreationsController.php index 8e3858d94..ced9727fb 100644 --- a/src/Controller/TransactionCreationsController.php +++ b/src/Controller/TransactionCreationsController.php @@ -28,6 +28,7 @@ class TransactionCreationsController extends AppController { parent::initialize(); $this->loadComponent('GradidoNumber'); + $this->loadComponent('JsonRequestClient'); //$this->Auth->allow(['add', 'edit']); //$this->Auth->allow('create'); } @@ -83,7 +84,7 @@ class TransactionCreationsController extends AppController // adding possible addresses + input field for copy $stateUserTable = TableRegistry::getTableLocator()->get('StateUsers'); - $stateUsers = $stateUserTable->find('all'); + $stateUsers = $stateUserTable->find('all')->contain(false); $receiverProposal = []; foreach($stateUsers as $stateUser) { $name = $stateUser->email; @@ -111,6 +112,7 @@ class TransactionCreationsController extends AppController if(count($receiverProposal) > $receiverIndex) { $pubKeyHex = $receiverProposal[$receiverIndex]['key']; $identHash = TransactionCreation::DRMakeStringHash($receiverProposal[$receiverIndex]['email']); + //echo "identHash: $identHash for " . $receiverProposal[$receiverIndex]['email']; } $builderResult = TransactionCreation::build( $amountCent, @@ -118,31 +120,35 @@ class TransactionCreationsController extends AppController $pubKeyHex, $identHash ); +// echo "builder result state: " . $builderResult['state'] . '
'; if($builderResult['state'] == 'success') { - $http = new Client(); - try { - $loginServer = Configure::read('LoginServer'); - $url = $loginServer['host'] . ':' . $loginServer['port']; - $session_id = $session->read('session_id'); - $response = $http->get($url . '/checkTransaction', [ - 'session_id' => $session_id, - 'transaction_base64' => base64_encode($builderResult['transactionBody']->serializeToString()), - 'balance' => $user['balance'] - ]); - //$json = $response->getJson(); - try { - $json = $response->getJson(); - } catch(Exception $ex) { - $this->Flash->error(__('result isn\'t json ') . $ex->getMessage()); + $user_balance = 0; + if(isset($user['balance'])) { + $user_balance = $user['balance']; + } + // $session_id, $base64Message, $user_balance = 0 + $requestResult = $this->JsonRequestClient->sendTransaction( + $session->read('session_id'), + base64_encode($builderResult['transactionBody']->serializeToString()), + $user_balance + ); + if($requestResult['state'] != 'success') { + $this->addAdminError('TransactionCreations', 'create', $requestResult, $user['id']); + if($requestResult['type'] == 'request error') { + $this->Flash->error(__('Error by requesting LoginServer, please try again')); + } else { + $this->Flash->error(__('Error, please wait for the admin to fix it')); } + } else { + $json = $requestResult['data']; if($json['state'] != 'success') { if($json['msg'] == 'session not found') { $session->destroy(); return $this->redirect(Router::url('/', true) . 'account', 303); - //$this->Flash->error(__('session not found, please login again')); } else { - $this->Flash->error(__('login server return error: ' . json_encode($json))); + $this->addAdminError('TransactionCreations', 'create', $json, $user['id']); + $this->Flash->error(__('Login Server Error, please wait for the admin to fix it')); } } else { $pendingTransactionCount = $session->read('Transactions.pending'); @@ -159,16 +165,10 @@ class TransactionCreationsController extends AppController $this->Flash->success(__('Transaction submitted for review.')); } } - - } catch(\Exception $e) { - $msg = $e->getMessage(); - $this->Flash->error(__('error http request: ') . $msg); } - } else { $this->Flash->error(__('Building transaction failed')); } - // */ } else { $this->Flash->error(__('Something was invalid, please try again!')); @@ -303,6 +303,8 @@ class TransactionCreationsController extends AppController $response = $http->post($url . '/checkTransaction', $transactionbody, ['type' => 'json']); //var_dump($response->getStringBody()); try { + //$stringBody = $response->getStringBody(); + //var_dump($stringBody); $json = $response->getJson(); } catch(Exception $ex) { $this->Flash->error(__('result isn\'t json ') . $ex->getMessage()); diff --git a/src/Controller/TransactionJsonRequestHandlerController.php b/src/Controller/TransactionJsonRequestHandlerController.php index 78b7662b3..651ccc97a 100644 --- a/src/Controller/TransactionJsonRequestHandlerController.php +++ b/src/Controller/TransactionJsonRequestHandlerController.php @@ -35,6 +35,7 @@ class TransactionJsonRequestHandlerController extends AppController { $method = $jsonData->method; switch($method) { case 'putTransaction': return $this->putTransaction($jsonData->transaction); + case 'userDelete': return $this->userDelete($jsonData->user); } return $this->returnJson(['state' => 'error', 'msg' => 'unknown method', 'details' => $method]); } @@ -64,6 +65,15 @@ class TransactionJsonRequestHandlerController extends AppController { return $this->returnJson(['state' => 'success']); } + private function userDelete($userPubkeyHex) { + $stateUserTable = TableRegistry::getTableLocator()->get('StateUsers'); + $user = $stateUserTable->find('all')->where(['public_key' => hex2bin($userPubkeyHex)]); + if(!$user || $user->count == 0) { + return $this->returnJson(['state' => 'error', 'msg' => 'user not found']); + } + + } + private function returnJsonSaveError($transaction, $errorArray) { $json = json_encode($errorArray); diff --git a/src/Model/Entity/AdminError.php b/src/Model/Entity/AdminError.php new file mode 100644 index 000000000..23c60fd4a --- /dev/null +++ b/src/Model/Entity/AdminError.php @@ -0,0 +1,41 @@ + true, + 'controller' => true, + 'action' => true, + 'state' => true, + 'msg' => true, + 'details' => true, + 'created' => true, + 'state_user' => true + ]; +} diff --git a/src/Model/Table/AdminErrorsTable.php b/src/Model/Table/AdminErrorsTable.php new file mode 100644 index 000000000..e6263d8ff --- /dev/null +++ b/src/Model/Table/AdminErrorsTable.php @@ -0,0 +1,107 @@ +setTable('admin_errors'); + $this->setDisplayField('id'); + $this->setPrimaryKey('id'); + + $this->addBehavior('Timestamp'); + + $this->belongsTo('StateUsers', [ + 'foreignKey' => 'state_user_id', + 'joinType' => 'INNER' + ]); + } + + /** + * Default validation rules. + * + * @param \Cake\Validation\Validator $validator Validator instance. + * @return \Cake\Validation\Validator + */ + public function validationDefault(Validator $validator) + { + $validator + ->integer('id') + ->allowEmptyString('id', null, 'create'); + + $validator + ->scalar('controller') + ->maxLength('controller', 255) + ->requirePresence('controller', 'create') + ->notEmptyString('controller'); + + $validator + ->scalar('action') + ->maxLength('action', 255) + ->requirePresence('action', 'create') + ->notEmptyString('action'); + + $validator + ->scalar('state') + ->maxLength('state', 255) + ->requirePresence('state', 'create') + ->notEmptyString('state'); + + $validator + ->scalar('msg') + ->maxLength('msg', 255) + ->requirePresence('msg', 'create') + ->notEmptyString('msg'); + + $validator + ->scalar('details') + ->maxLength('details', 255) + ->requirePresence('details', 'create') + ->notEmptyString('details'); + + return $validator; + } + + /** + * Returns a rules checker object that will be used for validating + * application integrity. + * + * @param \Cake\ORM\RulesChecker $rules The rules object to be modified. + * @return \Cake\ORM\RulesChecker + */ + public function buildRules(RulesChecker $rules) + { + $rules->add($rules->existsIn(['state_user_id'], 'StateUsers')); + + return $rules; + } +} diff --git a/src/Model/Transactions/TransactionCreation.php b/src/Model/Transactions/TransactionCreation.php index 668df706f..a62782898 100644 --- a/src/Model/Transactions/TransactionCreation.php +++ b/src/Model/Transactions/TransactionCreation.php @@ -97,8 +97,9 @@ class TransactionCreation extends TransactionBase { $existingCreations = $this->transactionCreationsTable ->find('all') ->select(['amount', 'state_user_id']) - ->contain(['StateUsers' => ['fields' => ['StateUsers.public_key']]]) - ->where(['ident_hash' => $identHashBin]); + ->contain(['StateUsers' => ['fields' => ['StateUsers.public_key']]]); + // uncomment because ident hash didn't work at the moment + //->where(['ident_hash' => $identHashBin]); //$existingCreations->select(['amount_sum' => $existingCreations->func()->sum('amount')]); $existingCreations->select(['amount', 'state_user_id']); $existingCreations->matching('Transactions', function ($q) { diff --git a/src/Template/AdminErrors/add.ctp b/src/Template/AdminErrors/add.ctp new file mode 100644 index 000000000..384adcf84 --- /dev/null +++ b/src/Template/AdminErrors/add.ctp @@ -0,0 +1,30 @@ + + +
+ Form->create($adminError) ?> +
+ + Form->control('state_user_id', ['options' => $stateUsers]); + echo $this->Form->control('controller'); + echo $this->Form->control('action'); + echo $this->Form->control('state'); + echo $this->Form->control('msg'); + echo $this->Form->control('details'); + ?> +
+ Form->button(__('Submit')) ?> + Form->end() ?> +
diff --git a/src/Template/AdminErrors/edit.ctp b/src/Template/AdminErrors/edit.ctp new file mode 100644 index 000000000..623744dd5 --- /dev/null +++ b/src/Template/AdminErrors/edit.ctp @@ -0,0 +1,36 @@ + + +
+ Form->create($adminError) ?> +
+ + Form->control('state_user_id', ['options' => $stateUsers]); + echo $this->Form->control('controller'); + echo $this->Form->control('action'); + echo $this->Form->control('state'); + echo $this->Form->control('msg'); + echo $this->Form->control('details'); + ?> +
+ Form->button(__('Submit')) ?> + Form->end() ?> +
diff --git a/src/Template/AdminErrors/index.ctp b/src/Template/AdminErrors/index.ctp new file mode 100644 index 000000000..d53dfb8ea --- /dev/null +++ b/src/Template/AdminErrors/index.ctp @@ -0,0 +1,61 @@ + + +
+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Paginator->sort('id') ?>Paginator->sort('state_user_id') ?>Paginator->sort('controller') ?>Paginator->sort('action') ?>Paginator->sort('state') ?>Paginator->sort('msg') ?>Paginator->sort('details') ?>Paginator->sort('created') ?>
Number->format($adminError->id) ?>has('state_user') ? $this->Html->link($adminError->state_user->id, ['controller' => 'StateUsers', 'action' => 'view', $adminError->state_user->id]) : '' ?>controller) ?>action) ?>state) ?>msg) ?>details) ?>created) ?> + Html->link(__('View'), ['action' => 'view', $adminError->id]) ?> + Html->link(__('Edit'), ['action' => 'edit', $adminError->id]) ?> + Form->postLink(__('Delete'), ['action' => 'delete', $adminError->id], ['confirm' => __('Are you sure you want to delete # {0}?', $adminError->id)]) ?> +
+
+ +

Paginator->counter(['format' => __('Page {{page}} of {{pages}}, showing {{current}} record(s) out of {{count}} total')]) ?>

+
+
diff --git a/src/Template/AdminErrors/view.ctp b/src/Template/AdminErrors/view.ctp new file mode 100644 index 000000000..64399e0d0 --- /dev/null +++ b/src/Template/AdminErrors/view.ctp @@ -0,0 +1,54 @@ + + +
+

id) ?>

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
has('state_user') ? $this->Html->link($adminError->state_user->id, ['controller' => 'StateUsers', 'action' => 'view', $adminError->state_user->id]) : '' ?>
controller) ?>
action) ?>
state) ?>
msg) ?>
details) ?>
Number->format($adminError->id) ?>
created) ?>
+