This commit is contained in:
@@ -10,12 +10,16 @@ $app = app();
|
||||
$pdo = $app->pdo();
|
||||
$users = [];
|
||||
$error = '';
|
||||
$emailStore = null;
|
||||
|
||||
try {
|
||||
if (!$pdo) {
|
||||
throw new RuntimeException('Keine Datenbankverbindung verfügbar.');
|
||||
}
|
||||
|
||||
$emailStore = new App\UserEmailStore($pdo);
|
||||
$emailStore->ensureSchema();
|
||||
|
||||
$hasRolesTable = false;
|
||||
try {
|
||||
$stmt = $pdo->query("SELECT 1 FROM information_schema.tables WHERE table_schema = DATABASE() AND table_name = 'user_roles' LIMIT 1");
|
||||
@@ -36,6 +40,7 @@ try {
|
||||
';
|
||||
$stmt = $pdo->query($sql);
|
||||
$users = $stmt->fetchAll(PDO::FETCH_ASSOC) ?: [];
|
||||
$users = $emailStore->decryptRowEmails($users);
|
||||
|
||||
if ($hasRolesTable && $users) {
|
||||
$roleStmt = $pdo->query('SELECT user_id, role FROM user_roles ORDER BY user_id ASC, role ASC');
|
||||
|
||||
Reference in New Issue
Block a user