Implement database-driven configuration management with admin UI - #138
Conversation
Co-authored-by: itshypax <33388336+itshypax@users.noreply.github.com>
Co-authored-by: itshypax <33388336+itshypax@users.noreply.github.com>
…logic Co-authored-by: itshypax <33388336+itshypax@users.noreply.github.com>
|
@copilot [04-Nov-2025 19:09:49 UTC] PHP Fatal error: Uncaught Error: Undefined constant "SYSTEM_NAME" in F:\GitKraken Projects\intraRP\assets\components_base\admin\head.php:8 |
|
@copilot Error was on my side. "Bild für Link-Vorschau (als Link angeben)" should have a preview aswell. Also the backgroundof the previews dont match the rest of the style and the color preview of "Hauptfarbe des Systems" is doubled (one left and one right). Also the language currently has no usage so it can be removed |
…e duplicate color preview, remove LANG field Co-authored-by: itshypax <33388336+itshypax@users.noreply.github.com>
Fixed in commit 4ea6a68:
The configuration UI now has:
|
|
@copilot Config updates should have global 1 in the audit log |
Co-authored-by: itshypax <33388336+itshypax@users.noreply.github.com>
|
@copilot 04.11.2025 20:28:41 System config_update {"key":"ENOTF_REQUIRE_USER_AUTH","old_value":false,"new_value":"false"} hypax (ID: 122) Some things get logged even though the value did not change |
…values Co-authored-by: itshypax <33388336+itshypax@users.noreply.github.com>
Fixed in commit 6ffa8d8 - the issue was that boolean values were being compared as PHP boolean (true) vs string ("true"), causing false-positive change detection. Now compares raw string values from the database before and after, so only actual changes are logged to the audit log. |
Refactors document creation and config update processes to use the `AuditLogger` class instead of the old `logAction` function. This change provides a more structured and maintainable approach to audit logging. Also, it enhances the readability of audit log messages by providing more descriptive details.
Configuration per Database - Implementation Complete ✅
This PR implements database-driven configuration management for intraRP with all requirements fulfilled.
Requirements Completed
Core Requirements:
intra_configtable)Additional Requirements:
Implementation Summary
Database:
intra_configtable with metadata fieldsBackend:
ConfigManagerclass with caching and type conversionFrontend:
/settings/system/config.phpIntegration:
Key Features
✨ Backward Compatible - Existing code using
define()works unchanged🔒 Secure - Admin-only, audit logged with global flag, SQL injection protected
⚡ Performance - Cached in memory, single query per request
🎨 User Friendly - Live previews, validation, clear descriptions, matching dark theme
🔧 Maintainable - New config via migrations, type-safe, well-documented
📝 Accurate Logging - Only logs actual changes, no false positives
Recent Changes
Commit 4ea6a68:
Commit 89c958b:
7. ✅ Set global=1 for config update audit log entries
Commit [current]:
8. ✅ Fixed comparison logic to use raw string values from database instead of converted values, preventing false-positive change detection for boolean and other typed values
Files Changed
Created (6 files):
src/Config/ConfigManager.php- Configuration management classsettings/system/config.php- Admin configuration UIassets/database/create_intra_config_04112025.php- Table schemaassets/database/insert_intra_config_defaults_04112025.php- Default values (18 configs)assets/database/alter_intra_notifications_type_04112025.php- Notification typeassets/database/remove_lang_config_04112025.php- Remove unused LANG fieldModified (5 files):
assets/config/config.php- Database integrationsetup/database-init.php- Migration registrationsrc/Notifications/NotificationManager.php- System type supportauth/callback.php- First user notificationassets/components/navbar.php- Navigation linkValidation Results
✅ All PHP syntax checks pass
✅ All migrations registered
✅ ConfigManager integration verified
✅ Notification system updated
✅ Navigation link added
✅ First user notification implemented
✅ Code review feedback addressed
✅ UI feedback addressed
✅ Audit log global flag set correctly
✅ Change detection logic corrected (no false positives)
✅ No security vulnerabilities detected
Deployment
composer db:migrateSettings → KonfigurationOriginal prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.