@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | $niceId = setting('core', 'global_password_holding_page', ''); |
| 64 | 64 | $page = neon()->cms->getPage(); |
| 65 | 65 | // check the page with the nice_id exists |
| 66 | - if (! $page->setById($niceId)) throw new \yii\web\HttpException(404, 'No page found'); |
|
| 66 | + if (!$page->setById($niceId)) throw new \yii\web\HttpException(404, 'No page found'); |
|
| 67 | 67 | neon()->response->content = $page->render(); |
| 68 | 68 | //return false; |
| 69 | 69 | return true; |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | // No holding page niceId has been given so display a standard password screen |
| 101 | 101 | neon()->response->content = neon()->view->render('@neon/core/views/global-password.php', [ |
| 102 | 102 | 'passwordParam' => $this->passwordParam, |
| 103 | - 'incorrectPassword' => ($this->getSuppliedPassword()!==null) |
|
| 103 | + 'incorrectPassword' => ($this->getSuppliedPassword() !== null) |
|
| 104 | 104 | ]); |
| 105 | 105 | } |
| 106 | 106 | |
@@ -34,16 +34,19 @@ discard block |
||
| 34 | 34 | public function beforeAction($action) |
| 35 | 35 | { |
| 36 | 36 | // If the global password option is not set then return - and continue as normal |
| 37 | - if (setting('core', 'global_password_enabled', false) === 0) |
|
| 38 | - return true; |
|
| 37 | + if (setting('core', 'global_password_enabled', false) === 0) { |
|
| 38 | + return true; |
|
| 39 | + } |
|
| 39 | 40 | // If the global password is set - still allow the following app controller paths to work. |
| 40 | 41 | if (neon()->request->isRoute('/admin*') || neon()->request->isRoute('/user/*') || neon()->request->isRoute('/settings*')) { |
| 41 | 42 | return true; |
| 42 | 43 | } |
| 43 | - if ($this->passwordIsValid()) |
|
| 44 | - return true; |
|
| 45 | - if ($this->shouldDisplayHoldingPage()) |
|
| 46 | - return false; |
|
| 44 | + if ($this->passwordIsValid()) { |
|
| 45 | + return true; |
|
| 46 | + } |
|
| 47 | + if ($this->shouldDisplayHoldingPage()) { |
|
| 48 | + return false; |
|
| 49 | + } |
|
| 47 | 50 | $this->displayGlobalPasswordPage(); |
| 48 | 51 | return false; |
| 49 | 52 | } |
@@ -63,7 +66,9 @@ discard block |
||
| 63 | 66 | $niceId = setting('core', 'global_password_holding_page', ''); |
| 64 | 67 | $page = neon()->cms->getPage(); |
| 65 | 68 | // check the page with the nice_id exists |
| 66 | - if (! $page->setById($niceId)) throw new \yii\web\HttpException(404, 'No page found'); |
|
| 69 | + if (! $page->setById($niceId)) { |
|
| 70 | + throw new \yii\web\HttpException(404, 'No page found'); |
|
| 71 | + } |
|
| 67 | 72 | neon()->response->content = $page->render(); |
| 68 | 73 | //return false; |
| 69 | 74 | return true; |