Renamed multiple database tables

This commit is contained in:
2026-05-15 23:00:08 +02:00
parent 925348e8fe
commit 5a27c678b1
40 changed files with 267 additions and 256 deletions

View File

@@ -48,29 +48,29 @@ function setSessionParams()
{
if (isset($_SESSION['user']['user_uuid'])) {
$user_uuid = $_SESSION['user']['user_uuid'];
$stmt = $GLOBALS['conn']->prepare("SELECT * FROM vc_users INNER JOIN vc_user_groups ON vc_users.user_group_uuid = vc_user_groups.user_group_uuid WHERE user_uuid = ? LIMIT 1");
$stmt = $GLOBALS['conn']->prepare("SELECT * FROM system_users INNER JOIN system_user_groups ON system_users.user_group_uuid = system_user_groups.user_group_uuid WHERE user_uuid = ? LIMIT 1");
$stmt->bind_param('s', $user_uuid);
$stmt->execute();
$result = $stmt->get_result();
$user = $result->fetch_assoc();
$_SESSION['user'] = ['user_uuid' => $user['user_uuid'],
'user_email' => $user['user_email'],
'user_first_name' => $user['user_first_name'],
'user_full_name' => $user['user_full_name'],
'user_group_uuid' => $user['user_group_uuid'],
'user_group_weight' => $user['user_group_weight'],
'user_group_type' => $user['user_group_type'],
'user_pref_language' => $user['user_pref_language'],
'user_two_factor_enabled' => $user['user_two_factor_enabled'],
'user_profile_picture' => $user['user_profile_picture'],
'user_profile_picture_thumbnail' => $user['user_profile_picture_thumbnail'],
'user_timezone' => getUserTimezone(),
'user_email' => $user['user_email'],
'user_first_name' => $user['user_first_name'],
'user_full_name' => $user['user_full_name'],
'user_group_uuid' => $user['user_group_uuid'],
'user_group_weight' => $user['user_group_weight'],
'user_group_type' => $user['user_group_type'],
'user_pref_language' => $user['user_pref_language'],
'user_two_factor_enabled' => $user['user_two_factor_enabled'],
'user_profile_picture' => $user['user_profile_picture'],
'user_profile_picture_thumbnail' => $user['user_profile_picture_thumbnail'],
'user_timezone' => getUserTimezone(),
];
$stmt = $GLOBALS['conn']->prepare("SELECT vc_user_group_permissions_portal.permission_value, vc_permissions.permission_name
FROM vc_user_group_permissions_portal
INNER JOIN vc_permissions ON vc_user_group_permissions_portal.permission_uuid = vc_permissions.permission_uuid
$stmt = $GLOBALS['conn']->prepare("SELECT system_user_group_permissions.permission_value, system_permissions.permission_name
FROM system_user_group_permissions
INNER JOIN system_permissions ON system_user_group_permissions.permission_uuid = system_permissions.permission_uuid
WHERE user_group_uuid = ?");
$stmt->bind_param('s', $user['user_group_uuid']);
$_SESSION['permission'] = array();
@@ -84,7 +84,7 @@ function setSessionParams()
function loginUser($user_uuid)
{
$update = $GLOBALS['conn']->prepare("UPDATE vc_users SET user_last_login_timestamp = ? WHERE user_uuid = ?");
$update = $GLOBALS['conn']->prepare("UPDATE system_users SET user_last_login_timestamp = ? WHERE user_uuid = ?");
$update->bind_param('is', time(), $user_uuid);
$update->execute();