UserToken / UserAPI

This commit is contained in:
2022-11-19 01:15:34 +01:00
parent f6bae08c05
commit b5b8f9b856
21 changed files with 496 additions and 613 deletions

View File

@@ -223,7 +223,7 @@ abstract class Request {
}
// Check for permission
if (!($this instanceof \API\Permission\Save)) {
if (!($this instanceof \Core\API\Permission\Save)) {
$req = new \Core\API\Permission\Check($this->context);
$this->success = $req->execute(array("method" => $this->getMethod()));
$this->lastError = $req->getLastError();
@@ -242,8 +242,8 @@ abstract class Request {
}
$sql = $this->context->getSQL();
if (!$sql->isConnected()) {
$this->lastError = $sql->getLastError();
if ($sql === null || !$sql->isConnected()) {
$this->lastError = $sql ? $sql->getLastError() : "Database not connected yet.";
return false;
}
@@ -265,8 +265,8 @@ abstract class Request {
return false;
}
protected function getParam($name, $obj = NULL) {
// i don't know why phpstorm
protected function getParam($name, $obj = NULL): mixed {
// I don't know why phpstorm
if ($obj === NULL) {
$obj = $this->params;
}