Update: 2026-06-16 17:47:17

This commit is contained in:
Hamza-Ayed
2026-06-16 17:47:19 +03:00
parent 49899da6b2
commit b516fbc4ed
96 changed files with 6073 additions and 3187 deletions

View File

@@ -15,14 +15,14 @@ try {
} catch (Exception $e) {
@file_put_contents($debugFile, " → Loading FAILED: " . $e->getMessage() . "\n", FILE_APPEND);
http_response_code(500);
echo json_encode(['status' => 'failure', 'message' => 'loading failed: ' . $e->getMessage()]);
printFailure('loading failed', 500);
exit;
}
// ── فحص الصلاحيات ────────────────────────────────────────
if ($role !== 'super_admin' && $role !== 'admin') {
@file_put_contents($debugFile, " → BLOCKED: role=$role\n", FILE_APPEND);
jsonError("Unauthorized. role=$role", 403);
printFailure("Unauthorized. role=$role", 403);
}
try {
@@ -61,6 +61,6 @@ try {
} catch (Exception $e) {
@file_put_contents($debugFile, " → QUERY ERROR: " . $e->getMessage() . "\n", FILE_APPEND);
jsonError('Query failed: ' . $e->getMessage(), 500);
jsonError('Query failed', 500);
}
?>