Siteconfig/Email

* make hardcoded email configurable
This commit is contained in:
Sarjuuk
2022-03-20 22:15:48 +01:00
parent feb6ee25dd
commit e109a6deed
6 changed files with 26 additions and 15 deletions

View File

@@ -41,6 +41,9 @@ function siteconfig() : void
case 'static_host':
array_push($updScripts, 'searchplugin', 'power', 'searchboxBody', 'searchboxScript');
break;
case 'contact_email':
array_push($updScripts, 'markup');
break;
case 'locales':
array_push($updScripts, 'locales');
CLI::write(' * remember to rebuild all static files for the language you just added.', CLI::LOG_INFO);
@@ -329,7 +332,8 @@ function siteconfig() : void
{
CLI::write();
if (!$validate($use ? $use['idx'] : ''))
$inp = $use['idx'] ?? '';
if (!$validate($inp))
{
CLI::write("value not in range", CLI::LOG_ERROR);
sleep(1);
@@ -338,10 +342,10 @@ function siteconfig() : void
else
{
$oldVal = DB::Aowow()->selectCell('SELECT `value` FROM ?_config WHERE `key` = ?', $key);
DB::Aowow()->query('UPDATE ?_config SET `value` = ? WHERE `key` = ?', $use['idx'], $key);
DB::Aowow()->query('UPDATE ?_config SET `value` = ? WHERE `key` = ?', $inp, $key);
// postChange returned false => reset value
if (!$onChange($key, $use['idx']))
if (!$onChange($key, $inp))
{
DB::Aowow()->query('UPDATE ?_config SET `value` = ? WHERE `key` = ?', $oldVal, $key);
sleep(1);

View File

@@ -26,6 +26,7 @@ class FileGen
'searchboxBody' => ['searchbox.html', 'static/widgets/searchbox/', []],
'realmMenu' => ['profile_all.js', 'static/js/', ['realmlist']],
'locales' => ['locale.js', 'static/js/', []],
'markup' => ['Markup.js', 'static/js/', []],
'itemScaling' => ['item-scaling', 'datasets/', []]
);
public static $datasets = array( // name => [AowowDeps, TCDeps, info]
@@ -59,10 +60,11 @@ class FileGen
);
private static $txtConstants = array(
'CFG_NAME' => '',
'CFG_NAME_SHORT' => '',
'HOST_URL' => '',
'STATIC_URL' => ''
'CFG_NAME' => '',
'CFG_NAME_SHORT' => '',
'CFG_CONTACT_EMAIL' => '',
'HOST_URL' => '',
'STATIC_URL' => ''
);
public static function init(int $mode = self::MODE_NORMAL, array $updScripts = []) : bool

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1 @@
UPDATE `aowow_dbversion` SET `build` = CONCAT(IFNULL(`build`, ''), ' markup');