Add new setting/configurable: site_url, prevents domain spoofing

This commit is contained in:
slawkens
2025-05-29 09:27:29 +02:00
parent 52109f5cca
commit d8a6090be3
8 changed files with 67 additions and 29 deletions

View File

@@ -21,6 +21,11 @@ $defaultTemplate = in_array('kathrine', $templates) ? 'kathrine' : $templates[0]
global $db;
require SYSTEM . 'base.php';
$serverUrl = 'http' . (isHttps() ? 's' : '') . '://' . $baseHost;
$siteURL = $serverUrl . $baseDir;
return [
'name' => 'MyAAC',
'settings' => [
@@ -32,6 +37,13 @@ return [
'type' => 'section',
'title' => 'General'
],
'site_url' => [
'name' => 'Website URL',
'type' => 'text',
'desc' => 'Website address of this MyAAC instance',
'default' => $siteURL,
'is_config' => true,
],
'env' => [
'name' => 'App Environment',
'type' => 'options',