misuzu/public/manage/general/settings.php

30 lines
666 B
PHP
Raw Normal View History

2022-09-13 13:14:49 +00:00
<?php
namespace Misuzu;
use Misuzu\Config;
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;
}
$hidden = Config::get('settings.hidden', Config::TYPE_ARR, []);
$vars = [];
foreach(Config::keys() as $key) {
$var = Config::get($key);
$vars[] = [
'key' => $key,
'type' => Config::type($var),
'value' => in_array($key, $hidden) ? '*** hidden ***' : json_encode($var),
];
}
Template::render('manage.general.settings', [
'conf_vars' => $vars,
]);