prepare('SELECT * FROM users WHERE id = ?'); $stmt->execute([$id]); $updated = $stmt->fetch(); if ($updated) { $_SESSION['user'] = $updated['username']; $_SESSION['role'] = bg_normalize_role($updated['role']); $_SESSION['credential_fingerprint'] = bg_auth_session_fingerprint($updated); } } bg_flash('success', bg_t('user_updated')); bg_redirect('web_users.php'); } if ($action === 'delete') { bg_delete_user((int)($_POST['id'] ?? 0)); bg_flash('success', bg_t('user_deleted')); bg_redirect('web_users.php'); } } catch (Throwable $e) { bg_flash('danger', $e->getMessage()); bg_redirect('web_users.php'); } } $editId = isset($_GET['edit']) ? (int)$_GET['edit'] : 0; if ($editId > 0) $editing = bg_user_by_id($editId); $users = bg_users_all(); $adminCount = 0; $standardCount = 0; foreach ($users as $u) { if (($u['role'] ?? 'user') === 'admin') $adminCount++; else $standardCount++; } include 'includes/header.php'; include 'includes/sidebar.php'; ?>

: :
:

·

minlength="8">
minlength="8">