diff options
author | Nicolas LÅ“uillet <nicolas.loeuillet@gmail.com> | 2013-09-20 10:21:39 +0200 |
---|---|---|
committer | Nicolas LÅ“uillet <nicolas.loeuillet@gmail.com> | 2013-09-20 10:21:39 +0200 |
commit | 00dbaf90bc44ef3ed0abaebb15307756e054a027 (patch) | |
tree | b3391178b65147d025a8ae01e2c97044c9298189 /inc/poche/Database.class.php | |
parent | 705250b93dc71ae91d3c305b51e7a20611873805 (diff) | |
download | wallabag-00dbaf90bc44ef3ed0abaebb15307756e054a027.tar.gz wallabag-00dbaf90bc44ef3ed0abaebb15307756e054a027.tar.zst wallabag-00dbaf90bc44ef3ed0abaebb15307756e054a027.zip |
merge #224
Diffstat (limited to 'inc/poche/Database.class.php')
-rw-r--r-- | inc/poche/Database.class.php | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/inc/poche/Database.class.php b/inc/poche/Database.class.php index 84916b83..4d664992 100644 --- a/inc/poche/Database.class.php +++ b/inc/poche/Database.class.php | |||
@@ -60,11 +60,15 @@ class Database { | |||
60 | $id_user = intval($this->getLastId($sequence)); | 60 | $id_user = intval($this->getLastId($sequence)); |
61 | 61 | ||
62 | $sql = 'INSERT INTO users_config ( user_id, name, value ) VALUES (?, ?, ?)'; | 62 | $sql = 'INSERT INTO users_config ( user_id, name, value ) VALUES (?, ?, ?)'; |
63 | $params = array($id_user, 'pager', '10'); | 63 | $params = array($id_user, 'pager', PAGINATION); |
64 | $query = $this->executeQuery($sql, $params); | 64 | $query = $this->executeQuery($sql, $params); |
65 | 65 | ||
66 | $sql = 'INSERT INTO users_config ( user_id, name, value ) VALUES (?, ?, ?)'; | 66 | $sql = 'INSERT INTO users_config ( user_id, name, value ) VALUES (?, ?, ?)'; |
67 | $params = array($id_user, 'language', 'en_EN.UTF8'); | 67 | $params = array($id_user, 'language', LANG); |
68 | $query = $this->executeQuery($sql, $params); | ||
69 | |||
70 | $sql = 'INSERT INTO users_config ( user_id, name, value ) VALUES (?, ?, ?)'; | ||
71 | $params = array($id_user, 'theme', DEFAULT_THEME); | ||
68 | $query = $this->executeQuery($sql, $params); | 72 | $query = $this->executeQuery($sql, $params); |
69 | 73 | ||
70 | return TRUE; | 74 | return TRUE; |
@@ -101,10 +105,16 @@ class Database { | |||
101 | return $user; | 105 | return $user; |
102 | } | 106 | } |
103 | 107 | ||
104 | public function updatePassword($id, $password) | 108 | public function updatePassword($userId, $password) |
105 | { | 109 | { |
106 | $sql_update = "UPDATE users SET password=? WHERE id=?"; | 110 | $sql_update = "UPDATE users SET password=? WHERE id=?"; |
107 | $params_update = array($password, $id); | 111 | $params_update = array($password, $id); |
112 | $this->updateUserConfig($userId, 'password', $password); | ||
113 | } | ||
114 | |||
115 | public function updateUserConfig($userId, $key, $value) { | ||
116 | $sql_update = "UPDATE users_config SET `value`=? WHERE `user_id`=? AND `name`=?"; | ||
117 | $params_update = array($value, $userId, $key); | ||
108 | $query = $this->executeQuery($sql_update, $params_update); | 118 | $query = $this->executeQuery($sql_update, $params_update); |
109 | } | 119 | } |
110 | 120 | ||