- Voice enhancements, user management, payment method
This commit is contained in:
+6
-15
@@ -1,32 +1,23 @@
|
||||
<?php
|
||||
// api/config.php - Serve safe config values to frontend
|
||||
define('CYBERCHAT_API', true);
|
||||
require_once __DIR__ . '/../bootstrap.php';
|
||||
sendCorsHeaders();
|
||||
|
||||
header('Content-Type: application/json');
|
||||
header('Cache-Control: no-store');
|
||||
|
||||
$config = getConfig();
|
||||
|
||||
// Only expose safe/needed values to frontend
|
||||
$safe = [
|
||||
jsonResponse([
|
||||
'chat' => [
|
||||
'max_message_length' => $config['chat']['max_message_length'] ?? 500,
|
||||
'max_username_length' => $config['chat']['max_username_length'] ?? 12,
|
||||
'poll_interval_ms' => $config['chat']['poll_interval_ms'] ?? 2000,
|
||||
'poll_interval_ms' => $config['chat']['poll_interval_ms'] ?? 2000,
|
||||
],
|
||||
'ui' => $config['ui'] ?? [],
|
||||
'security' => [
|
||||
'min_password_length' => $config['security']['min_password_length'] ?? 4,
|
||||
],
|
||||
'colors' => $config['colors'] ?? [],
|
||||
'security' => ['min_password_length' => $config['security']['min_password_length'] ?? 4],
|
||||
'colors' => ['user_palette' => $config['colors']['user_palette'] ?? []],
|
||||
'voice' => [
|
||||
'enabled' => $config['voice']['enabled'] ?? true,
|
||||
'max_duration_seconds' => $config['voice']['max_duration_seconds'] ?? 60,
|
||||
'max_upload_bytes' => $config['voice']['max_upload_bytes'] ?? 12582912,
|
||||
'auto_play_default' => $config['voice']['auto_play_default'] ?? true,
|
||||
],
|
||||
];
|
||||
|
||||
echo json_encode($safe);
|
||||
'subscriptions' => ['enabled' => $config['subscriptions']['enabled'] ?? true],
|
||||
]);
|
||||
|
||||
Reference in New Issue
Block a user