From 86801e2ef2da2d2b1f79fbfe74a3336b5f743aa6 Mon Sep 17 00:00:00 2001 From: Michael Foster Date: Tue, 20 Aug 2013 17:43:21 +1000 Subject: [PATCH] safer installation --- install.php | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/install.php b/install.php index a510631e..a6937028 100644 --- a/install.php +++ b/install.php @@ -645,18 +645,18 @@ if ($step == 0) { $sql_errors .= '
  • ' . db_error() . '
  • '; } - $boards = listBoards(); - foreach ($boards as &$_board) { - setupBoard($_board); - buildIndex(); - } - $page['title'] = 'Installation complete'; $page['body'] = '

    Thank you for using Tinyboard. Please remember to report any bugs you discover. How do I edit the config files?

    '; if (!empty($sql_errors)) { $page['body'] .= '

    SQL errors

    SQL errors were encountered when trying to install the database. This may be the result of using a database which is already occupied with a Tinyboard installation; if so, you can probably ignore this.

    The errors encountered were:

    Ignore errors and complete installation.

    '; } else { + $boards = listBoards(); + foreach ($boards as &$_board) { + setupBoard($_board); + buildIndex(); + } + file_write($config['has_installed'], VERSION); if (!file_unlink(__FILE__)) { $page['body'] .= '

    Delete install.php!

    I couldn\'t remove install.php. You will have to remove it manually.

    '; @@ -668,6 +668,12 @@ if ($step == 0) { $page['title'] = 'Installation complete'; $page['body'] = '

    Thank you for using Tinyboard. Please remember to report any bugs you discover.

    '; + $boards = listBoards(); + foreach ($boards as &$_board) { + setupBoard($_board); + buildIndex(); + } + file_write($config['has_installed'], VERSION); if (!file_unlink(__FILE__)) { $page['body'] .= '

    Delete install.php!

    I couldn\'t remove install.php. You will have to remove it manually.

    ';