]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - inc/poche/Database.class.php
get up to date for merge
[github/wallabag/wallabag.git] / inc / poche / Database.class.php
index 2c80b64b5dff24687777be87754134057be01091..b5dd21203a9a667872303bc71a0b97498f862769 100755 (executable)
@@ -23,6 +23,10 @@ class Database {
     {
         switch (STORAGE) {
             case 'sqlite':
+                // Check if /db is writeable
+                if ( !is_writable(STORAGE_SQLITE) || !is_writable(dirname(STORAGE_SQLITE))) {\r
+                       die('An error occured: "db" directory must be writeable for your web server user!');
+                }
                 $db_path = 'sqlite:' . STORAGE_SQLITE;
                 $this->handle = new PDO($db_path);
                 break;
@@ -113,10 +117,10 @@ class Database {
         $query = $this->executeQuery($sql, array());
     }
 
-    public function install($login, $password)
+    public function install($login, $password, $email = '')
     {
         $sql = 'INSERT INTO users ( username, password, name, email) VALUES (?, ?, ?, ?)';
-        $params = array($login, $password, $login, ' ');
+        $params = array($login, $password, $login, $email);
         $query = $this->executeQuery($sql, $params);
 
         $sequence = '';