@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | */ |
| 48 | 48 | public function __invoke() |
| 49 | 49 | { |
| 50 | - if (! $this->hasAuthenticatedUser() || ! $this->getAcl()->isUserAllowed($this->getAuthenticatedUser(), 'District', 'delete')) { |
|
| 50 | + if (!$this->hasAuthenticatedUser() || !$this->getAcl()->isUserAllowed($this->getAuthenticatedUser(), 'District', 'delete')) { |
|
| 51 | 51 | $this->viewFactory->displayView('error-403'); |
| 52 | 52 | return; |
| 53 | 53 | } |
@@ -56,14 +56,14 @@ discard block |
||
| 56 | 56 | $this->district = $this->getDistrictRepository()->find($this->districtId); |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | - if (! $this->district) { |
|
| 59 | + if (!$this->district) { |
|
| 60 | 60 | $this->viewFactory->displayView('error-404'); |
| 61 | 61 | return; |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | $district = $this->district; |
| 65 | 65 | |
| 66 | - if (! $this->getAcl()->canDeleteEntity($this->getAuthenticatedUser(), $district)) { |
|
| 66 | + if (!$this->getAcl()->canDeleteEntity($this->getAuthenticatedUser(), $district)) { |
|
| 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 | $district = $this->district; |
| 107 | 107 | |
| 108 | - if (! $this->hasAuthenticatedUser() || ! $this->getAcl()->canDeleteEntity($this->getAuthenticatedUser(), $district)) { |
|
| 108 | + if (!$this->hasAuthenticatedUser() || !$this->getAcl()->canDeleteEntity($this->getAuthenticatedUser(), $district)) { |
|
| 109 | 109 | return; |
| 110 | 110 | } |
| 111 | 111 | |
@@ -30,14 +30,14 @@ discard block |
||
| 30 | 30 | */ |
| 31 | 31 | public function __invoke() |
| 32 | 32 | { |
| 33 | - if (! $this->hasAuthenticatedUser() || ! $this->getAcl()->isUserAllowed($this->getAuthenticatedUser(), 'City', 'delete')) { |
|
| 33 | + if (!$this->hasAuthenticatedUser() || !$this->getAcl()->isUserAllowed($this->getAuthenticatedUser(), 'City', 'delete')) { |
|
| 34 | 34 | $this->viewFactory->displayView('error-403'); |
| 35 | 35 | return; |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | if (filter_has_var(INPUT_POST, 'cities')) { |
| 39 | 39 | $citiesIDs = filter_input(INPUT_POST, 'cities', FILTER_SANITIZE_NUMBER_INT, FILTER_REQUIRE_ARRAY); |
| 40 | - if (! empty($citiesIDs) && is_array($citiesIDs)) { |
|
| 40 | + if (!empty($citiesIDs) && is_array($citiesIDs)) { |
|
| 41 | 41 | $this->cities = $this->getCityRepository()->findBy(['id' => $citiesIDs]); |
| 42 | 42 | } |
| 43 | 43 | } |
@@ -70,20 +70,20 @@ discard block |
||
| 70 | 70 | */ |
| 71 | 71 | protected function doDeleteAction() |
| 72 | 72 | { |
| 73 | - if (! $this->hasAuthenticatedUser() || ! $this->getAcl()->isUserAllowed($this->getAuthenticatedUser(), 'City', 'delete')) { |
|
| 73 | + if (!$this->hasAuthenticatedUser() || !$this->getAcl()->isUserAllowed($this->getAuthenticatedUser(), 'City', 'delete')) { |
|
| 74 | 74 | return; |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | $sessionToken = $this->getSession()->getCsrfToken(); |
| 78 | 78 | $actionToken = filter_input(INPUT_POST, 'token'); |
| 79 | 79 | |
| 80 | - if (! $actionToken || ! $sessionToken->isValid($actionToken)) { |
|
| 80 | + if (!$actionToken || !$sessionToken->isValid($actionToken)) { |
|
| 81 | 81 | return; |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | $cities = $this->cities; |
| 85 | 85 | |
| 86 | - if (! $cities || ! is_array($cities)) { |
|
| 86 | + if (!$cities || !is_array($cities)) { |
|
| 87 | 87 | return; |
| 88 | 88 | } |
| 89 | 89 | |
@@ -25,7 +25,7 @@ discard block |
||
| 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(), 'Donor', 'read'))) { |
|
| 28 | + if (!$isSitePublic && (!$this->hasAuthenticatedUser() || !$this->getAcl()->isUserAllowed($this->getAuthenticatedUser(), 'Donor', 'read'))) { |
|
| 29 | 29 | $this->viewFactory->displayView('error-403'); |
| 30 | 30 | } else { |
| 31 | 31 | $this->viewFactory->displayView('view-donors', [ |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | $limit = (int) Options::getOption('entities_per_page'); |
| 119 | 119 | $offset = ($this->getCurrentPage() - 1) * $limit; |
| 120 | 120 | |
| 121 | - if (! $this->hasAuthenticatedUser() || ! $this->getAcl()->isUserAllowed($this->getAuthenticatedUser(), 'Donor', 'approve')) { |
|
| 121 | + if (!$this->hasAuthenticatedUser() || !$this->getAcl()->isUserAllowed($this->getAuthenticatedUser(), 'Donor', 'approve')) { |
|
| 122 | 122 | $criteria['status'] = 'approved'; |
| 123 | 123 | } |
| 124 | 124 | |
@@ -31,14 +31,14 @@ discard block |
||
| 31 | 31 | */ |
| 32 | 32 | public function __invoke() |
| 33 | 33 | { |
| 34 | - if (! $this->hasAuthenticatedUser() || ! $this->getAcl()->isUserAllowed($this->getAuthenticatedUser(), 'District', 'delete')) { |
|
| 34 | + if (!$this->hasAuthenticatedUser() || !$this->getAcl()->isUserAllowed($this->getAuthenticatedUser(), 'District', 'delete')) { |
|
| 35 | 35 | $this->viewFactory->displayView('error-403'); |
| 36 | 36 | return; |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | if (filter_has_var(INPUT_POST, 'districts')) { |
| 40 | 40 | $districtsIDs = filter_input(INPUT_POST, 'districts', FILTER_SANITIZE_NUMBER_INT, FILTER_REQUIRE_ARRAY); |
| 41 | - if (! empty($districtsIDs) && is_array($districtsIDs)) { |
|
| 41 | + if (!empty($districtsIDs) && is_array($districtsIDs)) { |
|
| 42 | 42 | $this->districts = $this->getDistrictRepository()->findBy(['id' => $districtsIDs]); |
| 43 | 43 | } |
| 44 | 44 | } |
@@ -71,20 +71,20 @@ discard block |
||
| 71 | 71 | */ |
| 72 | 72 | protected function doDeleteAction() |
| 73 | 73 | { |
| 74 | - if (! $this->hasAuthenticatedUser() || ! $this->getAcl()->isUserAllowed($this->getAuthenticatedUser(), 'District', 'delete')) { |
|
| 74 | + if (!$this->hasAuthenticatedUser() || !$this->getAcl()->isUserAllowed($this->getAuthenticatedUser(), 'District', 'delete')) { |
|
| 75 | 75 | return; |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | $sessionToken = $this->getSession()->getCsrfToken(); |
| 79 | 79 | $actionToken = filter_input(INPUT_POST, 'token'); |
| 80 | 80 | |
| 81 | - if (! $actionToken || ! $sessionToken->isValid($actionToken)) { |
|
| 81 | + if (!$actionToken || !$sessionToken->isValid($actionToken)) { |
|
| 82 | 82 | return; |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | $districts = $this->districts; |
| 86 | 86 | |
| 87 | - if (! $districts || ! is_array($districts)) { |
|
| 87 | + if (!$districts || !is_array($districts)) { |
|
| 88 | 88 | return; |
| 89 | 89 | } |
| 90 | 90 | |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | */ |
| 48 | 48 | public function __invoke() |
| 49 | 49 | { |
| 50 | - if (! $this->hasAuthenticatedUser() || ! $this->getAcl()->isUserAllowed($this->getAuthenticatedUser(), 'Donor', 'approve')) { |
|
| 50 | + if (!$this->hasAuthenticatedUser() || !$this->getAcl()->isUserAllowed($this->getAuthenticatedUser(), 'Donor', 'approve')) { |
|
| 51 | 51 | $this->viewFactory->displayView('error-403'); |
| 52 | 52 | return; |
| 53 | 53 | } |
@@ -56,14 +56,14 @@ discard block |
||
| 56 | 56 | $this->donor = $this->getDonorRepository()->find($this->donorId); |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | - if (! $this->donor) { |
|
| 59 | + if (!$this->donor) { |
|
| 60 | 60 | $this->viewFactory->displayView('error-404'); |
| 61 | 61 | return; |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | $donor = $this->donor; |
| 65 | 65 | |
| 66 | - if (! $this->getAcl()->canApproveDonor($this->getAuthenticatedUser(), $donor)) { |
|
| 66 | + if (!$this->getAcl()->canApproveDonor($this->getAuthenticatedUser(), $donor)) { |
|
| 67 | 67 | $this->viewFactory->displayView('error-403'); |
| 68 | 68 | return; |
| 69 | 69 | } |
@@ -96,17 +96,17 @@ discard block |
||
| 96 | 96 | $actionToken = filter_input(INPUT_POST, 'token'); |
| 97 | 97 | $sessionToken = $this->getSession()->getCsrfToken(); |
| 98 | 98 | |
| 99 | - if (! $actionToken || ! $sessionToken->isValid($actionToken)) { |
|
| 99 | + if (!$actionToken || !$sessionToken->isValid($actionToken)) { |
|
| 100 | 100 | return; |
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | $donor = $this->donor; |
| 104 | 104 | |
| 105 | - if (! $this->hasAuthenticatedUser() || ! $this->getAcl()->canApproveDonor($this->getAuthenticatedUser(), $donor)) { |
|
| 105 | + if (!$this->hasAuthenticatedUser() || !$this->getAcl()->canApproveDonor($this->getAuthenticatedUser(), $donor)) { |
|
| 106 | 106 | return; |
| 107 | 107 | } |
| 108 | 108 | |
| 109 | - if (! $donor->isPending()) { |
|
| 109 | + if (!$donor->isPending()) { |
|
| 110 | 110 | return; |
| 111 | 111 | } |
| 112 | 112 | |
@@ -29,13 +29,13 @@ discard block |
||
| 29 | 29 | */ |
| 30 | 30 | public function __invoke() |
| 31 | 31 | { |
| 32 | - if (! $this->hasAuthenticatedUser() || ! $this->getAcl()->isUserAllowed($this->getAuthenticatedUser(), 'Donor', 'delete')) { |
|
| 32 | + if (!$this->hasAuthenticatedUser() || !$this->getAcl()->isUserAllowed($this->getAuthenticatedUser(), 'Donor', 'delete')) { |
|
| 33 | 33 | $view = $this->viewFactory->forgeView('error-403'); |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | if (filter_has_var(INPUT_POST, 'donors')) { |
| 37 | 37 | $donorsIDs = filter_input(INPUT_POST, 'donors', FILTER_SANITIZE_NUMBER_INT, FILTER_REQUIRE_ARRAY); |
| 38 | - if (! empty($donorsIDs) && is_array($donorsIDs)) { |
|
| 38 | + if (!empty($donorsIDs) && is_array($donorsIDs)) { |
|
| 39 | 39 | $this->donors = $this->getDonorRepository()->findBy(['id' => $donorsIDs]); |
| 40 | 40 | } |
| 41 | 41 | } |
@@ -68,20 +68,20 @@ discard block |
||
| 68 | 68 | */ |
| 69 | 69 | protected function doDeleteAction() |
| 70 | 70 | { |
| 71 | - if (! $this->hasAuthenticatedUser() || ! $this->getAcl()->isUserAllowed($this->getAuthenticatedUser(), 'Donor', 'delete')) { |
|
| 71 | + if (!$this->hasAuthenticatedUser() || !$this->getAcl()->isUserAllowed($this->getAuthenticatedUser(), 'Donor', 'delete')) { |
|
| 72 | 72 | return; |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | $actionToken = filter_input(INPUT_POST, 'token'); |
| 76 | 76 | $sessionToken = $this->getSession()->getCsrfToken(); |
| 77 | 77 | |
| 78 | - if (! $actionToken || ! $sessionToken->isValid($actionToken)) { |
|
| 78 | + if (!$actionToken || !$sessionToken->isValid($actionToken)) { |
|
| 79 | 79 | return; |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | $donors = $this->donors; |
| 83 | 83 | |
| 84 | - if (! $donors || ! is_array($donors)) { |
|
| 84 | + if (!$donors || !is_array($donors)) { |
|
| 85 | 85 | return; |
| 86 | 86 | } |
| 87 | 87 | |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | */ |
| 35 | 35 | public function __invoke() |
| 36 | 36 | { |
| 37 | - if (! $this->hasAuthenticatedUser() || ! $this->getAcl()->isUserAllowed($this->getAuthenticatedUser(), 'District', 'add')) { |
|
| 37 | + if (!$this->hasAuthenticatedUser() || !$this->getAcl()->isUserAllowed($this->getAuthenticatedUser(), 'District', 'add')) { |
|
| 38 | 38 | $this->viewFactory->displayView('error-403'); |
| 39 | 39 | return; |
| 40 | 40 | } |
@@ -82,14 +82,14 @@ discard block |
||
| 82 | 82 | protected function doSubmitAction() |
| 83 | 83 | { |
| 84 | 84 | try { |
| 85 | - if (! $this->hasAuthenticatedUser() || ! $this->getAcl()->isUserAllowed($this->getAuthenticatedUser(), 'District', 'add')) { |
|
| 85 | + if (!$this->hasAuthenticatedUser() || !$this->getAcl()->isUserAllowed($this->getAuthenticatedUser(), 'District', 'add')) { |
|
| 86 | 86 | return; |
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | $sessionToken = $this->getSession()->getCsrfToken(); |
| 90 | 90 | $actionToken = filter_input(INPUT_POST, 'token'); |
| 91 | 91 | |
| 92 | - if (! $actionToken || ! $sessionToken->isValid($actionToken)) { |
|
| 92 | + if (!$actionToken || !$sessionToken->isValid($actionToken)) { |
|
| 93 | 93 | return; |
| 94 | 94 | } |
| 95 | 95 | |
@@ -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', 'activate')) { |
|
| 32 | + if (!$this->hasAuthenticatedUser() || !$this->getAcl()->isUserAllowed($this->getAuthenticatedUser(), 'User', 'activate')) { |
|
| 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 | } |
@@ -70,14 +70,14 @@ discard block |
||
| 70 | 70 | protected function doActivateAction() |
| 71 | 71 | { |
| 72 | 72 | // Double check |
| 73 | - if (! $this->hasAuthenticatedUser() || ! $this->getAcl()->isUserAllowed($this->getAuthenticatedUser(), 'User', 'activate')) { |
|
| 73 | + if (!$this->hasAuthenticatedUser() || !$this->getAcl()->isUserAllowed($this->getAuthenticatedUser(), 'User', 'activate')) { |
|
| 74 | 74 | return; |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | $actionToken = filter_input(INPUT_POST, 'token'); |
| 78 | 78 | $sessionToken = $this->getSession()->getCsrfToken(); |
| 79 | 79 | |
| 80 | - if (! $actionToken || ! $sessionToken->isValid($actionToken)) { |
|
| 80 | + if (!$actionToken || !$sessionToken->isValid($actionToken)) { |
|
| 81 | 81 | return; |
| 82 | 82 | } |
| 83 | 83 | |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | $activatedUsersCount = 0; |
| 89 | 89 | |
| 90 | 90 | foreach ($this->users as $user) { |
| 91 | - if (! $user->isPending()) { |
|
| 91 | + if (!$user->isPending()) { |
|
| 92 | 92 | continue; |
| 93 | 93 | } |
| 94 | 94 | if ($this->getAcl()->canActivateUser($this->getAuthenticatedUser(), $user)) { |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | $themesDir = EBB_THEMES_DIR; |
| 147 | 147 | $themePath = realpath("{$themesDir}/{$name}"); |
| 148 | 148 | |
| 149 | - if (! $themePath || ! is_dir($themePath)) { |
|
| 149 | + if (!$themePath || !is_dir($themePath)) { |
|
| 150 | 150 | return; |
| 151 | 151 | } |
| 152 | 152 | |
@@ -169,7 +169,7 @@ discard block |
||
| 169 | 169 | $themes = []; |
| 170 | 170 | |
| 171 | 171 | foreach (new DirectoryIterator(EBB_THEMES_DIR) as $themeDir) { |
| 172 | - if (! $themeDir->isDot() && $themeDir->isDir()) { |
|
| 172 | + if (!$themeDir->isDot() && $themeDir->isDir()) { |
|
| 173 | 173 | $themeName = $themeDir->getFilename(); |
| 174 | 174 | $themeDirPath = $themeDir->getRealPath(); |
| 175 | 175 | $themes[$themeName] = new Theme($themeName, $themeDirPath); |