Example #1
0
 public static function GetINI()
 {
     global $INI;
     $INI = Config::Instance('php');
     $SYS = Table::Fetch('system', 1);
     $SYS = Utility::ExtraDecode($SYS['value']);
     $INI = Config::MergeINI($INI, $SYS);
     $INI = ZSystem::WebRoot();
     return self::BuildINI($INI);
 }
Example #2
0
 public static function GetINI()
 {
     global $INI;
     /* load from php*/
     $dbphp = DIR_CONFIGURE . '/db.php';
     if (file_exists($dbphp)) {
         configure_load();
     } else {
         /* end */
         $INI = Config::Instance('php');
         $SYS = Table::Fetch('system', 1);
         $SYS = Utility::ExtraDecode($SYS['value']);
         $INI = Config::MergeINI($INI, $SYS);
     }
     $INI = ZSystem::WebRoot();
     return self::BuildINI($INI);
 }
Example #3
0
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));
Example #4
0
<?php

require_once dirname(__FILE__) . '/include/application.php';
/* magic_quota_gpc */
$_GET = magic_gpc($_GET);
$_POST = magic_gpc($_POST);
$_COOKIE = magic_gpc($_COOKIE);
/* process currefer*/
$currefer = uencode(strval($_SERVER['REQUEST_URI']));
/* session,cache,configure,webroot register */
Session::Init();
$INI = ZSystem::GetINI();
/* end */
/* date_zone */
if (function_exists('date_default_timezone_set')) {
    date_default_timezone_set($INI['system']['timezone']);
}
/* end date_zone */
/* biz logic */
$currency = $INI['system']['currency'];
$login_user_id = ZLogin::GetLoginId();
$login_user = Table::Fetch('user', $login_user_id);
$hotcities = option_hotcategory('city', false, true);
$allcities = option_category('city', false, true);
$city = cookie_city(null);
if (!isset($_COOKIE['referer'])) {
    setcookie('referer', $_SERVER['HTTP_REFERER']);
}
/* not allow access app.php */
if ($_SERVER['SCRIPT_FILENAME'] == __FILE__) {
    redirect(WEB_ROOT . '/index.php');
Example #5
0
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'));
}
Example #6
0
                    <form method="post">
                        <div class="field">
                            <label>模板切换</label>
							<select name="skin[template]" class="f-input" style="width:200px;"><?php 
echo Utility::Option(ZSystem::GetTemplateList(), $INI['skin']['template']);
?>
</select>
							<span class="hint">模板安装于 [<?php 
echo DIR_ROOT;
?>
/template] 目录下,仅默认模板支持多主题切换</span>
                        </div>
                        <div class="field">
                            <label>主题切换</label>
							<select name="skin[theme]" class="f-input" style="width:200px;"><?php 
echo Utility::Option(ZSystem::GetThemeList(), $INI['skin']['theme']);
?>
</select>
							<span class="hint">主题安装于 [<?php 
echo WWW_ROOT;
?>
/static/theme] 目录下,仅默认模板支持多主题切换</span>
                        </div>
                        <div class="act">
                            <input type="submit" value="保存" name="commit" class="formbutton"/>
                        </div>
                    </form>
                </div>
            </div>
            <div class="box-bottom"></div>
        </div>
Example #7
0
<?php

require_once 'lib/init.php';
switch ($task) {
    case 'settings':
        if (checkToken()) {
            if (updateSettings($_REQUEST)) {
                setmsg(t('Settings saved.'), 'notice', 'self');
            }
        }
        $sys = ZSystem::getSettings();
        $tpl_dir = ZH . "/tpl";
        $d = dir($tpl_dir);
        $themes = array();
        while ($f = $d->read()) {
            $param_file = "{$tpl_dir}/{$f}/param.ini";
            if (!is_file($param_file)) {
                continue;
            }
            $param = parse_ini_file($param_file);
            $themes[] = (object) $param;
        }
        break;
    case 'sync':
        syncSystemUsers();
        syncFtpUsers();
        syncVhosts();
        syncCBand();
        syncCrontab();
        setmsg(t('All data updated!'), 'notice');
        break;
function updateSettings($data)
{
    return ZSystem::updateSettings($data);
}