2022-09-13 13:14:49 +00:00
|
|
|
<?php
|
|
|
|
namespace Misuzu;
|
|
|
|
|
|
|
|
use Misuzu\Config;
|
2023-01-01 20:23:53 +00:00
|
|
|
use Misuzu\Config\CfgTools;
|
2023-01-06 20:50:41 +00:00
|
|
|
use Misuzu\Config\IConfig;
|
2022-09-13 13:14:49 +00:00
|
|
|
use Misuzu\Users\User;
|
|
|
|
|
|
|
|
require_once '../../../misuzu.php';
|
|
|
|
|
|
|
|
if(!User::hasCurrent()
|
|
|
|
|| !perms_check_user(MSZ_PERMS_GENERAL, User::getCurrent()->getId(), MSZ_PERM_GENERAL_MANAGE_CONFIG)) {
|
|
|
|
echo render_error(403);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2023-01-06 20:50:41 +00:00
|
|
|
$hidden = $cfg->getValue('settings.hidden', IConfig::T_ARR, []);
|
2022-09-13 13:14:49 +00:00
|
|
|
|
|
|
|
$vars = [];
|
2023-01-01 20:23:53 +00:00
|
|
|
foreach($cfg->getNames() as $key) {
|
|
|
|
$var = $cfg->getValue($key);
|
2022-09-13 13:14:49 +00:00
|
|
|
$vars[] = [
|
|
|
|
'key' => $key,
|
2023-01-01 20:23:53 +00:00
|
|
|
'type' => CfgTools::type($var),
|
2022-09-13 13:14:49 +00:00
|
|
|
'value' => in_array($key, $hidden) ? '*** hidden ***' : json_encode($var),
|
|
|
|
];
|
|
|
|
}
|
|
|
|
|
|
|
|
Template::render('manage.general.settings', [
|
|
|
|
'conf_vars' => $vars,
|
|
|
|
]);
|