Logout functionality
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user