X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=install%2Findex.php;h=d514eb2a41216a8806bc6cdc6210784523a82d46;hb=4b1fa4c2febc7abbc6da3d65e4e760949a55843c;hp=46638f8f02331c4391412c084d67dce25cf28ce3;hpb=0eae6d14b8858005919cc3069799f77008a81d29;p=github%2Fwallabag%2Fwallabag.git diff --git a/install/index.php b/install/index.php index 46638f8f..d514eb2a 100755 --- a/install/index.php +++ b/install/index.php @@ -12,13 +12,18 @@ $errors = array(); $successes = array(); $final = false; +$email = ""; 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'); } } @@ -57,6 +62,7 @@ else if (isset($_POST['install'])) { // User informations $username = trim($_POST['username']); $password = trim($_POST['password']); + $email = trim($_POST['email']); $salted_password = sha1($password . $username . $salt); // Database informations @@ -64,7 +70,7 @@ else if (isset($_POST['install'])) { if ($_POST['db_engine'] == 'sqlite') { if (!copy('install/poche.sqlite', 'db/poche.sqlite')) { - $errors[] = 'Impossible to create the SQLite database file.'; + $errors[] = 'Impossible to create the SQLite database file. Please check your file permissions.'; } else { $db_path = 'sqlite:' . realpath('') . '/db/poche.sqlite'; @@ -83,6 +89,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']); @@ -126,9 +133,17 @@ 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); + $sql = "INSERT INTO users (username, password, name, email) VALUES (?, ?, ?, ?)"; + $params = array($username, $salted_password, $username, $email); $query = executeQuery($handle, $sql, $params); $id_user = (int)$handle->lastInsertId('users_id_seq'); @@ -147,7 +162,7 @@ else if (isset($_POST['install'])) { if (!copy('inc/poche/config.inc.default.php', 'inc/poche/config.inc.php')) { - $errors[] = 'Installation aborted, impossible to create inc/poche/config.inc.php file. Maybe you don\'t have write access to create it.'; + $errors[] = 'Installation aborted, impossible to create inc/poche/config.inc.php file. Maybe you don\'t have write access to create it. Check your file permissions.'; } else { if ($_POST['db_engine'] != 'sqlite') { $content = str_replace("define ('STORAGE', 'sqlite');", "define ('STORAGE', '".$_POST['db_engine']."');", $content); @@ -393,8 +408,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, check your file permissions or just delete the install directory.

+

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

@@ -692,6 +709,7 @@ php composer.phar install $(".database_info").hide(); $(".usersettings").hide(); + /* * Database showing/hiding */ @@ -721,6 +739,10 @@ php composer.phar install endif; ?> + + $('.technical').hide(); + + $("#mysql_utf8_mb4").click(function() { $("#utf8_mb4_infos").toggle(); });