require_once(dirname(dirname(dirname(__FILE__))) . '/app.php'); need_manager(); need_rbac_auth('system_index'); $s = isset($_GET['s']) ? strval($_GET['s']) : null; $ts = $s ? '_' . $s : null; $system = Table::Fetch('system', 1); if ($_POST) { need_manager(true); unset($_POST['commit']); $INI = Config::MergeINI($INI, $_POST); $INI = ZSystem::GetUnsetINI($INI); $INI['system']['gzip'] = abs(intval($INI['system']['gzip']>0)); $INI['system']['partnerdown'] = abs(intval($INI['system']['partnerdown']>0)); $INI['system']['conduser'] = abs(intval($INI['system']['conduser']>0)); $INI['system']['currencyname'] = strtoupper($INI['system']['currencyname']); //2013.07.29 $sorts = array('MO', 'NO', 'AF', 'NI'); $sorts_key = array_search($INI['system']['sorttype'], $sorts); if(!$sorts_key) $sorts_key = 0; $INI['system']['sorttype'] = $sorts[($sorts_key + 1)%4]; save_config(); $value = Utility::ExtraEncode($INI); $table = new Table('system', array('value'=>$value));
function save_system($ini) { $system = Table::Fetch('system', 1); $ini = ZSystem::GetUnsetINI($ini); $value = Utility::ExtraEncode($ini); $table = new Table('system', array('value' => $value)); if ($system) { $table->SetPK('id', 1); } return $table->update(array('value')); }