1: | <?php
2: | namespace Opencart\Catalog\Controller\Startup;
3: | /**
4: | * Class Maintenance
5: | *
6: | * @package Opencart\Catalog\Controller\Startup
7: | */
8: | class Maintenance extends \Opencart\System\Engine\Controller {
9: | /**
10: | * @return \Opencart\System\Engine\Action|null
11: | */
12: | public function index(): ?\Opencart\System\Engine\Action {
13: | if ($this->config->get('config_maintenance')) {
14: | // Route
15: | if (isset($this->request->get['route'])) {
16: | $route = $this->request->get['route'];
17: | } else {
18: | $route = $this->config->get('action_default');
19: | }
20: |
21: | $ignore = [
22: | 'common/language/language',
23: | 'common/currency/currency'
24: | ];
25: |
26: | // Show site if logged in as admin
27: | $user = new \Opencart\System\Library\Cart\User($this->registry);
28: |
29: | if (substr($route, 0, 3) != 'api' && !in_array($route, $ignore) && !$user->isLogged()) {
30: | return new \Opencart\System\Engine\Action('common/maintenance');
31: | }
32: | }
33: |
34: | return null;
35: | }
36: | }
37: |

OpenCart API API documentation generated by ApiGen dev-master