Postgres Support
This commit is contained in:
@@ -2,7 +2,6 @@
|
||||
|
||||
namespace Api;
|
||||
|
||||
use \Driver\SQL\Keyword;
|
||||
use \Driver\SQL\Condition\Compare;
|
||||
|
||||
class GetApiKeys extends Request {
|
||||
@@ -21,7 +20,7 @@ class GetApiKeys extends Request {
|
||||
$res = $sql->select("uid", "api_key", "valid_until")
|
||||
->from("ApiKey")
|
||||
->where(new Compare("user_id", $this->user->getId()))
|
||||
->where(new Compare("valid_until", new Keyword($sql->currentTimestamp()), ">"))
|
||||
->where(new Compare("valid_until", $sql->currentTimestamp(), ">"))
|
||||
->where(new Compare("active", true))
|
||||
->execute();
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
namespace Api;
|
||||
|
||||
use \Api\Parameter\Parameter;
|
||||
use \Driver\SQL\Keyword;
|
||||
use \Driver\SQL\Condition\Compare;
|
||||
|
||||
class RefreshApiKey extends Request {
|
||||
@@ -23,7 +22,7 @@ class RefreshApiKey extends Request {
|
||||
->from("ApiKey")
|
||||
->where(new Compare("uid", $id))
|
||||
->where(new Compare("user_id", $this->user->getId()))
|
||||
->where(new Compare("valid_until", new Keyword($sql->currentTimestamp()), ">"))
|
||||
->where(new Compare("valid_until", $sql->currentTimestamp(), ">"))
|
||||
->where(new Compare("active", 1))
|
||||
->execute();
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
namespace Api;
|
||||
|
||||
use \Api\Parameter\Parameter;
|
||||
use \Driver\SQL\Keyword;
|
||||
use \Driver\SQL\Condition\Compare;
|
||||
|
||||
class RevokeApiKey extends Request {
|
||||
@@ -23,7 +22,7 @@ class RevokeApiKey extends Request {
|
||||
->from("ApiKey")
|
||||
->where(new Compare("uid", $id))
|
||||
->where(new Compare("user_id", $this->user->getId()))
|
||||
->where(new Compare("valid_until", new Keyword($sql->currentTimestamp()), ">"))
|
||||
->where(new Compare("valid_until", $sql->currentTimestamp(), ">"))
|
||||
->where(new Compare("active", 1))
|
||||
->execute();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user