22 lines
669 B
PHP
22 lines
669 B
PHP
<?php
|
|
namespace Misuzu;
|
|
|
|
if(!$msz->getAuthInfo()->getPerms('global')->check(Perm::G_CONFIG_MANAGE))
|
|
Template::throwError(403);
|
|
|
|
$valueName = (string)filter_input(INPUT_GET, 'name');
|
|
$valueInfo = $cfg->getValueInfo($valueName);
|
|
if($valueInfo === null)
|
|
Template::throwError(404);
|
|
|
|
if($_SERVER['REQUEST_METHOD'] === 'POST' && CSRF::validateRequest()) {
|
|
$valueName = $valueInfo->getName();
|
|
$msz->createAuditLog('CONFIG_DELETE', [$valueName]);
|
|
$cfg->removeValues($valueName);
|
|
Tools::redirect($msz->getURLs()->format('manage-general-settings'));
|
|
return;
|
|
}
|
|
|
|
Template::render('manage.general.setting-delete', [
|
|
'config_value' => $valueInfo,
|
|
]);
|