diff --git a/install/steps/7-finish.php b/install/steps/7-finish.php index 0ae302ea..afe63603 100644 --- a/install/steps/7-finish.php +++ b/install/steps/7-finish.php @@ -195,13 +195,4 @@ if(!isset($_SESSION['installed'])) { $_SESSION['installed'] = true; } -foreach($_SESSION as $key => $value) { - if(strpos($key, 'var_') !== false) - unset($_SESSION[$key]); -} -unset($_SESSION['saved']); -if(file_exists(CACHE . 'install.txt')) { - unlink(CACHE . 'install.txt'); -} - $hooks->trigger(HOOK_INSTALL_FINISH_END); diff --git a/install/tools/5-database.php b/install/tools/5-database.php index 395492ee..b9ff587f 100644 --- a/install/tools/5-database.php +++ b/install/tools/5-database.php @@ -7,6 +7,11 @@ require SYSTEM . 'functions.php'; require BASE . 'install/includes/functions.php'; require BASE . 'install/includes/locale.php'; +if(isset($config['installed']) && $config['installed'] && !isset($_SESSION['saved'])) { + warning($locale['already_installed']); + return; +} + $error = false; require BASE . 'install/includes/config.php'; diff --git a/install/tools/7-finish.php b/install/tools/7-finish.php index c1ab5c1d..9c64382b 100644 --- a/install/tools/7-finish.php +++ b/install/tools/7-finish.php @@ -17,11 +17,11 @@ ini_set('max_execution_time', 300); ob_implicit_flush(); header('X-Accel-Buffering: no'); -/* + if(isset($config['installed']) && $config['installed'] && !isset($_SESSION['saved'])) { warning($locale['already_installed']); return; -}*/ +} require SYSTEM . 'init.php'; @@ -94,6 +94,17 @@ $hooks->trigger(HOOK_INSTALL_FINISH); $db->setClearCacheAfter(true); +// cleanup +foreach($_SESSION as $key => $value) { + if(str_contains($key, 'var_')) { + unset($_SESSION[$key]); + } +} +unset($_SESSION['saved']); +if(file_exists(CACHE . 'install.txt')) { + unlink(CACHE . 'install.txt'); +} + $locale['step_finish_desc'] = str_replace('$ADMIN_PANEL$', generateLink(str_replace('tools/', '',ADMIN_URL), $locale['step_finish_admin_panel'], true), $locale['step_finish_desc']); $locale['step_finish_desc'] = str_replace('$HOMEPAGE$', generateLink(str_replace('tools/', '', BASE_URL), $locale['step_finish_homepage'], true), $locale['step_finish_desc']); $locale['step_finish_desc'] = str_replace('$LINK$', generateLink('https://my-aac.org', 'https://my-aac.org', true), $locale['step_finish_desc']);