Update: 2026-06-16 17:47:17
This commit is contained in:
@@ -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);
|
||||
}
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user