$ip, 'reason' => $reason]); } else { $error_message = "Failed to ban IP {$ip}."; } break; case 'unban': if (VIPTracker::unbanIP($ip)) { $success_message = "IP {$ip} has been unbanned successfully."; VIPTracker::logActivity('ip_unbanned', ['ip' => $ip]); } else { $error_message = "Failed to unban IP {$ip}."; } break; } } // Get IP statistics if IP is provided $ip_stats = null; $threat_info = null; $ban_info = null; if ($ip && filter_var($ip, FILTER_VALIDATE_IP)) { $ip_stats = VIPTracker::getIPStats($ip, 24); $threat_info = VIPTracker::detectThreats($ip); $ban_info = VIPTracker::isBanned($ip); } // Get recent activity global $db; $recent_activity = []; try { $sql = "SELECT ip_address, action, COUNT(*) as count, MAX(timestamp) as last_seen FROM db_ip_tracking WHERE timestamp >= DATE_SUB(NOW(), INTERVAL 1 HOUR) GROUP BY ip_address, action ORDER BY count DESC, last_seen DESC LIMIT 20"; $result = $db->Execute($sql); while ($result && !$result->EOF) { $recent_activity[] = [ 'ip' => $result->fields['ip_address'], 'action' => $result->fields['action'], 'count' => $result->fields['count'], 'last_seen' => $result->fields['last_seen'] ]; $result->MoveNext(); } } catch (Exception $e) { // Handle error } // Get current bans $current_bans = []; try { $sql = "SELECT ban_ip, ban_reason, ban_date, ban_expires, banned_by FROM db_banlist WHERE ban_active = 1 ORDER BY ban_date DESC LIMIT 50"; $result = $db->Execute($sql); while ($result && !$result->EOF) { $current_bans[] = [ 'ip' => $result->fields['ban_ip'], 'reason' => $result->fields['ban_reason'], 'ban_date' => $result->fields['ban_date'], 'expires' => $result->fields['ban_expires'], 'banned_by' => $result->fields['banned_by'] ]; $result->MoveNext(); } } catch (Exception $e) { // Handle error } ?>
= $ip_stats['total_requests'] ?>
= $ip_stats['unique_actions'] ?>
= secure_output($ip_stats['first_seen'] ?? 'Never') ?>
= secure_output($ip_stats['last_seen'] ?? 'Never') ?>
Risk Level: = $threat_info['risk_assessment'] ?>
| IP Address | Action | Count | Last Seen | Actions |
|---|---|---|---|---|
| = secure_output($activity['ip']) ?> | = secure_output($activity['action']) ?> | = $activity['count'] ?> | = secure_output($activity['last_seen']) ?> | View |
| IP Address | Reason | Banned Date | Expires | Banned By | Actions |
|---|---|---|---|---|---|
| = secure_output($ban['ip']) ?> | = secure_output($ban['reason']) ?> | = secure_output($ban['ban_date']) ?> | = $ban['expires'] ? secure_output($ban['expires']) : 'Permanent' ?> | = secure_output($ban['banned_by']) ?> |