From 1ff6d0e667e9a774ecbdce1c77959038374bf7ab Mon Sep 17 00:00:00 2001 From: Diogo Domanski de Souza Date: Sun, 3 May 2015 17:46:22 -0300 Subject: [PATCH 1/3] - Added register.pre event trigger --- src/ScnSocialAuth/Authentication/Adapter/HybridAuth.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/ScnSocialAuth/Authentication/Adapter/HybridAuth.php b/src/ScnSocialAuth/Authentication/Adapter/HybridAuth.php index a3771bee..ef04af40 100644 --- a/src/ScnSocialAuth/Authentication/Adapter/HybridAuth.php +++ b/src/ScnSocialAuth/Authentication/Adapter/HybridAuth.php @@ -130,6 +130,10 @@ public function authenticate(AuthEvent $authEvent) $localUserProvider->setUserId($localUser->getId()) ->setProviderId($userProfile->identifier) ->setProvider($provider); + + // Trigger register.pre event + $this->getEventManager()->trigger('register.pre', $this, array('user' => $localUser, 'userProvider' => $localUserProvider, 'userProfile' => $userProfile)); + $this->getMapper()->insert($localUserProvider); // Trigger register.post event From eb269716e771735178b41a6d6222146da4f6f787 Mon Sep 17 00:00:00 2001 From: Diogo Domanski de Souza Date: Sat, 9 May 2015 10:28:13 -0300 Subject: [PATCH 2/3] - Added register.pre event trigger --- src/ScnSocialAuth/Authentication/Adapter/HybridAuth.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ScnSocialAuth/Authentication/Adapter/HybridAuth.php b/src/ScnSocialAuth/Authentication/Adapter/HybridAuth.php index ef04af40..037a63d0 100644 --- a/src/ScnSocialAuth/Authentication/Adapter/HybridAuth.php +++ b/src/ScnSocialAuth/Authentication/Adapter/HybridAuth.php @@ -130,9 +130,9 @@ public function authenticate(AuthEvent $authEvent) $localUserProvider->setUserId($localUser->getId()) ->setProviderId($userProfile->identifier) ->setProvider($provider); - - // Trigger register.pre event - $this->getEventManager()->trigger('register.pre', $this, array('user' => $localUser, 'userProvider' => $localUserProvider, 'userProfile' => $userProfile)); + + // Trigger register.pre event + $this->getEventManager()->trigger('register.pre', $this, array('user' => $localUser, 'userProvider' => $localUserProvider, 'userProfile' => $userProfile)); $this->getMapper()->insert($localUserProvider); From 99cba63c497eeabc94425bdf3f89d714693a88f4 Mon Sep 17 00:00:00 2001 From: Diogo Domanski de Souza Date: Sat, 9 May 2015 10:35:03 -0300 Subject: [PATCH 3/3] - Added register.pre event trigger --- src/ScnSocialAuth/Authentication/Adapter/HybridAuth.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ScnSocialAuth/Authentication/Adapter/HybridAuth.php b/src/ScnSocialAuth/Authentication/Adapter/HybridAuth.php index 037a63d0..f3bb8187 100644 --- a/src/ScnSocialAuth/Authentication/Adapter/HybridAuth.php +++ b/src/ScnSocialAuth/Authentication/Adapter/HybridAuth.php @@ -133,7 +133,7 @@ public function authenticate(AuthEvent $authEvent) // Trigger register.pre event $this->getEventManager()->trigger('register.pre', $this, array('user' => $localUser, 'userProvider' => $localUserProvider, 'userProfile' => $userProfile)); - + $this->getMapper()->insert($localUserProvider); // Trigger register.post event