Renamed multiple database tables
This commit is contained in:
@@ -10,7 +10,7 @@ class API_apitoken extends API
|
||||
{
|
||||
public function getTokens()
|
||||
{
|
||||
$query = "SELECT * FROM vc_api_tokens WHERE vc_api_tokens.user_uuid = ?";
|
||||
$query = "SELECT * FROM system_api_tokens WHERE system_api_tokens.user_uuid = ?";
|
||||
$stmt = $this->prepareStatement($query);
|
||||
$stmt->bind_param('s', $this->data['user_uuid']);
|
||||
$this->executeStatement($stmt);
|
||||
@@ -33,7 +33,7 @@ class API_apitoken extends API
|
||||
|
||||
$api_token_hash = password_hash($api_token, PASSWORD_BCRYPT, ["cost" => 12]);
|
||||
$api_token_expiration_timestamp = strtotime('+1 year');
|
||||
$query = "INSERT INTO vc_api_tokens (api_token_uuid, user_uuid, api_token, api_token_expiration_timestamp, api_token_created_timestamp) VALUES (UUID(), ?, ?, ?, ?)";
|
||||
$query = "INSERT INTO system_api_tokens (api_token_uuid, user_uuid, api_token, api_token_expiration_timestamp, api_token_created_timestamp) VALUES (UUID(), ?, ?, ?, ?)";
|
||||
|
||||
$stmt = $this->prepareStatement($query);
|
||||
|
||||
@@ -57,7 +57,7 @@ class API_apitoken extends API
|
||||
|
||||
public function getNewToken()
|
||||
{
|
||||
$query = "SELECT * FROM vc_api_tokens WHERE user_uuid = ? ORDER BY api_token_created_timestamp DESC LIMIT 1";
|
||||
$query = "SELECT * FROM system_api_tokens WHERE user_uuid = ? ORDER BY api_token_created_timestamp DESC LIMIT 1";
|
||||
$stmt = $this->prepareStatement($query);
|
||||
$stmt->bind_param('s', $this->data['user_uuid']);
|
||||
$this->executeStatement($stmt);
|
||||
@@ -67,7 +67,7 @@ class API_apitoken extends API
|
||||
|
||||
public function getToken()
|
||||
{
|
||||
$query = "SELECT vc_users.user_email, vc_users.user_uuid FROM vc_api_tokens INNER JOIN vc_users ON vc_api_tokens.user_uuid = vc_users.user_uuid WHERE api_token_uuid = ?";
|
||||
$query = "SELECT system_users.user_email, system_users.user_uuid FROM system_api_tokens INNER JOIN system_users ON system_api_tokens.user_uuid = system_users.user_uuid WHERE api_token_uuid = ?";
|
||||
$stmt = $this->prepareStatement($query);
|
||||
$stmt->bind_param('s', $this->data['api_token_uuid']);
|
||||
$this->executeStatement($stmt);
|
||||
@@ -84,7 +84,7 @@ class API_apitoken extends API
|
||||
|
||||
public function deleteToken()
|
||||
{
|
||||
$query = "DELETE FROM vc_api_tokens WHERE api_token_uuid = ?";
|
||||
$query = "DELETE FROM system_api_tokens WHERE api_token_uuid = ?";
|
||||
$stmt = $this->prepareStatement($query);
|
||||
$stmt->bind_param('s', $this->data['api_token_uuid']);
|
||||
if ($this->executeStatement($stmt)) {
|
||||
@@ -97,7 +97,7 @@ class API_apitoken extends API
|
||||
|
||||
$api_token_revoked = ($this->data['api_token_revoked']) ? 1 : 0;
|
||||
|
||||
$query = "UPDATE vc_api_tokens SET api_token_revoked = ? WHERE api_token_uuid = ?";
|
||||
$query = "UPDATE system_api_tokens SET api_token_revoked = ? WHERE api_token_uuid = ?";
|
||||
$stmt = $this->prepareStatement($query);
|
||||
$stmt->bind_param('is', $api_token_revoked, $this->data['api_token_uuid']);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user