From e9cea98e9549f8a4876fa68db165cb3bb3a1ff55 Mon Sep 17 00:00:00 2001 From: Hamza-Ayed Date: Mon, 4 May 2026 00:29:31 +0300 Subject: [PATCH] Update: 2026-05-04 00:29:31 --- app/modules_app/users/index.php | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/app/modules_app/users/index.php b/app/modules_app/users/index.php index d33059c..de85b82 100644 --- a/app/modules_app/users/index.php +++ b/app/modules_app/users/index.php @@ -19,19 +19,17 @@ try { if ($role === 'super_admin') { // Super Admin sees ALL users from ALL tenants $stmt = $db->query(" - SELECT u.id, u.name, u.email, u.role, u.is_active, u.created_at, t.name as tenant_name, c.name as company_name + SELECT u.id, u.name, u.email, u.role, u.is_active, u.created_at, t.name as tenant_name FROM users u LEFT JOIN tenants t ON u.tenant_id = t.id - LEFT JOIN companies c ON u.company_id = c.id ORDER BY u.created_at DESC "); } elseif ($role === 'admin') { // Admin sees only users in THEIR tenant (Accounting Office) $stmt = $db->prepare(" - SELECT u.id, u.name, u.email, u.role, u.is_active, u.created_at, t.name as tenant_name, c.name as company_name + SELECT u.id, u.name, u.email, u.role, u.is_active, u.created_at, t.name as tenant_name FROM users u LEFT JOIN tenants t ON u.tenant_id = t.id - LEFT JOIN companies c ON u.company_id = c.id WHERE u.tenant_id = ? ORDER BY u.created_at DESC "); @@ -52,12 +50,6 @@ try { $decryptedEmail = Encryption::decrypt($user['email']); $user['email'] = $decryptedEmail !== false ? $decryptedEmail : $user['email']; - // Decrypt Company Name (if exists) - if (!empty($user['company_name'])) { - $decryptedCompanyName = Encryption::decrypt($user['company_name']); - $user['company_name'] = $decryptedCompanyName !== false ? $decryptedCompanyName : $user['company_name']; - } - // Decrypt Tenant Name (if exists) if (!empty($user['tenant_name'])) { $decryptedTenantName = Encryption::decrypt($user['tenant_name']);