diff options
Diffstat (limited to 'install/index.php')
-rwxr-xr-x | install/index.php | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/install/index.php b/install/index.php index bcb62708..5de2fb7b 100755 --- a/install/index.php +++ b/install/index.php | |||
@@ -1,4 +1,13 @@ | |||
1 | <?php | 1 | <?php |
2 | /** | ||
3 | * wallabag, self hostable application allowing you to not miss any content anymore | ||
4 | * | ||
5 | * @category wallabag | ||
6 | * @author Nicolas LÅ“uillet <nicolas@loeuillet.org> | ||
7 | * @copyright 2013 | ||
8 | * @license http://opensource.org/licenses/MIT see COPYING file | ||
9 | */ | ||
10 | |||
2 | $errors = array(); | 11 | $errors = array(); |
3 | $successes = array(); | 12 | $successes = array(); |
4 | 13 | ||
@@ -147,16 +156,16 @@ else if (isset($_POST['install'])) { | |||
147 | } | 156 | } |
148 | 157 | ||
149 | // create database structure | 158 | // create database structure |
150 | $query = executeQuery($handle, $sql_structure, array()); | 159 | $query = $handle->exec($sql_structure); |
151 | 160 | ||
152 | // Create user | 161 | // Create user |
153 | $handle->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); | 162 | $handle->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); |
154 | 163 | ||
155 | $sql = 'INSERT INTO users (username, password, name) VALUES (?, ?, ?)'; | 164 | $sql = "INSERT INTO users (username, password, name, email) VALUES (?, ?, ?, '')"; |
156 | $params = array($username, $salted_password, $username); | 165 | $params = array($username, $salted_password, $username); |
157 | $query = executeQuery($handle, $sql, $params); | 166 | $query = executeQuery($handle, $sql, $params); |
158 | 167 | ||
159 | $id_user = $handle->lastInsertId(); | 168 | $id_user = (int)$handle->lastInsertId('users_id_seq'); |
160 | 169 | ||
161 | $sql = 'INSERT INTO users_config ( user_id, name, value ) VALUES (?, ?, ?)'; | 170 | $sql = 'INSERT INTO users_config ( user_id, name, value ) VALUES (?, ?, ?)'; |
162 | $params = array($id_user, 'pager', '10'); | 171 | $params = array($id_user, 'pager', '10'); |
@@ -302,9 +311,11 @@ php composer.phar install</code></pre></li> | |||
302 | <p> | 311 | <p> |
303 | <label for="password">Password</label> | 312 | <label for="password">Password</label> |
304 | <input type="password" required id="password" name="password" value="wallabag" /> | 313 | <input type="password" required id="password" name="password" value="wallabag" /> |
314 | <label for="show">Show password:</label> <input style="margin-left:-80px;" name="show" id="show" type="checkbox" onchange="document.getElementById('password').type = this.checked ? 'text' : 'password'"> | ||
305 | </p> | 315 | </p> |
306 | <p> | 316 | <p> |
307 | <label for="show">Show password:</label> <input name="show" id="show" type="checkbox" onchange="document.getElementById('password').type = this.checked ? 'text' : 'password'"> | 317 | <label for="email">Email (not required)</label> |
318 | <input type="email" id="email" name="email" /> | ||
308 | </p> | 319 | </p> |
309 | </fieldset> | 320 | </fieldset> |
310 | 321 | ||