47 lines
953 B
PHP
Executable File
47 lines
953 B
PHP
Executable File
<?php
|
|
/**
|
|
* Public Site Settings API (safe subset only)
|
|
*/
|
|
|
|
require_once 'config.php';
|
|
|
|
if ($_SERVER['REQUEST_METHOD'] !== 'GET') {
|
|
jsonResponse(['success' => false, 'message' => 'Method not allowed'], 405);
|
|
}
|
|
|
|
$all = getSettingsMap();
|
|
|
|
$allowedKeys = [
|
|
'site_name',
|
|
'site_tagline',
|
|
'site_description',
|
|
'contact_email',
|
|
'contact_phone',
|
|
'contact_address',
|
|
'business_hours',
|
|
'support_hours',
|
|
'maps_url',
|
|
'social_facebook',
|
|
'social_linkedin',
|
|
'social_twitter',
|
|
'social_instagram',
|
|
'social_youtube',
|
|
'social_github',
|
|
'primary_color',
|
|
'secondary_color',
|
|
'accent_color'
|
|
];
|
|
|
|
$data = [];
|
|
foreach ($allowedKeys as $key) {
|
|
if (isset($all[$key]) && $all[$key] !== '') {
|
|
$data[$key] = $all[$key];
|
|
}
|
|
}
|
|
|
|
if (!isset($data['contact_email']) || $data['contact_email'] === '') {
|
|
$data['contact_email'] = ADMIN_EMAIL;
|
|
}
|
|
|
|
jsonResponse(['success' => true, 'data' => $data]);
|