From b17787c636b245a7edb55f53ba01f41fb497d42e Mon Sep 17 00:00:00 2001 From: Hamza-Ayed Date: Sun, 10 May 2026 02:10:17 +0300 Subject: [PATCH] add new featurs like realtime 2026-5-10-19 --- Admin/v2/security/audit_logs.php | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/Admin/v2/security/audit_logs.php b/Admin/v2/security/audit_logs.php index 8cb4b25..892b38b 100644 --- a/Admin/v2/security/audit_logs.php +++ b/Admin/v2/security/audit_logs.php @@ -1,15 +1,18 @@ getMessage() . "\n", FILE_APPEND); + @file_put_contents($debugFile, " → connect.php FAILED: " . $e->getMessage() . "\n", FILE_APPEND); http_response_code(500); echo json_encode(['status' => 'failure', 'message' => 'connect failed: ' . $e->getMessage()]); exit; @@ -17,7 +20,7 @@ try { // ── فحص الصلاحيات ──────────────────────────────────────── if ($role !== 'super_admin' && $role !== 'admin') { - file_put_contents($debugFile, " → BLOCKED: role=$role\n", FILE_APPEND); + @file_put_contents($debugFile, " → BLOCKED: role=$role\n", FILE_APPEND); jsonError("Unauthorized. role=$role", 403); } @@ -25,7 +28,7 @@ try { $tableExists = $con->query("SHOW TABLES LIKE 'admin_audit_log'")->rowCount() > 0; if (!$tableExists) { - file_put_contents($debugFile, " → Table NOT FOUND\n", FILE_APPEND); + @file_put_contents($debugFile, " → Table NOT FOUND\n", FILE_APPEND); jsonSuccess([], 'Audit log table not found'); } @@ -41,12 +44,12 @@ try { $logs = $stmt->fetchAll(PDO::FETCH_ASSOC); $count = count($logs); - file_put_contents($debugFile, " → SUCCESS: fetched $count logs\n", FILE_APPEND); + @file_put_contents($debugFile, " → SUCCESS: fetched $count logs\n", FILE_APPEND); jsonSuccess($logs); } catch (Exception $e) { - file_put_contents($debugFile, " → QUERY ERROR: " . $e->getMessage() . "\n", FILE_APPEND); + @file_put_contents($debugFile, " → QUERY ERROR: " . $e->getMessage() . "\n", FILE_APPEND); jsonError('Query failed: ' . $e->getMessage(), 500); } ?>