false, 'error' => 'Forbidden', ]); return; } // Snapshot done, release lock for concurrency @session_write_close(); if (!defined('FR_PRO_ACTIVE') || !FR_PRO_ACTIVE || !defined('FR_PRO_BUNDLE_DIR') || !FR_PRO_BUNDLE_DIR) { throw new RuntimeException('FileRise Pro is not active.'); } $slug = isset($_GET['slug']) ? trim((string)$_GET['slug']) : ''; if ($slug === '') { throw new InvalidArgumentException('Missing slug.'); } // Use your ProPortalSubmissions helper from the bundle $proSubmissionsPath = rtrim((string)FR_PRO_BUNDLE_DIR, "/\\") . '/ProPortalSubmissions.php'; if (!is_file($proSubmissionsPath)) { throw new RuntimeException('ProPortalSubmissions.php not found in Pro bundle.'); } require_once $proSubmissionsPath; $store = new ProPortalSubmissions((string)FR_PRO_BUNDLE_DIR); $submissions = $store->listBySlug($slug, 200); echo json_encode([ 'success' => true, 'slug' => $slug, 'submissions' => $submissions, ], JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES); } catch (InvalidArgumentException $e) { http_response_code(400); echo json_encode([ 'success' => false, 'error' => $e->getMessage(), ]); } catch (Throwable $e) { http_response_code(500); echo json_encode([ 'success' => false, 'error' => 'Server error: ' . $e->getMessage(), ]); }