Security: verwijder hardcoded wachtwoord, voeg random-wachtwoord-generator toe bij eerste installatie

This commit is contained in:
2026-08-27 08:57:05 +00:00
parent 6485f693dc
commit 74612aefbb
55 changed files with 6019 additions and 876 deletions
+60 -20
View File
@@ -1,37 +1,52 @@
<?php
/**
* CodePress CMS Core Loader
*
* This file serves as the central entry point for the CodePress CMS core system.
* It loads all essential classes and configuration needed for the CMS to function.
*
* Architecture:
* - config.php: Configuration loader that merges default settings with config.json
* - ThemeManager.php: Twig-based theme rendering + SCSS compilation
* - CodePressCMS.php: Main CMS class handling content, navigation, search, and rendering
*
* Usage:
* This file is included by public/index.php, which then:
* 1. Loads configuration from config.php
* 2. Creates a new CodePressCMS instance with the config
* 3. Calls render() to output the complete page
*
* The separation allows for:
* - Clean public entry point (public/index.php)
* - Reusable core components
* - Proper class organization with PHPDoc documentation
* CodePress CMS Core Loader.
*
* Centraal bootstrap-bestand voor de CodePress CMS-core. Laadt alle
* essentiële classes en configuratie die nodig zijn voor het CMS:
* configuratie, Composer-autoloader, core utility classes, logger,
* plugin-systeem, ContentAPI en de hoofdclass CodePressCMS.
*
* Architectuur:
* - config.php: configuratie-loader die defaults samenvoegt met config.json.
* - ThemeManager.php: Twig-based theme rendering + SCSS-compilatie.
* - CodePressCMS.php: hoofdclass voor content, navigation, search en rendering.
*
* Gebruik:
* Dit bestand wordt geïnclude door public/index.php, dat vervolgens:
* 1. Configuratie laadt vanuit config.php.
* 2. Een CodePressCMS-instantie aanmaakt met de config.
* 3. render() aanroept om de pagina uit te voeren.
*
* @since 2.6.4
* @package CodePress
*/
/**
* Configuratie-systeem laden: defaults en config.json-merge.
*
* @since 2.6.4
*/
// Load configuration system - handles default settings and config.json merging
require_once 'config.php';
/**
* Composer-autoloader laden indien aanwezig.
*
* @since 2.6.4
*/
// Load Composer autoloader
$autoloader = dirname(__DIR__, 2) . '/vendor/autoload.php';
if (file_exists($autoloader)) {
require_once $autoloader;
}
/**
* Core utility classes laden.
*
* @since 2.6.4
*/
// Load core utility classes
require_once 'class/Cache.php';
require_once 'class/RateLimiter.php';
@@ -41,21 +56,46 @@ require_once 'class/GeoIP.php';
require_once 'class/Analytics.php';
require_once 'class/ThemeManager.php';
/**
* Logger-klassen laden voor gestructureerde logging met log levels.
*
* @since 2.6.4
*/
// Load Logger class - structured logging with log levels
require_once 'class/Logger.php';
require_once 'class/LogManager.php';
/**
* Plugin-systeem laden (interfaces, API's en PluginManager).
*
* @since 2.6.4
*/
// Load Plugin system
require_once 'plugin/PluginAPIInterface.php';
require_once 'plugin/CMSAPI.php';
require_once 'plugin/AdminPluginAPI.php';
require_once 'plugin/PluginManager.php';
/**
* ContentAPI laden: CMS-data-toegang voor PHP content-bestanden.
*
* @since 2.6.4
*/
// Load ContentAPI class - provides CMS data access for PHP content files
require_once 'class/ContentAPI.php';
/**
* Hoofdclass laden: content parsing, navigation, search en page rendering.
*
* @since 2.6.4
*/
// Load main CMS class - handles content parsing, navigation, search, and page rendering
require_once 'class/CodePressCMS.php';
/**
* Logger initialiseren (debug-mode kan via config worden ingeschakeld).
*
* @since 2.6.4
*/
// Initialize logger (debug mode can be enabled in config)
Logger::init();