@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | $email = $request->request->get('email'); |
38 | 38 | $user = $this->getEntityManager()->getRepository('Webcook\Cms\SecurityBundle\Entity\User')->findOneBy(array('email'=> $email)); |
39 | 39 | |
40 | - if($user === null) { |
|
40 | + if ($user === null) { |
|
41 | 41 | $view = $this->getViewWithMessage(null, 404, 'This email does not exist. Please enter a valid email.'); |
42 | 42 | return $this->handleView($view); |
43 | 43 | } |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | ->setContentType("text/html"); |
58 | 58 | |
59 | 59 | $result = $this->get('mailer')->send($message); |
60 | - if($result) { |
|
60 | + if ($result) { |
|
61 | 61 | $view = $this->getViewWithMessage(null, 200, 'Your password reset link was sent to your e-mail address.'); |
62 | 62 | } else { |
63 | 63 | $view = $this->getViewWithMessage(null, 400, 'Cannot send an email.'); |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | { |
79 | 79 | $token = $request->query->get('token'); |
80 | 80 | $user = $this->getEntityManager()->getRepository('Webcook\Cms\SecurityBundle\Entity\User')->findOneBy(array('passwordResetToken'=> $token)); |
81 | - if($user === null || empty($token)){ |
|
81 | + if ($user === null || empty($token)) { |
|
82 | 82 | $view = $this->getViewWithMessage(null, 404, 'This token is invalid.'); |
83 | 83 | return $this->handleView($view); |
84 | 84 | } |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | |
91 | 91 | $view = $this->getViewWithMessage(null, 400, 'This token has expired.'); |
92 | 92 | $diffInSeconds = $dateDiff->i * 60 + $dateDiff->s; |
93 | - if($diffInSeconds < 600 && $dateDiff->y == 0 && $dateDiff->m == 0 && $dateDiff->d == 0 && $dateDiff->h == 0) { |
|
93 | + if ($diffInSeconds < 600 && $dateDiff->y == 0 && $dateDiff->m == 0 && $dateDiff->d == 0 && $dateDiff->h == 0) { |
|
94 | 94 | $view = $this->getViewWithMessage(null, 200, 'Please enter your new password.'); |
95 | 95 | } |
96 | 96 | |
@@ -110,14 +110,14 @@ discard block |
||
110 | 110 | $password = $request->request->get('password'); |
111 | 111 | $repeatPassword = $request->request->get('repeatPassword'); |
112 | 112 | $token = $request->request->get('token'); |
113 | - if(empty($password) || empty($repeatPassword) || empty($token)){ |
|
113 | + if (empty($password) || empty($repeatPassword) || empty($token)) { |
|
114 | 114 | $view = $this->getViewWithMessage(null, 400, 'Passwords and token can\'t be empty.'); |
115 | 115 | return $this->handleView($view); |
116 | 116 | } |
117 | 117 | |
118 | - if($password == $repeatPassword) { |
|
118 | + if ($password == $repeatPassword) { |
|
119 | 119 | $user = $this->getEntityManager()->getRepository('Webcook\Cms\SecurityBundle\Entity\User')->findOneBy(array('passwordResetToken'=> $token)); |
120 | - if($user === null){ |
|
120 | + if ($user === null) { |
|
121 | 121 | $view = $this->getViewWithMessage(null, 404, 'This token is invalid.'); |
122 | 122 | return $this->handleView($view); |
123 | 123 | } |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | * @ORM\Table(name="SecurityUser") |
20 | 20 | * @ORM\Entity(repositoryClass="Webcook\Cms\SecurityBundle\Entity\UserRepository") |
21 | 21 | */ |
22 | -class User extends BasicEntity implements UserInterface,\Serializable |
|
22 | +class User extends BasicEntity implements UserInterface, \Serializable |
|
23 | 23 | { |
24 | 24 | /** |
25 | 25 | * Username of the user. |
@@ -316,7 +316,7 @@ discard block |
||
316 | 316 | public function getSettingsByName($name) |
317 | 317 | { |
318 | 318 | foreach ($this->getSettings() as &$value) { |
319 | - if($value->getName() == $name) { |
|
319 | + if ($value->getName() == $name) { |
|
320 | 320 | return $value; |
321 | 321 | } |
322 | 322 | } |
@@ -31,13 +31,13 @@ |
||
31 | 31 | $builder |
32 | 32 | ->add('name', TextType::class, array( |
33 | 33 | 'constraints' => array( |
34 | - new NotBlank(array( 'message' => 'security.roles.form.name.required')), |
|
34 | + new NotBlank(array('message' => 'security.roles.form.name.required')), |
|
35 | 35 | ), |
36 | 36 | 'label' => 'security.roles.form.name', |
37 | 37 | )) |
38 | 38 | ->add('role', TextType::class, array( |
39 | 39 | 'constraints' => array( |
40 | - new NotBlank(array( 'message' => 'security.roles.form.rolename.required')), |
|
40 | + new NotBlank(array('message' => 'security.roles.form.rolename.required')), |
|
41 | 41 | ), |
42 | 42 | 'label' => 'security.roles.form.role', |
43 | 43 | ))->add('version', HiddenType::class, array('mapped' => false)); |
@@ -31,25 +31,25 @@ |
||
31 | 31 | $builder |
32 | 32 | ->add('name', TextType::class, array( |
33 | 33 | 'constraints' => array( |
34 | - new NotBlank(array( 'message' => 'security.setting.form.name.required')), |
|
34 | + new NotBlank(array('message' => 'security.setting.form.name.required')), |
|
35 | 35 | ), |
36 | 36 | 'label' => 'security.settings.form.name', |
37 | 37 | )) |
38 | 38 | ->add('key', TextType::class, array( |
39 | 39 | 'constraints' => array( |
40 | - new NotBlank(array( 'message' => 'security.setting.form.key.required')), |
|
40 | + new NotBlank(array('message' => 'security.setting.form.key.required')), |
|
41 | 41 | ), |
42 | 42 | 'label' => 'security.settings.form.email', |
43 | 43 | )) |
44 | 44 | ->add('value', TextType::class, array( |
45 | 45 | 'constraints' => array( |
46 | - new NotBlank(array( 'message' => 'security.setting.form.name.required')), |
|
46 | + new NotBlank(array('message' => 'security.setting.form.name.required')), |
|
47 | 47 | ), |
48 | 48 | 'label' => 'security.settings.form.password', |
49 | 49 | )) |
50 | 50 | ->add('section', TextType::class, array( |
51 | 51 | 'constraints' => array( |
52 | - new NotBlank(array( 'message' => 'security.setting.form.name.required')), |
|
52 | + new NotBlank(array('message' => 'security.setting.form.name.required')), |
|
53 | 53 | ), |
54 | 54 | 'label' => 'security.settings.form.section', |
55 | 55 | )); |
@@ -37,13 +37,13 @@ |
||
37 | 37 | $builder |
38 | 38 | ->add('username', TextType::class, array( |
39 | 39 | 'constraints' => array( |
40 | - new NotBlank(array( 'message' => 'security.user.form.name.required')), |
|
40 | + new NotBlank(array('message' => 'security.user.form.name.required')), |
|
41 | 41 | ), |
42 | 42 | 'label' => 'security.users.form.username', |
43 | 43 | )) |
44 | 44 | ->add('email', EmailType::class, array( |
45 | 45 | 'constraints' => array( |
46 | - new Email(array( 'message' => 'security.user.form.name.not_valid')), |
|
46 | + new Email(array('message' => 'security.user.form.name.not_valid')), |
|
47 | 47 | ), |
48 | 48 | 'label' => 'security.users.form.email', |
49 | 49 | )) |