removed notification + new react structure

This commit is contained in:
2022-11-23 23:36:30 +01:00
parent 303a5b69b5
commit b1c4c9e976
76 changed files with 10221 additions and 616 deletions

View File

@@ -21,9 +21,9 @@ class CreateDatabase extends DatabaseScript {
]);
$queries[] = Group::getHandler($sql)->getInsertQuery([
new Group(Group::ADMIN, Group::GROUPS[Group::ADMIN], "#007bff"),
new Group(Group::ADMIN, Group::GROUPS[Group::ADMIN], "#dc3545"),
new Group(Group::MODERATOR, Group::GROUPS[Group::MODERATOR], "#28a745"),
new Group(Group::SUPPORT, Group::GROUPS[Group::SUPPORT], "#dc3545"),
new Group(Group::SUPPORT, Group::GROUPS[Group::SUPPORT], "#007bff"),
]);
$queries[] = $sql->createTable("Visitor")
@@ -84,6 +84,7 @@ class CreateDatabase extends DatabaseScript {
->addRow("Mail/Sync", array(Group::SUPPORT, Group::ADMIN), "Allows users to synchronize mails with the database")
->addRow("Settings/get", array(Group::ADMIN), "Allows users to fetch server settings")
->addRow("Settings/set", array(Group::ADMIN), "Allows users create, delete or modify server settings")
->addRow("Settings/generateJWT", array(Group::ADMIN), "Allows users generate a new jwt key")
->addRow("Stats", array(Group::ADMIN, Group::SUPPORT), "Allows users to fetch server stats")
->addRow("User/create", array(Group::ADMIN), "Allows users to create a new user, email address does not need to be confirmed")
->addRow("User/fetch", array(Group::ADMIN, Group::SUPPORT), "Allows users to list all registered users")

View File

@@ -47,15 +47,18 @@ class Settings {
public function getJwtPublicKey(bool $allowPrivate = true): ?\Firebase\JWT\Key {
if (empty($this->jwtPublicKey)) {
// we might have a symmetric key, should we instead return the private key?
return $allowPrivate ? new \Firebase\JWT\Key($this->jwtSecretKey, $this->jwtAlgorithm) : null;
if ($allowPrivate && $this->jwtSecretKey) {
// we might have a symmetric key, should we instead return the private key?
return new \Firebase\JWT\Key($this->jwtSecretKey, $this->jwtAlgorithm);
}
return null;
} else {
return new \Firebase\JWT\Key($this->jwtPublicKey, $this->jwtAlgorithm);
}
}
public function getJwtSecretKey(): \Firebase\JWT\Key {
return new \Firebase\JWT\Key($this->jwtSecretKey, $this->jwtAlgorithm);
public function getJwtSecretKey(): ?\Firebase\JWT\Key {
return $this->jwtSecretKey ? new \Firebase\JWT\Key($this->jwtSecretKey, $this->jwtAlgorithm) : null;
}
public function isInstalled(): bool {