yxyX
This commit is contained in:
@@ -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'] ?? '';
|
||||
|
||||
Reference in New Issue
Block a user