diff --git a/composer.json b/composer.json index 3e30903..ec5a967 100644 --- a/composer.json +++ b/composer.json @@ -6,13 +6,14 @@ "license": "MIT", "require": { "php": ">=5.5.9", - "cakephp/cakephp": "3.7.*", + "cakephp/cakephp": "3.8.*", "mobiledetect/mobiledetectlib": "2.*", "cakephp/migrations": "~1.0", "cakephp/plugin-installer": "*", "sunra/php-simple-html-dom-parser": "^1.5", "spatie/array-to-xml": "^2.7", - "phpoffice/phpspreadsheet": "^1.5" + "phpoffice/phpspreadsheet": "^1.5", + "cakedc/users": "^8.4" }, "require-dev": { "psy/psysh": "@stable", diff --git a/composer.lock b/composer.lock index c6077dc..77d6d2b 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "520139bc99d21b2a3c8a43f89f907c30", + "content-hash": "d94f0d566d7dcdcbd0b86cc387673045", "packages": [ { "name": "aura/intl", @@ -53,17 +53,140 @@ "time": "2017-01-20T05:00:11+00:00" }, { - "name": "cakephp/cakephp", - "version": "3.7.7", + "name": "cakedc/auth", + "version": "3.0.4", "source": { "type": "git", - "url": "https://github.com/cakephp/cakephp.git", - "reference": "b0aeff37f78e6cca7ed35bc0e49dedd6cf5fb3d6" + "url": "https://github.com/CakeDC/auth.git", + "reference": "83ac6e545515acc1d0aaa440fb13ac1d1fe1ffa0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cakephp/cakephp/zipball/b0aeff37f78e6cca7ed35bc0e49dedd6cf5fb3d6", - "reference": "b0aeff37f78e6cca7ed35bc0e49dedd6cf5fb3d6", + "url": "https://api.github.com/repos/CakeDC/auth/zipball/83ac6e545515acc1d0aaa440fb13ac1d1fe1ffa0", + "reference": "83ac6e545515acc1d0aaa440fb13ac1d1fe1ffa0", + "shasum": "" + }, + "require": { + "cakephp/cakephp": "^3.6.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.0" + }, + "type": "cakephp-plugin", + "autoload": { + "psr-4": { + "CakeDC\\Auth\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "CakeDC", + "homepage": "https://www.cakedc.com", + "role": "Author" + }, + { + "name": "Others", + "homepage": "https://github.com/CakeDC/auth/graphs/contributors" + } + ], + "description": "Auth objects for CakePHP", + "homepage": "https://github.com/CakeDC/auth", + "keywords": [ + "Authentication", + "auth", + "cakedc", + "cakephp" + ], + "time": "2019-04-26T11:46:35+00:00" + }, + { + "name": "cakedc/users", + "version": "8.4.0", + "source": { + "type": "git", + "url": "https://github.com/CakeDC/users.git", + "reference": "3f817d9fe86e819a964ab2687a1adc4a33e7f2f8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/CakeDC/users/zipball/3f817d9fe86e819a964ab2687a1adc4a33e7f2f8", + "reference": "3f817d9fe86e819a964ab2687a1adc4a33e7f2f8", + "shasum": "" + }, + "require": { + "cakedc/auth": "^3.0", + "cakephp/cakephp": "^3.7" + }, + "require-dev": { + "cakephp/cakephp-codesniffer": "^2.0", + "google/recaptcha": "@stable", + "league/oauth2-facebook": "@stable", + "league/oauth2-google": "@stable", + "league/oauth2-instagram": "@stable", + "league/oauth2-linkedin": "@stable", + "luchianenco/oauth2-amazon": "^1.1", + "phpunit/phpunit": "^5.0", + "robthree/twofactorauth": "~1.6", + "yubico/u2flib-server": "^1.0" + }, + "suggest": { + "google/recaptcha": "Provides reCAPTCHA validation for registration form", + "league/oauth1-client": "Provides Social Authentication with Twitter", + "league/oauth2-facebook": "Provides Social Authentication with Facebook", + "league/oauth2-google": "Provides Social Authentication with Google+", + "league/oauth2-instagram": "Provides Social Authentication with Instagram", + "league/oauth2-linkedin": "Provides Social Authentication with LinkedIn", + "luchianenco/oauth2-amazon": "Provides Social Authentication with Amazon", + "robthree/twofactorauth": "Provides Google Authenticator functionality" + }, + "type": "cakephp-plugin", + "autoload": { + "psr-4": { + "CakeDC\\Users\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "CakeDC", + "homepage": "http://www.cakedc.com", + "role": "Author" + }, + { + "name": "Others", + "homepage": "https://github.com/CakeDC/users/graphs/contributors" + } + ], + "description": "Users Plugin for CakePHP", + "homepage": "https://github.com/CakeDC/users", + "keywords": [ + "Authentication", + "auth", + "cakedc", + "cakephp", + "oauth2" + ], + "time": "2019-03-13T12:15:25+00:00" + }, + { + "name": "cakephp/cakephp", + "version": "3.8.0", + "source": { + "type": "git", + "url": "https://github.com/cakephp/cakephp.git", + "reference": "69643f58dd110a4c5cce7ff867707de176c64bc4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/cakephp/cakephp/zipball/69643f58dd110a4c5cce7ff867707de176c64bc4", + "reference": "69643f58dd110a4c5cce7ff867707de176c64bc4", "shasum": "" }, "require": { @@ -139,20 +262,20 @@ "rapid-development", "validation" ], - "time": "2019-04-24T01:30:19+00:00" + "time": "2019-06-27T02:33:24+00:00" }, { "name": "cakephp/chronos", - "version": "1.2.5", + "version": "1.2.8", "source": { "type": "git", "url": "https://github.com/cakephp/chronos.git", - "reference": "8a2b005a2db173e1b5493002afb8e1e13c71a62a" + "reference": "0292f06e8cc23fc82f0574889da2d8bf27b613c1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cakephp/chronos/zipball/8a2b005a2db173e1b5493002afb8e1e13c71a62a", - "reference": "8a2b005a2db173e1b5493002afb8e1e13c71a62a", + "url": "https://api.github.com/repos/cakephp/chronos/zipball/0292f06e8cc23fc82f0574889da2d8bf27b613c1", + "reference": "0292f06e8cc23fc82f0574889da2d8bf27b613c1", "shasum": "" }, "require": { @@ -196,7 +319,7 @@ "datetime", "time" ], - "time": "2019-04-23T19:00:57+00:00" + "time": "2019-06-17T15:19:18+00:00" }, { "name": "cakephp/migrations", @@ -511,16 +634,16 @@ }, { "name": "phpoffice/phpspreadsheet", - "version": "1.6.0", + "version": "1.8.1", "source": { "type": "git", "url": "https://github.com/PHPOffice/PhpSpreadsheet.git", - "reference": "bf00f0cc5f55c354018f9a9ef15e6e3e1a229051" + "reference": "352c7002fefe4e4037d02654d853a1b09520946f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPOffice/PhpSpreadsheet/zipball/bf00f0cc5f55c354018f9a9ef15e6e3e1a229051", - "reference": "bf00f0cc5f55c354018f9a9ef15e6e3e1a229051", + "url": "https://api.github.com/repos/PHPOffice/PhpSpreadsheet/zipball/352c7002fefe4e4037d02654d853a1b09520946f", + "reference": "352c7002fefe4e4037d02654d853a1b09520946f", "shasum": "" }, "require": { @@ -601,7 +724,7 @@ "xls", "xlsx" ], - "time": "2019-01-02T04:42:54+00:00" + "time": "2019-07-01T20:46:51+00:00" }, { "name": "psr/http-message", @@ -816,24 +939,25 @@ }, { "name": "spatie/array-to-xml", - "version": "2.8.1", + "version": "2.11.0", "source": { "type": "git", "url": "https://github.com/spatie/array-to-xml.git", - "reference": "2bf193b3f795d5a42e147c4fa155c288878312e7" + "reference": "68a181261df9ba16688abb87d8658638157b8f90" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/array-to-xml/zipball/2bf193b3f795d5a42e147c4fa155c288878312e7", - "reference": "2bf193b3f795d5a42e147c4fa155c288878312e7", + "url": "https://api.github.com/repos/spatie/array-to-xml/zipball/68a181261df9ba16688abb87d8658638157b8f90", + "reference": "68a181261df9ba16688abb87d8658638157b8f90", "shasum": "" }, "require": { - "php": "^7.1" + "ext-dom": "*", + "php": "^7.2" }, "require-dev": { "mockery/mockery": "^1.0", - "phpunit/phpunit": "^7.0", + "phpunit/phpunit": "^8.0", "spatie/phpunit-snapshot-assertions": "^2.0" }, "type": "library", @@ -861,7 +985,7 @@ "convert", "xml" ], - "time": "2019-03-15T18:43:25+00:00" + "time": "2019-06-26T21:54:49+00:00" }, { "name": "sunra/php-simple-html-dom-parser", @@ -913,16 +1037,16 @@ }, { "name": "symfony/config", - "version": "v3.4.26", + "version": "v3.4.29", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "177a276c01575253c95cefe0866e3d1b57637fe0" + "reference": "29a33f66194fbe2ed4555981810f15fd8440e4a8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/177a276c01575253c95cefe0866e3d1b57637fe0", - "reference": "177a276c01575253c95cefe0866e3d1b57637fe0", + "url": "https://api.github.com/repos/symfony/config/zipball/29a33f66194fbe2ed4555981810f15fd8440e4a8", + "reference": "29a33f66194fbe2ed4555981810f15fd8440e4a8", "shasum": "" }, "require": { @@ -973,20 +1097,20 @@ ], "description": "Symfony Config Component", "homepage": "https://symfony.com", - "time": "2019-02-23T15:06:07+00:00" + "time": "2019-05-30T15:47:52+00:00" }, { "name": "symfony/console", - "version": "v3.4.26", + "version": "v3.4.29", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "15a9104356436cb26e08adab97706654799d31d8" + "reference": "c4d2f3529755ffc0be9fb823583b28d8744eeb3d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/15a9104356436cb26e08adab97706654799d31d8", - "reference": "15a9104356436cb26e08adab97706654799d31d8", + "url": "https://api.github.com/repos/symfony/console/zipball/c4d2f3529755ffc0be9fb823583b28d8744eeb3d", + "reference": "c4d2f3529755ffc0be9fb823583b28d8744eeb3d", "shasum": "" }, "require": { @@ -1045,20 +1169,20 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2019-04-08T09:29:13+00:00" + "time": "2019-06-05T11:33:52+00:00" }, { "name": "symfony/debug", - "version": "v4.2.7", + "version": "v4.3.2", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", - "reference": "2d279b6bb1d582dd5740d4d3251ae8c18812ed37" + "reference": "d8f4fb38152e0eb6a433705e5f661d25b32c5fcd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/2d279b6bb1d582dd5740d4d3251ae8c18812ed37", - "reference": "2d279b6bb1d582dd5740d4d3251ae8c18812ed37", + "url": "https://api.github.com/repos/symfony/debug/zipball/d8f4fb38152e0eb6a433705e5f661d25b32c5fcd", + "reference": "d8f4fb38152e0eb6a433705e5f661d25b32c5fcd", "shasum": "" }, "require": { @@ -1074,7 +1198,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.2-dev" + "dev-master": "4.3-dev" } }, "autoload": { @@ -1101,20 +1225,20 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2019-04-11T11:27:41+00:00" + "time": "2019-06-19T15:27:09+00:00" }, { "name": "symfony/filesystem", - "version": "v4.2.7", + "version": "v4.3.2", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "e16b9e471703b2c60b95f14d31c1239f68f11601" + "reference": "b9896d034463ad6fd2bf17e2bf9418caecd6313d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/e16b9e471703b2c60b95f14d31c1239f68f11601", - "reference": "e16b9e471703b2c60b95f14d31c1239f68f11601", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/b9896d034463ad6fd2bf17e2bf9418caecd6313d", + "reference": "b9896d034463ad6fd2bf17e2bf9418caecd6313d", "shasum": "" }, "require": { @@ -1124,7 +1248,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.2-dev" + "dev-master": "4.3-dev" } }, "autoload": { @@ -1151,7 +1275,7 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2019-02-07T11:40:08+00:00" + "time": "2019-06-23T08:51:25+00:00" }, { "name": "symfony/polyfill-ctype", @@ -1272,7 +1396,7 @@ }, { "name": "symfony/yaml", - "version": "v3.4.26", + "version": "v3.4.29", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", @@ -1568,20 +1692,20 @@ }, { "name": "cakephp/bake", - "version": "1.9.5", + "version": "1.11.0", "source": { "type": "git", "url": "https://github.com/cakephp/bake.git", - "reference": "8a93a8867a1fcf2e9ab0deff4c4651dcd4a478ac" + "reference": "0769020dda9e2014463fba9457b855017058fed4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cakephp/bake/zipball/8a93a8867a1fcf2e9ab0deff4c4651dcd4a478ac", - "reference": "8a93a8867a1fcf2e9ab0deff4c4651dcd4a478ac", + "url": "https://api.github.com/repos/cakephp/bake/zipball/0769020dda9e2014463fba9457b855017058fed4", + "reference": "0769020dda9e2014463fba9457b855017058fed4", "shasum": "" }, "require": { - "cakephp/cakephp": "^3.7.0", + "cakephp/cakephp": "^3.8.0", "cakephp/plugin-installer": "^1.0", "php": ">=5.6.0", "wyrihaximus/twig-view": "^4.3.7" @@ -1612,20 +1736,20 @@ "bake", "cakephp" ], - "time": "2019-04-13T01:13:37+00:00" + "time": "2019-07-01T22:46:19+00:00" }, { "name": "cakephp/debug_kit", - "version": "3.18.0", + "version": "3.19.0", "source": { "type": "git", "url": "https://github.com/cakephp/debug_kit.git", - "reference": "6f5ab6ad9a5f36e1ea32cf4fca1afc71d36a0f89" + "reference": "e2d856ed7c504b80354038b22d6f342c13ac5145" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cakephp/debug_kit/zipball/6f5ab6ad9a5f36e1ea32cf4fca1afc71d36a0f89", - "reference": "6f5ab6ad9a5f36e1ea32cf4fca1afc71d36a0f89", + "url": "https://api.github.com/repos/cakephp/debug_kit/zipball/e2d856ed7c504b80354038b22d6f342c13ac5145", + "reference": "e2d856ed7c504b80354038b22d6f342c13ac5145", "shasum": "" }, "require": { @@ -1672,7 +1796,7 @@ "debug", "kit" ], - "time": "2019-04-04T17:27:59+00:00" + "time": "2019-05-31T13:45:08+00:00" }, { "name": "composer/ca-bundle", @@ -1732,16 +1856,16 @@ }, { "name": "composer/composer", - "version": "1.8.5", + "version": "1.8.6", "source": { "type": "git", "url": "https://github.com/composer/composer.git", - "reference": "949b116f9e7d98d8d276594fed74b580d125c0e6" + "reference": "19b5f66a0e233eb944f134df34091fe1c5dfcc11" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/composer/zipball/949b116f9e7d98d8d276594fed74b580d125c0e6", - "reference": "949b116f9e7d98d8d276594fed74b580d125c0e6", + "url": "https://api.github.com/repos/composer/composer/zipball/19b5f66a0e233eb944f134df34091fe1c5dfcc11", + "reference": "19b5f66a0e233eb944f134df34091fe1c5dfcc11", "shasum": "" }, "require": { @@ -1808,7 +1932,7 @@ "dependency", "package" ], - "time": "2019-04-09T15:46:48+00:00" + "time": "2019-06-11T13:03:06+00:00" }, { "name": "composer/semver", @@ -1934,16 +2058,16 @@ }, { "name": "composer/xdebug-handler", - "version": "1.3.2", + "version": "1.3.3", "source": { "type": "git", "url": "https://github.com/composer/xdebug-handler.git", - "reference": "d17708133b6c276d6e42ef887a877866b909d892" + "reference": "46867cbf8ca9fb8d60c506895449eb799db1184f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/d17708133b6c276d6e42ef887a877866b909d892", - "reference": "d17708133b6c276d6e42ef887a877866b909d892", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/46867cbf8ca9fb8d60c506895449eb799db1184f", + "reference": "46867cbf8ca9fb8d60c506895449eb799db1184f", "shasum": "" }, "require": { @@ -1974,7 +2098,7 @@ "Xdebug", "performance" ], - "time": "2019-01-28T20:25:53+00:00" + "time": "2019-05-27T17:52:04+00:00" }, { "name": "dnoegel/php-xdg-base-dir", @@ -2275,16 +2399,16 @@ }, { "name": "nikic/php-parser", - "version": "v4.2.1", + "version": "v4.2.2", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "5221f49a608808c1e4d436df32884cbc1b821ac0" + "reference": "1bd73cc04c3843ad8d6b0bfc0956026a151fc420" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/5221f49a608808c1e4d436df32884cbc1b821ac0", - "reference": "5221f49a608808c1e4d436df32884cbc1b821ac0", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/1bd73cc04c3843ad8d6b0bfc0956026a151fc420", + "reference": "1bd73cc04c3843ad8d6b0bfc0956026a151fc420", "shasum": "" }, "require": { @@ -2322,7 +2446,7 @@ "parser", "php" ], - "time": "2019-02-16T20:54:15+00:00" + "time": "2019-05-25T20:07:01+00:00" }, { "name": "psy/psysh", @@ -2493,16 +2617,16 @@ }, { "name": "symfony/finder", - "version": "v4.2.7", + "version": "v4.3.2", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "e45135658bd6c14b61850bf131c4f09a55133f69" + "reference": "33c21f7d5d3dc8a140c282854a7e13aeb5d0f91a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/e45135658bd6c14b61850bf131c4f09a55133f69", - "reference": "e45135658bd6c14b61850bf131c4f09a55133f69", + "url": "https://api.github.com/repos/symfony/finder/zipball/33c21f7d5d3dc8a140c282854a7e13aeb5d0f91a", + "reference": "33c21f7d5d3dc8a140c282854a7e13aeb5d0f91a", "shasum": "" }, "require": { @@ -2511,7 +2635,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.2-dev" + "dev-master": "4.3-dev" } }, "autoload": { @@ -2538,7 +2662,7 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2019-04-06T13:51:08+00:00" + "time": "2019-06-13T11:03:18+00:00" }, { "name": "symfony/polyfill-php72", @@ -2597,16 +2721,16 @@ }, { "name": "symfony/process", - "version": "v4.2.7", + "version": "v4.3.2", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "8cf39fb4ccff793340c258ee7760fd40bfe745fe" + "reference": "856d35814cf287480465bb7a6c413bb7f5f5e69c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/8cf39fb4ccff793340c258ee7760fd40bfe745fe", - "reference": "8cf39fb4ccff793340c258ee7760fd40bfe745fe", + "url": "https://api.github.com/repos/symfony/process/zipball/856d35814cf287480465bb7a6c413bb7f5f5e69c", + "reference": "856d35814cf287480465bb7a6c413bb7f5f5e69c", "shasum": "" }, "require": { @@ -2615,7 +2739,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.2-dev" + "dev-master": "4.3-dev" } }, "autoload": { @@ -2642,20 +2766,20 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2019-04-10T16:20:36+00:00" + "time": "2019-05-30T16:10:05+00:00" }, { "name": "symfony/var-dumper", - "version": "v4.2.7", + "version": "v4.3.2", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "e760a38e12b15032325e64be63f7ffc1817af617" + "reference": "45d6ef73671995aca565a1aa3d9a432a3ea63f91" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/e760a38e12b15032325e64be63f7ffc1817af617", - "reference": "e760a38e12b15032325e64be63f7ffc1817af617", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/45d6ef73671995aca565a1aa3d9a432a3ea63f91", + "reference": "45d6ef73671995aca565a1aa3d9a432a3ea63f91", "shasum": "" }, "require": { @@ -2684,7 +2808,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.2-dev" + "dev-master": "4.3-dev" } }, "autoload": { @@ -2718,20 +2842,20 @@ "debug", "dump" ], - "time": "2019-04-17T14:57:01+00:00" + "time": "2019-06-17T17:37:00+00:00" }, { "name": "twig/twig", - "version": "v1.39.1", + "version": "v1.42.2", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "23e7b6f0cfa1d7ba3de69f30d8e05cf957412fec" + "reference": "21707d6ebd05476854805e4f91b836531941bcd4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/23e7b6f0cfa1d7ba3de69f30d8e05cf957412fec", - "reference": "23e7b6f0cfa1d7ba3de69f30d8e05cf957412fec", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/21707d6ebd05476854805e4f91b836531941bcd4", + "reference": "21707d6ebd05476854805e4f91b836531941bcd4", "shasum": "" }, "require": { @@ -2741,12 +2865,12 @@ "require-dev": { "psr/container": "^1.0", "symfony/debug": "^2.7", - "symfony/phpunit-bridge": "^3.4.19|^4.1.8" + "symfony/phpunit-bridge": "^3.4.19|^4.1.8|^5.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.39-dev" + "dev-master": "1.42-dev" } }, "autoload": { @@ -2784,7 +2908,7 @@ "keywords": [ "templating" ], - "time": "2019-04-16T17:12:57+00:00" + "time": "2019-06-18T15:35:16+00:00" }, { "name": "umpirsky/twig-php-function", diff --git a/config/bootstrap.php b/config/bootstrap.php index 4bd1cfd..516a24c 100644 --- a/config/bootstrap.php +++ b/config/bootstrap.php @@ -227,3 +227,6 @@ if (Configure::read('debug')) { //Plugin::load('AsdCurl', ['autoload' => true]); Plugin::load('AsdCurl', ['autoload' => true, 'bootstrap' => true, 'routes' => true]); + +Configure::write('Users.config', ['users']); +Plugin::load('CakeDC/Users', ['routes' => true, 'bootstrap' => true]); diff --git a/config/permissions.php b/config/permissions.php new file mode 100644 index 0000000..153af28 --- /dev/null +++ b/config/permissions.php @@ -0,0 +1,121 @@ + 'role' | ['roles'] | '*' + * 'prefix' => 'Prefix' | , (default = null) + * 'plugin' => 'Plugin' | , (default = null) + * 'controller' => 'Controller' | ['Controllers'] | '*', + * 'action' => 'action' | ['actions'] | '*', + * 'allowed' => true | false | callback (default = true) + * ] + * You could use '*' to match anything + * 'allowed' will be considered true if not defined. It allows a callable to manage complex + * permissions, like this + * 'allowed' => function (array $user, $role, Request $request) {} + * + * Example, using allowed callable to define permissions only for the owner of the Posts to edit/delete + * + * (remember to add the 'uses' at the top of the permissions.php file for Hash, TableRegistry and Request + [ + 'role' => ['user'], + 'controller' => ['Posts'], + 'action' => ['edit', 'delete'], + 'allowed' => function(array $user, $role, Request $request) { + $postId = Hash::get($request->params, 'pass.0'); + $post = TableRegistry::getTableLocator()->get('Posts')->get($postId); + $userId = Hash::get($user, 'id'); + if (!empty($post->user_id) && !empty($userId)) { + return $post->user_id === $userId; + } + return false; + } + ], + */ + +return [ + 'CakeDC/Auth.permissions' => [ + //admin role allowed to all the things + [ + 'role' => 'admin', + 'prefix' => '*', + 'extension' => '*', + 'plugin' => '*', + 'controller' => '*', + 'action' => '*', + ], + //specific actions allowed for the all roles in Users plugin + [ + 'role' => '*', + 'plugin' => 'CakeDC/Users', + 'controller' => 'Users', + 'action' => ['profile', 'logout', 'linkSocial', 'callbackLinkSocial'], + ], + [ + 'role' => '*', + 'plugin' => 'CakeDC/Users', + 'controller' => 'Users', + 'action' => 'resetGoogleAuthenticator', + 'allowed' => function (array $user, $role, \Cake\Http\ServerRequest $request) { + $userId = \Cake\Utility\Hash::get($request->getAttribute('params'), 'pass.0'); + if (!empty($userId) && !empty($user)) { + return $userId === $user['id']; + } + + return false; + } + ], + //all roles allowed to Pages/display + [ + 'role' => ['user'], + 'controller' => 'Employments', + 'action' => ['index'], + ], + /* [ + 'role' => '*', + 'controller' => 'Imports', + 'action' => ['ftp','ftp_analyse','index','ftpAnalyse'], + ], */ + [ + 'role' => '*', + 'controller' => 'Pages', + 'action' => 'display', + ], + [ + 'role' => 'asd', + 'controller' => 'Employments', + 'action' => 'analyse', + ], + + /*[ + 'role' => ['user'], + 'prefix' => 'admin', + 'controller' => ['Curls'], + 'action' => ['upStatistik', 'usStatistik'], + /*'allowed' => function(array $user, $role, \Cake\Http\ServerRequest $request) { + $userId = \Cake\Utility\Hash::get($request->getAttribute('params'), 'pass.0'); + if (!empty($userId) && !empty($user)) { + return $userId === $user['id']; + } + + return false; + } + ], */ + ] +]; diff --git a/config/routes.php b/config/routes.php index ce7ae5d..ffae512 100644 --- a/config/routes.php +++ b/config/routes.php @@ -49,7 +49,8 @@ Router::scope('/', function (RouteBuilder $routes) { * its action called 'display', and we pass a param to select the view file * to use (in this case, src/Template/Pages/home.ctp)... */ - $routes->connect('/', ['controller' => 'curls', 'action' => 'usStatistik']); + $routes->connect('/', ['controller' => 'Pages', 'action' => 'home']); + //$routes->connect('/', ['controller' => 'curls', 'action' => 'usStatistik']); //$routes->connect('/', ['controller' => 'examinations', 'action' => 'index']); /** diff --git a/config/users.php b/config/users.php new file mode 100644 index 0000000..2b26108 --- /dev/null +++ b/config/users.php @@ -0,0 +1,226 @@ + [ + // Table used to manage users + 'table' => 'CakeDC/Users.Users', + // Controller used to manage users plugin features & actions + 'controller' => 'CakeDC/Users.Users', + // configure Auth component + 'auth' => true, + // Password Hasher + 'passwordHasher' => '\Cake\Auth\DefaultPasswordHasher', + // token expiration, 1 hour + 'Token' => ['expiration' => 3600], + 'Email' => [ + // determines if the user should include email + 'required' => false, + // determines if registration workflow includes email validation + 'validate' => false, + ], + 'Registration' => [ + // determines if the register is enabled + 'active' => true, + // determines if the reCaptcha is enabled for registration + 'reCaptcha' => true, + // allow a logged in user to access the registration form + 'allowLoggedIn' => false, + //ensure user is active (confirmed email) to reset his password + 'ensureActive' => false, + // default role name used in registration + 'defaultRole' => 'user', + ], + 'reCaptcha' => [ + // reCaptcha key goes here + 'key' => null, + // reCaptcha secret + 'secret' => null, + // use reCaptcha in registration + 'registration' => false, + // use reCaptcha in login, valid values are false, true + 'login' => false, + ], + 'Tos' => [ + // determines if the user should include tos accepted + 'required' => false, + ], + 'Social' => [ + // enable social login + 'login' => false, + // enable social login + 'authenticator' => 'CakeDC/Users.Social', + ], + 'GoogleAuthenticator' => [ + // enable Google Authenticator + 'login' => false, + 'issuer' => null, + // The number of digits the resulting codes will be + 'digits' => 6, + // The number of seconds a code will be valid + 'period' => 30, + // The algorithm used + 'algorithm' => 'sha1', + // QR-code provider (more on this later) + 'qrcodeprovider' => null, + // Random Number Generator provider (more on this later) + 'rngprovider' => null + ], + 'Profile' => [ + // Allow view other users profiles + 'viewOthers' => true, + 'route' => ['plugin' => 'CakeDC/Users', 'controller' => 'Users', 'action' => 'profile'], + ], + 'Key' => [ + 'Session' => [ + // session key to store the social auth data + 'social' => 'Users.social', + // userId key used in reset password workflow + 'resetPasswordUserId' => 'Users.resetPasswordUserId', + ], + // form key to store the social auth data + 'Form' => [ + 'social' => 'social' + ], + 'Data' => [ + // data key to store the users email + 'email' => 'email', + // data key to store email coming from social networks + 'socialEmail' => 'info.email', + // data key to check if the remember me option is enabled + 'rememberMe' => 'remember_me', + ], + ], + // Avatar placeholder + 'Avatar' => ['placeholder' => 'CakeDC/Users.avatar_placeholder.png'], + 'RememberMe' => [ + // configure Remember Me component + 'active' => true, + 'checked' => true, + 'Cookie' => [ + 'name' => 'remember_me', + 'Config' => [ + 'expires' => '1 month', + 'httpOnly' => true, + ] + ] + ], + ], + 'GoogleAuthenticator' => [ + 'checker' => \CakeDC\Users\Auth\DefaultTwoFactorAuthenticationChecker::class, + 'verifyAction' => [ + 'plugin' => 'CakeDC/Users', + 'controller' => 'Users', + 'action' => 'verify', + 'prefix' => false, + ], + ], + 'U2f' => [ + 'enabled' => false, + 'checker' => \CakeDC\Users\Auth\DefaultU2fAuthenticationChecker::class, + 'startAction' => [ + 'plugin' => 'CakeDC/Users', + 'controller' => 'Users', + 'action' => 'u2f', + 'prefix' => false, + ] + ], + // default configuration used to auto-load the Auth Component, override to change the way Auth works + 'Auth' => [ + 'loginAction' => [ + 'plugin' => 'CakeDC/Users', + 'controller' => 'Users', + 'action' => 'login', + 'prefix' => false + ], + 'authenticate' => [ + 'all' => [ + 'finder' => 'auth', + ], + 'CakeDC/Auth.ApiKey', + 'CakeDC/Auth.RememberMe', + 'Form', + ], + 'authorize' => [ + 'CakeDC/Auth.Superuser', + 'CakeDC/Auth.SimpleRbac', + ], + ], + 'OAuth' => [ + 'path' => ['plugin' => 'CakeDC/Users', 'controller' => 'Users', 'action' => 'socialLogin', 'prefix' => null], + 'providers' => [ + 'facebook' => [ + 'className' => 'League\OAuth2\Client\Provider\Facebook', + 'authParams' => ['scope' => ['public_profile', 'email', 'user_birthday', 'user_gender', 'user_link']], + 'options' => [ + 'graphApiVersion' => 'v2.8', //bio field was deprecated on >= v2.8 + 'redirectUri' => Router::fullBaseUrl() . '/auth/facebook', + 'linkSocialUri' => Router::fullBaseUrl() . '/link-social/facebook', + 'callbackLinkSocialUri' => Router::fullBaseUrl() . '/callback-link-social/facebook', + ] + ], + 'twitter' => [ + 'options' => [ + 'redirectUri' => Router::fullBaseUrl() . '/auth/twitter', + 'linkSocialUri' => Router::fullBaseUrl() . '/link-social/twitter', + 'callbackLinkSocialUri' => Router::fullBaseUrl() . '/callback-link-social/twitter', + ] + ], + 'linkedIn' => [ + 'className' => 'League\OAuth2\Client\Provider\LinkedIn', + 'options' => [ + 'redirectUri' => Router::fullBaseUrl() . '/auth/linkedIn', + 'linkSocialUri' => Router::fullBaseUrl() . '/link-social/linkedIn', + 'callbackLinkSocialUri' => Router::fullBaseUrl() . '/callback-link-social/linkedIn', + ] + ], + 'instagram' => [ + 'className' => 'League\OAuth2\Client\Provider\Instagram', + 'options' => [ + 'redirectUri' => Router::fullBaseUrl() . '/auth/instagram', + 'linkSocialUri' => Router::fullBaseUrl() . '/link-social/instagram', + 'callbackLinkSocialUri' => Router::fullBaseUrl() . '/callback-link-social/instagram', + ] + ], + 'google' => [ + 'className' => 'League\OAuth2\Client\Provider\Google', + 'options' => [ + 'userFields' => ['url', 'aboutMe'], + 'redirectUri' => Router::fullBaseUrl() . '/auth/google', + 'linkSocialUri' => Router::fullBaseUrl() . '/link-social/google', + 'callbackLinkSocialUri' => Router::fullBaseUrl() . '/callback-link-social/google', + ] + ], + 'amazon' => [ + 'className' => 'Luchianenco\OAuth2\Client\Provider\Amazon', + 'options' => [ + 'redirectUri' => Router::fullBaseUrl() . '/auth/amazon', + 'linkSocialUri' => Router::fullBaseUrl() . '/link-social/amazon', + 'callbackLinkSocialUri' => Router::fullBaseUrl() . '/callback-link-social/amazon', + ] + ], + 'cognito' => [ + 'className' => 'CakeDC\OAuth2\Client\Provider\Cognito', + 'options' => [ + 'redirectUri' => Router::fullBaseUrl() . '/auth/cognito', + 'linkSocialUri' => Router::fullBaseUrl() . '/link-social/cognito', + 'callbackLinkSocialUri' => Router::fullBaseUrl() . '/callback-link-social/cognito', + 'scope' => 'email openid' + ] + ], + ], + ] +]; + +return $config; diff --git a/plugins/AsdCurl/config/bootstrap.php b/plugins/AsdCurl/config/bootstrap.php index 1609104..2efa720 100644 --- a/plugins/AsdCurl/config/bootstrap.php +++ b/plugins/AsdCurl/config/bootstrap.php @@ -13,7 +13,8 @@ try { define('SCHULPORTAL_BASE0_URL', "https://portal.schulen.bayern.de"); define('SCHULPORTAL_BASE_URL', SCHULPORTAL_BASE0_URL . '/uniquesig2d1dfad4a11c25e42c462e53b4721e48/uniquesig0'); define('SCHULPORTAL_ASD_BASE_URL', SCHULPORTAL_BASE0_URL . '/uniquesigc3ba1685059aaf325d44099df697a0a635e79a4ec36ec614a98f3bf4b79d7c043ac3880605b7751df91d11233380ad86/uniquesig0/asd'); -define('PROD_SCHULPORTAL_ASD_BASE_URL', SCHULPORTAL_BASE0_URL . '/uniquesigc3ba1685059aaf325d44099df697a0a635e79a4ec36ec614a98f3bf4b79d7c043ac3880605b7751df91d11233380ad86/uniquesig0/asd'); +//define('PROD_SCHULPORTAL_ASD_BASE_URL', SCHULPORTAL_BASE0_URL . '/uniquesigc3ba1685059aaf325d44099df697a0a635e79a4ec36ec614a98f3bf4b79d7c043ac3880605b7751df91d11233380ad86/uniquesig0/asd'); +define('PROD_SCHULPORTAL_ASD_BASE_URL', SCHULPORTAL_BASE0_URL . '/uniquesig632cea04e8c585dd8dd40ffb367af53448ad1113e945323b22126735ae9513abb1f12262cb9414f17e32ca470882289a/uniquesig0/asd'); define('PARA_SCHULPORTAL_ASD_BASE_URL', SCHULPORTAL_BASE0_URL . '/uniquesiga877c16a8d4fa0326c4d1f7447020d3867d9b0ca4503652219a0f5b2b569f316747c8c199bc9626ccb01613a0a36a342/uniquesig0/asd'); diff --git a/plugins/AsdCurl/src/AsdCurl.php b/plugins/AsdCurl/src/AsdCurl.php index 68f2058..db4897a 100644 --- a/plugins/AsdCurl/src/AsdCurl.php +++ b/plugins/AsdCurl/src/AsdCurl.php @@ -34,7 +34,7 @@ class AsdCurl curl_setopt($ch, CURLOPT_COOKIESESSION, true); curl_setopt($ch, CURLOPT_COOKIEJAR, Configure::read('AsdCurl.cookiejar')); curl_setopt($ch, CURLOPT_COOKIEFILE, Configure::read('AsdCurl.cookiefile')); - curl_setopt($ch, CURLOPT_COOKIE, Configure::read('AsdCurl.cookie')); + //curl_setopt($ch, CURLOPT_COOKIE, Configure::read('AsdCurl.cookie')); curl_setopt($ch, CURLOPT_SSLCERT, Configure::read('AsdCurl.cert')); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); return ($ch); @@ -176,10 +176,10 @@ class AsdCurl if(!($this->status)) { die($this->error); } - //echo $this->html; die; + //echo $this->html; die; $login_data = [ 'portal_username' => 'asd.trinkl', - 'portal_password' => 'HiegTzs!192', + 'portal_password' => 'HiegTzs!193', ]; $post = [ @@ -199,6 +199,7 @@ class AsdCurl if(!($this->status)) { die($this->error); } + $this->exec_curl($ch, $SCHULPORTAL_BASE_URL . '/SecureSchulportalPortalHomePage/',false); //debug($this->html);die; } diff --git a/plugins/AsdCurl/src/AsdUs.php b/plugins/AsdCurl/src/AsdUs.php index e7107a9..89e64b4 100644 --- a/plugins/AsdCurl/src/AsdUs.php +++ b/plugins/AsdCurl/src/AsdUs.php @@ -96,6 +96,7 @@ class AsdUs extends AsdCurl $mainform = $matches[0][0]; } } + $mainform='184'; //die; /* diff --git a/src/Controller/AppController.php b/src/Controller/AppController.php index 1dbfff8..192c508 100644 --- a/src/Controller/AppController.php +++ b/src/Controller/AppController.php @@ -41,9 +41,9 @@ class AppController extends Controller { parent::initialize(); - $this->loadComponent('RequestHandler'); + $this->loadComponent('RequestHandler', ['enableBeforeRedirect' => false]); $this->loadComponent('Flash'); - + $this->loadComponent('CakeDC/Users.UsersAuth'); /* * Enable the following components for recommended CakePHP security settings. * see http://book.cakephp.org/3.0/en/controllers/components/security.html @@ -65,5 +65,12 @@ class AppController extends Controller ) { $this->set('_serialize', true); } + $session = $this->getRequest()->getSession(); + $id = $session->read('Auth.User.id'); + if(isset($id)) { + $this->loadModel('Users'); + $user = $this->Users->get($id); + $this->set('LoggedInUser',$user->first_name . ' '. $user->last_name); + } } } diff --git a/src/Controller/ApresultsController.php b/src/Controller/ApresultsController.php index 7810ad9..ce98108 100644 --- a/src/Controller/ApresultsController.php +++ b/src/Controller/ApresultsController.php @@ -3,6 +3,7 @@ namespace App\Controller; use App\Controller\AppController; use Cake\I18n\Time; +use Cake\Event\Event; /** * Apresults Controller @@ -11,6 +12,11 @@ use Cake\I18n\Time; */ class ApresultsController extends AppController { + public function beforeFilter(Event $event) { + $this->Auth->setConfig('checkAuthIn', 'Controller.initialize'); + //$this->Auth->allow('ftp'); + } + function export() { $fields = array('snr','aptype','lieferstatus','erzeugungsdatum','apcount','anzahl'); $schools = $this->Apresults->find('all',array('fields' => $fields)); diff --git a/src/Controller/CurlsController.php b/src/Controller/CurlsController.php index d93d833..a9ffcd1 100644 --- a/src/Controller/CurlsController.php +++ b/src/Controller/CurlsController.php @@ -7,9 +7,15 @@ use AsdCurl\AsdMstr; use AsdCurl\AsdUs; use Cake\I18n\Time; use Cake\Filesystem\File; +use Cake\Event\Event; class CurlsController extends AppController { + public function beforeFilter(Event $event) { + //$this->Auth->setConfig('checkAuthIn', 'Controller.initialize'); + $this->Auth->allow(['saveus','getjsonus','saveup','getjsonup','usStatistik','upStatistik']); + } + //public $uses = array('Monitoring'); public function monitmstr() @@ -89,7 +95,7 @@ class CurlsController extends AppController //debug($curl->status); $ch = $curl->init_curl_params(); $curl->login_school($ch); - + //echo $curl->html;die; $curl->login_asd($ch,$env); //echo $curl->html;die; $curl->save_us_data($ch,$env); diff --git a/src/Controller/EmailsController.php b/src/Controller/EmailsController.php index 5d9b1c8..343c862 100644 --- a/src/Controller/EmailsController.php +++ b/src/Controller/EmailsController.php @@ -4,6 +4,7 @@ namespace App\Controller; use App\Controller\AppController; use Cake\Mailer\Email; use Cake\I18n\Time; +use Cake\Event\Event; /** * Emails Controller @@ -12,6 +13,22 @@ use Cake\I18n\Time; */ class EmailsController extends AppController { + public function beforeFilter(Event $event) { + $this->Auth->setConfig('checkAuthIn', 'Controller.initialize'); + //$this->Auth->allow('ftp'); + } + + public function testmail() { + $email = new Email(); + $email + ->emailFormat('html') + ->from(['abschlusspruefung@schulen.bayern.de' => 'Abschlusspruefung']) + ->to('asd.trinkl@schulen.bayern.de') + ->subject('Teste E-Mail Verbindung') + ->send('Das ist nur eine Testnachricht.'); + $this->set('email',$email); + } + public function emailFoerder() { debug($this->request['?']); $filename = $this->request['?']['file']; @@ -163,6 +180,7 @@ class EmailsController extends AppController $email ->emailFormat('html') ->from(['abschlusspruefung@schulen.bayern.de' => 'Abschlusspruefung']) + //->to('asd.trinkl@schulen.bayern.de') ->to($mail->snr . '@schulen.bayern.de') ->cc('abschlusspruefung@schulen.bayern.de') ->template('abschluss') @@ -173,6 +191,7 @@ class EmailsController extends AppController //$line = $this->Apimports->patchEntity($line, (array) $data); $result = $this->Emails->save($mail); } + //die; return $this->redirect(['controller' => 'Apresults', 'action' => 'export']); } diff --git a/src/Controller/EmploymentsController.php b/src/Controller/EmploymentsController.php index 5e16a92..97f3a58 100644 --- a/src/Controller/EmploymentsController.php +++ b/src/Controller/EmploymentsController.php @@ -5,6 +5,30 @@ class EmploymentsController extends AppController { + public function analyse() + { + if ($this->request->is('post')) { + $data = $this->request->data; + //debug($data['Login_Key']); + $key = $data['Login_Key']; + if($key == 't5BfdBY4Tj4uPBpQ3773mbkmFuhybLsn') { + $file_out = '/var/www/html/asd-control/webroot/files/analyse/analyse.txt'; + $this->set('file_content',file_get_contents($file_out)); + $this->set('stage',1); + } + else { + $employment = $this->Employments->newEntity(); + $this->set('employment',$employment); + $this->set('stage',0); + } + } + else { + $employment = $this->Employments->newEntity(); + $this->set('employment',$employment); + $this->set('stage',0); + } + } + public function index() { $employment = $this->Employments->newEntity(); @@ -74,4 +98,4 @@ } - } \ No newline at end of file + } diff --git a/src/Controller/ImportsController.php b/src/Controller/ImportsController.php index b2193f9..5ba5219 100644 --- a/src/Controller/ImportsController.php +++ b/src/Controller/ImportsController.php @@ -3,6 +3,8 @@ namespace App\Controller; use App\Controller\AppController; +use Cake\Event\Event; + use ZipArchive; /** @@ -11,6 +13,13 @@ use ZipArchive; * @property \App\Model\Table\ImportsTable $Imports */ class ImportsController extends AppController { + + public function beforeFilter(Event $event) { + //$this->Auth->setConfig('checkAuthIn', 'Controller.initialize'); + //$this->Auth->allow('ftp','ftpAnalyse','ftp_analyse','index'); + $this->Auth->allow(['ftp','ftpanalyse']); + } + public function ftpFoerder() { $filename = 'foerder.csv'; @@ -18,7 +27,66 @@ class ImportsController extends AppController { //debug($date);die; $this->redirect(array('controller' => 'Emails', 'action' => 'EmailFoerder?file='.$filename.'&date='.$date)); } + public function ftpanalyse() { + $ftp_server = "10.190.22.35"; + $ftp_port = "2587"; + $ftp_user = "LfStaD-Log"; + $ftp_pass = "135!Log!086"; + $local_file = '/test/analyse.zip'; + $zip_pass = 'N3Y8prW6kR'; + $local_folder = '/test'; + $conn_id = ftp_connect($ftp_server, $ftp_port) or die("Couldn't connect to $ftp_server"); + + if (@ftp_login($conn_id, $ftp_user, $ftp_pass)) { + //echo "Angemeldet als $ftp_user@$ftp_server\n"; + } else { + echo "Anmeldung als $ftp_user nicht möglich\n"; + } + + ftp_chdir($conn_id, 'ap-csv'); + $contents = ftp_nlist($conn_id, "."); + $date_akt = date('Ymd'); + $filename = 'AB-514_'.$date_akt; + //debug($filename); + //debug($contents); + foreach($contents as $content) { + $pos = strpos($content,$filename); + //debug($pos); + if($pos === 0) { + $file_akt = $content; + } + } + //debug($file_akt); + //die; + ftp_get($conn_id, $local_file, $file_akt, FTP_BINARY); + + $zip = new ZipArchive(); + $zip_status = $zip->open($local_file); + + if ($zip_status === true) { + if ($zip->setPassword($zip_pass)) { + if (!$zip->extractTo('/test/results/')) + echo "Extraction failed (wrong password?)"; + } + //debug($zip->statIndex(0)); + $date = date('d.m.Y',$zip->statIndex(0)['mtime']); + //debug($date); + //die; + $file = $zip->statIndex(0)['name']; + //debug($file); + //debug($file); + $zip->close(); + } + else { + die("Failed opening archive: " . @$zip->getStatusString() . " (code: " . $zip_status . ")"); + } + $file_out = '/var/www/html/asd-control/webroot/files/analyse/analyse.txt'; + rename('/test/results/'.$file,$file_out); + $this->set('filename',$file_akt); + //return $this->redirect(['controller' => 'Imports', 'action' => 'index']); + + } private function ftp_get($file_in,$file_out,$zip_pass) { $ftp_server = "10.190.22.35"; $ftp_port = "2587"; @@ -75,7 +143,7 @@ class ImportsController extends AppController { $ftp_user = "LfStaD-Log"; $ftp_pass = "135!Log!086"; $local_file = '/test/test.zip'; - $zip_pass = '!AP-AS-2018!'; + $zip_pass = '!US-US-2018!'; $local_folder = '/test'; $conn_id = ftp_connect($ftp_server, $ftp_port) or die("Couldn't connect to $ftp_server"); @@ -89,8 +157,8 @@ class ImportsController extends AppController { ftp_chdir($conn_id, 'ap-csv'); $contents = ftp_nlist($conn_id, "."); //debug($contents); - $abschluss = array_search('Abschlusspruefung_2018.zip',$contents); - //debug($abschluss); + $abschluss = array_search('AB-341_Abschlusspruefung_2019_PROD.zip',$contents); + debug($abschluss); //die; ftp_get($conn_id, $local_file, $contents[$abschluss], FTP_BINARY); @@ -112,7 +180,7 @@ class ImportsController extends AppController { die("Failed opening archive: " . @$zip->getStatusString() . " (code: " . $zip_status . ")"); } rename('/test/results/'.$file,'/var/www/html/asd-control/webroot/files/ap/results.csv'); - exec('/usr/bin/smbclient -U \'BAYKM/km-tri-wil%HiegTzs!182\' //KM-Svr-Daten/Projektshare -c \'cd /14_Materialien/Austausch/WiTr/ap; put /var/www/html/asd-control/webroot/files/ap/results.csv results-ap.csv\''); + exec('/usr/bin/smbclient -U \'BAYKM/km-tri-wil%HiegTzs!193\' //KM-Svr-Daten/Projektshare -c \'cd /14_Materialien/Austausch/WiTr/ap; put /var/www/html/asd-control/webroot/files/ap/results.csv results-ap.csv\''); //die; //debug($contents);die; diff --git a/src/Controller/JirasController.php b/src/Controller/JirasController.php new file mode 100644 index 0000000..c9a706f --- /dev/null +++ b/src/Controller/JirasController.php @@ -0,0 +1,67 @@ +Auth->setConfig('checkAuthIn', 'Controller.initialize'); + $this->Auth->allow(['index']); + } + public function index() + { + $http = new Client(); + $tickets = ['423','469','533','568','421','424','569','422','586','587','588','589','514','420','590','591']; + $tabledata = array(); + //$j = 0; + foreach($tickets as $ticket) { + //debug($ticket); + + $response = $http->get('https://kmjira.bayern.de/rest/api/latest/issue/UHD-' . $ticket .'?fields=description', [], + [ + 'proxy' => ['proxy' => 'www.proxy.bybn.de:80'], + 'auth' => ['type' => 'basic', 'username' => 'TrinklW', 'password' => 'HiegTzs!12'] + ]); + //debug($response->getStringBody()); + + $data = json_decode($response->getStringBody()); + + $skuList = explode(PHP_EOL, $data->fields->description); + + $istable = 0; + $entries = array(); + $i=0; + foreach($skuList as $line) { + if(substr($line,0,1) == '|' and substr($line,1,1) !== '|') { + $istable = 1; + //debug($i); + $entries[$i] = $line; + } + if($istable == 1 and substr($line,0,1) !== '|') { + //debug($i); + $entries[$i - 1] .= trim($line); + } + else if($istable == 1) { + $i++; + } + } + + foreach($entries as $entry) { + $entry = trim(preg_replace('/\s+/', ' ', $entry)); + //debug($entry); + //debug(explode('|',$entry)); + array_push($tabledata,explode('|',$entry)); + //$tabledate[$j][] = explode('|',$entry); + //debug($j); + //debug($tabledate[$j]); + //debug($tabledata); + //$j++; + } + } + //debug($tabledata); + $this->set('tabledata',$tabledata); + } + } diff --git a/src/Controller/OfficesController.php b/src/Controller/OfficesController.php index 605f7d3..3c4fcac 100644 --- a/src/Controller/OfficesController.php +++ b/src/Controller/OfficesController.php @@ -19,7 +19,7 @@ class OfficesController extends AppController //debug($this->request['data']);die; $options = [ 'length' => 0, - 'delimiter' => ';', + 'delimiter' => ',', 'enclosure' => '"', 'escape' => '\\', 'headers' => false, diff --git a/src/Controller/PagesController.php b/src/Controller/PagesController.php index 49dd228..5499d7b 100644 --- a/src/Controller/PagesController.php +++ b/src/Controller/PagesController.php @@ -18,6 +18,7 @@ use Cake\Core\Configure; use Cake\Network\Exception\ForbiddenException; use Cake\Network\Exception\NotFoundException; use Cake\View\Exception\MissingTemplateException; +use Cake\Event\Event; /** * Static content controller @@ -37,6 +38,15 @@ class PagesController extends AppController * @throws \Cake\Network\Exception\NotFoundException When the view file could not * be found or \Cake\View\Exception\MissingTemplateException in debug mode. */ + + public function beforeFilter(Event $event) { + //$this->Auth->setConfig('checkAuthIn', 'Controller.initialize'); + $this->Auth->allow(['home']); + } + public function home() + { + + } public function display() { $path = func_get_args(); diff --git a/src/Template/Curls/up_statistik.ctp b/src/Template/Curls/up_statistik.ctp index a4c8a1b..b23b149 100644 --- a/src/Template/Curls/up_statistik.ctp +++ b/src/Template/Curls/up_statistik.ctp @@ -5,7 +5,13 @@ echo '