upgraded FosUserBundle and Symfony 4.3 (#1005)
This commit is contained in:
@@ -12,7 +12,8 @@ Perform EACH version specific task between your version and the new one, otherwi
|
|||||||
|
|
||||||
### BC breaks
|
### BC breaks
|
||||||
|
|
||||||
Deleted timezone conversion command. If you are still using 0.7 or below, you need to upgrade to 1.1 before upgrading to this version.
|
- Deleted timezone conversion command. If you are still using 0.7 or below, you need to upgrade to 1.1 before upgrading to this version.
|
||||||
|
- Minimum password length raised from 5 to 8 character (applies only for password changes and new users)
|
||||||
|
|
||||||
## [1.1](https://github.com/kevinpapst/kimai2/releases/tag/1.1)
|
## [1.1](https://github.com/kevinpapst/kimai2/releases/tag/1.1)
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ if (!isset($_SERVER['APP_ENV'])) {
|
|||||||
if (!class_exists(Dotenv::class)) {
|
if (!class_exists(Dotenv::class)) {
|
||||||
throw new \RuntimeException('APP_ENV environment variable is not defined. You need to define environment variables for configuration or add "symfony/dotenv" as a Composer dependency to load variables from a .env file.');
|
throw new \RuntimeException('APP_ENV environment variable is not defined. You need to define environment variables for configuration or add "symfony/dotenv" as a Composer dependency to load variables from a .env file.');
|
||||||
}
|
}
|
||||||
(new Dotenv())->load(__DIR__.'/../.env');
|
(new Dotenv(true))->load(__DIR__.'/../.env');
|
||||||
}
|
}
|
||||||
|
|
||||||
$input = new ArgvInput();
|
$input = new ArgvInput();
|
||||||
|
|||||||
@@ -19,8 +19,8 @@
|
|||||||
"ext-zip": "*",
|
"ext-zip": "*",
|
||||||
"beberlei/doctrineextensions": "^1.2",
|
"beberlei/doctrineextensions": "^1.2",
|
||||||
"erusev/parsedown": "^1.6",
|
"erusev/parsedown": "^1.6",
|
||||||
"friendsofsymfony/rest-bundle": "^2.3",
|
"friendsofsymfony/rest-bundle": "^2.5",
|
||||||
"friendsofsymfony/user-bundle": "~2.0",
|
"friendsofsymfony/user-bundle": "dev-master",
|
||||||
"gedmo/doctrine-extensions": "^2.4",
|
"gedmo/doctrine-extensions": "^2.4",
|
||||||
"jms/metadata": "^2.0",
|
"jms/metadata": "^2.0",
|
||||||
"jms/serializer-bundle": "^3.2",
|
"jms/serializer-bundle": "^3.2",
|
||||||
@@ -43,12 +43,12 @@
|
|||||||
"symfony/form": "^4.0",
|
"symfony/form": "^4.0",
|
||||||
"symfony/framework-bundle": "^4.0",
|
"symfony/framework-bundle": "^4.0",
|
||||||
"symfony/intl": "^4.0",
|
"symfony/intl": "^4.0",
|
||||||
"symfony/monolog-bundle": "^3.1",
|
"symfony/monolog-bundle": "^3.4",
|
||||||
"symfony/orm-pack": "^1.0",
|
"symfony/orm-pack": "^1.0",
|
||||||
"symfony/security-bundle": "~4.2.0",
|
"symfony/security-bundle": "^4.0",
|
||||||
"symfony/security-csrf": "^4.0",
|
"symfony/security-csrf": "^4.0",
|
||||||
"symfony/serializer": "^4.0",
|
"symfony/serializer": "^4.0",
|
||||||
"symfony/swiftmailer-bundle": "^3.1",
|
"symfony/swiftmailer-bundle": "^3.2",
|
||||||
"symfony/translation": "^4.0",
|
"symfony/translation": "^4.0",
|
||||||
"symfony/twig-bundle": "^4.0",
|
"symfony/twig-bundle": "^4.0",
|
||||||
"symfony/validator": "^4.0",
|
"symfony/validator": "^4.0",
|
||||||
@@ -138,7 +138,7 @@
|
|||||||
"symfony": {
|
"symfony": {
|
||||||
"id": "01C3FWRDJJEX9K6Y3A4XDFXPBR",
|
"id": "01C3FWRDJJEX9K6Y3A4XDFXPBR",
|
||||||
"allow-contrib": true,
|
"allow-contrib": true,
|
||||||
"require": "~4.2.0"
|
"require": "4.3.*"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
1228
composer.lock
generated
1228
composer.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
|||||||
security:
|
security:
|
||||||
encoders:
|
encoders:
|
||||||
App\Entity\User: bcrypt
|
App\Entity\User: auto
|
||||||
|
|
||||||
providers:
|
providers:
|
||||||
chain_provider:
|
chain_provider:
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ security:
|
|||||||
encoders:
|
encoders:
|
||||||
# to make tests much faster, BCrypt cost is changed to its minimum allowed value (4)
|
# to make tests much faster, BCrypt cost is changed to its minimum allowed value (4)
|
||||||
# See https://symfony.com/doc/current/reference/configuration/security.html#using-the-bcrypt-password-encoder
|
# See https://symfony.com/doc/current/reference/configuration/security.html#using-the-bcrypt-password-encoder
|
||||||
App\Entity\User: { algorithm: bcrypt, cost: 4 }
|
App\Entity\User: { algorithm: auto }
|
||||||
|
|
||||||
firewalls:
|
firewalls:
|
||||||
secured_area:
|
secured_area:
|
||||||
|
|||||||
@@ -9,5 +9,5 @@ App\Entity\User:
|
|||||||
- NotBlank: ~
|
- NotBlank: ~
|
||||||
- Email: ~
|
- Email: ~
|
||||||
plainPassword:
|
plainPassword:
|
||||||
- NotBlank: { groups: [registration, passwordUpdate] }
|
- NotBlank: { groups: [Registration, PasswordUpdate] }
|
||||||
- Length: { min: 5, max: 60, groups: [registration, passwordUpdate] }
|
- Length: { min: 8, max: 60, groups: [Registration, PasswordUpdate] }
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ parameters:
|
|||||||
- '#Access to an undefined property Faker\\Generator::\$stateAbbr.#'
|
- '#Access to an undefined property Faker\\Generator::\$stateAbbr.#'
|
||||||
- '#Access to an undefined property Faker\\Generator::\$catchPhrase.#'
|
- '#Access to an undefined property Faker\\Generator::\$catchPhrase.#'
|
||||||
- '#Access to an undefined property Faker\\Generator::\$bs.#'
|
- '#Access to an undefined property Faker\\Generator::\$bs.#'
|
||||||
|
- '#Method Symfony\\Contracts\\EventDispatcher\\EventDispatcherInterface::dispatch\(\) invoked with 2 parameters, 1 required.#'
|
||||||
excludes_analyse:
|
excludes_analyse:
|
||||||
- %rootDir%/../../../src/Command/KimaiImporterCommand.php
|
- %rootDir%/../../../src/Command/KimaiImporterCommand.php
|
||||||
- %rootDir%/../../../src/Ldap/LdapDriver.php
|
- %rootDir%/../../../src/Ldap/LdapDriver.php
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
public/build/app.9530b7ca.js
Normal file
1
public/build/app.9530b7ca.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
public/build/calendar.e654bdd4.js
Normal file
1
public/build/calendar.e654bdd4.js
Normal file
File diff suppressed because one or more lines are too long
@@ -2,29 +2,29 @@
|
|||||||
"entrypoints": {
|
"entrypoints": {
|
||||||
"app": {
|
"app": {
|
||||||
"js": [
|
"js": [
|
||||||
"build/runtime.784b5d0d.js",
|
"build/runtime.4ee6be68.js",
|
||||||
"build/0.66b5fd0b.js",
|
"build/0.a87622f3.js",
|
||||||
"build/1.93f0cf2b.js",
|
"build/1.c1bee41f.js",
|
||||||
"build/app.3f742878.js"
|
"build/app.9530b7ca.js"
|
||||||
],
|
],
|
||||||
"css": [
|
"css": [
|
||||||
"build/app.7f4a18a1.css"
|
"build/app.e8d9cb98.css"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"chart": {
|
"chart": {
|
||||||
"js": [
|
"js": [
|
||||||
"build/runtime.784b5d0d.js",
|
"build/runtime.4ee6be68.js",
|
||||||
"build/0.66b5fd0b.js",
|
"build/0.a87622f3.js",
|
||||||
"build/2.c06cd055.js",
|
"build/2.7be60d8d.js",
|
||||||
"build/chart.2bb71e2e.js"
|
"build/chart.0af3f813.js"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"calendar": {
|
"calendar": {
|
||||||
"js": [
|
"js": [
|
||||||
"build/runtime.784b5d0d.js",
|
"build/runtime.4ee6be68.js",
|
||||||
"build/0.66b5fd0b.js",
|
"build/0.a87622f3.js",
|
||||||
"build/1.93f0cf2b.js",
|
"build/1.c1bee41f.js",
|
||||||
"build/calendar.59417f4c.js"
|
"build/calendar.e654bdd4.js"
|
||||||
],
|
],
|
||||||
"css": [
|
"css": [
|
||||||
"build/calendar.b0551848.css"
|
"build/calendar.b0551848.css"
|
||||||
@@ -32,14 +32,14 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"integrity": {
|
"integrity": {
|
||||||
"build/runtime.784b5d0d.js": "sha384-+AsC7zoefPga1AkczlNSCXcbGwD0TwokkldvNISHf1nMlOpafanLjtKvlZy9cVsm",
|
"build/runtime.4ee6be68.js": "sha384-xNNrNinl64G3nCUrIskgSjU0mUXXCB9lj6XCSInBTwxSKXk8uTMafnLHtdWdIGtd",
|
||||||
"build/0.66b5fd0b.js": "sha384-ncT/BKhCsqH6jhxwdsSG95m1ei7ZZjeZtzH1262h+OPUU80TSFFE3dt+abcHHMok",
|
"build/0.a87622f3.js": "sha384-ncT/BKhCsqH6jhxwdsSG95m1ei7ZZjeZtzH1262h+OPUU80TSFFE3dt+abcHHMok",
|
||||||
"build/1.93f0cf2b.js": "sha384-pmnwzvj+UJhDD3uDf+ekLARMBRtMDxWGbnJDrJvwIoRZd3MW/tOGzAW5Ybhbvw20",
|
"build/1.c1bee41f.js": "sha384-7UVWcP6Hefp2k/CrtGSITKXx4dSZqtvpAiU8WX7dClETkzMewrUjoCRtVXQ5j3KI",
|
||||||
"build/app.3f742878.js": "sha384-7221dBEmG8aOmSRCEjuKlrVH47VH1bdnmdEC2pb9y1d9Jtbg6d2t2HfyV3Wa34TI",
|
"build/app.9530b7ca.js": "sha384-5ZvNe6G4j5pbJ6moYaX9Osalr1mGLdFJrLn9g7PDY2ODVzXIfHG2B+c+OWpGy4Rg",
|
||||||
"build/app.7f4a18a1.css": "sha384-p8Dw7CP1RxxJ2K5yuaNpCw8r1lKd64DlVA2IQeEGxBAC2QxOjweafd8w9CSMk0GC",
|
"build/app.e8d9cb98.css": "sha384-UuTUHbhvRNk3t+1gL0JNACbAl5xXH8OhD9ah7jaXDbd32z8dNCjK+5oJSQF77rmz",
|
||||||
"build/2.c06cd055.js": "sha384-txR0QG+838LKYtPQ99Gx4OU7WmgN9J3joZEyGwIskSz74EN1T4/IBVnmNaKiFN1q",
|
"build/2.7be60d8d.js": "sha384-txR0QG+838LKYtPQ99Gx4OU7WmgN9J3joZEyGwIskSz74EN1T4/IBVnmNaKiFN1q",
|
||||||
"build/chart.2bb71e2e.js": "sha384-I57c9DtU3AOG2kzKqIZkIu0hi1aGYHRZ5QG4LKC9+9slzJnAMttPGXoL2cQG3m6y",
|
"build/chart.0af3f813.js": "sha384-I57c9DtU3AOG2kzKqIZkIu0hi1aGYHRZ5QG4LKC9+9slzJnAMttPGXoL2cQG3m6y",
|
||||||
"build/calendar.59417f4c.js": "sha384-16sOZQy1UmOaoLAVFPfHnF8nFqUxhc4URAg+ypJnnab8uqZAGHDfFFrnq0/6PXl1",
|
"build/calendar.e654bdd4.js": "sha384-TYdXaKv0q95Z4i/TFUaFHzMOZ0N6T4iuV92ejc0BX7Rpbd0p55ZhbgriPSn5pVcK",
|
||||||
"build/calendar.b0551848.css": "sha384-ta519W5+NY1a8FBh7rD4zORYTfUXCYTLci0Z25nf4BfodmuXqyPVNEe7dSe2/fRd"
|
"build/calendar.b0551848.css": "sha384-ta519W5+NY1a8FBh7rD4zORYTfUXCYTLci0Z25nf4BfodmuXqyPVNEe7dSe2/fRd"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,13 +1,13 @@
|
|||||||
{
|
{
|
||||||
"build/0.66b5fd0b.js": "build/0.66b5fd0b.js",
|
"build/0.a87622f3.js": "build/0.a87622f3.js",
|
||||||
"build/1.93f0cf2b.js": "build/1.93f0cf2b.js",
|
"build/1.c1bee41f.js": "build/1.c1bee41f.js",
|
||||||
"build/2.c06cd055.js": "build/2.c06cd055.js",
|
"build/2.7be60d8d.js": "build/2.7be60d8d.js",
|
||||||
"build/app.css": "build/app.7f4a18a1.css",
|
"build/app.css": "build/app.e8d9cb98.css",
|
||||||
"build/app.js": "build/app.3f742878.js",
|
"build/app.js": "build/app.9530b7ca.js",
|
||||||
"build/calendar.css": "build/calendar.b0551848.css",
|
"build/calendar.css": "build/calendar.b0551848.css",
|
||||||
"build/calendar.js": "build/calendar.59417f4c.js",
|
"build/calendar.js": "build/calendar.e654bdd4.js",
|
||||||
"build/chart.js": "build/chart.2bb71e2e.js",
|
"build/chart.js": "build/chart.0af3f813.js",
|
||||||
"build/runtime.js": "build/runtime.784b5d0d.js",
|
"build/runtime.js": "build/runtime.4ee6be68.js",
|
||||||
"build/fonts/fa-brands-400.eot": "build/fonts/fa-brands-400.8e49b728.eot",
|
"build/fonts/fa-brands-400.eot": "build/fonts/fa-brands-400.8e49b728.eot",
|
||||||
"build/fonts/fa-brands-400.woff": "build/fonts/fa-brands-400.9f018d10.woff",
|
"build/fonts/fa-brands-400.woff": "build/fonts/fa-brands-400.9f018d10.woff",
|
||||||
"build/fonts/fa-brands-400.woff2": "build/fonts/fa-brands-400.9f4ce3dc.woff2",
|
"build/fonts/fa-brands-400.woff2": "build/fonts/fa-brands-400.9f4ce3dc.woff2",
|
||||||
|
|||||||
1
public/build/runtime.4ee6be68.js
Normal file
1
public/build/runtime.4ee6be68.js
Normal file
@@ -0,0 +1 @@
|
|||||||
|
!function(e){function r(r){for(var n,l,i=r[0],f=r[1],a=r[2],c=0,s=[];c<i.length;c++)l=i[c],Object.prototype.hasOwnProperty.call(o,l)&&o[l]&&s.push(o[l][0]),o[l]=0;for(n in f)Object.prototype.hasOwnProperty.call(f,n)&&(e[n]=f[n]);for(p&&p(r);s.length;)s.shift()();return u.push.apply(u,a||[]),t()}function t(){for(var e,r=0;r<u.length;r++){for(var t=u[r],n=!0,i=1;i<t.length;i++){var f=t[i];0!==o[f]&&(n=!1)}n&&(u.splice(r--,1),e=l(l.s=t[0]))}return e}var n={},o={runtime:0},u=[];function l(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,l),t.l=!0,t.exports}l.m=e,l.c=n,l.d=function(e,r,t){l.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},l.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.t=function(e,r){if(1&r&&(e=l(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(l.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)l.d(t,n,function(r){return e[r]}.bind(null,n));return t},l.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return l.d(r,"a",r),r},l.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},l.p="build/";var i=window.webpackJsonp=window.webpackJsonp||[],f=i.push.bind(i);i.push=r,i=i.slice();for(var a=0;a<i.length;a++)r(i[a]);var p=f;t()}([]);
|
||||||
@@ -1 +0,0 @@
|
|||||||
!function(e){function r(r){for(var n,i,l=r[0],f=r[1],a=r[2],c=0,s=[];c<l.length;c++)i=l[c],o[i]&&s.push(o[i][0]),o[i]=0;for(n in f)Object.prototype.hasOwnProperty.call(f,n)&&(e[n]=f[n]);for(p&&p(r);s.length;)s.shift()();return u.push.apply(u,a||[]),t()}function t(){for(var e,r=0;r<u.length;r++){for(var t=u[r],n=!0,l=1;l<t.length;l++){var f=t[l];0!==o[f]&&(n=!1)}n&&(u.splice(r--,1),e=i(i.s=t[0]))}return e}var n={},o={runtime:0},u=[];function i(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,i),t.l=!0,t.exports}i.m=e,i.c=n,i.d=function(e,r,t){i.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,r){if(1&r&&(e=i(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(i.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)i.d(t,n,function(r){return e[r]}.bind(null,n));return t},i.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(r,"a",r),r},i.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},i.p="build/";var l=window.webpackJsonp=window.webpackJsonp||[],f=l.push.bind(l);l.push=r,l=l.slice();for(var a=0;a<l.length;a++)r(l[a]);var p=f;t()}([]);
|
|
||||||
@@ -12,7 +12,7 @@ if (!isset($_SERVER['APP_ENV'])) {
|
|||||||
if (!class_exists(Dotenv::class)) {
|
if (!class_exists(Dotenv::class)) {
|
||||||
throw new \RuntimeException('APP_ENV environment variable is not defined. You need to define environment variables for configuration or add "symfony/dotenv" as a Composer dependency to load variables from a .env file.');
|
throw new \RuntimeException('APP_ENV environment variable is not defined. You need to define environment variables for configuration or add "symfony/dotenv" as a Composer dependency to load variables from a .env file.');
|
||||||
}
|
}
|
||||||
(new Dotenv())->load(__DIR__.'/../.env');
|
(new Dotenv(true))->load(__DIR__.'/../.env');
|
||||||
}
|
}
|
||||||
|
|
||||||
$env = $_SERVER['APP_ENV'] ?? 'dev';
|
$env = $_SERVER['APP_ENV'] ?? 'dev';
|
||||||
|
|||||||
@@ -114,17 +114,14 @@ class CreateReleaseCommand extends Command
|
|||||||
$tar .= '.tar.gz';
|
$tar .= '.tar.gz';
|
||||||
$zip .= '.zip';
|
$zip .= '.zip';
|
||||||
|
|
||||||
// this removes the current env settings, as they might differ from the release ones
|
$prefix = 'APP_ENV=prod DATABASE_URL=sqlite:///%kernel.project_dir%/var/data/kimai.sqlite';
|
||||||
// if we don't unset them, the .env file won't be read when executing bin/console commands
|
|
||||||
putenv('DATABASE_URL');
|
|
||||||
putenv('APP_ENV');
|
|
||||||
|
|
||||||
$commands = [
|
$commands = [
|
||||||
'Clone repository' => $gitCmd . ' ' . $tmpDir,
|
'Clone repository' => $gitCmd . ' ' . $tmpDir,
|
||||||
'Install composer dependencies' => 'cd ' . $tmpDir . ' && composer install --no-dev --optimize-autoloader',
|
'Install composer dependencies' => 'cd ' . $tmpDir . ' && composer install --no-dev --optimize-autoloader',
|
||||||
'Create database' => 'cd ' . $tmpDir . ' && bin/console doctrine:database:create -n',
|
'Create database' => 'cd ' . $tmpDir . ' && ' . $prefix . ' bin/console doctrine:database:create -n',
|
||||||
'Create tables' => 'cd ' . $tmpDir . ' && bin/console doctrine:schema:create -n',
|
'Create tables' => 'cd ' . $tmpDir . ' && ' . $prefix . ' bin/console doctrine:schema:create -n',
|
||||||
'Add all migrations' => 'cd ' . $tmpDir . ' && bin/console doctrine:migrations:version --add --all -n',
|
'Add all migrations' => 'cd ' . $tmpDir . ' && ' . $prefix . ' bin/console doctrine:migrations:version --add --all -n',
|
||||||
];
|
];
|
||||||
|
|
||||||
$filesToDelete = [
|
$filesToDelete = [
|
||||||
|
|||||||
@@ -106,9 +106,6 @@ class CreateUserCommand extends Command
|
|||||||
->setRoles(explode(',', $role))
|
->setRoles(explode(',', $role))
|
||||||
;
|
;
|
||||||
|
|
||||||
$pwd = $this->encoder->encodePassword($user, $user->getPlainPassword());
|
|
||||||
$user->setPassword($pwd);
|
|
||||||
|
|
||||||
$errors = $this->validator->validate($user, null, ['Registration']);
|
$errors = $this->validator->validate($user, null, ['Registration']);
|
||||||
if ($errors->count() > 0) {
|
if ($errors->count() > 0) {
|
||||||
/** @var \Symfony\Component\Validator\ConstraintViolation $error */
|
/** @var \Symfony\Component\Validator\ConstraintViolation $error */
|
||||||
@@ -126,6 +123,9 @@ class CreateUserCommand extends Command
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
$pwd = $this->encoder->encodePassword($user, $user->getPlainPassword());
|
||||||
|
$user->setPassword($pwd);
|
||||||
|
|
||||||
$entityManager = $this->doctrine->getManager();
|
$entityManager = $this->doctrine->getManager();
|
||||||
$entityManager->persist($user);
|
$entityManager->persist($user);
|
||||||
$entityManager->flush();
|
$entityManager->flush();
|
||||||
|
|||||||
@@ -197,7 +197,7 @@ class ActivityController extends AbstractController
|
|||||||
protected function renderActivityForm(Activity $activity, Request $request)
|
protected function renderActivityForm(Activity $activity, Request $request)
|
||||||
{
|
{
|
||||||
$event = new ActivityMetaDefinitionEvent($activity);
|
$event = new ActivityMetaDefinitionEvent($activity);
|
||||||
$this->dispatcher->dispatch(ActivityMetaDefinitionEvent::class, $event);
|
$this->dispatcher->dispatch($event, ActivityMetaDefinitionEvent::class);
|
||||||
|
|
||||||
$editForm = $this->createEditForm($activity);
|
$editForm = $this->createEditForm($activity);
|
||||||
$editForm->handleRequest($request);
|
$editForm->handleRequest($request);
|
||||||
|
|||||||
@@ -206,7 +206,7 @@ class CustomerController extends AbstractController
|
|||||||
protected function renderCustomerForm(Customer $customer, Request $request)
|
protected function renderCustomerForm(Customer $customer, Request $request)
|
||||||
{
|
{
|
||||||
$event = new CustomerMetaDefinitionEvent($customer);
|
$event = new CustomerMetaDefinitionEvent($customer);
|
||||||
$this->dispatcher->dispatch(CustomerMetaDefinitionEvent::class, $event);
|
$this->dispatcher->dispatch($event, CustomerMetaDefinitionEvent::class);
|
||||||
|
|
||||||
$editForm = $this->createEditForm($customer);
|
$editForm = $this->createEditForm($customer);
|
||||||
|
|
||||||
|
|||||||
@@ -88,10 +88,7 @@ class DashboardController extends AbstractController
|
|||||||
$event->addSection($row);
|
$event->addSection($row);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->eventDispatcher->dispatch(
|
$this->eventDispatcher->dispatch($event, DashboardEvent::DASHBOARD);
|
||||||
DashboardEvent::DASHBOARD,
|
|
||||||
$event
|
|
||||||
);
|
|
||||||
|
|
||||||
$sections = $event->getSections();
|
$sections = $event->getSections();
|
||||||
|
|
||||||
|
|||||||
@@ -183,7 +183,7 @@ class ProfileController extends AbstractController
|
|||||||
{
|
{
|
||||||
// we need to prepare the user preferences, which is done via an EventSubscriber
|
// we need to prepare the user preferences, which is done via an EventSubscriber
|
||||||
$event = new PrepareUserEvent($profile);
|
$event = new PrepareUserEvent($profile);
|
||||||
$this->dispatcher->dispatch(PrepareUserEvent::PREPARE, $event);
|
$this->dispatcher->dispatch($event, PrepareUserEvent::PREPARE);
|
||||||
|
|
||||||
$original = [];
|
$original = [];
|
||||||
foreach ($profile->getPreferences() as $preference) {
|
foreach ($profile->getPreferences() as $preference) {
|
||||||
@@ -288,7 +288,7 @@ class ProfileController extends AbstractController
|
|||||||
{
|
{
|
||||||
// we need to prepare the user preferences, which is done via an EventSubscriber
|
// we need to prepare the user preferences, which is done via an EventSubscriber
|
||||||
$event = new PrepareUserEvent($user);
|
$event = new PrepareUserEvent($user);
|
||||||
$this->dispatcher->dispatch(PrepareUserEvent::PREPARE, $event);
|
$this->dispatcher->dispatch($event, PrepareUserEvent::PREPARE);
|
||||||
|
|
||||||
return $this->createForm(
|
return $this->createForm(
|
||||||
UserPreferencesForm::class,
|
UserPreferencesForm::class,
|
||||||
@@ -343,7 +343,7 @@ class ProfileController extends AbstractController
|
|||||||
UserPasswordType::class,
|
UserPasswordType::class,
|
||||||
$user,
|
$user,
|
||||||
[
|
[
|
||||||
'validation_groups' => ['passwordUpdate'],
|
'validation_groups' => ['PasswordUpdate'],
|
||||||
'action' => $this->generateUrl('user_profile_password', ['username' => $user->getUsername()]),
|
'action' => $this->generateUrl('user_profile_password', ['username' => $user->getUsername()]),
|
||||||
'method' => 'POST'
|
'method' => 'POST'
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -195,7 +195,7 @@ class ProjectController extends AbstractController
|
|||||||
protected function renderProjectForm(Project $project, Request $request)
|
protected function renderProjectForm(Project $project, Request $request)
|
||||||
{
|
{
|
||||||
$event = new ProjectMetaDefinitionEvent($project);
|
$event = new ProjectMetaDefinitionEvent($project);
|
||||||
$this->dispatcher->dispatch(ProjectMetaDefinitionEvent::class, $event);
|
$this->dispatcher->dispatch($event, ProjectMetaDefinitionEvent::class);
|
||||||
|
|
||||||
$editForm = $this->createEditForm($project);
|
$editForm = $this->createEditForm($project);
|
||||||
$editForm->handleRequest($request);
|
$editForm->handleRequest($request);
|
||||||
|
|||||||
@@ -169,7 +169,7 @@ class SystemConfigurationController extends AbstractController
|
|||||||
$types = $this->getConfigurationTypes();
|
$types = $this->getConfigurationTypes();
|
||||||
|
|
||||||
$event = new SystemConfigurationEvent($types);
|
$event = new SystemConfigurationEvent($types);
|
||||||
$this->eventDispatcher->dispatch(SystemConfigurationEvent::CONFIGURE, $event);
|
$this->eventDispatcher->dispatch($event, SystemConfigurationEvent::CONFIGURE);
|
||||||
|
|
||||||
foreach ($event->getConfigurations() as $configs) {
|
foreach ($event->getConfigurations() as $configs) {
|
||||||
foreach ($configs->getConfiguration() as $config) {
|
foreach ($configs->getConfiguration() as $config) {
|
||||||
|
|||||||
@@ -138,7 +138,7 @@ abstract class TimesheetAbstractController extends AbstractController
|
|||||||
protected function edit(Timesheet $entry, Request $request, string $renderTemplate)
|
protected function edit(Timesheet $entry, Request $request, string $renderTemplate)
|
||||||
{
|
{
|
||||||
$event = new TimesheetMetaDefinitionEvent($entry);
|
$event = new TimesheetMetaDefinitionEvent($entry);
|
||||||
$this->dispatcher->dispatch(TimesheetMetaDefinitionEvent::class, $event);
|
$this->dispatcher->dispatch($event, TimesheetMetaDefinitionEvent::class);
|
||||||
|
|
||||||
$editForm = $this->getEditForm($entry, $request->get('page'));
|
$editForm = $this->getEditForm($entry, $request->get('page'));
|
||||||
$editForm->handleRequest($request);
|
$editForm->handleRequest($request);
|
||||||
@@ -196,7 +196,7 @@ abstract class TimesheetAbstractController extends AbstractController
|
|||||||
}
|
}
|
||||||
|
|
||||||
$event = new TimesheetMetaDefinitionEvent($entry);
|
$event = new TimesheetMetaDefinitionEvent($entry);
|
||||||
$this->dispatcher->dispatch(TimesheetMetaDefinitionEvent::class, $event);
|
$this->dispatcher->dispatch($event, TimesheetMetaDefinitionEvent::class);
|
||||||
|
|
||||||
$mode = $this->getTrackingMode();
|
$mode = $this->getTrackingMode();
|
||||||
$mode->create($entry, $request);
|
$mode->create($entry, $request);
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
namespace App\Event;
|
namespace App\Event;
|
||||||
|
|
||||||
use App\Entity\Activity;
|
use App\Entity\Activity;
|
||||||
use Symfony\Component\EventDispatcher\Event;
|
use Symfony\Contracts\EventDispatcher\Event;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This event can be used, to dynamically add meta fields to activities
|
* This event can be used, to dynamically add meta fields to activities
|
||||||
|
|||||||
@@ -1,57 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
/*
|
|
||||||
* This file is part of the Kimai time-tracking app.
|
|
||||||
*
|
|
||||||
* For the full copyright and license information, please view the LICENSE
|
|
||||||
* file that was distributed with this source code.
|
|
||||||
*/
|
|
||||||
|
|
||||||
namespace App\Event;
|
|
||||||
|
|
||||||
use KevinPapst\AdminLTEBundle\Model\MenuItemModel;
|
|
||||||
use Symfony\Component\EventDispatcher\Event;
|
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The ConfigureAdminMenuEvent is used for populating the administration navigation.
|
|
||||||
*/
|
|
||||||
final class ConfigureAdminMenuEvent extends Event
|
|
||||||
{
|
|
||||||
public const CONFIGURE = 'app.admin_menu_configure';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var Request
|
|
||||||
*/
|
|
||||||
private $request;
|
|
||||||
/**
|
|
||||||
* @var MenuItemModel
|
|
||||||
*/
|
|
||||||
private $menu;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param Request $request
|
|
||||||
* @param MenuItemModel $menu
|
|
||||||
*/
|
|
||||||
public function __construct(Request $request, MenuItemModel $menu)
|
|
||||||
{
|
|
||||||
$this->request = $request;
|
|
||||||
$this->menu = $menu;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return Request
|
|
||||||
*/
|
|
||||||
public function getRequest()
|
|
||||||
{
|
|
||||||
return $this->request;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return MenuItemModel
|
|
||||||
*/
|
|
||||||
public function getAdminMenu()
|
|
||||||
{
|
|
||||||
return $this->menu;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -11,8 +11,8 @@ namespace App\Event;
|
|||||||
|
|
||||||
use KevinPapst\AdminLTEBundle\Event\SidebarMenuEvent;
|
use KevinPapst\AdminLTEBundle\Event\SidebarMenuEvent;
|
||||||
use KevinPapst\AdminLTEBundle\Model\MenuItemModel;
|
use KevinPapst\AdminLTEBundle\Model\MenuItemModel;
|
||||||
use Symfony\Component\EventDispatcher\Event;
|
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
|
use Symfony\Contracts\EventDispatcher\Event;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The ConfigureMainMenuEvent is used for populating the main navigation.
|
* The ConfigureMainMenuEvent is used for populating the main navigation.
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
namespace App\Event;
|
namespace App\Event;
|
||||||
|
|
||||||
use App\Entity\Customer;
|
use App\Entity\Customer;
|
||||||
use Symfony\Component\EventDispatcher\Event;
|
use Symfony\Contracts\EventDispatcher\Event;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This event can be used, to dynamically add meta fields to customers
|
* This event can be used, to dynamically add meta fields to customers
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ namespace App\Event;
|
|||||||
|
|
||||||
use App\Entity\User;
|
use App\Entity\User;
|
||||||
use App\Widget\WidgetContainerInterface;
|
use App\Widget\WidgetContainerInterface;
|
||||||
use Symfony\Component\EventDispatcher\Event;
|
use Symfony\Contracts\EventDispatcher\Event;
|
||||||
|
|
||||||
final class DashboardEvent extends Event
|
final class DashboardEvent extends Event
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
namespace App\Event;
|
namespace App\Event;
|
||||||
|
|
||||||
use App\Entity\User;
|
use App\Entity\User;
|
||||||
use Symfony\Component\EventDispatcher\Event;
|
use Symfony\Contracts\EventDispatcher\Event;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This event should be used, if a user profile is loaded and want to fill the dynamic user preferences
|
* This event should be used, if a user profile is loaded and want to fill the dynamic user preferences
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
namespace App\Event;
|
namespace App\Event;
|
||||||
|
|
||||||
use App\Entity\Project;
|
use App\Entity\Project;
|
||||||
use Symfony\Component\EventDispatcher\Event;
|
use Symfony\Contracts\EventDispatcher\Event;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This event can be used, to dynamically add meta fields to projects
|
* This event can be used, to dynamically add meta fields to projects
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
namespace App\Event;
|
namespace App\Event;
|
||||||
|
|
||||||
use App\Form\Model\SystemConfiguration;
|
use App\Form\Model\SystemConfiguration;
|
||||||
use Symfony\Component\EventDispatcher\Event;
|
use Symfony\Contracts\EventDispatcher\Event;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This event should be used, if system configurations should be changed/added dynamically.
|
* This event should be used, if system configurations should be changed/added dynamically.
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
namespace App\Event;
|
namespace App\Event;
|
||||||
|
|
||||||
use App\Entity\User;
|
use App\Entity\User;
|
||||||
use Symfony\Component\EventDispatcher\Event;
|
use Symfony\Contracts\EventDispatcher\Event;
|
||||||
|
|
||||||
final class ThemeEvent extends Event
|
final class ThemeEvent extends Event
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
namespace App\Event;
|
namespace App\Event;
|
||||||
|
|
||||||
use App\Entity\Timesheet;
|
use App\Entity\Timesheet;
|
||||||
use Symfony\Component\EventDispatcher\Event;
|
use Symfony\Contracts\EventDispatcher\Event;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This event can be used, to dynamically add meta fields to timesheets
|
* This event can be used, to dynamically add meta fields to timesheets
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ namespace App\Event;
|
|||||||
|
|
||||||
use App\Entity\User;
|
use App\Entity\User;
|
||||||
use App\Entity\UserPreference;
|
use App\Entity\UserPreference;
|
||||||
use Symfony\Component\EventDispatcher\Event;
|
use Symfony\Contracts\EventDispatcher\Event;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This event should be used, if further user preferences should added dynamically
|
* This event should be used, if further user preferences should added dynamically
|
||||||
|
|||||||
@@ -9,7 +9,6 @@
|
|||||||
|
|
||||||
namespace App\EventSubscriber;
|
namespace App\EventSubscriber;
|
||||||
|
|
||||||
use App\Event\ConfigureAdminMenuEvent;
|
|
||||||
use App\Event\ConfigureMainMenuEvent;
|
use App\Event\ConfigureMainMenuEvent;
|
||||||
use KevinPapst\AdminLTEBundle\Event\SidebarMenuEvent;
|
use KevinPapst\AdminLTEBundle\Event\SidebarMenuEvent;
|
||||||
use KevinPapst\AdminLTEBundle\Event\ThemeEvents;
|
use KevinPapst\AdminLTEBundle\Event\ThemeEvents;
|
||||||
@@ -73,16 +72,7 @@ class MenuBuilderSubscriber implements EventSubscriberInterface
|
|||||||
new MenuItemModel('system', 'menu.system', '')
|
new MenuItemModel('system', 'menu.system', '')
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->eventDispatcher->dispatch(ConfigureMainMenuEvent::CONFIGURE, $menuEvent);
|
$this->eventDispatcher->dispatch($menuEvent, ConfigureMainMenuEvent::CONFIGURE);
|
||||||
|
|
||||||
// @deprecated since 0.9, will be removed with 1.0
|
|
||||||
$this->eventDispatcher->dispatch(
|
|
||||||
ConfigureAdminMenuEvent::CONFIGURE,
|
|
||||||
new ConfigureAdminMenuEvent(
|
|
||||||
$request,
|
|
||||||
$menuEvent->getAdminMenu()
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
if ($menuEvent->getAdminMenu()->hasChildren()) {
|
if ($menuEvent->getAdminMenu()->hasChildren()) {
|
||||||
$event->addItem(new MenuItemModel('admin', 'menu.admin', ''));
|
$event->addItem(new MenuItemModel('admin', 'menu.admin', ''));
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ namespace App\EventSubscriber;
|
|||||||
|
|
||||||
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
|
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
|
||||||
use Symfony\Component\HttpFoundation\RedirectResponse;
|
use Symfony\Component\HttpFoundation\RedirectResponse;
|
||||||
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
|
use Symfony\Component\HttpKernel\Event\RequestEvent;
|
||||||
use Symfony\Component\HttpKernel\KernelEvents;
|
use Symfony\Component\HttpKernel\KernelEvents;
|
||||||
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
|
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
|
||||||
|
|
||||||
@@ -72,9 +72,6 @@ class RedirectToLocaleSubscriber implements EventSubscriberInterface
|
|||||||
$this->locales = array_unique($this->locales);
|
$this->locales = array_unique($this->locales);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return array
|
|
||||||
*/
|
|
||||||
public static function getSubscribedEvents(): array
|
public static function getSubscribedEvents(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
@@ -82,10 +79,7 @@ class RedirectToLocaleSubscriber implements EventSubscriberInterface
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public function onKernelRequest(RequestEvent $event)
|
||||||
* @param GetResponseEvent $event
|
|
||||||
*/
|
|
||||||
public function onKernelRequest(GetResponseEvent $event)
|
|
||||||
{
|
{
|
||||||
$request = $event->getRequest();
|
$request = $event->getRequest();
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ namespace App\EventSubscriber;
|
|||||||
|
|
||||||
use App\Entity\User;
|
use App\Entity\User;
|
||||||
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
|
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
|
||||||
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
|
use Symfony\Component\HttpKernel\Event\RequestEvent;
|
||||||
use Symfony\Component\HttpKernel\KernelEvents;
|
use Symfony\Component\HttpKernel\KernelEvents;
|
||||||
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
|
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
|
||||||
|
|
||||||
@@ -34,7 +34,7 @@ class TimezoneSubscriber implements EventSubscriberInterface
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setTimezone(GetResponseEvent $event)
|
public function setTimezone(RequestEvent $event)
|
||||||
{
|
{
|
||||||
if (!$this->canHandleEvent()) {
|
if (!$this->canHandleEvent()) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -155,7 +155,7 @@ class UserPreferenceSubscriber implements EventSubscriberInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
$event = new UserPreferenceEvent($user, $this->getDefaultPreferences($user));
|
$event = new UserPreferenceEvent($user, $this->getDefaultPreferences($user));
|
||||||
$this->eventDispatcher->dispatch(UserPreferenceEvent::CONFIGURE, $event);
|
$this->eventDispatcher->dispatch($event, UserPreferenceEvent::CONFIGURE);
|
||||||
|
|
||||||
foreach ($event->getPreferences() as $preference) {
|
foreach ($event->getPreferences() as $preference) {
|
||||||
/* @var UserPreference[] $prefs */
|
/* @var UserPreference[] $prefs */
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ class UserProfileSubscriber implements EventSubscriberInterface
|
|||||||
$user = $this->storage->getToken()->getUser();
|
$user = $this->storage->getToken()->getUser();
|
||||||
|
|
||||||
$event = new PrepareUserEvent($user);
|
$event = new PrepareUserEvent($user);
|
||||||
$this->eventDispatcher->dispatch(PrepareUserEvent::PREPARE, $event);
|
$this->eventDispatcher->dispatch($event, PrepareUserEvent::PREPARE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ namespace App\Form\Type;
|
|||||||
|
|
||||||
use Symfony\Component\Form\AbstractType;
|
use Symfony\Component\Form\AbstractType;
|
||||||
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
||||||
use Symfony\Component\Intl\Intl;
|
use Symfony\Component\Intl\Locales;
|
||||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -43,7 +43,7 @@ class LanguageType extends AbstractType
|
|||||||
{
|
{
|
||||||
$choices = [];
|
$choices = [];
|
||||||
foreach ($this->locales as $key) {
|
foreach ($this->locales as $key) {
|
||||||
$name = ucfirst(Intl::getLocaleBundle()->getLocaleName($key, $key));
|
$name = ucfirst(Locales::getName($key, $key));
|
||||||
$choices[$name] = $key;
|
$choices[$name] = $key;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ class EventExtensions extends AbstractExtension
|
|||||||
$themeEvent = new ThemeEvent($this->user, $payload);
|
$themeEvent = new ThemeEvent($this->user, $payload);
|
||||||
|
|
||||||
if ($this->hasListener($eventName)) {
|
if ($this->hasListener($eventName)) {
|
||||||
$this->getDispatcher()->dispatch($eventName, $themeEvent);
|
$this->getDispatcher()->dispatch($themeEvent, $eventName);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $themeEvent;
|
return $themeEvent;
|
||||||
|
|||||||
@@ -14,7 +14,9 @@ use App\Entity\Timesheet;
|
|||||||
use App\Utils\Duration;
|
use App\Utils\Duration;
|
||||||
use App\Utils\LocaleSettings;
|
use App\Utils\LocaleSettings;
|
||||||
use NumberFormatter;
|
use NumberFormatter;
|
||||||
use Symfony\Component\Intl\Intl;
|
use Symfony\Component\Intl\Countries;
|
||||||
|
use Symfony\Component\Intl\Currencies;
|
||||||
|
use Symfony\Component\Intl\Locales;
|
||||||
use Twig\Extension\AbstractExtension;
|
use Twig\Extension\AbstractExtension;
|
||||||
use Twig\TwigFilter;
|
use Twig\TwigFilter;
|
||||||
use Twig\TwigFunction;
|
use Twig\TwigFunction;
|
||||||
@@ -136,7 +138,7 @@ class Extensions extends AbstractExtension
|
|||||||
*/
|
*/
|
||||||
public function currency($currency)
|
public function currency($currency)
|
||||||
{
|
{
|
||||||
return Intl::getCurrencyBundle()->getCurrencySymbol($currency);
|
return Currencies::getSymbol($currency);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -145,7 +147,7 @@ class Extensions extends AbstractExtension
|
|||||||
*/
|
*/
|
||||||
public function country($country)
|
public function country($country)
|
||||||
{
|
{
|
||||||
return Intl::getRegionBundle()->getCountryName($country);
|
return Countries::getName($country);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -190,7 +192,7 @@ class Extensions extends AbstractExtension
|
|||||||
{
|
{
|
||||||
$locales = [];
|
$locales = [];
|
||||||
foreach ($this->localeSettings->getAvailableLanguages() as $locale) {
|
foreach ($this->localeSettings->getAvailableLanguages() as $locale) {
|
||||||
$locales[] = ['code' => $locale, 'name' => Intl::getLocaleBundle()->getLocaleName($locale, $locale)];
|
$locales[] = ['code' => $locale, 'name' => Locales::getName($locale, $locale)];
|
||||||
}
|
}
|
||||||
|
|
||||||
return $locales;
|
return $locales;
|
||||||
|
|||||||
18
symfony.lock
18
symfony.lock
@@ -528,6 +528,9 @@
|
|||||||
"ref": "fadbfe33303a76e25cb63401050439aa9b1a9c7f"
|
"ref": "fadbfe33303a76e25cb63401050439aa9b1a9c7f"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"symfony/mime": {
|
||||||
|
"version": "v4.3.3"
|
||||||
|
},
|
||||||
"symfony/monolog-bridge": {
|
"symfony/monolog-bridge": {
|
||||||
"version": "v4.0.3"
|
"version": "v4.0.3"
|
||||||
},
|
},
|
||||||
@@ -570,6 +573,9 @@
|
|||||||
"symfony/polyfill-php72": {
|
"symfony/polyfill-php72": {
|
||||||
"version": "v1.6.0"
|
"version": "v1.6.0"
|
||||||
},
|
},
|
||||||
|
"symfony/polyfill-php73": {
|
||||||
|
"version": "v1.11.0"
|
||||||
|
},
|
||||||
"symfony/process": {
|
"symfony/process": {
|
||||||
"version": "v4.0.3"
|
"version": "v4.0.3"
|
||||||
},
|
},
|
||||||
@@ -591,9 +597,6 @@
|
|||||||
"ref": "cda8b550123383d25827705d05a42acf6819fe4e"
|
"ref": "cda8b550123383d25827705d05a42acf6819fe4e"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"symfony/security": {
|
|
||||||
"version": "v4.2.8"
|
|
||||||
},
|
|
||||||
"symfony/security-bundle": {
|
"symfony/security-bundle": {
|
||||||
"version": "3.3",
|
"version": "3.3",
|
||||||
"recipe": {
|
"recipe": {
|
||||||
@@ -603,9 +606,18 @@
|
|||||||
"ref": "85834af1496735f28d831489d12ab1921a875e0d"
|
"ref": "85834af1496735f28d831489d12ab1921a875e0d"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"symfony/security-core": {
|
||||||
|
"version": "v4.3.3"
|
||||||
|
},
|
||||||
"symfony/security-csrf": {
|
"symfony/security-csrf": {
|
||||||
"version": "v4.0.4"
|
"version": "v4.0.4"
|
||||||
},
|
},
|
||||||
|
"symfony/security-guard": {
|
||||||
|
"version": "v4.3.3"
|
||||||
|
},
|
||||||
|
"symfony/security-http": {
|
||||||
|
"version": "v4.3.3"
|
||||||
|
},
|
||||||
"symfony/serializer": {
|
"symfony/serializer": {
|
||||||
"version": "v4.1.2"
|
"version": "v4.1.2"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -41,10 +41,19 @@ class CreateUserCommandTest extends KernelTestCase
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testCreateUser()
|
public function testCreateUserFailsForShortPassword()
|
||||||
{
|
{
|
||||||
$commandTester = $this->createUser('MyTestUser', 'user@example.com', 'ROLE_USER', 'foobar');
|
$commandTester = $this->createUser('MyTestUser', 'user@example.com', 'ROLE_USER', 'foobar');
|
||||||
|
|
||||||
|
$output = $commandTester->getDisplay();
|
||||||
|
$this->assertContains('[ERROR] plainPassword (foobar)', $output);
|
||||||
|
$this->assertContains('The password is too short.', $output);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testCreateUser()
|
||||||
|
{
|
||||||
|
$commandTester = $this->createUser('MyTestUser', 'user@example.com', 'ROLE_USER', 'foobar12');
|
||||||
|
|
||||||
$output = $commandTester->getDisplay();
|
$output = $commandTester->getDisplay();
|
||||||
$this->assertContains('[OK] Success! Created user: MyTestUser', $output);
|
$this->assertContains('[OK] Success! Created user: MyTestUser', $output);
|
||||||
|
|
||||||
@@ -69,7 +78,7 @@ class CreateUserCommandTest extends KernelTestCase
|
|||||||
return $commandTester;
|
return $commandTester;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testUserWithValidationProblem()
|
public function testUserWithEmptyFieldsTriggersValidationProblem()
|
||||||
{
|
{
|
||||||
$commandTester = $this->createUser('xx', '', 'ROLE_USER', '');
|
$commandTester = $this->createUser('xx', '', 'ROLE_USER', '');
|
||||||
$output = $commandTester->getDisplay();
|
$output = $commandTester->getDisplay();
|
||||||
@@ -81,7 +90,7 @@ class CreateUserCommandTest extends KernelTestCase
|
|||||||
|
|
||||||
public function testUserAlreadyExisting()
|
public function testUserAlreadyExisting()
|
||||||
{
|
{
|
||||||
$this->createUser('MyTestUser', 'user@example.com', 'ROLE_USER', 'foobar');
|
$this->createUser('MyTestUser', 'user@example.com', 'ROLE_USER', 'foobar12');
|
||||||
$commandTester = $this->createUser('MyTestUser', 'user@example.com', 'ROLE_USER', 'foobar');
|
$commandTester = $this->createUser('MyTestUser', 'user@example.com', 'ROLE_USER', 'foobar');
|
||||||
|
|
||||||
$output = $commandTester->getDisplay();
|
$output = $commandTester->getDisplay();
|
||||||
@@ -91,7 +100,7 @@ class CreateUserCommandTest extends KernelTestCase
|
|||||||
|
|
||||||
public function testUserEmail()
|
public function testUserEmail()
|
||||||
{
|
{
|
||||||
$commandTester = $this->createUser('MyTestUser', 'ROLE_USER', 'ROLE_USER', 'foobar');
|
$commandTester = $this->createUser('MyTestUser', 'ROLE_USER', 'ROLE_USER', 'foobar12');
|
||||||
|
|
||||||
$output = $commandTester->getDisplay();
|
$output = $commandTester->getDisplay();
|
||||||
$this->assertContains('[ERROR] email (ROLE_USER)', $output);
|
$this->assertContains('[ERROR] email (ROLE_USER)', $output);
|
||||||
|
|||||||
@@ -220,8 +220,8 @@ class ProfileControllerTest extends ControllerBaseTest
|
|||||||
$client->submit($form, [
|
$client->submit($form, [
|
||||||
'user_password' => [
|
'user_password' => [
|
||||||
'plainPassword' => [
|
'plainPassword' => [
|
||||||
'first' => 'test123',
|
'first' => 'test1234',
|
||||||
'second' => 'test123',
|
'second' => 'test1234',
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
]);
|
]);
|
||||||
@@ -236,7 +236,7 @@ class ProfileControllerTest extends ControllerBaseTest
|
|||||||
$user = $this->getUserByRole($em, User::ROLE_USER);
|
$user = $this->getUserByRole($em, User::ROLE_USER);
|
||||||
|
|
||||||
$this->assertFalse($passwordEncoder->getEncoder($user)->isPasswordValid($user->getPassword(), UserFixtures::DEFAULT_PASSWORD, $user->getSalt()));
|
$this->assertFalse($passwordEncoder->getEncoder($user)->isPasswordValid($user->getPassword(), UserFixtures::DEFAULT_PASSWORD, $user->getSalt()));
|
||||||
$this->assertTrue($passwordEncoder->getEncoder($user)->isPasswordValid($user->getPassword(), 'test123', $user->getSalt()));
|
$this->assertTrue($passwordEncoder->getEncoder($user)->isPasswordValid($user->getPassword(), 'test1234', $user->getSalt()));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testApiTokenAction()
|
public function testApiTokenAction()
|
||||||
|
|||||||
@@ -85,8 +85,8 @@ class SecurityControllerTest extends ControllerBaseTest
|
|||||||
'email' => 'test@example.com',
|
'email' => 'test@example.com',
|
||||||
'username' => 'example',
|
'username' => 'example',
|
||||||
'plainPassword' => [
|
'plainPassword' => [
|
||||||
'first' => 'test123',
|
'first' => 'test1234',
|
||||||
'second' => 'test123',
|
'second' => 'test1234',
|
||||||
],
|
],
|
||||||
]
|
]
|
||||||
]);
|
]);
|
||||||
|
|||||||
@@ -1,33 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
/*
|
|
||||||
* This file is part of the Kimai time-tracking app.
|
|
||||||
*
|
|
||||||
* For the full copyright and license information, please view the LICENSE
|
|
||||||
* file that was distributed with this source code.
|
|
||||||
*/
|
|
||||||
|
|
||||||
namespace App\Tests\Event;
|
|
||||||
|
|
||||||
use App\Event\ConfigureAdminMenuEvent;
|
|
||||||
use KevinPapst\AdminLTEBundle\Model\MenuItemModel;
|
|
||||||
use PHPUnit\Framework\TestCase;
|
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @covers \App\Event\ConfigureAdminMenuEvent
|
|
||||||
*/
|
|
||||||
class ConfigureAdminMenuEventTest extends TestCase
|
|
||||||
{
|
|
||||||
public function testGetterAndSetter()
|
|
||||||
{
|
|
||||||
$request = new Request();
|
|
||||||
$request->setLocale('de');
|
|
||||||
|
|
||||||
$admin = new MenuItemModel('admin', 'foo', 'bar');
|
|
||||||
$sut = new ConfigureAdminMenuEvent($request, $admin);
|
|
||||||
|
|
||||||
$this->assertEquals($request, $sut->getRequest());
|
|
||||||
$this->assertEquals($admin, $sut->getAdminMenu());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -10,3 +10,4 @@ parameters:
|
|||||||
- '#Access to an undefined property Faker\\Generator::\$bs.#'
|
- '#Access to an undefined property Faker\\Generator::\$bs.#'
|
||||||
excludes_analyse:
|
excludes_analyse:
|
||||||
- %rootDir%/../../../tests/Ldap/LdapDriverTest.php
|
- %rootDir%/../../../tests/Ldap/LdapDriverTest.php
|
||||||
|
inferPrivatePropertyTypeFromConstructor: true
|
||||||
Reference in New Issue
Block a user