aboutsummaryrefslogtreecommitdiffhomepage
path: root/inc/poche/Database.class.php
diff options
context:
space:
mode:
authorNicolas LÅ“uillet <nicolas.loeuillet@gmail.com>2013-10-24 23:51:59 -0700
committerNicolas LÅ“uillet <nicolas.loeuillet@gmail.com>2013-10-24 23:51:59 -0700
commitcd8a3441561fa63b9da1b705c4b28dee787f79b0 (patch)
treee21417394aac2f23060506e120601d74b19ecd29 /inc/poche/Database.class.php
parent8e76eaad19c32fd9993fcd4c66de80394b55fbe2 (diff)
parent6ae804853f6f2e10d394b6abfb977b7a251ee7e4 (diff)
downloadwallabag-cd8a3441561fa63b9da1b705c4b28dee787f79b0.tar.gz
wallabag-cd8a3441561fa63b9da1b705c4b28dee787f79b0.tar.zst
wallabag-cd8a3441561fa63b9da1b705c4b28dee787f79b0.zip
Merge pull request #289 from inthepoche/dev
1.1.0
Diffstat (limited to 'inc/poche/Database.class.php')
-rw-r--r--inc/poche/Database.class.php15
1 files changed, 13 insertions, 2 deletions
diff --git a/inc/poche/Database.class.php b/inc/poche/Database.class.php
index 0662581b..1d3ff0c2 100644
--- a/inc/poche/Database.class.php
+++ b/inc/poche/Database.class.php
@@ -87,6 +87,17 @@ class Database {
87 return $user_config; 87 return $user_config;
88 } 88 }
89 89
90 public function userExists($username) {
91 $sql = "SELECT * FROM users WHERE username=?";
92 $query = $this->executeQuery($sql, array($username));
93 $login = $query->fetchAll();
94 if (isset($login[0])) {
95 return true;
96 } else {
97 return false;
98 }
99 }
100
90 public function login($username, $password) { 101 public function login($username, $password) {
91 $sql = "SELECT * FROM users WHERE username=? AND password=?"; 102 $sql = "SELECT * FROM users WHERE username=? AND password=?";
92 $query = $this->executeQuery($sql, array($username, $password)); 103 $query = $this->executeQuery($sql, array($username, $password));
@@ -108,8 +119,8 @@ class Database {
108 public function updatePassword($userId, $password) 119 public function updatePassword($userId, $password)
109 { 120 {
110 $sql_update = "UPDATE users SET password=? WHERE id=?"; 121 $sql_update = "UPDATE users SET password=? WHERE id=?";
111 $params_update = array($password, $id); 122 $params_update = array($password, $userId);
112 $this->updateUserConfig($userId, 'password', $password); 123 $query = $this->executeQuery($sql_update, $params_update);
113 } 124 }
114 125
115 public function updateUserConfig($userId, $key, $value) { 126 public function updateUserConfig($userId, $key, $value) {