removeToken() in removeRequest() umbenannt, Bugfix
This commit is contained in:
parent
5f90bb2f07
commit
53133a18bc
|
@ -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,
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue