X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=inc%2Fpoche%2FDatabase.class.php;h=b5dd21203a9a667872303bc71a0b97498f862769;hb=cf8a5e1eedbed484dbcb1ddc9f7a13fc19b7a27b;hp=2c80b64b5dff24687777be87754134057be01091;hpb=505a74ad1de7cf2cd3605e793233365501f03d87;p=github%2Fwallabag%2Fwallabag.git diff --git a/inc/poche/Database.class.php b/inc/poche/Database.class.php index 2c80b64b..b5dd2120 100755 --- a/inc/poche/Database.class.php +++ b/inc/poche/Database.class.php @@ -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))) { + 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 = '';