30 lines
666 B
PHP
30 lines
666 B
PHP
|
<?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,
|
||
|
]);
|