X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=install%2Findex.php;h=31c15f89f2850105d2bdcc2d00f7a711eb7ce8ac;hb=0a749cff880e40d25f0988fedb65217e40145245;hp=bd9e502d95b8fcb1b412615f496eb90d6b44159c;hpb=11ef4de52d387ef2a93bd9bbaf00b745f2bbf3e4;p=github%2Fwallabag%2Fwallabag.git diff --git a/install/index.php b/install/index.php index bd9e502d..31c15f89 100755 --- a/install/index.php +++ b/install/index.php @@ -11,12 +11,18 @@ $errors = array(); $successes = array(); +$final = false; + require_once('install_functions.php'); if (isset($_GET['clean'])) { if (is_dir('install')){ - delTree('install'); - header('Location: index.php'); + delTree('install'); + header('Location: index.php'); + } + if (is_dir('cache')) { + delTree('cache', false); + header('Location: index.php'); } } @@ -49,7 +55,6 @@ else if (isset($_POST['install'])) { $errors[] = 'You must install twig before.'; } else { $continue = true; - $final = false; $salt = generate_salt(); $content = file_get_contents('inc/poche/config.inc.default.php'); @@ -82,6 +87,7 @@ else if (isset($_POST['install'])) { $handle = new PDO($db_path, $_POST['mysql_user'], $_POST['mysql_password'], array( PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8mb4', )); + $content = str_replace("define ('MYSQL_USE_UTF8MB4', FALSE);", "define ('MYSQL_USE_UTF8MB4', TRUE);", $content); } else { // regular UTF8 $db_path = 'mysql:host=' . $_POST['mysql_server'] . ';dbname=' . $_POST['mysql_database']; $handle = new PDO($db_path, $_POST['mysql_user'], $_POST['mysql_password']); @@ -125,6 +131,14 @@ else if (isset($_POST['install'])) { } } } + + $usertest = executeQuery($handle,"SELECT * from users WHERE username = ?", array($username)); + if (!empty($usertest)) { + $continue = false; + $errors[] = "An user already exists with this username in database."; + } + + if ($continue) { $sql = "INSERT INTO users (username, password, name, email) VALUES (?, ?, ?, '')"; $params = array($username, $salted_password, $username); @@ -392,8 +406,10 @@ border: 1px solid #000;

- wallabag seems already installed. If you want to update it, you only have to delete install folder, then reload this page. + Click here to finish update.
+ If it fails, just delete the install directory.

+

You may have to clear cache (by going into config screen) after update.

@@ -521,8 +537,16 @@ border: 1px solid #000; allow_url_fopen Enabled - Enabled' : 'Disabled'; ?> - allow_url_fopen: You have allow_url_fopen enabled.' : 'allow_url_fopen: Your PHP configuration has allow_url_fopen disabled. ' . $status['app_name'] . ' will not work here.' ?> + + Enabled + allow_url_fopen: You have allow_url_fopen enabled. + + Disabled + allow_url_fopen is disabled, but curl is supported, so it should be ok. + + Disabled + allow_url_fopen: Your PHP configuration has allow_url_fopen disabled. + will not work here. gettext @@ -683,6 +707,7 @@ php composer.phar install $(".database_info").hide(); $(".usersettings").hide(); + /* * Database showing/hiding */ @@ -712,6 +737,10 @@ php composer.phar install endif; ?> + + $('.technical').hide(); + + $("#mysql_utf8_mb4").click(function() { $("#utf8_mb4_infos").toggle(); });