mirror of
https://github.com/wallabag/wallabag.git
synced 2025-09-15 18:57:05 +00:00
fix of bug #368 Endless redirects or user doesn't exist with basic authentication
This commit is contained in:
parent
f4fbfaa7cb
commit
6af66b1106
2 changed files with 18 additions and 12 deletions
|
@ -165,9 +165,14 @@ class Database {
|
|||
}
|
||||
}
|
||||
|
||||
public function login($username, $password) {
|
||||
$sql = "SELECT * FROM users WHERE username=? AND password=?";
|
||||
$query = $this->executeQuery($sql, array($username, $password));
|
||||
public function login($username, $password, $isauthenticated=false) {
|
||||
if ($isauthenticated) {
|
||||
$sql = "SELECT * FROM users WHERE username=?";
|
||||
$query = $this->executeQuery($sql, array($username));
|
||||
} else {
|
||||
$sql = "SELECT * FROM users WHERE username=? AND password=?";
|
||||
$query = $this->executeQuery($sql, array($username, $password));
|
||||
}
|
||||
$login = $query->fetchAll();
|
||||
|
||||
$user = array();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue