fix: harden CMS security controls

This commit is contained in:
Andy Dixon
2026-06-08 17:12:42 +01:00
parent d946aaddc5
commit c34564a0a9
297 changed files with 174942 additions and 7485 deletions
+11 -2
View File
@@ -1,6 +1,15 @@
<?php
/**
* JSON API entry point for authenticated CMS operations.
*
* The controller performs authentication, authorisation, CSRF validation, and dispatch. Keeping
* this file thin makes it harder for an endpoint to wander off and invent its own security rules.
*/
// Load the site-specific credentials, roles, and content settings.
require_once "../config.php";
// Resolve NeoCMS namespaces to the matching class beneath cms/src/.
spl_autoload_register(function ($class) {
$classPath = str_replace('\\', DIRECTORY_SEPARATOR, $class);
require_once "../src/{$classPath}.php";
@@ -8,6 +17,6 @@ spl_autoload_register(function ($class) {
use NeoCMS\CMSController;
// Instantiate the controller with necessary dependencies
// Dispatch the current request and allow the controller to emit its JSON response.
$controller = new CMSController($config ?? []);
$controller->handleRequest();
$controller->handleRequest();