mirror of
https://github.com/wallabag/wallabag.git
synced 2024-11-01 14:49:15 +00:00
fix eventual bugs when user exists in database and connection doesn't work
This commit is contained in:
parent
6269df8df9
commit
5395d7f8f5
1 changed files with 7 additions and 7 deletions
|
@ -127,12 +127,6 @@ else if (isset($_POST['install'])) {
|
||||||
}
|
}
|
||||||
// create database structure
|
// create database structure
|
||||||
$query = $handle->exec($sql_structure);
|
$query = $handle->exec($sql_structure);
|
||||||
} catch (PDOException $e) {
|
|
||||||
$errors[] = $e->getMessage();
|
|
||||||
$continue = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$usertest = executeQuery($handle,"SELECT * from users WHERE username = ?", array($username));
|
$usertest = executeQuery($handle,"SELECT * from users WHERE username = ?", array($username));
|
||||||
if (!empty($usertest)) {
|
if (!empty($usertest)) {
|
||||||
|
@ -140,6 +134,12 @@ else if (isset($_POST['install'])) {
|
||||||
$errors[] = "An user already exists with this username in database.";
|
$errors[] = "An user already exists with this username in database.";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} catch (PDOException $e) {
|
||||||
|
$errors[] = $e->getMessage();
|
||||||
|
$continue = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ($continue) {
|
if ($continue) {
|
||||||
$sql = "INSERT INTO users (username, password, name, email) VALUES (?, ?, ?, ?)";
|
$sql = "INSERT INTO users (username, password, name, email) VALUES (?, ?, ?, ?)";
|
||||||
|
|
Loading…
Reference in a new issue