aboutsummaryrefslogtreecommitdiffhomepage
path: root/inc/poche/Database.class.php
diff options
context:
space:
mode:
authorNicolas Lœuillet <nicolas@loeuillet.org>2014-02-03 10:03:41 -0800
committerNicolas Lœuillet <nicolas@loeuillet.org>2014-02-03 10:03:41 -0800
commit38dafee05d52948fba4a06066d7b0343c8e3de9d (patch)
tree2e3f7bd3a58bfdb046742c3e65ff082e31a9859b /inc/poche/Database.class.php
parentf355d2c87fa441221ca8a9339c426c1c95e7c2ac (diff)
parentfa0bfb775a53a074e0a9d642298685b5ed1af83f (diff)
downloadwallabag-1.4.0.tar.gz
wallabag-1.4.0.tar.zst
wallabag-1.4.0.zip
Merge pull request #427 from wallabag/dev1.4.0
changelog 1.4
Diffstat (limited to 'inc/poche/Database.class.php')
-rw-r--r--inc/poche/Database.class.php19
1 files changed, 12 insertions, 7 deletions
diff --git a/inc/poche/Database.class.php b/inc/poche/Database.class.php
index 04731821..0457af69 100644
--- a/inc/poche/Database.class.php
+++ b/inc/poche/Database.class.php
@@ -1,9 +1,9 @@
1<?php 1<?php
2/** 2/**
3 * poche, a read it later open source system 3 * wallabag, self hostable application allowing you to not miss any content anymore
4 * 4 *
5 * @category poche 5 * @category wallabag
6 * @author Nicolas Lœuillet <support@inthepoche.com> 6 * @author Nicolas Lœuillet <nicolas@loeuillet.org>
7 * @copyright 2013 7 * @copyright 2013
8 * @license http://www.wtfpl.net/ see COPYING file 8 * @license http://www.wtfpl.net/ see COPYING file
9 */ 9 */
@@ -165,9 +165,14 @@ class Database {
165 } 165 }
166 } 166 }
167 167
168 public function login($username, $password) { 168 public function login($username, $password, $isauthenticated=false) {
169 $sql = "SELECT * FROM users WHERE username=? AND password=?"; 169 if ($isauthenticated) {
170 $query = $this->executeQuery($sql, array($username, $password)); 170 $sql = "SELECT * FROM users WHERE username=?";
171 $query = $this->executeQuery($sql, array($username));
172 } else {
173 $sql = "SELECT * FROM users WHERE username=? AND password=?";
174 $query = $this->executeQuery($sql, array($username, $password));
175 }
171 $login = $query->fetchAll(); 176 $login = $query->fetchAll();
172 177
173 $user = array(); 178 $user = array();
@@ -193,7 +198,7 @@ class Database {
193 public function updateUserConfig($userId, $key, $value) { 198 public function updateUserConfig($userId, $key, $value) {
194 $config = $this->getConfigUser($userId); 199 $config = $this->getConfigUser($userId);
195 200
196 if (!isset ($user_config[$key])) { 201 if (! isset($config[$key])) {
197 $sql = "INSERT INTO users_config (value, user_id, name) VALUES (?, ?, ?)"; 202 $sql = "INSERT INTO users_config (value, user_id, name) VALUES (?, ?, ?)";
198 } 203 }
199 else { 204 else {