forked from berhsi/matrix-register
fix typo, db-weiche wieder entfernt
This commit is contained in:
parent
0483ceab53
commit
a80da9dab8
10
lib/db.php
10
lib/db.php
|
@ -158,15 +158,9 @@ class Database {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$this->log->d("Check if table requests exists");
|
$this->log->d("Check if table requests exists");
|
||||||
if ($this->pdo->driver === "PDO_PGSQL") {
|
|
||||||
$stmt = "SELECT * FROM information_schema.tables WHERE
|
$stmt = "SELECT * FROM information_schema.tables WHERE
|
||||||
table_type = 'BASE TABLE' and
|
table_type = 'BASE TABLE' and
|
||||||
table_name = 'requests'";
|
table_name = 'requests'";
|
||||||
} else if ($this->pdo->driver === "PDO_PSQLITE") {
|
|
||||||
// ungetestet
|
|
||||||
$stmt = "SELECT 1 FROM sqlite_master WHERE type='table' and
|
|
||||||
name='requests'";
|
|
||||||
}
|
|
||||||
try {
|
try {
|
||||||
$response = $this->pdo->query($stmt);
|
$response = $this->pdo->query($stmt);
|
||||||
} catch (PDOException $e) {
|
} catch (PDOException $e) {
|
||||||
|
@ -234,7 +228,7 @@ class Database {
|
||||||
$userFound = false;
|
$userFound = false;
|
||||||
$users = [];
|
$users = [];
|
||||||
$this->log->d("Search for localpart {$nick} in users");
|
$this->log->d("Search for localpart {$nick} in users");
|
||||||
$query = "SELECT `name` FROM users WHERE `name` = :nick";
|
$query = "SELECT name FROM users WHERE name = :nick";
|
||||||
$name = "@" . $nick . ":matrix.kraut.space";
|
$name = "@" . $nick . ":matrix.kraut.space";
|
||||||
$users = $this->searchUser($query, $name);
|
$users = $this->searchUser($query, $name);
|
||||||
$count = count($users);
|
$count = count($users);
|
||||||
|
@ -321,7 +315,7 @@ class Database {
|
||||||
|
|
||||||
$this->log->i("Search for IP: {$_SERVER['REMOTE_ADDR']}");
|
$this->log->i("Search for IP: {$_SERVER['REMOTE_ADDR']}");
|
||||||
$stmt = $this->pdo->prepare(
|
$stmt = $this->pdo->prepare(
|
||||||
"SELECT `time` FROM requests WHERE ip = :ip"
|
"SELECT time FROM requests WHERE ip = :ip"
|
||||||
);
|
);
|
||||||
try {
|
try {
|
||||||
$stmt->BindValue(':ip', $ip, PDO::PARAM_LOB);
|
$stmt->BindValue(':ip', $ip, PDO::PARAM_LOB);
|
||||||
|
|
Loading…
Reference in a new issue