This commit is contained in:
2025-12-08 00:14:39 +01:00
parent b3f10164de
commit 65e028d6e4
2 changed files with 224 additions and 6 deletions

View File

@@ -859,6 +859,9 @@ class ApiKernel
case 'placeholders.schema':
$this->handlePlaceholderSchema();
break;
case 'debug.phpinfo':
$this->handleDebugPhpInfo();
break;
case 'templates.test_send':
$this->handleTemplateTestSend();
break;
@@ -1820,6 +1823,16 @@ class ApiKernel
]);
}
private function handleDebugPhpInfo(): void
{
$user = $this->authService->requireAuth();
$this->ensureDebugUser($user);
ob_start();
phpinfo(INFO_GENERAL | INFO_CONFIGURATION | INFO_MODULES | INFO_ENVIRONMENT);
$html = ob_get_clean() ?: '';
$this->respond(['ok' => true, 'html' => $html]);
}
private function resolveBridgeConfig(?int $customerId): array
{
$fileConf = $this->conf['placeholders']['bridge'] ?? [];
@@ -2146,6 +2159,14 @@ class ApiKernel
}
}
private function ensureDebugUser(array $user): void
{
$email = strtolower((string)($user['email'] ?? ''));
if ($email !== 'madmin@papa-kind-treff.info') {
$this->fail('Debug nicht erlaubt', null, 403);
}
}
private function defaultApiBase(): string
{
$base = $this->conf['base_url'] ?? '';