style: auto-fix 1340 phpcs PSR-12 violations via phpcbf; exclude MissingNamespace and SideEffects
This commit is contained in:
+43
-14
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Audit Log API Endpoint
|
||||
* Handles fetching filtered audit logs and CSV export
|
||||
@@ -23,13 +24,27 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
|
||||
if (isset($_GET['export']) && $_GET['export'] === 'csv') {
|
||||
// Build filters
|
||||
$filters = [];
|
||||
if (isset($_GET['action_type'])) $filters['action_type'] = $_GET['action_type'];
|
||||
if (isset($_GET['entity_type'])) $filters['entity_type'] = $_GET['entity_type'];
|
||||
if (isset($_GET['user_id'])) $filters['user_id'] = $_GET['user_id'];
|
||||
if (isset($_GET['entity_id'])) $filters['entity_id'] = $_GET['entity_id'];
|
||||
if (isset($_GET['date_from'])) $filters['date_from'] = $_GET['date_from'];
|
||||
if (isset($_GET['date_to'])) $filters['date_to'] = $_GET['date_to'];
|
||||
if (isset($_GET['ip_address'])) $filters['ip_address'] = $_GET['ip_address'];
|
||||
if (isset($_GET['action_type'])) {
|
||||
$filters['action_type'] = $_GET['action_type'];
|
||||
}
|
||||
if (isset($_GET['entity_type'])) {
|
||||
$filters['entity_type'] = $_GET['entity_type'];
|
||||
}
|
||||
if (isset($_GET['user_id'])) {
|
||||
$filters['user_id'] = $_GET['user_id'];
|
||||
}
|
||||
if (isset($_GET['entity_id'])) {
|
||||
$filters['entity_id'] = $_GET['entity_id'];
|
||||
}
|
||||
if (isset($_GET['date_from'])) {
|
||||
$filters['date_from'] = $_GET['date_from'];
|
||||
}
|
||||
if (isset($_GET['date_to'])) {
|
||||
$filters['date_to'] = $_GET['date_to'];
|
||||
}
|
||||
if (isset($_GET['ip_address'])) {
|
||||
$filters['ip_address'] = $_GET['ip_address'];
|
||||
}
|
||||
|
||||
// Get all matching logs (no limit for CSV export)
|
||||
$result = $auditLogModel->getFilteredLogs($filters, 10000, 0);
|
||||
@@ -77,13 +92,27 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
|
||||
|
||||
// Build filters
|
||||
$filters = [];
|
||||
if (isset($_GET['action_type'])) $filters['action_type'] = $_GET['action_type'];
|
||||
if (isset($_GET['entity_type'])) $filters['entity_type'] = $_GET['entity_type'];
|
||||
if (isset($_GET['user_id'])) $filters['user_id'] = $_GET['user_id'];
|
||||
if (isset($_GET['entity_id'])) $filters['entity_id'] = $_GET['entity_id'];
|
||||
if (isset($_GET['date_from'])) $filters['date_from'] = $_GET['date_from'];
|
||||
if (isset($_GET['date_to'])) $filters['date_to'] = $_GET['date_to'];
|
||||
if (isset($_GET['ip_address'])) $filters['ip_address'] = $_GET['ip_address'];
|
||||
if (isset($_GET['action_type'])) {
|
||||
$filters['action_type'] = $_GET['action_type'];
|
||||
}
|
||||
if (isset($_GET['entity_type'])) {
|
||||
$filters['entity_type'] = $_GET['entity_type'];
|
||||
}
|
||||
if (isset($_GET['user_id'])) {
|
||||
$filters['user_id'] = $_GET['user_id'];
|
||||
}
|
||||
if (isset($_GET['entity_id'])) {
|
||||
$filters['entity_id'] = $_GET['entity_id'];
|
||||
}
|
||||
if (isset($_GET['date_from'])) {
|
||||
$filters['date_from'] = $_GET['date_from'];
|
||||
}
|
||||
if (isset($_GET['date_to'])) {
|
||||
$filters['date_to'] = $_GET['date_to'];
|
||||
}
|
||||
if (isset($_GET['ip_address'])) {
|
||||
$filters['ip_address'] = $_GET['ip_address'];
|
||||
}
|
||||
|
||||
// Get filtered logs
|
||||
$result = $auditLogModel->getFilteredLogs($filters, $limit, $offset);
|
||||
|
||||
Reference in New Issue
Block a user