@@ -124,7 +124,7 @@ |
||
124 | 124 | /** |
125 | 125 | * |
126 | 126 | * @param integer $id |
127 | - * @return ActionLog |
|
127 | + * @return ImpersonationReport |
|
128 | 128 | * @throws NotFoundHttpException |
129 | 129 | */ |
130 | 130 | private function getOr404($id) |
@@ -2,7 +2,6 @@ |
||
2 | 2 | |
3 | 3 | namespace LoginCidadao\CoreBundle\Controller\Admin; |
4 | 4 | |
5 | -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; |
|
6 | 5 | use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; |
7 | 6 | use Symfony\Bundle\FrameworkBundle\Controller\Controller; |
8 | 7 | use Symfony\Component\Routing\Annotation\Route; |
@@ -339,6 +339,10 @@ discard block |
||
339 | 339 | $formBuilder->add('idcard', 'lc_idcard_form', array('label' => false)); |
340 | 340 | } |
341 | 341 | |
342 | + /** |
|
343 | + * @param string $field |
|
344 | + * @param string $type |
|
345 | + */ |
|
342 | 346 | private function addPersonField(FormBuilderInterface $formBuilder, |
343 | 347 | Person $person, $field, $type = null, |
344 | 348 | $options = array()) |
@@ -389,6 +393,9 @@ discard block |
||
389 | 393 | return; |
390 | 394 | } |
391 | 395 | |
396 | + /** |
|
397 | + * @return null|City |
|
398 | + */ |
|
392 | 399 | private function getCity(Request $request) |
393 | 400 | { |
394 | 401 | $id = $request->get('city'); |
@@ -399,6 +406,9 @@ discard block |
||
399 | 406 | return $repo->find($id); |
400 | 407 | } |
401 | 408 | |
409 | + /** |
|
410 | + * @return null|State |
|
411 | + */ |
|
402 | 412 | private function getState(Request $request) |
403 | 413 | { |
404 | 414 | $id = $request->get('state'); |
@@ -409,6 +419,9 @@ discard block |
||
409 | 419 | return $repo->find($id); |
410 | 420 | } |
411 | 421 | |
422 | + /** |
|
423 | + * @return null|Country |
|
424 | + */ |
|
412 | 425 | private function getCountry(Request $request) |
413 | 426 | { |
414 | 427 | $id = $request->get('country'); |
@@ -217,8 +217,8 @@ discard block |
||
217 | 217 | } |
218 | 218 | |
219 | 219 | private function addField(Request $request, |
220 | - FormBuilderInterface $formBuilder, $scope, |
|
221 | - Person $person) |
|
220 | + FormBuilderInterface $formBuilder, $scope, |
|
221 | + Person $person) |
|
222 | 222 | { |
223 | 223 | $placeOfBirthLevel = ''; |
224 | 224 | switch ($scope) { |
@@ -285,7 +285,7 @@ discard block |
||
285 | 285 | } |
286 | 286 | |
287 | 287 | private function getPersonForm(FormBuilderInterface $formBuilder, |
288 | - Person $person) |
|
288 | + Person $person) |
|
289 | 289 | { |
290 | 290 | if ($formBuilder->has('person') === false) { |
291 | 291 | $formBuilder->add('person', new DynamicPersonType(), |
@@ -296,7 +296,7 @@ discard block |
||
296 | 296 | } |
297 | 297 | |
298 | 298 | private function addAddresses(FormBuilderInterface $formBuilder, |
299 | - Person $person, $new = true) |
|
299 | + Person $person, $new = true) |
|
300 | 300 | { |
301 | 301 | $addresses = $person->getAddresses(); |
302 | 302 | $address = new PersonAddress(); |
@@ -318,7 +318,7 @@ discard block |
||
318 | 318 | } |
319 | 319 | |
320 | 320 | private function addIdCard(Request $request, |
321 | - FormBuilderInterface $formBuilder, Person $person) |
|
321 | + FormBuilderInterface $formBuilder, Person $person) |
|
322 | 322 | { |
323 | 323 | $state = $this->getStateFromRequest($request); |
324 | 324 | $formData = $formBuilder->getData(); |
@@ -7,7 +7,6 @@ |
||
7 | 7 | use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; |
8 | 8 | use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; |
9 | 9 | use Symfony\Component\Security\Core\Exception\AccessDeniedException; |
10 | -use LoginCidadao\CoreBundle\Helper\GridHelper; |
|
11 | 10 | use LoginCidadao\CoreBundle\Form\Type\RemoveIdCardFormType; |
12 | 11 | use LoginCidadao\CoreBundle\Model\PersonInterface; |
13 | 12 | use Doctrine\Common\Collections\Collection; |
@@ -11,7 +11,6 @@ discard block |
||
11 | 11 | namespace LoginCidadao\CoreBundle\Controller; |
12 | 12 | |
13 | 13 | use Symfony\Component\HttpFoundation\Request; |
14 | -use JMS\Serializer\SerializationContext; |
|
15 | 14 | use Symfony\Component\HttpFoundation\JsonResponse; |
16 | 15 | use Symfony\Bundle\FrameworkBundle\Controller\Controller; |
17 | 16 | use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; |
@@ -21,7 +20,6 @@ discard block |
||
21 | 20 | use FOS\UserBundle\FOSUserEvents; |
22 | 21 | use FOS\UserBundle\Event\FilterUserResponseEvent; |
23 | 22 | use FOS\UserBundle\Util\TokenGenerator; |
24 | -use LoginCidadao\CoreBundle\Form\Type\DocFormType; |
|
25 | 23 | use FOS\UserBundle\Event\GetResponseUserEvent; |
26 | 24 | use FOS\UserBundle\Event\FormEvent; |
27 | 25 | use LoginCidadao\CoreBundle\EventListener\ProfileEditListner; |
@@ -29,9 +27,6 @@ discard block |
||
29 | 27 | use LoginCidadao\CoreBundle\Entity\IdCard; |
30 | 28 | use Symfony\Component\HttpFoundation\Response; |
31 | 29 | use Symfony\Component\Form\FormError; |
32 | -use LoginCidadao\BadgesBundle\BadgesEvents; |
|
33 | -use LoginCidadao\BadgesBundle\Event\EvaluateBadgesEvent; |
|
34 | -use LoginCidadao\BadgesBundle\Event\ListBadgesEvent; |
|
35 | 30 | use LoginCidadao\CoreBundle\Helper\GridHelper; |
36 | 31 | |
37 | 32 | class PersonController extends Controller |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | 'client' => $client, |
80 | 80 | 'user' => $user |
81 | 81 | )); |
82 | - $refreshTokens = $em->getRepository('LoginCidadaoOAuthBundle:RefreshToken') |
|
82 | + $refreshTokens = $em->getRepository('LoginCidadaoOAuthBundle:RefreshToken') |
|
83 | 83 | ->findBy(array( |
84 | 84 | 'client' => $client, |
85 | 85 | 'user' => $user |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | public function registrationCpfAction(Request $request) |
217 | 217 | { |
218 | 218 | $person = $this->getUser(); |
219 | - if (is_numeric($cpf = preg_replace('/[^0-9]/', '', |
|
219 | + if (is_numeric($cpf = preg_replace('/[^0-9]/', '', |
|
220 | 220 | $request->get('cpf'))) && strlen($cpf) == 11) { |
221 | 221 | $person->setCpf($cpf); |
222 | 222 | } |
@@ -395,8 +395,8 @@ discard block |
||
395 | 395 | { |
396 | 396 | $form = $this->createForm(new DocRgFormType()); |
397 | 397 | $rg = null; |
398 | - if (($id = $request->get('id')) || (($data = $request->get($form->getName())) |
|
399 | - && ($id = $data['id']))) { |
|
398 | + if (($id = $request->get('id')) || (($data = $request->get($form->getName())) |
|
399 | + && ($id = $data['id']))) { |
|
400 | 400 | $rg = $this->getDoctrine() |
401 | 401 | ->getManager() |
402 | 402 | ->getRepository('LoginCidadaoCoreBundle:IdCard')->findOneBy(array( |
@@ -461,11 +461,21 @@ |
||
461 | 461 | $n5 = ($rg[0] * 2) % 9; |
462 | 462 | $total = $n1 + $n2 + $n3 + $n4 + $n5 + $rg[7] + $rg[5] + $rg[3] + $rg[1]; |
463 | 463 | |
464 | - if ($rg[8] == 9) $total = $total + 9; |
|
465 | - if ($rg[6] == 9) $total = $total + 9; |
|
466 | - if ($rg[4] == 9) $total = $total + 9; |
|
467 | - if ($rg[2] == 9) $total = $total + 9; |
|
468 | - if ($rg[0] == 9) $total = $total + 9; |
|
464 | + if ($rg[8] == 9) { |
|
465 | + $total = $total + 9; |
|
466 | + } |
|
467 | + if ($rg[6] == 9) { |
|
468 | + $total = $total + 9; |
|
469 | + } |
|
470 | + if ($rg[4] == 9) { |
|
471 | + $total = $total + 9; |
|
472 | + } |
|
473 | + if ($rg[2] == 9) { |
|
474 | + $total = $total + 9; |
|
475 | + } |
|
476 | + if ($rg[0] == 9) { |
|
477 | + $total = $total + 9; |
|
478 | + } |
|
469 | 479 | |
470 | 480 | $resto = $total % 10; |
471 | 481 |
@@ -151,6 +151,9 @@ |
||
151 | 151 | return compact('data'); |
152 | 152 | } |
153 | 153 | |
154 | + /** |
|
155 | + * @param integer $days |
|
156 | + */ |
|
154 | 157 | private function getNewUsersByService($days, $clientId = null, |
155 | 158 | $format = 'html') |
156 | 159 | { |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | |
69 | 69 | |
70 | 70 | return $this->render('LoginCidadaoCoreBundle:Statistics:usersByRegion.html.twig', |
71 | - array('data' => $data, 'totalUsers' => $totalUsers)); |
|
71 | + array('data' => $data, 'totalUsers' => $totalUsers)); |
|
72 | 72 | } |
73 | 73 | |
74 | 74 | /** |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | $data = $repo->getCountByCity($stateId); |
83 | 83 | |
84 | 84 | return $this->render('LoginCidadaoCoreBundle:Statistics:usersByCity.html.twig', |
85 | - array('data' => $data)); |
|
85 | + array('data' => $data)); |
|
86 | 86 | } |
87 | 87 | |
88 | 88 | /** |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | } |
153 | 153 | |
154 | 154 | private function getNewUsersByService($days, $clientId = null, |
155 | - $format = 'html') |
|
155 | + $format = 'html') |
|
156 | 156 | { |
157 | 157 | $em = $this->getDoctrine()->getManager(); |
158 | 158 | $repo = $em->getRepository('LoginCidadaoOAuthBundle:Client'); |
@@ -126,6 +126,9 @@ discard block |
||
126 | 126 | return $this->getUser(); |
127 | 127 | } |
128 | 128 | |
129 | + /** |
|
130 | + * @param \Symfony\Component\Form\Form $form |
|
131 | + */ |
|
129 | 132 | protected function enable2FA(PersonInterface $person, $form) |
130 | 133 | { |
131 | 134 | $em = $this->getDoctrine()->getManager(); |
@@ -134,6 +137,9 @@ discard block |
||
134 | 137 | $em->flush(); |
135 | 138 | } |
136 | 139 | |
140 | + /** |
|
141 | + * @param \Symfony\Component\Form\Form $form |
|
142 | + */ |
|
137 | 143 | protected function disable2FA(BackupCodeInterface $person, $form) |
138 | 144 | { |
139 | 145 | $em = $this->getDoctrine()->getManager(); |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | { |
67 | 67 | $person = $this->getPerson(); |
68 | 68 | $form = $this->createForm(new TwoFactorAuthenticationDisableFormType(), |
69 | - $person); |
|
69 | + $person); |
|
70 | 70 | $form->handleRequest($request); |
71 | 71 | |
72 | 72 | if ($form->isValid()) { |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | { |
91 | 91 | $person = $this->getPerson(); |
92 | 92 | $form = $this->createForm(new TwoFactorAuthenticationBackupCodeGenerationFormType(), |
93 | - $person); |
|
93 | + $person); |
|
94 | 94 | $form->handleRequest($request); |
95 | 95 | |
96 | 96 | if ($form->isValid()) { |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | } |
148 | 148 | |
149 | 149 | protected function removeBackupCodes(EntityManager $em, |
150 | - PersonInterface $person) |
|
150 | + PersonInterface $person) |
|
151 | 151 | { |
152 | 152 | $backupCodes = $person->getBackupCodes(); |
153 | 153 | foreach ($backupCodes as $backupCode) { |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | } |
157 | 157 | |
158 | 158 | protected function generateBackupCodes(EntityManager $em, |
159 | - PersonInterface $person) |
|
159 | + PersonInterface $person) |
|
160 | 160 | { |
161 | 161 | $generator = new SecureRandom(); |
162 | 162 | $backupCodes = array(); |
@@ -74,6 +74,9 @@ |
||
74 | 74 | return $this->ip; |
75 | 75 | } |
76 | 76 | |
77 | + /** |
|
78 | + * @param \DateTime $var |
|
79 | + */ |
|
77 | 80 | public function setIDhacess($var) |
78 | 81 | { |
79 | 82 | $this->dhacess = $var; |
@@ -50,7 +50,7 @@ |
||
50 | 50 | * Set text |
51 | 51 | * |
52 | 52 | * @param string $text |
53 | - * @return Notification |
|
53 | + * @return ClientSuggestion |
|
54 | 54 | */ |
55 | 55 | public function setText($text) |
56 | 56 | { |
@@ -2,7 +2,6 @@ |
||
2 | 2 | namespace LoginCidadao\CoreBundle\Entity; |
3 | 3 | |
4 | 4 | use Doctrine\ORM\Mapping as ORM; |
5 | -use LoginCidadao\OAuthBundle\Entity\Client; |
|
6 | 5 | use LoginCidadao\CoreBundle\Entity\Person; |
7 | 6 | |
8 | 7 | /** |