From db02850a9d007afe3778b8370dfc6cc498de6b51 Mon Sep 17 00:00:00 2001 From: tattali Date: Thu, 1 Feb 2018 08:41:14 +0100 Subject: [PATCH 1/9] Add recipe for FOSUserBundle --- .../@dev/config/packages/fos_user.yaml | 7 +++++ .../@dev/config/routes/fos_user.yaml | 18 +++++++++++++ .../user-bundle/@dev/manifest.json | 9 +++++++ .../user-bundle/@dev/post-install.txt | 13 ++++++++++ .../user-bundle/@dev/src/Entity/User.php | 26 +++++++++++++++++++ 5 files changed, 73 insertions(+) create mode 100644 friendsofsymfony/user-bundle/@dev/config/packages/fos_user.yaml create mode 100644 friendsofsymfony/user-bundle/@dev/config/routes/fos_user.yaml create mode 100644 friendsofsymfony/user-bundle/@dev/manifest.json create mode 100644 friendsofsymfony/user-bundle/@dev/post-install.txt create mode 100644 friendsofsymfony/user-bundle/@dev/src/Entity/User.php diff --git a/friendsofsymfony/user-bundle/@dev/config/packages/fos_user.yaml b/friendsofsymfony/user-bundle/@dev/config/packages/fos_user.yaml new file mode 100644 index 000000000..6530da3b6 --- /dev/null +++ b/friendsofsymfony/user-bundle/@dev/config/packages/fos_user.yaml @@ -0,0 +1,7 @@ +fos_user: + db_driver: orm + firewall_name: main + user_class: App\Entity\User + from_email: + address: "address" + sender_name: "name" diff --git a/friendsofsymfony/user-bundle/@dev/config/routes/fos_user.yaml b/friendsofsymfony/user-bundle/@dev/config/routes/fos_user.yaml new file mode 100644 index 000000000..e9c0b0bae --- /dev/null +++ b/friendsofsymfony/user-bundle/@dev/config/routes/fos_user.yaml @@ -0,0 +1,18 @@ +fos_user_security: + resource: "@FOSUserBundle/Resources/config/routing/security.xml" + +fos_user_profile: + resource: "@FOSUserBundle/Resources/config/routing/profile.xml" + prefix: /profile + +fos_user_register: + resource: "@FOSUserBundle/Resources/config/routing/registration.xml" + prefix: /register + +fos_user_resetting: + resource: "@FOSUserBundle/Resources/config/routing/resetting.xml" + prefix: /resetting + +fos_user_change_password: + resource: "@FOSUserBundle/Resources/config/routing/change_password.xml" + prefix: /profile diff --git a/friendsofsymfony/user-bundle/@dev/manifest.json b/friendsofsymfony/user-bundle/@dev/manifest.json new file mode 100644 index 000000000..9221a7b13 --- /dev/null +++ b/friendsofsymfony/user-bundle/@dev/manifest.json @@ -0,0 +1,9 @@ +{ + "bundles": { + "FOS\\UserBundle\\FOSUserBundle": ["all"] + }, + "copy-from-recipe": { + "config/": "%CONFIG_DIR%/", + "src/": "%SRC_DIR%/" + } +} diff --git a/friendsofsymfony/user-bundle/@dev/post-install.txt b/friendsofsymfony/user-bundle/@dev/post-install.txt new file mode 100644 index 000000000..82226d357 --- /dev/null +++ b/friendsofsymfony/user-bundle/@dev/post-install.txt @@ -0,0 +1,13 @@ + + What's next? + + +Warning: make sure the twig engine is turned on in framework.yaml + + - If not, add the following to config/packages/framework.yaml: + +framework: + # ... + csrf_protection: { enabled: true } + templating: + engines: ['twig'] diff --git a/friendsofsymfony/user-bundle/@dev/src/Entity/User.php b/friendsofsymfony/user-bundle/@dev/src/Entity/User.php new file mode 100644 index 000000000..68b3254bf --- /dev/null +++ b/friendsofsymfony/user-bundle/@dev/src/Entity/User.php @@ -0,0 +1,26 @@ + Date: Thu, 1 Feb 2018 08:54:16 +0100 Subject: [PATCH 2/9] Rename friendsofsymfony/user-bundle/@dev/post-install.txt to friendsofsymfony/user-bundle/2.1.x-dev/post-install.txt --- friendsofsymfony/user-bundle/{@dev => 2.1.x-dev}/post-install.txt | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename friendsofsymfony/user-bundle/{@dev => 2.1.x-dev}/post-install.txt (100%) diff --git a/friendsofsymfony/user-bundle/@dev/post-install.txt b/friendsofsymfony/user-bundle/2.1.x-dev/post-install.txt similarity index 100% rename from friendsofsymfony/user-bundle/@dev/post-install.txt rename to friendsofsymfony/user-bundle/2.1.x-dev/post-install.txt From e123d028bdffcc8b529e20599ff42c1d91217a42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Attali?= Date: Thu, 1 Feb 2018 08:57:42 +0100 Subject: [PATCH 3/9] rename to 2.1.x-dev version --- .../user-bundle/{@dev => 2.1.x-dev}/config/packages/fos_user.yaml | 0 .../user-bundle/{@dev => 2.1.x-dev}/config/routes/fos_user.yaml | 0 friendsofsymfony/user-bundle/{@dev => 2.1.x-dev}/manifest.json | 0 .../user-bundle/{@dev => 2.1.x-dev}/src/Entity/User.php | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename friendsofsymfony/user-bundle/{@dev => 2.1.x-dev}/config/packages/fos_user.yaml (100%) rename friendsofsymfony/user-bundle/{@dev => 2.1.x-dev}/config/routes/fos_user.yaml (100%) rename friendsofsymfony/user-bundle/{@dev => 2.1.x-dev}/manifest.json (100%) rename friendsofsymfony/user-bundle/{@dev => 2.1.x-dev}/src/Entity/User.php (100%) diff --git a/friendsofsymfony/user-bundle/@dev/config/packages/fos_user.yaml b/friendsofsymfony/user-bundle/2.1.x-dev/config/packages/fos_user.yaml similarity index 100% rename from friendsofsymfony/user-bundle/@dev/config/packages/fos_user.yaml rename to friendsofsymfony/user-bundle/2.1.x-dev/config/packages/fos_user.yaml diff --git a/friendsofsymfony/user-bundle/@dev/config/routes/fos_user.yaml b/friendsofsymfony/user-bundle/2.1.x-dev/config/routes/fos_user.yaml similarity index 100% rename from friendsofsymfony/user-bundle/@dev/config/routes/fos_user.yaml rename to friendsofsymfony/user-bundle/2.1.x-dev/config/routes/fos_user.yaml diff --git a/friendsofsymfony/user-bundle/@dev/manifest.json b/friendsofsymfony/user-bundle/2.1.x-dev/manifest.json similarity index 100% rename from friendsofsymfony/user-bundle/@dev/manifest.json rename to friendsofsymfony/user-bundle/2.1.x-dev/manifest.json diff --git a/friendsofsymfony/user-bundle/@dev/src/Entity/User.php b/friendsofsymfony/user-bundle/2.1.x-dev/src/Entity/User.php similarity index 100% rename from friendsofsymfony/user-bundle/@dev/src/Entity/User.php rename to friendsofsymfony/user-bundle/2.1.x-dev/src/Entity/User.php From f5c05978350351039bbd86b2b2ceea3e3879b2b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Attali?= Date: Thu, 1 Feb 2018 09:00:27 +0100 Subject: [PATCH 4/9] rename to 2.1 version --- .../user-bundle/{2.1.x-dev => 2.1}/config/packages/fos_user.yaml | 0 .../user-bundle/{2.1.x-dev => 2.1}/config/routes/fos_user.yaml | 0 friendsofsymfony/user-bundle/{2.1.x-dev => 2.1}/manifest.json | 0 friendsofsymfony/user-bundle/{2.1.x-dev => 2.1}/post-install.txt | 0 .../user-bundle/{2.1.x-dev => 2.1}/src/Entity/User.php | 0 5 files changed, 0 insertions(+), 0 deletions(-) rename friendsofsymfony/user-bundle/{2.1.x-dev => 2.1}/config/packages/fos_user.yaml (100%) rename friendsofsymfony/user-bundle/{2.1.x-dev => 2.1}/config/routes/fos_user.yaml (100%) rename friendsofsymfony/user-bundle/{2.1.x-dev => 2.1}/manifest.json (100%) rename friendsofsymfony/user-bundle/{2.1.x-dev => 2.1}/post-install.txt (100%) rename friendsofsymfony/user-bundle/{2.1.x-dev => 2.1}/src/Entity/User.php (100%) diff --git a/friendsofsymfony/user-bundle/2.1.x-dev/config/packages/fos_user.yaml b/friendsofsymfony/user-bundle/2.1/config/packages/fos_user.yaml similarity index 100% rename from friendsofsymfony/user-bundle/2.1.x-dev/config/packages/fos_user.yaml rename to friendsofsymfony/user-bundle/2.1/config/packages/fos_user.yaml diff --git a/friendsofsymfony/user-bundle/2.1.x-dev/config/routes/fos_user.yaml b/friendsofsymfony/user-bundle/2.1/config/routes/fos_user.yaml similarity index 100% rename from friendsofsymfony/user-bundle/2.1.x-dev/config/routes/fos_user.yaml rename to friendsofsymfony/user-bundle/2.1/config/routes/fos_user.yaml diff --git a/friendsofsymfony/user-bundle/2.1.x-dev/manifest.json b/friendsofsymfony/user-bundle/2.1/manifest.json similarity index 100% rename from friendsofsymfony/user-bundle/2.1.x-dev/manifest.json rename to friendsofsymfony/user-bundle/2.1/manifest.json diff --git a/friendsofsymfony/user-bundle/2.1.x-dev/post-install.txt b/friendsofsymfony/user-bundle/2.1/post-install.txt similarity index 100% rename from friendsofsymfony/user-bundle/2.1.x-dev/post-install.txt rename to friendsofsymfony/user-bundle/2.1/post-install.txt diff --git a/friendsofsymfony/user-bundle/2.1.x-dev/src/Entity/User.php b/friendsofsymfony/user-bundle/2.1/src/Entity/User.php similarity index 100% rename from friendsofsymfony/user-bundle/2.1.x-dev/src/Entity/User.php rename to friendsofsymfony/user-bundle/2.1/src/Entity/User.php From f1f2b7049e3a73b69f4a0d9800173a6ebb86f9db Mon Sep 17 00:00:00 2001 From: tattali Date: Mon, 5 Feb 2018 16:12:15 +0100 Subject: [PATCH 5/9] Update post-install.txt --- friendsofsymfony/user-bundle/2.1/post-install.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/friendsofsymfony/user-bundle/2.1/post-install.txt b/friendsofsymfony/user-bundle/2.1/post-install.txt index 82226d357..268dc2054 100644 --- a/friendsofsymfony/user-bundle/2.1/post-install.txt +++ b/friendsofsymfony/user-bundle/2.1/post-install.txt @@ -4,10 +4,15 @@ Warning: make sure the twig engine is turned on in framework.yaml - - If not, add the following to config/packages/framework.yaml: + - Modify your address config in config/packages/fos_user.yaml + + - If not, add the following to config/packages/framework.yaml: framework: # ... csrf_protection: { enabled: true } templating: engines: ['twig'] + + - Modify your security configuration in config/packages/security.yaml + https://symfony.com/doc/2.0/bundles/FOSUserBundle/index.html#step-4-configure-your-application-s-security-yml From dfb8b229e496d031a68151d7d62eec13fb56a6f9 Mon Sep 17 00:00:00 2001 From: tattali Date: Tue, 6 Feb 2018 15:59:26 +0100 Subject: [PATCH 6/9] Update fos_user.yaml --- friendsofsymfony/user-bundle/2.1/config/packages/fos_user.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/friendsofsymfony/user-bundle/2.1/config/packages/fos_user.yaml b/friendsofsymfony/user-bundle/2.1/config/packages/fos_user.yaml index 6530da3b6..19e387f42 100644 --- a/friendsofsymfony/user-bundle/2.1/config/packages/fos_user.yaml +++ b/friendsofsymfony/user-bundle/2.1/config/packages/fos_user.yaml @@ -1,5 +1,7 @@ fos_user: db_driver: orm + service: + mailer: fos_user.mailer.twig_swift firewall_name: main user_class: App\Entity\User from_email: From 53c9524f5a680461bd6b7dc5ffea82f044a2a9a5 Mon Sep 17 00:00:00 2001 From: tattali Date: Mon, 4 Jun 2018 00:42:32 +0200 Subject: [PATCH 7/9] Update post-install.txt --- friendsofsymfony/user-bundle/2.1/post-install.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/friendsofsymfony/user-bundle/2.1/post-install.txt b/friendsofsymfony/user-bundle/2.1/post-install.txt index 268dc2054..3284df813 100644 --- a/friendsofsymfony/user-bundle/2.1/post-install.txt +++ b/friendsofsymfony/user-bundle/2.1/post-install.txt @@ -4,7 +4,7 @@ Warning: make sure the twig engine is turned on in framework.yaml - - Modify your address config in config/packages/fos_user.yaml + - Modify your email address config in config/packages/fos_user.yaml - If not, add the following to config/packages/framework.yaml: From 176e34b19b24d8641cbfe6fdc77ecf533c5e622d Mon Sep 17 00:00:00 2001 From: tattali Date: Tue, 3 Jul 2018 11:36:11 +0200 Subject: [PATCH 8/9] Update fos_user.yaml --- friendsofsymfony/user-bundle/2.1/config/packages/fos_user.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/friendsofsymfony/user-bundle/2.1/config/packages/fos_user.yaml b/friendsofsymfony/user-bundle/2.1/config/packages/fos_user.yaml index 19e387f42..1dc2ce678 100644 --- a/friendsofsymfony/user-bundle/2.1/config/packages/fos_user.yaml +++ b/friendsofsymfony/user-bundle/2.1/config/packages/fos_user.yaml @@ -1,7 +1,7 @@ fos_user: db_driver: orm service: - mailer: fos_user.mailer.twig_swift + mailer: fos_user.mailer.noop firewall_name: main user_class: App\Entity\User from_email: From 9bd9382d9a56b5e9a459eeae14f6336461791098 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Attali?= Date: Thu, 16 Aug 2018 17:01:30 +0200 Subject: [PATCH 9/9] use no_driver parameter and modify post-install.txt --- .../user-bundle/2.1/config/packages/fos_user.yaml | 11 ++++++----- friendsofsymfony/user-bundle/2.1/manifest.json | 4 ++++ friendsofsymfony/user-bundle/2.1/post-install.txt | 13 ++++++++----- 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/friendsofsymfony/user-bundle/2.1/config/packages/fos_user.yaml b/friendsofsymfony/user-bundle/2.1/config/packages/fos_user.yaml index 1dc2ce678..e84b2d982 100644 --- a/friendsofsymfony/user-bundle/2.1/config/packages/fos_user.yaml +++ b/friendsofsymfony/user-bundle/2.1/config/packages/fos_user.yaml @@ -1,9 +1,10 @@ fos_user: - db_driver: orm + db_driver: no_driver # valid values are 'orm', 'mongodb' and 'couchdb' + user_class: App\Entity\User + firewall_name: main service: mailer: fos_user.mailer.noop - firewall_name: main - user_class: App\Entity\User from_email: - address: "address" - sender_name: "name" + address: "%env(MAILER_SENDER_ADDRESS)%" + sender_name: "%env(MAILER_SENDER_NAME)%" + diff --git a/friendsofsymfony/user-bundle/2.1/manifest.json b/friendsofsymfony/user-bundle/2.1/manifest.json index 9221a7b13..9e49b131d 100644 --- a/friendsofsymfony/user-bundle/2.1/manifest.json +++ b/friendsofsymfony/user-bundle/2.1/manifest.json @@ -5,5 +5,9 @@ "copy-from-recipe": { "config/": "%CONFIG_DIR%/", "src/": "%SRC_DIR%/" + }, + "env": { + "MAILER_SENDER_ADDRESS": "joh.doe@example.com", + "MAILER_SENDER_NAME": "John Doe" } } diff --git a/friendsofsymfony/user-bundle/2.1/post-install.txt b/friendsofsymfony/user-bundle/2.1/post-install.txt index 3284df813..55f3e31ca 100644 --- a/friendsofsymfony/user-bundle/2.1/post-install.txt +++ b/friendsofsymfony/user-bundle/2.1/post-install.txt @@ -2,17 +2,20 @@ What's next? -Warning: make sure the twig engine is turned on in framework.yaml + - If not, install a driver storage and change it in config/packages/fos_user.yaml - - Modify your email address config in config/packages/fos_user.yaml + - Modify your email address config in .env - - If not, add the following to config/packages/framework.yaml: + - Uncomment csrf_protection and make sure twig engine is turned on by adding in config/packages/framework.yaml: framework: # ... - csrf_protection: { enabled: true } + csrf_protection: true templating: engines: ['twig'] + - Create your User class + https://symfony.com/doc/master/bundles/FOSUserBundle/index.html#step-3-create-your-user-class + - Modify your security configuration in config/packages/security.yaml - https://symfony.com/doc/2.0/bundles/FOSUserBundle/index.html#step-4-configure-your-application-s-security-yml + https://symfony.com/doc/master/bundles/FOSUserBundle/index.html#step-4-configure-your-application-s-security-yml