From 53133a18bcfd2d78359cc980dac6e6aa7f4e1fbc Mon Sep 17 00:00:00 2001 From: bernd Date: Mon, 1 Mar 2021 19:47:34 +0100 Subject: [PATCH] removeToken() in removeRequest() umbenannt, Bugfix --- lib/db.php | 6 +++--- lib/register.php | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/db.php b/lib/db.php index e05ccf9..d7e44bb 100644 --- a/lib/db.php +++ b/lib/db.php @@ -14,7 +14,7 @@ function testDriver(): bool return true; } -function getDatabase(&$config): Database { +function getDatabase(&$config, $log): Database { /** * Erstellt ein Datenbank Objekt und gibt dieses zurück. Im Fehlerfall @@ -102,7 +102,7 @@ class Database { { $this->pdo = $pdo; $this->log = $log; - $this->log->d("Databaseobject created"); + $this->log->d(Databaseobject created); // hier vielleicht TableCreate hin } @@ -314,7 +314,7 @@ class Database { return $response; } - public function removeToken(int $id): int { + public function removeRequest(int $id): int { /** * Entfernt den Request aus der Tabelle requests. Wird aufgerufen, diff --git a/lib/register.php b/lib/register.php index 6393ce5..97ca0d8 100644 --- a/lib/register.php +++ b/lib/register.php @@ -41,8 +41,8 @@ class Registrator extends BaseClass { $this->log->d("Validation started for token: {$_GET['token']}"); if ($this->checkToken() === true) { if ($this->generateToken(32) === true) { - if ($this->registerMXID($token) === true) { - $message = "Your temporary password is {$token}. Please + if ($this->registerMXID($this->token) === true) { + $message = "Your temporary password is {$this->token}. Please immediately change your password!"; if ($this->removeRequest() === true) { return true; @@ -104,7 +104,7 @@ class Registrator extends BaseClass { $nick = $this->dataSet[0]['nick']; $token = $this->dataSet[0]['token']; try { - $response = $this->db->deleteToken($id); + $response = $this->db->removeRequest($id); } catch (Exception $e) { $this->log->e("Error: {$e->getMessage()}"); return false;