web-base/core/Api/User/Logout.class.php
Roman Hergenreder bc2fbbda68 reactjs
2020-06-14 12:38:35 +02:00

28 lines
602 B
PHP

<?php
namespace Api\User;
use \Api\Request;
class Logout extends Request {
public function __construct($user, $externalCall = false) {
parent::__construct($user, $externalCall);
$this->loginRequired = true;
$this->apiKeyAllowed = false;
}
public function execute($values = array()) {
if(!parent::execute($values)) {
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;
}
}