forked from FriendsOfSymfony/FOSUserBundle
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merged in bugfix (pull request FriendsOfSymfony#1)
Bugfix Approved-by: Dani González <[email protected]>
- Loading branch information
Showing
36 changed files
with
186 additions
and
211 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
.php_cs | ||
.php_cs.cache | ||
.phpunit.result.cache | ||
.idea/ | ||
composer.lock | ||
phpunit.xml | ||
vendor/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,8 +18,8 @@ | |
use FOS\UserBundle\FOSUserEvents; | ||
use FOS\UserBundle\Model\UserInterface; | ||
use FOS\UserBundle\Model\UserManagerInterface; | ||
use Symfony\Bundle\FrameworkBundle\Controller\Controller; | ||
use Symfony\Component\EventDispatcher\EventDispatcherInterface; | ||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; | ||
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface; | ||
use Symfony\Component\HttpFoundation\RedirectResponse; | ||
use Symfony\Component\HttpFoundation\Request; | ||
use Symfony\Component\HttpFoundation\Response; | ||
|
@@ -31,7 +31,7 @@ | |
* @author Thibault Duplessis <[email protected]> | ||
* @author Christophe Coevoet <[email protected]> | ||
*/ | ||
class ChangePasswordController extends Controller | ||
class ChangePasswordController extends AbstractController | ||
{ | ||
private $eventDispatcher; | ||
private $formFactory; | ||
|
@@ -59,7 +59,7 @@ public function changePasswordAction(Request $request) | |
} | ||
|
||
$event = new GetResponseUserEvent($user, $request); | ||
$this->eventDispatcher->dispatch(FOSUserEvents::CHANGE_PASSWORD_INITIALIZE, $event); | ||
$this->eventDispatcher->dispatch($event, FOSUserEvents::CHANGE_PASSWORD_INITIALIZE); | ||
|
||
if (null !== $event->getResponse()) { | ||
return $event->getResponse(); | ||
|
@@ -72,7 +72,7 @@ public function changePasswordAction(Request $request) | |
|
||
if ($form->isSubmitted() && $form->isValid()) { | ||
$event = new FormEvent($form, $request); | ||
$this->eventDispatcher->dispatch(FOSUserEvents::CHANGE_PASSWORD_SUCCESS, $event); | ||
$this->eventDispatcher->dispatch($event, FOSUserEvents::CHANGE_PASSWORD_SUCCESS); | ||
|
||
$this->userManager->updateUser($user); | ||
|
||
|
@@ -81,7 +81,7 @@ public function changePasswordAction(Request $request) | |
$response = new RedirectResponse($url); | ||
} | ||
|
||
$this->eventDispatcher->dispatch(FOSUserEvents::CHANGE_PASSWORD_COMPLETED, new FilterUserResponseEvent($user, $request, $response)); | ||
$this->eventDispatcher->dispatch(new FilterUserResponseEvent($user, $request, $response), FOSUserEvents::CHANGE_PASSWORD_COMPLETED); | ||
|
||
return $response; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,8 +19,8 @@ | |
use FOS\UserBundle\FOSUserEvents; | ||
use FOS\UserBundle\Model\GroupInterface; | ||
use FOS\UserBundle\Model\GroupManagerInterface; | ||
use Symfony\Bundle\FrameworkBundle\Controller\Controller; | ||
use Symfony\Component\EventDispatcher\EventDispatcherInterface; | ||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; | ||
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface; | ||
use Symfony\Component\HttpFoundation\RedirectResponse; | ||
use Symfony\Component\HttpFoundation\Request; | ||
use Symfony\Component\HttpFoundation\Response; | ||
|
@@ -32,7 +32,7 @@ | |
* @author Thibault Duplessis <[email protected]> | ||
* @author Christophe Coevoet <[email protected]> | ||
*/ | ||
class GroupController extends Controller | ||
class GroupController extends AbstractController | ||
{ | ||
private $eventDispatcher; | ||
private $formFactory; | ||
|
@@ -82,7 +82,7 @@ public function editAction(Request $request, $groupName) | |
$group = $this->findGroupBy('name', $groupName); | ||
|
||
$event = new GetResponseGroupEvent($group, $request); | ||
$this->eventDispatcher->dispatch(FOSUserEvents::GROUP_EDIT_INITIALIZE, $event); | ||
$this->eventDispatcher->dispatch($event, FOSUserEvents::GROUP_EDIT_INITIALIZE); | ||
|
||
if (null !== $event->getResponse()) { | ||
return $event->getResponse(); | ||
|
@@ -95,7 +95,7 @@ public function editAction(Request $request, $groupName) | |
|
||
if ($form->isSubmitted() && $form->isValid()) { | ||
$event = new FormEvent($form, $request); | ||
$this->eventDispatcher->dispatch(FOSUserEvents::GROUP_EDIT_SUCCESS, $event); | ||
$this->eventDispatcher->dispatch($event, FOSUserEvents::GROUP_EDIT_SUCCESS); | ||
|
||
$this->groupManager->updateGroup($group); | ||
|
||
|
@@ -104,7 +104,7 @@ public function editAction(Request $request, $groupName) | |
$response = new RedirectResponse($url); | ||
} | ||
|
||
$this->eventDispatcher->dispatch(FOSUserEvents::GROUP_EDIT_COMPLETED, new FilterGroupResponseEvent($group, $request, $response)); | ||
$this->eventDispatcher->dispatch(new FilterGroupResponseEvent($group, $request, $response), FOSUserEvents::GROUP_EDIT_COMPLETED); | ||
|
||
return $response; | ||
} | ||
|
@@ -126,7 +126,7 @@ public function newAction(Request $request) | |
{ | ||
$group = $this->groupManager->createGroup(''); | ||
|
||
$this->eventDispatcher->dispatch(FOSUserEvents::GROUP_CREATE_INITIALIZE, new GroupEvent($group, $request)); | ||
$this->eventDispatcher->dispatch(new GroupEvent($group, $request), FOSUserEvents::GROUP_CREATE_INITIALIZE); | ||
|
||
$form = $this->formFactory->createForm(); | ||
$form->setData($group); | ||
|
@@ -135,7 +135,7 @@ public function newAction(Request $request) | |
|
||
if ($form->isSubmitted() && $form->isValid()) { | ||
$event = new FormEvent($form, $request); | ||
$this->eventDispatcher->dispatch(FOSUserEvents::GROUP_CREATE_SUCCESS, $event); | ||
$this->eventDispatcher->dispatch($event, FOSUserEvents::GROUP_CREATE_SUCCESS); | ||
|
||
$this->groupManager->updateGroup($group); | ||
|
||
|
@@ -144,7 +144,7 @@ public function newAction(Request $request) | |
$response = new RedirectResponse($url); | ||
} | ||
|
||
$this->eventDispatcher->dispatch(FOSUserEvents::GROUP_CREATE_COMPLETED, new FilterGroupResponseEvent($group, $request, $response)); | ||
$this->eventDispatcher->dispatch(new FilterGroupResponseEvent($group, $request, $response), FOSUserEvents::GROUP_CREATE_COMPLETED); | ||
|
||
return $response; | ||
} | ||
|
@@ -169,7 +169,7 @@ public function deleteAction(Request $request, $groupName) | |
|
||
$response = new RedirectResponse($this->generateUrl('fos_user_group_list')); | ||
|
||
$this->eventDispatcher->dispatch(FOSUserEvents::GROUP_DELETE_COMPLETED, new FilterGroupResponseEvent($group, $request, $response)); | ||
$this->eventDispatcher->dispatch(new FilterGroupResponseEvent($group, $request, $response), FOSUserEvents::GROUP_DELETE_COMPLETED); | ||
|
||
return $response; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,8 +18,8 @@ | |
use FOS\UserBundle\FOSUserEvents; | ||
use FOS\UserBundle\Model\UserInterface; | ||
use FOS\UserBundle\Model\UserManagerInterface; | ||
use Symfony\Bundle\FrameworkBundle\Controller\Controller; | ||
use Symfony\Component\EventDispatcher\EventDispatcherInterface; | ||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; | ||
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface; | ||
use Symfony\Component\HttpFoundation\RedirectResponse; | ||
use Symfony\Component\HttpFoundation\Request; | ||
use Symfony\Component\HttpFoundation\Response; | ||
|
@@ -30,7 +30,7 @@ | |
* | ||
* @author Christophe Coevoet <[email protected]> | ||
*/ | ||
class ProfileController extends Controller | ||
class ProfileController extends AbstractController | ||
{ | ||
private $eventDispatcher; | ||
private $formFactory; | ||
|
@@ -73,7 +73,7 @@ public function editAction(Request $request) | |
} | ||
|
||
$event = new GetResponseUserEvent($user, $request); | ||
$this->eventDispatcher->dispatch(FOSUserEvents::PROFILE_EDIT_INITIALIZE, $event); | ||
$this->eventDispatcher->dispatch($event, FOSUserEvents::PROFILE_EDIT_INITIALIZE); | ||
|
||
if (null !== $event->getResponse()) { | ||
return $event->getResponse(); | ||
|
@@ -86,7 +86,7 @@ public function editAction(Request $request) | |
|
||
if ($form->isSubmitted() && $form->isValid()) { | ||
$event = new FormEvent($form, $request); | ||
$this->eventDispatcher->dispatch(FOSUserEvents::PROFILE_EDIT_SUCCESS, $event); | ||
$this->eventDispatcher->dispatch($event, FOSUserEvents::PROFILE_EDIT_SUCCESS); | ||
|
||
$this->userManager->updateUser($user); | ||
|
||
|
@@ -95,7 +95,7 @@ public function editAction(Request $request) | |
$response = new RedirectResponse($url); | ||
} | ||
|
||
$this->eventDispatcher->dispatch(FOSUserEvents::PROFILE_EDIT_COMPLETED, new FilterUserResponseEvent($user, $request, $response)); | ||
$this->eventDispatcher->dispatch(new FilterUserResponseEvent($user, $request, $response), FOSUserEvents::PROFILE_EDIT_COMPLETED); | ||
|
||
return $response; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,8 +18,8 @@ | |
use FOS\UserBundle\FOSUserEvents; | ||
use FOS\UserBundle\Model\UserInterface; | ||
use FOS\UserBundle\Model\UserManagerInterface; | ||
use Symfony\Bundle\FrameworkBundle\Controller\Controller; | ||
use Symfony\Component\EventDispatcher\EventDispatcherInterface; | ||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; | ||
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface; | ||
use Symfony\Component\HttpFoundation\RedirectResponse; | ||
use Symfony\Component\HttpFoundation\Request; | ||
use Symfony\Component\HttpFoundation\Response; | ||
|
@@ -33,7 +33,7 @@ | |
* @author Thibault Duplessis <[email protected]> | ||
* @author Christophe Coevoet <[email protected]> | ||
*/ | ||
class RegistrationController extends Controller | ||
class RegistrationController extends AbstractController | ||
{ | ||
private $eventDispatcher; | ||
private $formFactory; | ||
|
@@ -59,7 +59,7 @@ public function registerAction(Request $request) | |
$user->setEnabled(true); | ||
|
||
$event = new GetResponseUserEvent($user, $request); | ||
$this->eventDispatcher->dispatch(FOSUserEvents::REGISTRATION_INITIALIZE, $event); | ||
$this->eventDispatcher->dispatch($event, FOSUserEvents::REGISTRATION_INITIALIZE); | ||
|
||
if (null !== $event->getResponse()) { | ||
return $event->getResponse(); | ||
|
@@ -73,7 +73,7 @@ public function registerAction(Request $request) | |
if ($form->isSubmitted()) { | ||
if ($form->isValid()) { | ||
$event = new FormEvent($form, $request); | ||
$this->eventDispatcher->dispatch(FOSUserEvents::REGISTRATION_SUCCESS, $event); | ||
$this->eventDispatcher->dispatch($event, FOSUserEvents::REGISTRATION_SUCCESS); | ||
|
||
$this->userManager->updateUser($user); | ||
|
||
|
@@ -82,13 +82,13 @@ public function registerAction(Request $request) | |
$response = new RedirectResponse($url); | ||
} | ||
|
||
$this->eventDispatcher->dispatch(FOSUserEvents::REGISTRATION_COMPLETED, new FilterUserResponseEvent($user, $request, $response)); | ||
$this->eventDispatcher->dispatch(new FilterUserResponseEvent($user, $request, $response), FOSUserEvents::REGISTRATION_COMPLETED); | ||
|
||
return $response; | ||
} | ||
|
||
$event = new FormEvent($form, $request); | ||
$this->eventDispatcher->dispatch(FOSUserEvents::REGISTRATION_FAILURE, $event); | ||
$this->eventDispatcher->dispatch($event, FOSUserEvents::REGISTRATION_FAILURE); | ||
|
||
if (null !== $response = $event->getResponse()) { | ||
return $response; | ||
|
@@ -145,7 +145,7 @@ public function confirmAction(Request $request, $token) | |
$user->setEnabled(true); | ||
|
||
$event = new GetResponseUserEvent($user, $request); | ||
$this->eventDispatcher->dispatch(FOSUserEvents::REGISTRATION_CONFIRM, $event); | ||
$this->eventDispatcher->dispatch($event, FOSUserEvents::REGISTRATION_CONFIRM); | ||
|
||
$userManager->updateUser($user); | ||
|
||
|
@@ -154,7 +154,7 @@ public function confirmAction(Request $request, $token) | |
$response = new RedirectResponse($url); | ||
} | ||
|
||
$this->eventDispatcher->dispatch(FOSUserEvents::REGISTRATION_CONFIRMED, new FilterUserResponseEvent($user, $request, $response)); | ||
$this->eventDispatcher->dispatch(new FilterUserResponseEvent($user, $request, $response), FOSUserEvents::REGISTRATION_CONFIRMED); | ||
|
||
return $response; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,8 +20,8 @@ | |
use FOS\UserBundle\Mailer\MailerInterface; | ||
use FOS\UserBundle\Model\UserManagerInterface; | ||
use FOS\UserBundle\Util\TokenGeneratorInterface; | ||
use Symfony\Bundle\FrameworkBundle\Controller\Controller; | ||
use Symfony\Component\EventDispatcher\EventDispatcherInterface; | ||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; | ||
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface; | ||
use Symfony\Component\HttpFoundation\RedirectResponse; | ||
use Symfony\Component\HttpFoundation\Request; | ||
use Symfony\Component\HttpFoundation\Response; | ||
|
@@ -32,7 +32,7 @@ | |
* @author Thibault Duplessis <[email protected]> | ||
* @author Christophe Coevoet <[email protected]> | ||
*/ | ||
class ResettingController extends Controller | ||
class ResettingController extends AbstractController | ||
{ | ||
private $eventDispatcher; | ||
private $formFactory; | ||
|
@@ -85,15 +85,15 @@ public function sendEmailAction(Request $request) | |
$user = $this->userManager->findUserByUsernameOrEmail($username); | ||
|
||
$event = new GetResponseNullableUserEvent($user, $request); | ||
$this->eventDispatcher->dispatch(FOSUserEvents::RESETTING_SEND_EMAIL_INITIALIZE, $event); | ||
$this->eventDispatcher->dispatch($event, FOSUserEvents::RESETTING_SEND_EMAIL_INITIALIZE); | ||
|
||
if (null !== $event->getResponse()) { | ||
return $event->getResponse(); | ||
} | ||
|
||
if (null !== $user && !$user->isPasswordRequestNonExpired($this->retryTtl)) { | ||
$event = new GetResponseUserEvent($user, $request); | ||
$this->eventDispatcher->dispatch(FOSUserEvents::RESETTING_RESET_REQUEST, $event); | ||
$this->eventDispatcher->dispatch($event, FOSUserEvents::RESETTING_RESET_REQUEST); | ||
|
||
if (null !== $event->getResponse()) { | ||
return $event->getResponse(); | ||
|
@@ -104,7 +104,7 @@ public function sendEmailAction(Request $request) | |
} | ||
|
||
$event = new GetResponseUserEvent($user, $request); | ||
$this->eventDispatcher->dispatch(FOSUserEvents::RESETTING_SEND_EMAIL_CONFIRM, $event); | ||
$this->eventDispatcher->dispatch($event, FOSUserEvents::RESETTING_SEND_EMAIL_CONFIRM); | ||
|
||
if (null !== $event->getResponse()) { | ||
return $event->getResponse(); | ||
|
@@ -115,7 +115,7 @@ public function sendEmailAction(Request $request) | |
$this->userManager->updateUser($user); | ||
|
||
$event = new GetResponseUserEvent($user, $request); | ||
$this->eventDispatcher->dispatch(FOSUserEvents::RESETTING_SEND_EMAIL_COMPLETED, $event); | ||
$this->eventDispatcher->dispatch($event, FOSUserEvents::RESETTING_SEND_EMAIL_COMPLETED); | ||
|
||
if (null !== $event->getResponse()) { | ||
return $event->getResponse(); | ||
|
@@ -163,7 +163,7 @@ public function resetAction(Request $request, $token) | |
} | ||
|
||
$event = new GetResponseUserEvent($user, $request); | ||
$this->eventDispatcher->dispatch(FOSUserEvents::RESETTING_RESET_INITIALIZE, $event); | ||
$this->eventDispatcher->dispatch($event, FOSUserEvents::RESETTING_RESET_INITIALIZE); | ||
|
||
if (null !== $event->getResponse()) { | ||
return $event->getResponse(); | ||
|
@@ -176,7 +176,7 @@ public function resetAction(Request $request, $token) | |
|
||
if ($form->isSubmitted() && $form->isValid()) { | ||
$event = new FormEvent($form, $request); | ||
$this->eventDispatcher->dispatch(FOSUserEvents::RESETTING_RESET_SUCCESS, $event); | ||
$this->eventDispatcher->dispatch($event, FOSUserEvents::RESETTING_RESET_SUCCESS); | ||
|
||
$this->userManager->updateUser($user); | ||
|
||
|
@@ -186,8 +186,8 @@ public function resetAction(Request $request, $token) | |
} | ||
|
||
$this->eventDispatcher->dispatch( | ||
FOSUserEvents::RESETTING_RESET_COMPLETED, | ||
new FilterUserResponseEvent($user, $request, $response) | ||
new FilterUserResponseEvent($user, $request, $response), | ||
FOSUserEvents::RESETTING_RESET_COMPLETED | ||
); | ||
|
||
return $response; | ||
|
Oops, something went wrong.