1
0
mirror of https://github.com/moparisthebest/wallabag synced 2024-12-25 00:38:51 -05:00

bug fix #229: theme not stored on updated poches

This commit is contained in:
Nicolas Lœuillet 2013-09-21 14:37:53 +02:00
parent 37527034ab
commit 58ace4941e

View File

@ -113,9 +113,17 @@ class Database {
} }
public function updateUserConfig($userId, $key, $value) { public function updateUserConfig($userId, $key, $value) {
$sql_update = "UPDATE users_config SET `value`=? WHERE `user_id`=? AND `name`=?"; $config = $this->getConfigUser($userId);
$params_update = array($value, $userId, $key);
$query = $this->executeQuery($sql_update, $params_update); if (!isset ($user_config[$key])) {
$sql = "INSERT INTO users_config (`value`, `user_id`, `name`) VALUES (?, ?, ?)";
}
else {
$sql = "UPDATE users_config SET `value`=? WHERE `user_id`=? AND `name`=?";
}
$params = array($value, $userId, $key);
$query = $this->executeQuery($sql, $params);
} }
private function executeQuery($sql, $params) { private function executeQuery($sql, $params) {