|
|
@@ -90,38 +90,6 @@ $cache1 = DEDEDATA.'/cache/inc_catalog_base.inc'; |
|
|
|
if (!file_exists($cache1)) UpDateCatCache(); |
|
|
|
$cacheFile = DEDEDATA.'/cache/admincat_'.$cuserLogin->userID.'.inc'; |
|
|
|
if (file_exists($cacheFile)) require_once($cacheFile); |
|
|
|
//更新服务器 |
|
|
|
require_once(DEDEDATA.'/admin/config_update.php'); |
|
|
|
if (strlen($cfg_cookie_encode) <= 10) { |
|
|
|
$chars = 'abcdefghigklmnopqrstuvwxwyABCDEFGHIGKLMNOPQRSTUVWXWY0123456789'; |
|
|
|
$hash = ''; |
|
|
|
$length = rand(28, 32); |
|
|
|
$max = strlen($chars) - 1; |
|
|
|
for ($i = 0; $i < $length; $i++) { |
|
|
|
$hash .= $chars[mt_rand(0, $max)]; |
|
|
|
} |
|
|
|
$dsql->ExecuteNoneQuery("UPDATE `#@__sysconfig` SET `value`='{$hash}' WHERE varname='cfg_cookie_encode' "); |
|
|
|
$configfile = DEDEDATA.'/config.cache.inc.php'; |
|
|
|
if (!is_writeable($configfile)) { |
|
|
|
echo "配置文件'{$configfile}'不支持写入,无法修改系统配置参数"; |
|
|
|
exit(); |
|
|
|
} |
|
|
|
$fp = fopen($configfile, 'w'); |
|
|
|
flock($fp, 3); |
|
|
|
fwrite($fp, "<"."?php\r\n"); |
|
|
|
$dsql->SetQuery("SELECT `varname`,`type`,`value`,`groupid` FROM `#@__sysconfig` ORDER BY aid ASC "); |
|
|
|
$dsql->Execute(); |
|
|
|
while ($row = $dsql->GetArray()) { |
|
|
|
if ($row['type'] == 'number') { |
|
|
|
if ($row['value'] == '') $row['value'] = 0; |
|
|
|
fwrite($fp, "\${$row['varname']} = ".$row['value'].";\r\n"); |
|
|
|
} else { |
|
|
|
fwrite($fp, "\${$row['varname']} = '".str_replace("'", '', $row['value'])."';\r\n"); |
|
|
|
} |
|
|
|
} |
|
|
|
fwrite($fp, "?".">"); |
|
|
|
fclose($fp); |
|
|
|
} |
|
|
|
/** |
|
|
|
* 更新栏目缓存 |
|
|
|
* |
|
|
|