aboutsummaryrefslogtreecommitdiffhomepage
path: root/inc/poche/Database.class.php
diff options
context:
space:
mode:
authorNicolas LÅ“uillet <nicolas.loeuillet@gmail.com>2013-09-20 04:36:35 -0700
committerNicolas LÅ“uillet <nicolas.loeuillet@gmail.com>2013-09-20 04:36:35 -0700
commit79026b73a804d1fe3715c3edf5bc2cfb1e56732c (patch)
tree225136afe844ad0b1c3fef443fcea86fe54384e5 /inc/poche/Database.class.php
parentc51be6b697da573cdcf0788eb8617130ce5517a4 (diff)
parent6a6c1c1172f3c6167d360a2322335ea91e94a3ff (diff)
downloadwallabag-1.0-beta5.tar.gz
wallabag-1.0-beta5.tar.zst
wallabag-1.0-beta5.zip
Merge pull request #226 from inthepoche/dev1.0-beta5
beta5
Diffstat (limited to 'inc/poche/Database.class.php')
-rw-r--r--inc/poche/Database.class.php16
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