php 7.4 dev branch
This commit is contained in:
@@ -3,10 +3,11 @@
|
||||
namespace Api\ApiKey;
|
||||
|
||||
use \Api\Request;
|
||||
|
||||
class Create extends Request {
|
||||
|
||||
public function __construct($user, $externCall = false) {
|
||||
parent::__construct($user, $externCall, array());
|
||||
public function __construct($user, $externalCall = false) {
|
||||
parent::__construct($user, $externalCall, array());
|
||||
$this->apiKeyAllowed = false;
|
||||
$this->loginRequired = true;
|
||||
}
|
||||
@@ -39,6 +40,4 @@ class Create extends Request {
|
||||
}
|
||||
return $this->success;
|
||||
}
|
||||
};
|
||||
|
||||
?>
|
||||
}
|
||||
@@ -3,12 +3,13 @@
|
||||
namespace Api\ApiKey;
|
||||
|
||||
use \Api\Request;
|
||||
use DateTime;
|
||||
use \Driver\SQL\Condition\Compare;
|
||||
|
||||
class Fetch extends Request {
|
||||
|
||||
public function __construct($user, $externCall = false) {
|
||||
parent::__construct($user, $externCall, array());
|
||||
public function __construct($user, $externalCall = false) {
|
||||
parent::__construct($user, $externalCall, array());
|
||||
$this->loginRequired = true;
|
||||
}
|
||||
|
||||
@@ -31,16 +32,20 @@ class Fetch extends Request {
|
||||
if($this->success) {
|
||||
$this->result["api_keys"] = array();
|
||||
foreach($res as $row) {
|
||||
try {
|
||||
$validUntil = (new DateTime($row["valid_until"]))->getTimestamp();
|
||||
} catch (\Exception $e) {
|
||||
$validUntil = $row["valid_until"];
|
||||
}
|
||||
|
||||
$this->result["api_keys"][] = array(
|
||||
"uid" => $row["uid"],
|
||||
"api_key" => $row["api_key"],
|
||||
"valid_until" => (new \DateTime($row["valid_until"]))->getTimestamp(),
|
||||
);
|
||||
"uid" => $row["uid"],
|
||||
"api_key" => $row["api_key"],
|
||||
"valid_until" => $validUntil,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return $this->success;
|
||||
}
|
||||
};
|
||||
|
||||
?>
|
||||
}
|
||||
@@ -8,8 +8,8 @@ use \Driver\SQL\Condition\Compare;
|
||||
|
||||
class Refresh extends Request {
|
||||
|
||||
public function __construct($user, $externCall = false) {
|
||||
parent::__construct($user, $externCall, array(
|
||||
public function __construct($user, $externalCall = false) {
|
||||
parent::__construct($user, $externalCall, array(
|
||||
"id" => new Parameter("id", Parameter::TYPE_INT),
|
||||
));
|
||||
$this->loginRequired = true;
|
||||
@@ -62,6 +62,4 @@ class Refresh extends Request {
|
||||
|
||||
return $this->success;
|
||||
}
|
||||
};
|
||||
|
||||
?>
|
||||
}
|
||||
@@ -8,8 +8,8 @@ use \Driver\SQL\Condition\Compare;
|
||||
|
||||
class Revoke extends Request {
|
||||
|
||||
public function __construct($user, $externCall = false) {
|
||||
parent::__construct($user, $externCall, array(
|
||||
public function __construct($user, $externalCall = false) {
|
||||
parent::__construct($user, $externalCall, array(
|
||||
"id" => new Parameter("id", Parameter::TYPE_INT),
|
||||
));
|
||||
$this->loginRequired = true;
|
||||
@@ -57,6 +57,4 @@ class Revoke extends Request {
|
||||
|
||||
return $this->success;
|
||||
}
|
||||
};
|
||||
|
||||
?>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user