shared frontend, UserAPI invalidate sessions, bugfixes, stuff

This commit is contained in:
2023-02-09 23:55:30 +01:00
parent 8a09fc1f2d
commit 5acd13b945
15 changed files with 164 additions and 78 deletions

View File

@@ -211,4 +211,16 @@ class Context {
public function getLanguage(): Language {
return $this->language;
}
public function invalidateSessions(bool $keepCurrent = true): bool {
$query = $this->sql->update("Session")
->set("active", false)
->whereEq("user_id", $this->user->getId());
if (!$keepCurrent && $this->session !== null) {
$query->whereNeq("id", $this->session->getId());
}
return $query->execute();
}
}