@@ -72,24 +72,24 @@ |
||
72 | 72 | */ |
73 | 73 | public function checkUserHash($hash, $email) |
74 | 74 | { |
75 | - $em = $this->getDoctrine()->getManager(); |
|
75 | + $em = $this->getDoctrine()->getManager(); |
|
76 | 76 | |
77 | - $user = $em->getRepository('AppBundle:User') |
|
78 | - ->findOneBy(array('email' => $email, 'hash' => $hash)); |
|
77 | + $user = $em->getRepository('AppBundle:User') |
|
78 | + ->findOneBy(array('email' => $email, 'hash' => $hash)); |
|
79 | 79 | |
80 | - if ($user) { |
|
80 | + if ($user) { |
|
81 | 81 | |
82 | - $user->setIsReg(true); |
|
83 | - $user->setHash(null); |
|
84 | - $this->addFlash('notice', 'You have successfully passed registration confirmation'); |
|
82 | + $user->setIsReg(true); |
|
83 | + $user->setHash(null); |
|
84 | + $this->addFlash('notice', 'You have successfully passed registration confirmation'); |
|
85 | 85 | |
86 | - $em->flush(); |
|
86 | + $em->flush(); |
|
87 | 87 | |
88 | - return $this->redirectToRoute('homepage'); |
|
89 | - } |
|
88 | + return $this->redirectToRoute('homepage'); |
|
89 | + } |
|
90 | 90 | |
91 | - $this->addFlash('notice', 'You haven\'t passed registration confirmation'); |
|
91 | + $this->addFlash('notice', 'You haven\'t passed registration confirmation'); |
|
92 | 92 | |
93 | - return $this->redirectToRoute('homepage'); |
|
93 | + return $this->redirectToRoute('homepage'); |
|
94 | 94 | } |
95 | 95 | } |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | $email = trim($request->get('email')); |
105 | 105 | |
106 | 106 | $user = $em->getRepository('AppBundle:User') |
107 | - ->findOneBy(['email' => $email]); |
|
107 | + ->findOneBy([ 'email' => $email ]); |
|
108 | 108 | |
109 | 109 | if ($user && $user->getIsReg() == true) { |
110 | 110 | $password = $this->get('app.custom.mailer')->sendMailRecovery($email); |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | return $this->redirectToRoute('homepage'); |
128 | 128 | } else { |
129 | 129 | |
130 | - return []; |
|
130 | + return [ ]; |
|
131 | 131 | } |
132 | 132 | } |
133 | 133 | } |
@@ -1,10 +1,10 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Created by PhpStorm. |
|
4 | - * User: device |
|
5 | - * Date: 19.03.16 |
|
6 | - * Time: 10:05 |
|
7 | - */ |
|
3 | + * Created by PhpStorm. |
|
4 | + * User: device |
|
5 | + * Date: 19.03.16 |
|
6 | + * Time: 10:05 |
|
7 | + */ |
|
8 | 8 | |
9 | 9 | namespace AppBundle\Services; |
10 | 10 |
@@ -1,10 +1,10 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Created by PhpStorm. |
|
4 | - * User: device |
|
5 | - * Date: 20.03.16 |
|
6 | - * Time: 10:40 |
|
7 | - */ |
|
3 | + * Created by PhpStorm. |
|
4 | + * User: device |
|
5 | + * Date: 20.03.16 |
|
6 | + * Time: 10:40 |
|
7 | + */ |
|
8 | 8 | |
9 | 9 | namespace AppBundle\Services; |
10 | 10 |
@@ -14,10 +14,10 @@ |
||
14 | 14 | public function generator() |
15 | 15 | { |
16 | 16 | $key = ''; |
17 | - $array = array_merge(range('A','Z'),range('a','z'),range('0','9')); |
|
17 | + $array = array_merge(range('A', 'Z'), range('a', 'z'), range('0', '9')); |
|
18 | 18 | $c = count($array); |
19 | - for($i = 0; $i < 6; $i++) { |
|
20 | - $key .= $array[rand(0, $c)]; |
|
19 | + for ($i = 0; $i < 6; $i++) { |
|
20 | + $key .= $array[ rand(0, $c) ]; |
|
21 | 21 | } |
22 | 22 | |
23 | 23 | return $key; |