Renamed multiple database tables
This commit is contained in:
@@ -10,7 +10,7 @@ class API_usergroups extends API
|
||||
{
|
||||
public function getUsergroup($returnBoolean = false)
|
||||
{
|
||||
list($query, $types, $params) = $this->buildDynamicQuery('vc_user_groups');
|
||||
list($query, $types, $params) = $this->buildDynamicQuery('system_user_groups');
|
||||
|
||||
$items = $this->generalGetFunction($query, $types, $params, $returnBoolean, 'User Group');
|
||||
|
||||
@@ -32,7 +32,7 @@ class API_usergroups extends API
|
||||
$this->apiOutput(400, ['error' => 'You cannot make an group with an lower weight then yourself!']);
|
||||
}
|
||||
|
||||
$query = "INSERT INTO vc_user_groups (user_group_uuid, user_group_name, user_group_slugify, user_group_weight, user_group_type, user_group_create_timestamp) VALUES (UUID(), ?, ?, ?, ?, ?)";
|
||||
$query = "INSERT INTO system_user_groups (user_group_uuid, user_group_name, user_group_slugify, user_group_weight, user_group_type, user_group_create_timestamp) VALUES (UUID(), ?, ?, ?, ?, ?)";
|
||||
$stmt = $this->prepareStatement($query);
|
||||
$timestamp = time();
|
||||
$stmt->bind_param("ssisi", $this->data['user_group_name'], $this->data['user_group_slugify'], $this->data['user_group_weight'], $this->data['user_group_type'], $timestamp);
|
||||
@@ -42,7 +42,7 @@ class API_usergroups extends API
|
||||
|
||||
|
||||
# Get all the permission from the database and create the permission for the user group.
|
||||
$stmt = $this->conn->query("SELECT permission_uuid FROM vc_permissions");
|
||||
$stmt = $this->conn->query("SELECT permission_uuid FROM system_permissions");
|
||||
while ($row = $stmt->fetch_assoc()) {
|
||||
$permission_uuids[] = $row['permission_uuid'];
|
||||
}
|
||||
@@ -57,7 +57,7 @@ class API_usergroups extends API
|
||||
if (!empty($values)) {
|
||||
$values_sql = implode(", ", $values);
|
||||
|
||||
$query = "INSERT INTO vc_user_group_permissions_portal (permission_uuid, user_group_uuid) VALUES $values_sql";
|
||||
$query = "INSERT INTO system_user_group_permissions (permission_uuid, user_group_uuid) VALUES $values_sql";
|
||||
|
||||
$stmt = $this->prepareStatement($query);
|
||||
$this->executeStatement($stmt);
|
||||
@@ -83,7 +83,7 @@ class API_usergroups extends API
|
||||
$this->apiOutput(400, ['error' => 'groups with an lower weight cannot be deleted.']);
|
||||
}
|
||||
|
||||
$query = "DELETE FROM vc_user_groups WHERE user_group_uuid = ?";
|
||||
$query = "DELETE FROM system_user_groups WHERE user_group_uuid = ?";
|
||||
$stmt = $this->prepareStatement($query);
|
||||
$stmt->bind_param('s', $this->data['user_group_uuid']);
|
||||
$this->executeStatement($stmt);
|
||||
@@ -94,7 +94,7 @@ class API_usergroups extends API
|
||||
private function get_next_available_user_group_weight($weight)
|
||||
{
|
||||
# checks what the next avail weight is if the weight is taken by another item
|
||||
$sql = "SELECT user_group_weight FROM vc_user_groups ORDER BY user_group_weight ASC";
|
||||
$sql = "SELECT user_group_weight FROM system_user_groups ORDER BY user_group_weight ASC";
|
||||
$result = $this->conn->query($sql);
|
||||
|
||||
// Store all existing weights in an array
|
||||
@@ -130,7 +130,7 @@ class API_usergroups extends API
|
||||
$this->apiOutput(400, ['error' => 'You cannot make an group with an lower weight then yourself!']);
|
||||
}
|
||||
|
||||
$query = "UPDATE vc_user_groups SET user_group_name = ?, user_group_weight = ?, user_group_modified_timestamp = ? WHERE user_group_uuid = ?";
|
||||
$query = "UPDATE system_user_groups SET user_group_name = ?, user_group_weight = ?, user_group_modified_timestamp = ? WHERE user_group_uuid = ?";
|
||||
$stmt = $this->prepareStatement($query);
|
||||
$stmt->bind_param("siis", $this->data['user_group_name'], $this->data['user_group_weight'], time(), $this->data['user_group_uuid']);
|
||||
$this->executeStatement($stmt);
|
||||
|
||||
Reference in New Issue
Block a user