2025-06-16 18:28:08 +05:00

18 lines
539 B
PHP
Executable File

<?php
switch(@$_POST['act']) {
case 'save-system':
$array=\json::from_j(\DB::getValue("SELECT `json` FROM `settings` WHERE `mod`=?", 'global'));
foreach ($array as $key => $val) if ($_POST[$key])$array[$key]=$_POST[$key];
$json= \json::to_j($array);
\DB::set("UPDATE `settings` SET `json` = ? WHERE `mod` = ?", array($json, 'global'));
break;
case 'save-config':
$filename = 'set/config-' . $_SERVER['SERVER_NAME'] . '.conf';
file_put_contents($filename, $_POST['config']);
break;
default:
}
?>