@@ -30,7 +30,7 @@ |
||
| 30 | 30 | $reserved = array_combine($this->reservedScopes, $this->reservedScopes); |
| 31 | 31 | |
| 32 | 32 | $builder->addEventListener(FormEvents::PRE_SET_DATA, |
| 33 | - function (FormEvent $event) use ($security, $public, $reserved) { |
|
| 33 | + function(FormEvent $event) use ($security, $public, $reserved) { |
|
| 34 | 34 | $form = $event->getForm(); |
| 35 | 35 | |
| 36 | 36 | if ($security->isGranted('ROLE_EDIT_CLIENT_ALLOWED_SCOPES') === false) { |
@@ -27,14 +27,14 @@ |
||
| 27 | 27 | $builder->add('id', 'hidden', array( |
| 28 | 28 | 'required' => false |
| 29 | 29 | )); |
| 30 | - $builder->add('state', 'entity',array( |
|
| 30 | + $builder->add('state', 'entity', array( |
|
| 31 | 31 | 'required' => true, |
| 32 | 32 | 'class' => 'LoginCidadaoCoreBundle:State', |
| 33 | 33 | 'choice_label' => 'name', |
| 34 | 34 | 'query_builder' => function(EntityRepository $er) { |
| 35 | 35 | $country = $er->createQueryBuilder('h')->getEntityManager()->getRepository('LoginCidadaoCoreBundle:Country')->findOneBy(array('iso2' => 'BR')); |
| 36 | 36 | return $er->createQueryBuilder('u') |
| 37 | - ->where('u.reviewed = ' . Country::REVIEWED_OK) |
|
| 37 | + ->where('u.reviewed = '.Country::REVIEWED_OK) |
|
| 38 | 38 | ->andWhere('u.country = :country') |
| 39 | 39 | ->setParameter('country', $country) |
| 40 | 40 | ->orderBy('u.name', 'ASC'); |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | 'class' => 'LoginCidadaoCoreBundle:State', |
| 42 | 42 | 'choice_label' => 'name', |
| 43 | 43 | 'read_only' => true, |
| 44 | - 'query_builder' => function (EntityRepository $er) use($countryAcronym) { |
|
| 44 | + 'query_builder' => function(EntityRepository $er) use($countryAcronym) { |
|
| 45 | 45 | return $er->createQueryBuilder('s') |
| 46 | 46 | ->join('LoginCidadaoCoreBundle:Country', 'c', |
| 47 | 47 | 'WITH', 's.country = c') |
@@ -63,12 +63,12 @@ discard block |
||
| 63 | 63 | |
| 64 | 64 | $dispatcher = $this->dispatcher; |
| 65 | 65 | $builder->addEventListener(FormEvents::PRE_SET_DATA, |
| 66 | - function (FormEvent $event) use ($dispatcher) { |
|
| 66 | + function(FormEvent $event) use ($dispatcher) { |
|
| 67 | 67 | $dispatcher->dispatch(ValidationEvents::ID_CARD_FORM_PRE_SET_DATA, |
| 68 | 68 | $event); |
| 69 | 69 | }); |
| 70 | 70 | $builder->addEventListener(FormEvents::PRE_SUBMIT, |
| 71 | - function (FormEvent $event) use ($dispatcher) { |
|
| 71 | + function(FormEvent $event) use ($dispatcher) { |
|
| 72 | 72 | $dispatcher->dispatch(ValidationEvents::ID_CARD_FORM_PRE_SUBMIT, |
| 73 | 73 | $event); |
| 74 | 74 | }); |
@@ -63,7 +63,7 @@ |
||
| 63 | 63 | 'mapped' => false |
| 64 | 64 | )); |
| 65 | 65 | |
| 66 | - if ($this->hasVerifyCaptcha()) { |
|
| 66 | + if ($this->hasVerifyCaptcha()) { |
|
| 67 | 67 | $builder->add('recaptcha', 'ewz_recaptcha', array( |
| 68 | 68 | 'attr' => array( |
| 69 | 69 | 'options' => array( |
@@ -4,7 +4,6 @@ |
||
| 4 | 4 | use Symfony\Component\Form\FormBuilderInterface; |
| 5 | 5 | use EWZ\Bundle\RecaptchaBundle\Validator\Constraints\True; |
| 6 | 6 | use Symfony\Component\Form\AbstractType; |
| 7 | -use Symfony\Component\Security\Core\Validator\Constraints\UserPassword; |
|
| 8 | 7 | use Symfony\Component\OptionsResolver\OptionsResolver; |
| 9 | 8 | use Symfony\Component\Security\Core\SecurityContext; |
| 10 | 9 | |
@@ -14,7 +14,7 @@ |
||
| 14 | 14 | |
| 15 | 15 | public function buildForm(FormBuilderInterface $builder, array $options) |
| 16 | 16 | { |
| 17 | - $queryBuilder = function (EntityRepository $er) { |
|
| 17 | + $queryBuilder = function(EntityRepository $er) { |
|
| 18 | 18 | return $er->createQueryBuilder('u')->orderBy('u.acronym'); |
| 19 | 19 | }; |
| 20 | 20 | $stateRepo = $this->em->getRepository('LoginCidadaoCoreBundle:State'); |
@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | { |
| 16 | 16 | $builder |
| 17 | 17 | ->add('googleAuthenticatorSecret', 'text', |
| 18 | - array( |
|
| 18 | + array( |
|
| 19 | 19 | 'read_only' => true, |
| 20 | 20 | 'label' => "Authenticator Secret" |
| 21 | 21 | )) |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | } |
| 42 | 42 | $builder |
| 43 | 43 | ->add('enable', 'submit', |
| 44 | - array( |
|
| 44 | + array( |
|
| 45 | 45 | 'attr' => array('class' => 'btn btn-success'), |
| 46 | 46 | 'label' => 'Activate Two-Factor Authentication') |
| 47 | 47 | ); |
@@ -79,7 +79,7 @@ |
||
| 79 | 79 | * @param QueryBuilder $var |
| 80 | 80 | * @return GridHelper |
| 81 | 81 | */ |
| 82 | - public function setQueryBuilder(QueryBuilder &$queryBuilder) |
|
| 82 | + public function setQueryBuilder(QueryBuilder & $queryBuilder) |
|
| 83 | 83 | { |
| 84 | 84 | $this->queryBuilder = $queryBuilder; |
| 85 | 85 | // create QueryBuilderIterator for legacy code |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | return $this->container; |
| 24 | 24 | } |
| 25 | 25 | |
| 26 | - private function _getVars(Request &$request) |
|
| 26 | + private function _getVars(Request & $request) |
|
| 27 | 27 | { |
| 28 | 28 | if ($this->options['post_only']) { |
| 29 | 29 | $username = trim($request->request->get($this->options['username_parameter'], null, true)); |
@@ -41,11 +41,11 @@ discard block |
||
| 41 | 41 | $vars = $this->_getVars($request); |
| 42 | 42 | $doctrine = $this->container->get('doctrine'); |
| 43 | 43 | $accessSession = $doctrine->getRepository('LoginCidadaoCoreBundle:AccessSession')->findOneBy($vars); |
| 44 | - if (! $accessSession) { |
|
| 44 | + if (!$accessSession) { |
|
| 45 | 45 | $accessSession = new AccessSession(); |
| 46 | 46 | $accessSession->fromArray($vars); |
| 47 | 47 | } |
| 48 | - $accessSession->setVal($accessSession->getVal()+1); |
|
| 48 | + $accessSession->setVal($accessSession->getVal() + 1); |
|
| 49 | 49 | $doctrine->getManager()->persist($accessSession); |
| 50 | 50 | $doctrine->getManager()->flush(); |
| 51 | 51 | $request->getSession()->set(SecurityContextInterface::LAST_USERNAME, $vars['username']); |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | $formType->setVerifyCaptcha($accessSession->getVal() >= $this->container->getParameter('brute_force_threshold')); |
| 54 | 54 | $form = $this->container->get('form.factory')->create($formType); |
| 55 | 55 | $form->handleRequest($request); |
| 56 | - if (! $form->isValid()) { |
|
| 56 | + if (!$form->isValid()) { |
|
| 57 | 57 | $translator = $this->container->get('translator'); |
| 58 | 58 | throw new BadCredentialsException($translator->trans('Captcha is invalid.')); |
| 59 | 59 | } |
@@ -3,7 +3,6 @@ |
||
| 3 | 3 | |
| 4 | 4 | use Symfony\Component\Security\Http\Firewall\UsernamePasswordFormAuthenticationListener; |
| 5 | 5 | use Symfony\Component\HttpFoundation\Request; |
| 6 | -use LoginCidadao\CoreBundle\Entity\Person; |
|
| 7 | 6 | use Symfony\Component\Security\Core\Exception\BadCredentialsException; |
| 8 | 7 | use LoginCidadao\CoreBundle\Entity\AccessSession; |
| 9 | 8 | use Symfony\Component\Security\Core\SecurityContextInterface; |
@@ -112,7 +112,7 @@ |
||
| 112 | 112 | * @return UserInterface |
| 113 | 113 | */ |
| 114 | 114 | public function createUser($username, $password, array $roles = array(), |
| 115 | - array $scopes = array()) |
|
| 115 | + array $scopes = array()) |
|
| 116 | 116 | { |
| 117 | 117 | $user = parent::createUser(); |
| 118 | 118 | |