29 lines
915 B
PHP
Executable File
29 lines
915 B
PHP
Executable File
<?php
|
|
ini_set('display_errors', 0);
|
|
if ($_SESSION['dostup']!=='a' && $_SESSION['dostup']!=='e')header( 'Location: /403/' );
|
|
$smarty -> assign( 'global_settings', \json::from_j(\DB::getValue("SELECT `json` FROM `settings` WHERE `mod`=?", 'global')) );
|
|
|
|
//$array=\json::from_j(\DB::getValue("SELECT `json` FROM `settings` WHERE `mod`=?", 'global'));
|
|
|
|
//foreach ($array as $key => $val) {
|
|
|
|
// echo $key . ' -- ' . $val;
|
|
|
|
//}
|
|
$filename = 'set/config-' . $_SERVER['SERVER_NAME'] . '.conf';
|
|
$text = file_get_contents($filename);
|
|
$smarty -> assign( 'conf', $text );
|
|
|
|
|
|
|
|
require_once "api/php/list_dir.php";
|
|
$list_dir=list_dir('api/modules');
|
|
$smarty -> assign( 'list_dir', $list_dir );
|
|
|
|
if ($_POST['ok']){
|
|
unset($_POST['ok']);
|
|
$json= \json::to_j($_POST);
|
|
\DB::set("UPDATE `settings` SET `json` = ? WHERE `mod` = ?", array($json, 'global'));
|
|
header( 'Location: /settings/' );
|
|
}
|
|
?>
|