diff --git a/install/steps/5-database.php b/install/steps/5-database.php index eba45349..084cfcd2 100644 --- a/install/steps/5-database.php +++ b/install/steps/5-database.php @@ -57,16 +57,35 @@ if(!$error) { error($database_error); } else { - $twig->display('install.installer.html.twig', array( - 'url' => 'tools/5-database.php', - 'message' => $locale['loading_spinner'] - )); + if(!$db->hasTable('accounts')) { + $tmp = str_replace('$TABLE$', 'accounts', $locale['step_database_error_table']); + error($tmp); + $error = true; + } + + if(!$db->hasTable('players')) { + $tmp = str_replace('$TABLE$', 'players', $locale['step_database_error_table']); + error($tmp); + $error = true; + } + + if(!$db->hasTable('guilds')) { + $tmp = str_replace('$TABLE$', 'guilds', $locale['step_database_error_table']); + error($tmp); + $error = true; + } if(!$error) { + $twig->display('install.installer.html.twig', array( + 'url' => 'tools/5-database.php', + 'message' => $locale['loading_spinner'] + )); + if(!Validator::email($_SESSION['var_mail_admin'])) { error($locale['step_config_mail_admin_error']); $error = true; } + if(!Validator::email($_SESSION['var_mail_address'])) { error($locale['step_config_mail_address_error']); $error = true; @@ -105,4 +124,4 @@ if(!$error) { - \ No newline at end of file + diff --git a/install/tools/5-database.php b/install/tools/5-database.php index 4570cf62..c4b89d0b 100644 --- a/install/tools/5-database.php +++ b/install/tools/5-database.php @@ -23,24 +23,6 @@ if(!$error) { } } -if(!$db->hasTable('accounts')) { - $locale['step_database_error_table'] = str_replace('$TABLE$', 'accounts', $locale['step_database_error_table']); - error($locale['step_database_error_table']); - return; -} - -if(!$db->hasTable('players')) { - $locale['step_database_error_table'] = str_replace('$TABLE$', 'players', $locale['step_database_error_table']); - error($locale['step_database_error_table']); - return; -} - -if(!$db->hasTable('guilds')) { - $locale['step_database_error_table'] = str_replace('$TABLE$', 'guilds', $locale['step_database_error_table']); - error($locale['step_database_error_table']); - return; -} - if($db->hasTable(TABLE_PREFIX . 'account_actions')) { $locale['step_database_error_table_exist'] = str_replace('$TABLE$', TABLE_PREFIX . 'account_actions', $locale['step_database_error_table_exist']); warning($locale['step_database_error_table_exist']);