docker: gd extension + 2FA Bugfix

This commit is contained in:
Roman Hergenreder
2022-11-27 15:58:44 +01:00
parent 26a22f5299
commit c9a7da688f
13 changed files with 241 additions and 182 deletions

View File

@@ -19,7 +19,7 @@ abstract class TwoFactorToken extends DatabaseEntity {
#[ExtendingEnum(self::TWO_FACTOR_TOKEN_TYPES)] private string $type;
private bool $confirmed;
private bool $authenticated;
#[MaxLength(512)] private string $data;
#[MaxLength(512)] private ?string $data;
public function __construct(string $type, ?int $id = null, bool $confirmed = false) {
parent::__construct($id);
@@ -27,6 +27,7 @@ abstract class TwoFactorToken extends DatabaseEntity {
$this->type = $type;
$this->confirmed = $confirmed;
$this->authenticated = $_SESSION["2faAuthenticated"] ?? false;
$this->data = null;
}
public function jsonSerialize(): array {
@@ -63,11 +64,12 @@ abstract class TwoFactorToken extends DatabaseEntity {
return $this->confirmed;
}
public function getId(): int {
return $this->id;
}
public function isAuthenticated(): bool {
return $this->authenticated;
}
public function confirm(SQL $sql): bool {
$this->confirmed = true;
return $this->save($sql) !== false;
}
}