diff options
author | Nicolas LÅ“uillet <nicolas.loeuillet@gmail.com> | 2013-09-21 14:37:53 +0200 |
---|---|---|
committer | Nicolas LÅ“uillet <nicolas.loeuillet@gmail.com> | 2013-09-21 14:37:53 +0200 |
commit | 58ace4941ef3ec92ab71ae84df816343e2deb625 (patch) | |
tree | 6934a62277ec6891fcd32277ac806fd26bf098f0 /inc/poche | |
parent | 37527034ab3d1e925b8e1806f17215979170c200 (diff) | |
download | wallabag-58ace4941ef3ec92ab71ae84df816343e2deb625.tar.gz wallabag-58ace4941ef3ec92ab71ae84df816343e2deb625.tar.zst wallabag-58ace4941ef3ec92ab71ae84df816343e2deb625.zip |
bug fix #229: theme not stored on updated poches
Diffstat (limited to 'inc/poche')
-rw-r--r-- | inc/poche/Database.class.php | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/inc/poche/Database.class.php b/inc/poche/Database.class.php index 4d664992..0662581b 100644 --- a/inc/poche/Database.class.php +++ b/inc/poche/Database.class.php | |||
@@ -113,9 +113,17 @@ class Database { | |||
113 | } | 113 | } |
114 | 114 | ||
115 | public function updateUserConfig($userId, $key, $value) { | 115 | public function updateUserConfig($userId, $key, $value) { |
116 | $sql_update = "UPDATE users_config SET `value`=? WHERE `user_id`=? AND `name`=?"; | 116 | $config = $this->getConfigUser($userId); |
117 | $params_update = array($value, $userId, $key); | 117 | |
118 | $query = $this->executeQuery($sql_update, $params_update); | 118 | if (!isset ($user_config[$key])) { |
119 | $sql = "INSERT INTO users_config (`value`, `user_id`, `name`) VALUES (?, ?, ?)"; | ||
120 | } | ||
121 | else { | ||
122 | $sql = "UPDATE users_config SET `value`=? WHERE `user_id`=? AND `name`=?"; | ||
123 | } | ||
124 | |||
125 | $params = array($value, $userId, $key); | ||
126 | $query = $this->executeQuery($sql, $params); | ||
119 | } | 127 | } |
120 | 128 | ||
121 | private function executeQuery($sql, $params) { | 129 | private function executeQuery($sql, $params) { |