diff --git a/install/index.php b/install/index.php index 750b6e4..ac2f93b 100755 --- a/install/index.php +++ b/install/index.php @@ -10,6 +10,7 @@ $errors = array(); $successes = array(); +$installed = false; /** @@ -59,14 +60,20 @@ function delTree($dir) { return rmdir($dir); } +/** + * Call to delete install directory if already installed + */ +if (isset($_GET['clean'])) { + clean(); + header('Location: index.php'); +} + /** * Delete install directory */ - -if (isset($_GET['clean'])) { +function clean() { if (is_dir('install')){ - delTree('install'); - header('Location: index.php'); + delTree('install'); } } @@ -105,7 +112,7 @@ if (isset($_POST['download'])) { else if (isset($_POST['install'])) { if (!is_dir('vendor')) { - $errors[] = 'You must install twig before.'; + $errors[] = 'You must install twig before.'; # useless unless JS not enabled } else { $continue = true; @@ -209,6 +216,8 @@ else if (isset($_POST['install'])) { $params = array($id_user, 'language', 'en_EN.UTF8'); $query = executeQuery($handle, $sql, $params); + clean(); + $installed = true; $successes[] = 'wallabag is now installed. You can now access it !'; } } @@ -291,7 +300,8 @@ else if (isset($_POST['install'])) {
Then, please reload the page.
Reload -Then, please reload the page.
location.reload(); }); + + +