fix 500 error
Deploy / deploy (push) Successful in 31s

This commit is contained in:
2026-05-07 23:56:43 +02:00
parent d812e7d926
commit 8c483b59b6
2 changed files with 25 additions and 9 deletions
+17 -3
View File
@@ -14,10 +14,24 @@ $sql = "SELECT id, action, ip, user_agent, details, created_at FROM activity_log
$stmt = mysqli_prepare($conn, $sql); $stmt = mysqli_prepare($conn, $sql);
mysqli_stmt_bind_param($stmt, 'i', $user_id); mysqli_stmt_bind_param($stmt, 'i', $user_id);
mysqli_stmt_execute($stmt); mysqli_stmt_execute($stmt);
$result = mysqli_stmt_get_result($stmt); mysqli_stmt_store_result($stmt);
$entries = []; $entries = [];
while ($row = mysqli_fetch_assoc($result)) { $id = 0;
$entries[] = $row; $action = '';
$ip = '';
$user_agent = '';
$details = '';
$created_at = '';
mysqli_stmt_bind_result($stmt, $id, $action, $ip, $user_agent, $details, $created_at);
while (mysqli_stmt_fetch($stmt)) {
$entries[] = [
'id' => $id,
'action' => $action,
'ip' => $ip,
'user_agent' => $user_agent,
'details' => $details,
'created_at' => $created_at,
];
} }
mysqli_stmt_close($stmt); mysqli_stmt_close($stmt);
+8 -6
View File
@@ -12,17 +12,19 @@ $user_id = $_SESSION['id'];
$method = $_SERVER['REQUEST_METHOD']; $method = $_SERVER['REQUEST_METHOD'];
if ($method === 'GET') { if ($method === 'GET') {
$sql = "SELECT id, agent, auth_token FROM keepmeloggedin WHERE user_id = ? ORDER BY id DESC"; $sql = "SELECT id, agent FROM keepmeloggedin WHERE user_id = ? ORDER BY id DESC";
$stmt = mysqli_prepare($conn, $sql); $stmt = mysqli_prepare($conn, $sql);
mysqli_stmt_bind_param($stmt, 'i', $user_id); mysqli_stmt_bind_param($stmt, 'i', $user_id);
mysqli_stmt_execute($stmt); mysqli_stmt_execute($stmt);
$result = mysqli_stmt_get_result($stmt); mysqli_stmt_store_result($stmt);
$sessions = []; $sessions = [];
while ($row = mysqli_fetch_assoc($result)) { $id = 0;
$agent = '';
mysqli_stmt_bind_result($stmt, $id, $agent);
while (mysqli_stmt_fetch($stmt)) {
$sessions[] = [ $sessions[] = [
'id' => $row['id'], 'id' => $id,
'user_agent' => $row['agent'], 'user_agent' => $agent,
'auth_token' => substr($row['auth_token'], 0, 16) . '...'
]; ];
} }
mysqli_stmt_close($stmt); mysqli_stmt_close($stmt);