aboutsummaryrefslogtreecommitdiffhomepage
path: root/install/index.php
diff options
context:
space:
mode:
Diffstat (limited to 'install/index.php')
-rwxr-xr-xinstall/index.php14
1 files changed, 7 insertions, 7 deletions
diff --git a/install/index.php b/install/index.php
index d514eb2a..24577aaa 100755
--- a/install/index.php
+++ b/install/index.php
@@ -127,6 +127,13 @@ else if (isset($_POST['install'])) {
127 } 127 }
128 // create database structure 128 // create database structure
129 $query = $handle->exec($sql_structure); 129 $query = $handle->exec($sql_structure);
130
131 $usertest = executeQuery($handle,"SELECT * from users WHERE username = ?", array($username));
132 if (!empty($usertest)) {
133 $continue = false;
134 $errors[] = "An user already exists with this username in database.";
135 }
136
130 } catch (PDOException $e) { 137 } catch (PDOException $e) {
131 $errors[] = $e->getMessage(); 138 $errors[] = $e->getMessage();
132 $continue = false; 139 $continue = false;
@@ -134,13 +141,6 @@ else if (isset($_POST['install'])) {
134 } 141 }
135 } 142 }
136 143
137 $usertest = executeQuery($handle,"SELECT * from users WHERE username = ?", array($username));
138 if (!empty($usertest)) {
139 $continue = false;
140 $errors[] = "An user already exists with this username in database.";
141 }
142
143
144 if ($continue) { 144 if ($continue) {
145 $sql = "INSERT INTO users (username, password, name, email) VALUES (?, ?, ?, ?)"; 145 $sql = "INSERT INTO users (username, password, name, email) VALUES (?, ?, ?, ?)";
146 $params = array($username, $salted_password, $username, $email); 146 $params = array($username, $salted_password, $username, $email);