From 1e98ee1de08d319facfa4c74d87c51506c662b78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Mon, 7 Oct 2013 14:56:21 +0200 Subject: bug fix: changing password was buggy --- inc/poche/Database.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'inc/poche/Database.class.php') diff --git a/inc/poche/Database.class.php b/inc/poche/Database.class.php index 0662581b..5c40b026 100644 --- a/inc/poche/Database.class.php +++ b/inc/poche/Database.class.php @@ -108,8 +108,8 @@ class Database { public function updatePassword($userId, $password) { $sql_update = "UPDATE users SET password=? WHERE id=?"; - $params_update = array($password, $id); - $this->updateUserConfig($userId, 'password', $password); + $params_update = array($password, $userId); + $query = $this->executeQuery($sql_update, $params_update); } public function updateUserConfig($userId, $key, $value) { -- cgit v1.2.3 From 027b4e156853b4d5e358e19e83506ec4446de7ab Mon Sep 17 00:00:00 2001 From: Denis Sacchet Date: Sun, 20 Oct 2013 23:28:45 +0200 Subject: Adding support for http_auth --- inc/poche/Database.class.php | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'inc/poche/Database.class.php') diff --git a/inc/poche/Database.class.php b/inc/poche/Database.class.php index 5c40b026..1d3ff0c2 100644 --- a/inc/poche/Database.class.php +++ b/inc/poche/Database.class.php @@ -87,6 +87,17 @@ class Database { return $user_config; } + public function userExists($username) { + $sql = "SELECT * FROM users WHERE username=?"; + $query = $this->executeQuery($sql, array($username)); + $login = $query->fetchAll(); + if (isset($login[0])) { + return true; + } else { + return false; + } + } + public function login($username, $password) { $sql = "SELECT * FROM users WHERE username=? AND password=?"; $query = $this->executeQuery($sql, array($username, $password)); -- cgit v1.2.3