web-base/core/Api/User/Logout.class.php

24 lines
508 B
PHP
Raw Normal View History

2020-02-10 00:52:25 +01:00
<?php
2020-04-02 21:19:06 +02:00
namespace Api\User;
use \Api\Request;
2020-02-10 00:52:25 +01:00
class Logout extends Request {
2020-04-03 15:56:04 +02:00
public function __construct($user, $externalCall = false) {
parent::__construct($user, $externalCall);
2020-02-10 00:52:25 +01:00
$this->loginRequired = true;
$this->apiKeyAllowed = false;
}
public function execute($values = array()) {
if(!parent::execute($values)) {
return false;
}
2020-04-02 00:02:51 +02:00
$this->success = $this->user->logout();
$this->lastError = $this->user->getSQL()->getLastError();
return $this->success;
2020-02-10 00:52:25 +01:00
}
2020-04-03 15:56:04 +02:00
}