From abcaf0d8eb7eead191a0d572e8c085c81d1684d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20Pfl=C3=BCger?= Date: Sun, 11 Sep 2016 17:46:01 +0200 Subject: [PATCH 1/9] UserProvider supportsClass return fix --- Resources/config/services.yml | 10 ++++++++++ Security/EmailUserProvider.php | 13 +++++++++++++ Security/UserProvider.php | 13 +++++++++++++ 3 files changed, 36 insertions(+) create mode 100644 Security/EmailUserProvider.php create mode 100644 Security/UserProvider.php diff --git a/Resources/config/services.yml b/Resources/config/services.yml index fb5ec4f..12eb31c 100644 --- a/Resources/config/services.yml +++ b/Resources/config/services.yml @@ -48,3 +48,13 @@ services: pugx_user_discriminator: alias: pugx_user.manager.user_discriminator + # user providers + pugx_multi_user.user_provider.username: + class: PUGX\MultiUserBundle\Security\UserProvider + arguments: ["@fos_user.user_manager"] + public: false + + pugx_multi_user.user_provider.username_email: + class: PUGX\MultiUserBundle\Security\EmailUserProvider + arguments: ["@fos_user.user_manager"] + public: false \ No newline at end of file diff --git a/Security/EmailUserProvider.php b/Security/EmailUserProvider.php new file mode 100644 index 0000000..6d6e541 --- /dev/null +++ b/Security/EmailUserProvider.php @@ -0,0 +1,13 @@ +userManager->getClass(); + return $userClass === $class || is_subclass_of($class, $userClass) || + (get_parent_class($class) === get_parent_class($userClass) && get_parent_class($class) !== false); + } +} \ No newline at end of file diff --git a/Security/UserProvider.php b/Security/UserProvider.php new file mode 100644 index 0000000..383615e --- /dev/null +++ b/Security/UserProvider.php @@ -0,0 +1,13 @@ +userManager->getClass(); + return $userClass === $class || is_subclass_of($class, $userClass) || + (get_parent_class($class) === get_parent_class($userClass) && get_parent_class($class) !== false); + } +} \ No newline at end of file From a2c7977b3b86359344cce008ab0075a10ff99396 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20Pfl=C3=BCger?= Date: Sun, 11 Sep 2016 17:51:16 +0200 Subject: [PATCH 2/9] Newline at end of file fix --- Resources/config/services.yml | 2 +- Security/EmailUserProvider.php | 2 +- Security/UserProvider.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Resources/config/services.yml b/Resources/config/services.yml index 12eb31c..d278889 100644 --- a/Resources/config/services.yml +++ b/Resources/config/services.yml @@ -57,4 +57,4 @@ services: pugx_multi_user.user_provider.username_email: class: PUGX\MultiUserBundle\Security\EmailUserProvider arguments: ["@fos_user.user_manager"] - public: false \ No newline at end of file + public: false diff --git a/Security/EmailUserProvider.php b/Security/EmailUserProvider.php index 6d6e541..2c11765 100644 --- a/Security/EmailUserProvider.php +++ b/Security/EmailUserProvider.php @@ -10,4 +10,4 @@ public function supportsClass($class) { return $userClass === $class || is_subclass_of($class, $userClass) || (get_parent_class($class) === get_parent_class($userClass) && get_parent_class($class) !== false); } -} \ No newline at end of file +} diff --git a/Security/UserProvider.php b/Security/UserProvider.php index 383615e..44e2d86 100644 --- a/Security/UserProvider.php +++ b/Security/UserProvider.php @@ -10,4 +10,4 @@ public function supportsClass($class) { return $userClass === $class || is_subclass_of($class, $userClass) || (get_parent_class($class) === get_parent_class($userClass) && get_parent_class($class) !== false); } -} \ No newline at end of file +} From 9b021b5edfc98e26017dfd52a344c0a179e2cf0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20Pfl=C3=BCger?= Date: Sun, 11 Sep 2016 18:08:36 +0200 Subject: [PATCH 3/9] Update EmailUserProvider.php --- Security/EmailUserProvider.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Security/EmailUserProvider.php b/Security/EmailUserProvider.php index 2c11765..4ddeeff 100644 --- a/Security/EmailUserProvider.php +++ b/Security/EmailUserProvider.php @@ -8,6 +8,6 @@ class EmailUserProvider extends FOSEmailUserProvider { public function supportsClass($class) { $userClass = $this->userManager->getClass(); return $userClass === $class || is_subclass_of($class, $userClass) || - (get_parent_class($class) === get_parent_class($userClass) && get_parent_class($class) !== false); + (get_parent_class($class) === get_parent_class($userClass) && get_parent_class($class) != false); } } From af02e6b09e8f1b9f2c473c039c71c9a6c081161e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20Pfl=C3=BCger?= Date: Sun, 11 Sep 2016 18:08:44 +0200 Subject: [PATCH 4/9] Update UserProvider.php --- Security/UserProvider.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Security/UserProvider.php b/Security/UserProvider.php index 44e2d86..584584c 100644 --- a/Security/UserProvider.php +++ b/Security/UserProvider.php @@ -8,6 +8,6 @@ class UserProvider extends FOSUserProvider { public function supportsClass($class) { $userClass = $this->userManager->getClass(); return $userClass === $class || is_subclass_of($class, $userClass) || - (get_parent_class($class) === get_parent_class($userClass) && get_parent_class($class) !== false); + (get_parent_class($class) === get_parent_class($userClass) && get_parent_class($class) != false); } } From 85e769050ff1a021e1d9b494decab64a97d6f68a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20Pfl=C3=BCger?= Date: Sun, 11 Sep 2016 18:14:04 +0200 Subject: [PATCH 5/9] Update EmailUserProvider.php --- Security/EmailUserProvider.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Security/EmailUserProvider.php b/Security/EmailUserProvider.php index 4ddeeff..074e2d7 100644 --- a/Security/EmailUserProvider.php +++ b/Security/EmailUserProvider.php @@ -8,6 +8,6 @@ class EmailUserProvider extends FOSEmailUserProvider { public function supportsClass($class) { $userClass = $this->userManager->getClass(); return $userClass === $class || is_subclass_of($class, $userClass) || - (get_parent_class($class) === get_parent_class($userClass) && get_parent_class($class) != false); + (get_parent_class($class) === get_parent_class($userClass) && get_parent_class($class) != false); } } From 6c1d01d10d814781ecd6c90ac8641f897a3588e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20Pfl=C3=BCger?= Date: Sun, 11 Sep 2016 18:15:29 +0200 Subject: [PATCH 6/9] Update EmailUserProvider.php --- Security/EmailUserProvider.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Security/EmailUserProvider.php b/Security/EmailUserProvider.php index 074e2d7..ed50f6d 100644 --- a/Security/EmailUserProvider.php +++ b/Security/EmailUserProvider.php @@ -8,6 +8,6 @@ class EmailUserProvider extends FOSEmailUserProvider { public function supportsClass($class) { $userClass = $this->userManager->getClass(); return $userClass === $class || is_subclass_of($class, $userClass) || - (get_parent_class($class) === get_parent_class($userClass) && get_parent_class($class) != false); + (get_parent_class($class) == get_parent_class($userClass) && get_parent_class($class) != false); } } From 47b7eb0b95275766d310c89852594e54c4e0ecd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20Pfl=C3=BCger?= Date: Sun, 11 Sep 2016 18:15:37 +0200 Subject: [PATCH 7/9] Update UserProvider.php --- Security/UserProvider.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Security/UserProvider.php b/Security/UserProvider.php index 584584c..fc73744 100644 --- a/Security/UserProvider.php +++ b/Security/UserProvider.php @@ -8,6 +8,6 @@ class UserProvider extends FOSUserProvider { public function supportsClass($class) { $userClass = $this->userManager->getClass(); return $userClass === $class || is_subclass_of($class, $userClass) || - (get_parent_class($class) === get_parent_class($userClass) && get_parent_class($class) != false); + (get_parent_class($class) == get_parent_class($userClass) && get_parent_class($class) != false); } } From 230e1a81277b7604bef125a02a61b546aa249763 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20Pfl=C3=BCger?= Date: Sun, 11 Sep 2016 18:17:37 +0200 Subject: [PATCH 8/9] Update EmailUserProvider.php --- Security/EmailUserProvider.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Security/EmailUserProvider.php b/Security/EmailUserProvider.php index ed50f6d..4e8724d 100644 --- a/Security/EmailUserProvider.php +++ b/Security/EmailUserProvider.php @@ -8,6 +8,6 @@ class EmailUserProvider extends FOSEmailUserProvider { public function supportsClass($class) { $userClass = $this->userManager->getClass(); return $userClass === $class || is_subclass_of($class, $userClass) || - (get_parent_class($class) == get_parent_class($userClass) && get_parent_class($class) != false); + (get_parent_class($class) === get_parent_class($userClass) && get_parent_class($class) !== false); } } From 7ca1ff38ab895f10264842ace675aa2be7722053 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20Pfl=C3=BCger?= Date: Sun, 11 Sep 2016 18:17:46 +0200 Subject: [PATCH 9/9] Update UserProvider.php --- Security/UserProvider.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Security/UserProvider.php b/Security/UserProvider.php index fc73744..44e2d86 100644 --- a/Security/UserProvider.php +++ b/Security/UserProvider.php @@ -8,6 +8,6 @@ class UserProvider extends FOSUserProvider { public function supportsClass($class) { $userClass = $this->userManager->getClass(); return $userClass === $class || is_subclass_of($class, $userClass) || - (get_parent_class($class) == get_parent_class($userClass) && get_parent_class($class) != false); + (get_parent_class($class) === get_parent_class($userClass) && get_parent_class($class) !== false); } }