@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | */ |
50 | 50 | public function __invoke() |
51 | 51 | { |
52 | - if (! $this->hasAuthenticatedUser() || ! $this->getAcl()->isUserAllowed($this->getAuthenticatedUser(), 'City', 'edit')) { |
|
52 | + if (!$this->hasAuthenticatedUser() || !$this->getAcl()->isUserAllowed($this->getAuthenticatedUser(), 'City', 'edit')) { |
|
53 | 53 | $this->viewFactory->displayView('error-403'); |
54 | 54 | return; |
55 | 55 | } |
@@ -58,14 +58,14 @@ discard block |
||
58 | 58 | $this->city = $this->getCityRepository()->find($this->cityId); |
59 | 59 | } |
60 | 60 | |
61 | - if (! $this->city) { |
|
61 | + if (!$this->city) { |
|
62 | 62 | $this->viewFactory->displayView('error-404'); |
63 | 63 | return; |
64 | 64 | } |
65 | 65 | |
66 | 66 | $city = $this->city; |
67 | 67 | |
68 | - if (! $this->getAcl()->canEditEntity($this->getAuthenticatedUser(), $city)) { |
|
68 | + if (!$this->getAcl()->canEditEntity($this->getAuthenticatedUser(), $city)) { |
|
69 | 69 | $this->viewFactory->displayView('error-403'); |
70 | 70 | return; |
71 | 71 | } |
@@ -114,13 +114,13 @@ discard block |
||
114 | 114 | $sessionToken = $this->getSession()->getCsrfToken(); |
115 | 115 | $actionToken = filter_input(INPUT_POST, 'token'); |
116 | 116 | |
117 | - if (! $actionToken || ! $sessionToken->isValid($actionToken)) { |
|
117 | + if (!$actionToken || !$sessionToken->isValid($actionToken)) { |
|
118 | 118 | return; |
119 | 119 | } |
120 | 120 | |
121 | 121 | $city = $this->city; |
122 | 122 | |
123 | - if (! $this->hasAuthenticatedUser() || ! $this->getAcl()->canEditEntity($this->getAuthenticatedUser(), $city)) { |
|
123 | + if (!$this->hasAuthenticatedUser() || !$this->getAcl()->canEditEntity($this->getAuthenticatedUser(), $city)) { |
|
124 | 124 | return; |
125 | 125 | } |
126 | 126 | |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | |
130 | 130 | $duplicateCity = $this->getCityRepository()->findOneBy(['name' => $city->get('name')]); |
131 | 131 | |
132 | - if (! empty($duplicateCity) && $duplicateCity->get('id') != $city->get('id')) { |
|
132 | + if (!empty($duplicateCity) && $duplicateCity->get('id') != $city->get('id')) { |
|
133 | 133 | throw new InvalidArgumentException(__('Please enter a unique city name.')); |
134 | 134 | } |
135 | 135 |
@@ -25,7 +25,7 @@ |
||
25 | 25 | public function __invoke() |
26 | 26 | { |
27 | 27 | $isSitePublic = ('on' === EBB\Options::getOption('site_publication')); |
28 | - if (! $isSitePublic && (! $this->hasAuthenticatedUser() || ! $this->getAcl()->isUserAllowed($this->getAuthenticatedUser(), 'District', 'read'))) { |
|
28 | + if (!$isSitePublic && (!$this->hasAuthenticatedUser() || !$this->getAcl()->isUserAllowed($this->getAuthenticatedUser(), 'District', 'read'))) { |
|
29 | 29 | $this->viewFactory->displayView('error-403'); |
30 | 30 | } else { |
31 | 31 | $this->viewFactory->displayView('view-districts', [ |
@@ -70,7 +70,7 @@ |
||
70 | 70 | |
71 | 71 | $user = $this->getUserRepository()->findOneBy(['email' => $userEmail, 'status' => 'any']); |
72 | 72 | |
73 | - if (empty($user) || ! password_verify($userPass, $user->get('pass'))) { |
|
73 | + if (empty($user) || !password_verify($userPass, $user->get('pass'))) { |
|
74 | 74 | Notices::addNotice('wrong_login_details', __('No match for user e-mail and/or password.'), 'warning'); |
75 | 75 | return; |
76 | 76 | } |
@@ -29,14 +29,14 @@ discard block |
||
29 | 29 | */ |
30 | 30 | public function __invoke() |
31 | 31 | { |
32 | - if (! $this->hasAuthenticatedUser() || ! $this->getAcl()->isUserAllowed($this->getAuthenticatedUser(), 'User', 'delete')) { |
|
32 | + if (!$this->hasAuthenticatedUser() || !$this->getAcl()->isUserAllowed($this->getAuthenticatedUser(), 'User', 'delete')) { |
|
33 | 33 | $this->viewFactory->displayView('error-403'); |
34 | 34 | return; |
35 | 35 | } |
36 | 36 | |
37 | 37 | if (filter_has_var(INPUT_POST, 'users')) { |
38 | 38 | $usersIDs = filter_input(INPUT_POST, 'users', FILTER_SANITIZE_NUMBER_INT, FILTER_REQUIRE_ARRAY); |
39 | - if (! empty($usersIDs) && is_array($usersIDs)) { |
|
39 | + if (!empty($usersIDs) && is_array($usersIDs)) { |
|
40 | 40 | $this->users = $this->getUserRepository()->findBy(['id' => $usersIDs]); |
41 | 41 | } |
42 | 42 | } |
@@ -69,20 +69,20 @@ discard block |
||
69 | 69 | */ |
70 | 70 | protected function doDeleteAction() |
71 | 71 | { |
72 | - if (! $this->hasAuthenticatedUser() || ! $this->getAcl()->isUserAllowed($this->getAuthenticatedUser(), 'User', 'delete')) { |
|
72 | + if (!$this->hasAuthenticatedUser() || !$this->getAcl()->isUserAllowed($this->getAuthenticatedUser(), 'User', 'delete')) { |
|
73 | 73 | return; |
74 | 74 | } |
75 | 75 | |
76 | 76 | $sessionToken = $this->getSession()->getCsrfToken(); |
77 | 77 | $actionToken = filter_input(INPUT_POST, 'token'); |
78 | 78 | |
79 | - if (! $actionToken || ! $sessionToken->isValid($actionToken)) { |
|
79 | + if (!$actionToken || !$sessionToken->isValid($actionToken)) { |
|
80 | 80 | return; |
81 | 81 | } |
82 | 82 | |
83 | 83 | $users = $this->users; |
84 | 84 | |
85 | - if (! $users || ! is_array($users)) { |
|
85 | + if (!$users || !is_array($users)) { |
|
86 | 86 | return; |
87 | 87 | } |
88 | 88 |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | */ |
50 | 50 | public function __invoke() |
51 | 51 | { |
52 | - if (! $this->hasAuthenticatedUser()) { |
|
52 | + if (!$this->hasAuthenticatedUser()) { |
|
53 | 53 | $this->viewFactory->displayView('error-403'); |
54 | 54 | return; |
55 | 55 | } |
@@ -58,14 +58,14 @@ discard block |
||
58 | 58 | $this->user = $this->getUserRepository()->find($this->userId); |
59 | 59 | } |
60 | 60 | |
61 | - if (! $this->user) { |
|
61 | + if (!$this->user) { |
|
62 | 62 | $this->viewFactory->displayView('error-404'); |
63 | 63 | return; |
64 | 64 | } |
65 | 65 | |
66 | 66 | $user = $this->user; |
67 | 67 | |
68 | - if (! $this->getAcl()->canEditEntity($this->getAuthenticatedUser(), $user)) { |
|
68 | + if (!$this->getAcl()->canEditEntity($this->getAuthenticatedUser(), $user)) { |
|
69 | 69 | $this->viewFactory->displayView('error-403'); |
70 | 70 | return; |
71 | 71 | } |
@@ -114,13 +114,13 @@ discard block |
||
114 | 114 | $sessionToken = $this->getSession()->getCsrfToken(); |
115 | 115 | $actionToken = filter_input(INPUT_POST, 'token'); |
116 | 116 | |
117 | - if (! $actionToken || ! $sessionToken->isValid($actionToken)) { |
|
117 | + if (!$actionToken || !$sessionToken->isValid($actionToken)) { |
|
118 | 118 | return; |
119 | 119 | } |
120 | 120 | |
121 | 121 | $user = $this->user; |
122 | 122 | |
123 | - if (! $this->hasAuthenticatedUser() || ! $this->getAcl()->canEditEntity($this->getAuthenticatedUser(), $user)) { |
|
123 | + if (!$this->hasAuthenticatedUser() || !$this->getAcl()->canEditEntity($this->getAuthenticatedUser(), $user)) { |
|
124 | 124 | return; |
125 | 125 | } |
126 | 126 | |
@@ -132,18 +132,18 @@ discard block |
||
132 | 132 | |
133 | 133 | $duplicateUser = $this->getUserRepository()->findOneBy(['email' => $user->get('email'), 'status' => 'any']); |
134 | 134 | |
135 | - if (! empty($duplicateUser) && $duplicateUser->get('id') != $user->get('id')) { |
|
135 | + if (!empty($duplicateUser) && $duplicateUser->get('id') != $user->get('id')) { |
|
136 | 136 | throw new InvalidArgumentException(__('Please enter a unique user e-mail.')); |
137 | 137 | } |
138 | 138 | |
139 | 139 | $userPass1 = filter_input(INPUT_POST, 'user_pass_1', FILTER_UNSAFE_RAW); |
140 | 140 | $userPass2 = filter_input(INPUT_POST, 'user_pass_2', FILTER_UNSAFE_RAW); |
141 | 141 | |
142 | - if (! empty($userPass1) xor ! empty($userPass2)) { |
|
142 | + if (!empty($userPass1) xor !empty($userPass2)) { |
|
143 | 143 | throw new InvalidArgumentException(__('Please enter the password twice.')); |
144 | 144 | } |
145 | 145 | |
146 | - if (! empty($userPass1) && ! empty($userPass2)) { |
|
146 | + if (!empty($userPass1) && !empty($userPass2)) { |
|
147 | 147 | if ($userPass1 !== $userPass2) { |
148 | 148 | throw new InvalidArgumentException(__('Please enter the same password.')); |
149 | 149 | } |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | { |
51 | 51 | $isSitePublic = ('on' === EBB\Options::getOption('site_publication')); |
52 | 52 | |
53 | - if (! $isSitePublic && (! $this->hasAuthenticatedUser() || ! $this->getAcl()->isUserAllowed($this->getAuthenticatedUser(), 'Donor', 'read'))) { |
|
53 | + if (!$isSitePublic && (!$this->hasAuthenticatedUser() || !$this->getAcl()->isUserAllowed($this->getAuthenticatedUser(), 'Donor', 'read'))) { |
|
54 | 54 | $this->viewFactory->displayView('error-403'); |
55 | 55 | return; |
56 | 56 | } |
@@ -59,14 +59,14 @@ discard block |
||
59 | 59 | $this->donor = $this->getDonorRepository()->find($this->donorId); |
60 | 60 | } |
61 | 61 | |
62 | - if (! $this->donor) { |
|
62 | + if (!$this->donor) { |
|
63 | 63 | $this->viewFactory->displayView('error-404'); |
64 | 64 | return; |
65 | 65 | } |
66 | 66 | |
67 | 67 | $donor = $this->donor; |
68 | 68 | |
69 | - if ($this->hasAuthenticatedUser() && ! $this->getAcl()->canReadEntity($this->getAuthenticatedUser(), $donor)) { |
|
69 | + if ($this->hasAuthenticatedUser() && !$this->getAcl()->canReadEntity($this->getAuthenticatedUser(), $donor)) { |
|
70 | 70 | $this->viewFactory->displayView('error-403'); |
71 | 71 | return; |
72 | 72 | } |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | */ |
48 | 48 | public function __invoke() |
49 | 49 | { |
50 | - if (! $this->hasAuthenticatedUser() || ! $this->getAcl()->isUserAllowed($this->getAuthenticatedUser(), 'User', 'delete')) { |
|
50 | + if (!$this->hasAuthenticatedUser() || !$this->getAcl()->isUserAllowed($this->getAuthenticatedUser(), 'User', 'delete')) { |
|
51 | 51 | $this->viewFactory->displayView('error-403'); |
52 | 52 | return; |
53 | 53 | } |
@@ -56,14 +56,14 @@ discard block |
||
56 | 56 | $this->user = $this->getUserRepository()->find($this->userId); |
57 | 57 | } |
58 | 58 | |
59 | - if (! $this->user) { |
|
59 | + if (!$this->user) { |
|
60 | 60 | $this->viewFactory->displayView('error-404'); |
61 | 61 | return; |
62 | 62 | } |
63 | 63 | |
64 | 64 | $user = $this->user; |
65 | 65 | |
66 | - if (! $this->getAcl()->canDeleteEntity($this->getAuthenticatedUser(), $user)) { |
|
66 | + if (!$this->getAcl()->canDeleteEntity($this->getAuthenticatedUser(), $user)) { |
|
67 | 67 | $this->viewFactory->displayView('error-403'); |
68 | 68 | return; |
69 | 69 | } |
@@ -99,13 +99,13 @@ discard block |
||
99 | 99 | $actionToken = filter_input(INPUT_POST, 'token'); |
100 | 100 | $sessionToken = $this->getSession()->getCsrfToken(); |
101 | 101 | |
102 | - if (! $actionToken || ! $sessionToken->isValid($actionToken)) { |
|
102 | + if (!$actionToken || !$sessionToken->isValid($actionToken)) { |
|
103 | 103 | return; |
104 | 104 | } |
105 | 105 | |
106 | 106 | $user = $this->user; |
107 | 107 | |
108 | - if (! $this->hasAuthenticatedUser() || ! $this->getAcl()->canDeleteEntity($this->getAuthenticatedUser(), $user)) { |
|
108 | + if (!$this->hasAuthenticatedUser() || !$this->getAcl()->canDeleteEntity($this->getAuthenticatedUser(), $user)) { |
|
109 | 109 | return; |
110 | 110 | } |
111 | 111 |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | */ |
36 | 36 | public function __invoke() |
37 | 37 | { |
38 | - if (! $this->hasAuthenticatedUser() || ! $this->getAcl()->isUserAllowed($this->getAuthenticatedUser(), 'Donor', 'add')) { |
|
38 | + if (!$this->hasAuthenticatedUser() || !$this->getAcl()->isUserAllowed($this->getAuthenticatedUser(), 'Donor', 'add')) { |
|
39 | 39 | $this->viewFactory->displayView('error-403'); |
40 | 40 | return; |
41 | 41 | } |
@@ -83,14 +83,14 @@ discard block |
||
83 | 83 | protected function doSubmitAction() |
84 | 84 | { |
85 | 85 | try { |
86 | - if (! $this->hasAuthenticatedUser() || ! $this->getAcl()->isUserAllowed($this->getAuthenticatedUser(), 'Donor', 'add')) { |
|
86 | + if (!$this->hasAuthenticatedUser() || !$this->getAcl()->isUserAllowed($this->getAuthenticatedUser(), 'Donor', 'add')) { |
|
87 | 87 | return; |
88 | 88 | } |
89 | 89 | |
90 | 90 | $sessionToken = $this->getSession()->getCsrfToken(); |
91 | 91 | $actionToken = filter_input(INPUT_POST, 'token'); |
92 | 92 | |
93 | - if (! $actionToken || ! $sessionToken->isValid($actionToken)) { |
|
93 | + if (!$actionToken || !$sessionToken->isValid($actionToken)) { |
|
94 | 94 | return; |
95 | 95 | } |
96 | 96 |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | */ |
50 | 50 | public function __invoke() |
51 | 51 | { |
52 | - if (! $this->hasAuthenticatedUser() || ! $this->getAcl()->isUserAllowed($this->getAuthenticatedUser(), 'City', 'delete')) { |
|
52 | + if (!$this->hasAuthenticatedUser() || !$this->getAcl()->isUserAllowed($this->getAuthenticatedUser(), 'City', 'delete')) { |
|
53 | 53 | $this->viewFactory->displayView('error-403'); |
54 | 54 | return; |
55 | 55 | } |
@@ -58,14 +58,14 @@ discard block |
||
58 | 58 | $this->city = $this->getCityRepository()->find($this->cityId); |
59 | 59 | } |
60 | 60 | |
61 | - if (! $this->city) { |
|
61 | + if (!$this->city) { |
|
62 | 62 | $this->viewFactory->displayView('error-404'); |
63 | 63 | return; |
64 | 64 | } |
65 | 65 | |
66 | 66 | $city = $this->city; |
67 | 67 | |
68 | - if (! $this->getAcl()->canDeleteEntity($this->getAuthenticatedUser(), $city)) { |
|
68 | + if (!$this->getAcl()->canDeleteEntity($this->getAuthenticatedUser(), $city)) { |
|
69 | 69 | $this->viewFactory->displayView('error-403'); |
70 | 70 | return; |
71 | 71 | } |
@@ -101,13 +101,13 @@ discard block |
||
101 | 101 | $sessionToken = $this->getSession()->getCsrfToken(); |
102 | 102 | $actionToken = filter_input(INPUT_POST, 'token'); |
103 | 103 | |
104 | - if (! $actionToken || ! $sessionToken->isValid($actionToken)) { |
|
104 | + if (!$actionToken || !$sessionToken->isValid($actionToken)) { |
|
105 | 105 | return; |
106 | 106 | } |
107 | 107 | |
108 | 108 | $city = $this->city; |
109 | 109 | |
110 | - if (! $this->hasAuthenticatedUser() || ! $this->getAcl()->canDeleteEntity($this->getAuthenticatedUser(), $city)) { |
|
110 | + if (!$this->hasAuthenticatedUser() || !$this->getAcl()->canDeleteEntity($this->getAuthenticatedUser(), $city)) { |
|
111 | 111 | return; |
112 | 112 | } |
113 | 113 |