mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-18 07:23:13 +00:00
Refactor LoginController
PHRAS-529 #time 2h
This commit is contained in:
@@ -65,7 +65,7 @@ class AccountController extends Controller
|
||||
}
|
||||
|
||||
return $this->render('account/change-password.html.twig', array_merge(
|
||||
$this->getLoginController()->getDefaultTemplateVariables($this->app),
|
||||
$this->getLoginController()->getDefaultTemplateVariables($request),
|
||||
['form' => $form->createView()]
|
||||
));
|
||||
}
|
||||
@@ -151,7 +151,7 @@ class AccountController extends Controller
|
||||
return $this->app->redirectPath('account');
|
||||
}
|
||||
|
||||
$context = $this->getLoginController()->getDefaultTemplateVariables($this->app);
|
||||
$context = $this->getLoginController()->getDefaultTemplateVariables($request);
|
||||
|
||||
return $this->render('account/reset-email.html.twig', $context);
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -28,6 +28,8 @@ class Login implements ControllerProviderInterface, ServiceProviderInterface
|
||||
$app['login.controller'] = $app->share(function (PhraseaApplication $app) {
|
||||
return (new LoginController($app))
|
||||
->setDelivererLocator(new LazyLocator($app, 'notification.deliverer'))
|
||||
->setDispatcher($app['dispatcher'])
|
||||
->setEntityManagerLocator(new LazyLocator($app, 'orm.em'))
|
||||
;
|
||||
});
|
||||
}
|
||||
|
@@ -12,6 +12,7 @@
|
||||
namespace Alchemy\Phrasea\Model\Repositories;
|
||||
|
||||
use Alchemy\Phrasea\Model\Entities\User;
|
||||
use Alchemy\Phrasea\Model\Entities\UsrAuthProvider;
|
||||
use Doctrine\ORM\EntityRepository;
|
||||
|
||||
/**
|
||||
@@ -22,6 +23,10 @@ use Doctrine\ORM\EntityRepository;
|
||||
*/
|
||||
class UsrAuthProviderRepository extends EntityRepository
|
||||
{
|
||||
/**
|
||||
* @param User $user
|
||||
* @return UsrAuthProvider[]
|
||||
*/
|
||||
public function findByUser(User $user)
|
||||
{
|
||||
$dql = 'SELECT u
|
||||
@@ -36,6 +41,12 @@ class UsrAuthProviderRepository extends EntityRepository
|
||||
return $query->getResult();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $providerId
|
||||
* @param $distantId
|
||||
* @return UsrAuthProvider|null
|
||||
* @throws \Doctrine\ORM\NonUniqueResultException
|
||||
*/
|
||||
public function findWithProviderAndId($providerId, $distantId)
|
||||
{
|
||||
$dql = 'SELECT u
|
||||
|
@@ -11,6 +11,7 @@
|
||||
|
||||
namespace Alchemy\Phrasea\Model\Repositories;
|
||||
|
||||
use Alchemy\Phrasea\Model\Entities\ValidationParticipant;
|
||||
use Doctrine\ORM\EntityRepository;
|
||||
use Doctrine\DBAL\Types\Type;
|
||||
|
||||
@@ -21,7 +22,7 @@ class ValidationParticipantRepository extends EntityRepository
|
||||
* Retrieve all not reminded participants where the validation has not expired
|
||||
*
|
||||
* @param $expireDate The expiration Date
|
||||
* @return array
|
||||
* @return ValidationParticipant[]
|
||||
*/
|
||||
public function findNotConfirmedAndNotRemindedParticipantsByExpireDate(\DateTime $expireDate)
|
||||
{
|
||||
|
@@ -37,7 +37,7 @@ abstract class AbstractMailWithLink extends AbstractMail implements MailWithLink
|
||||
* @param string $url
|
||||
* @param \DateTime $expiration
|
||||
*
|
||||
* @return MailWithLinkInterface
|
||||
* @return static
|
||||
*/
|
||||
public static function create(Application $app, ReceiverInterface $receiver, EmitterInterface $emitter = null, $message = null, $url = null, \DateTime $expiration = null)
|
||||
{
|
||||
|
Reference in New Issue
Block a user