diff --git a/index.php b/index.php index a24e6abe5..1bc68dcc5 100644 --- a/index.php +++ b/index.php @@ -58,18 +58,20 @@ if (file_exists(__DIR__ . '/config.php')) { $config = array_merge($config, require __DIR__ . '/config.php'); } -if (!defined('IN_INSTALL_MODE') && !file_exists($config['core'] . '/.install')) { +if (!defined('IN_INSTALL_MODE') && !file_exists($config['core'] . '/.install')) { + + if (is_dir(__DIR__ . '/install')) { + header('Location: install/index.php?action=not_installed'); + exit; + } + header('HTTP/1.1 503 Service Temporarily Unavailable'); header('Status: 503 Service Temporarily Unavailable'); header('Retry-After: 3600'); - $path = __DIR__ . '/install/src/template/not_installed.tpl'; - if (file_exists($path)) { - readfile($path); - } else { - echo '

Unable to load configuration settings

'; - echo 'Please run the Evolution CMS install utility'; - } + echo '

Unable to load configuration settings

'; + echo 'Please run the Evolution CMS install utility'; + exit; } @@ -78,7 +80,7 @@ define('IN_INSTALL_MODE', false); } if (IN_INSTALL_MODE) { -// set some settings, and address some IE issues + // set some settings, and address some IE issues @ini_set('url_rewriter.tags', ''); @ini_set('session.use_trans_sid', 0); @ini_set('session.use_only_cookies', 1); diff --git a/install/index.php b/install/index.php index efc14cf3c..3848e19f3 100644 --- a/install/index.php +++ b/install/index.php @@ -15,6 +15,8 @@ die('MGR_DIR is not defined'); } } + + if (!defined('MODX_MANAGER_PATH')) { define('MODX_MANAGER_PATH', $base_path . MGR_DIR . '/'); } @@ -28,8 +30,10 @@ require_once 'src/lang.php'; require_once 'src/functions.php'; + + if (empty($_GET['s'])) { - require_once '../' . MGR_DIR . '/includes/version.inc.php'; + require_once '../' . MGR_DIR . '/includes/version.inc.php'; // start session session_start(); @@ -74,11 +78,19 @@ $ph = array_merge($ph, $_lang); $ph['install_language'] = $install_language; - ob_start(); + ob_start(); $action = isset($_GET['action']) ? trim(strip_tags($_GET['action'])) : 'language'; - str_replace('.', '', $action); + $action = str_replace('.', '', $action); + $controller = 'src/controllers/' . $action . '.php'; + + if ($action === 'not_installed') { + require_once 'src/controllers/not_installed.php'; + exit; + } + + if (! file_exists($controller)) { die("Invalid install action attempted. [action={$action}]"); } diff --git a/install/src/controllers/not_installed.php b/install/src/controllers/not_installed.php new file mode 100644 index 000000000..20d5ddd38 --- /dev/null +++ b/install/src/controllers/not_installed.php @@ -0,0 +1,39 @@ +System not installed

Run installer

'; +} +exit; diff --git a/install/src/lang/be.inc.php b/install/src/lang/be.inc.php index 4841a9afc..02651a229 100644 --- a/install/src/lang/be.inc.php +++ b/install/src/lang/be.inc.php @@ -1,8 +1,9 @@ - + + - -Evolution CMS is not installed! - - - + + [+not_installed_title+] + + + + -
-

Evolution CMS is not currently installed or the configuration file cannot be found.

-

Do you want to install now?

-
- \ No newline at end of file + + +
+
+ +
+
+ +
+
+
+

[+not_installed_header+]

+

[+not_installed_message+]

+ +
+
+
+ + + + + + + \ No newline at end of file