« Back to History
build_role_redirect_cache.php
|
20260721_154033.php
Initial Bulk Import
Copy Code
<?php require_once __DIR__ . '/../../modules/auth/page_acl.php'; require_once __DIR__ . '/../../modules/auth/role_redirect.php'; $ctx = page_require_access('admin_only'); $pdo = $ctx['pdo'] ?? null; $company_id = (int)($ctx['company_id'] ?? 0); $role = strtolower(trim((string)($ctx['user']['role'] ?? ''))); if (!in_array($role, ['owner', 'admin', 'developer'], true)) { http_response_code(403); exit('Forbidden'); } if (!($pdo instanceof PDO)) { exit('Database connection not available.'); } role_redirect_rebuild_cache($pdo, $company_id); echo "✅ Role redirect cache built for company: " . $company_id; exit;