Logout functionality

This commit is contained in:
2020-06-14 22:35:01 +02:00
parent 11323f2781
commit 95b803a1e4
19 changed files with 4620 additions and 2742 deletions

View File

@@ -91,7 +91,13 @@ class Request {
$values = $_REQUEST;
if($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_SERVER["CONTENT_TYPE"]) && in_array("application/json", explode(";", $_SERVER["CONTENT_TYPE"]))) {
$jsonData = json_decode(file_get_contents('php://input'), true);
$values = array_merge($values, $jsonData);
if ($jsonData) {
$values = array_merge($values, $jsonData);
} else {
$this->lastError = 'Invalid request body.';
header('HTTP 1.1 400 Bad Request');
return false;
}
}
}

View File

@@ -18,10 +18,6 @@ class Logout extends Request {
return false;
}
$this->lastError = "CUSTOM ERROR MESSAGE";
$this->success = false;
return false;
$this->success = $this->user->logout();
$this->lastError = $this->user->getSQL()->getLastError();
return $this->success;

View File

@@ -30,7 +30,7 @@ namespace Documents\Admin {
protected function initSources() {
// $this->loadJQuery();
// $this->loadFontawesome();
$this->loadFontawesome();
// $this->addJS(Script::CORE);
// $this->addCSS(Link::CORE);
// $this->addJS(Script::ADMIN);

View File

@@ -273,7 +273,7 @@ class AdminDashboardBody extends Body {
*/
$script = new Script(Script::MIME_TEXT_JAVASCRIPT, "/js/admin.min.js");
$html .= "<body id=\"root\">$script</body>";
$html .= "<body><div class=\"wrapper\" id=\"root\">$script</div></body>";
return $html;
}
}

View File

@@ -17,7 +17,6 @@ class LoginBody extends Body {
$head = $this->getDocument()->getHead();
$head->loadBootstrap();
$head->loadJQuery();
$head->loadFontawesome();
$head->addJS(Script::CORE);
$head->addCSS(Link::CORE);
$head->addJS(Script::ADMIN);