Skip to content

Commit

Permalink
merge wallabag#224
Browse files Browse the repository at this point in the history
  • Loading branch information
nicosomb committed Sep 20, 2013
1 parent 705250b commit 00dbaf9
Show file tree
Hide file tree
Showing 55 changed files with 476 additions and 881 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ composer.phar
db/poche.sqlite
output
phpdoc*
inc/poche/myconfig.inc.php
inc/poche/config.inc.php
5 changes: 4 additions & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[submodule "inc/3rdparty/site_config"]
path = inc/3rdparty/site_config
url = git://github.com/inthepoche/site_config.git
url = [email protected]:inthepoche/site_config.git
[submodule "themes"]
path = themes
url = [email protected]:inthepoche/poche-themes.git
1 change: 0 additions & 1 deletion inc/3rdparty/site_config
Submodule site_config deleted from fe9f0d
16 changes: 13 additions & 3 deletions inc/poche/Database.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,15 @@ public function install($login, $password) {
$id_user = intval($this->getLastId($sequence));

$sql = 'INSERT INTO users_config ( user_id, name, value ) VALUES (?, ?, ?)';
$params = array($id_user, 'pager', '10');
$params = array($id_user, 'pager', PAGINATION);
$query = $this->executeQuery($sql, $params);

$sql = 'INSERT INTO users_config ( user_id, name, value ) VALUES (?, ?, ?)';
$params = array($id_user, 'language', 'en_EN.UTF8');
$params = array($id_user, 'language', LANG);
$query = $this->executeQuery($sql, $params);

$sql = 'INSERT INTO users_config ( user_id, name, value ) VALUES (?, ?, ?)';
$params = array($id_user, 'theme', DEFAULT_THEME);
$query = $this->executeQuery($sql, $params);

return TRUE;
Expand Down Expand Up @@ -101,10 +105,16 @@ public function login($username, $password) {
return $user;
}

public function updatePassword($id, $password)
public function updatePassword($userId, $password)
{
$sql_update = "UPDATE users SET password=? WHERE id=?";
$params_update = array($password, $id);
$this->updateUserConfig($userId, 'password', $password);
}

public function updateUserConfig($userId, $key, $value) {
$sql_update = "UPDATE users_config SET `value`=? WHERE `user_id`=? AND `name`=?";
$params_update = array($value, $userId, $key);
$query = $this->executeQuery($sql_update, $params_update);
}

Expand Down
Loading

0 comments on commit 00dbaf9

Please sign in to comment.