DEDECMS后台【模块管理】打开很慢的原因,DEDECMS会自动获取dedecms官网的内容,然后进行模块列表重新下载。其实这个也算一个后门吧~ 很多网站的站长总是受到dedecms官网QQ的聊天说要交钱,很黑的感觉。 屏蔽后门其实很简单,用文本编辑软件或者dreamweaver在整个网站PHP的源码里面搜索“dedecms.com”然后都屏蔽掉。 3 y7 ^! n5 E8 N3 ]- b
保险的做法: 打开文件 /include/dedemodule.class.php 方法 GetModuleUrlList() 里面的如下代码改掉: [mw_shl_code=php,true]if(file_exists($cachefile) && (filemtime($cachefile) + 60 * 30) > time())
6 l9 s n* z( V5 r // 30分钟本地缓存一次
6 r& @/ s7 H2 h& w9 @" R' x $remotelist = file_get_contents($cachefile);
6 O! V; n. I5 X" U1 H} else { 9 J A* F/ ^' P7 Z
$del = new DedeHttpDown();
( [' z7 O% b1 h- u5 X% j $del->OpenUrl($url); ' j- Y1 s: [ u: j H6 ?
$remotelist = $del->GetHtml();
* L3 i6 z% ^& U4 T J PutFile($cachefile, $remotelist);
+ \3 {( Y+ h) j1 D( U} [/mw_shl_code]' K: i& J) N- m1 Y# a8 ?8 |. ?
改成如下(防止他自动30分钟自动下载更新,很多空间商是禁止网站自动从服务器端下载的,有时候下载会误认为是在采集,因为dedecms的服务器超级的慢!): [mw_shl_code=php,true]//if(file_exists($cachefile) && (filemtime($cachefile) + 60 * 30) > time())
; F2 X- L' n7 }//default use cache
' c9 C, F& H7 i% S1 ^6 b* Vif(file_exists($cachefile) && $_GET['upcache'] != 'yes')
2 S- p7 x0 ^" @8 ~( D; a{ 3 v, }8 B; } K. E; C1 L0 b5 S
// 30分钟本地缓存一次
5 ^+ G4 ~) {, D0 F1 A7 D2 F $remotelist = file_get_contents($cachefile);
* u' R+ ^2 C3 Z} else {
% R+ P2 q4 R `/ B& Z/ n0 C $del = new DedeHttpDown(); ) ^( h' h) U& m
$del->OpenUrl($url); ) `/ P8 |2 i5 D5 ? f% ^
$remotelist = $del->GetHtml(); % r& B) C! T4 {" R! m9 T
PutFile($cachefile, $remotelist);
( ^( x( K4 V& X0 U0 I7 b1 w3 ?} [/mw_shl_code] 第二个要修改的地方:/dede/module_main.php 这里dede设置了一个统计的函数,每次安装或者卸载模块,都会发送一次统计信息,很无语,注释掉就可以。 函数SendData() 屏蔽掉,在开头加上 return FALSE; [mw_shl_code=php,true]function SendData($hash = '',$type = 1)
- S$ |8 A. Q2 Y/ {4 y{
, [* u6 Y9 f" ^+ a) |. t return FALSE;//开头就返回,屏蔽掉 ' P) A' y6 ^' S/ P
if(!empty($hash)){ 1 u9 | a4 V/ u
global $cfg_basehost; 8 g _+ V9 @, j: _5 C% `
$str = "basehost=".$cfg_basehost."&hash=".$hash."&type=".$type; # g! ~; y! R) r- ?$ R
$fp = fsockopen('www.dedecms.com',80,$errno,$errstr,30);
! D& e8 p7 |3 v. i: e if(!$fp) ( e% S6 N. @" B; i: i
{
# W9 c: o2 D' v8 q) t return FALSE;
; k; R. ~& a1 \: W }else{ % t, j" |3 U6 u% k# j$ k# g
fputs($fp, "POST http://www.dedecms.com/plugin.php HTTP/1.1\r\n"); / P. q# q7 j3 s0 P$ [
fputs($fp, "Host: www.dedecms.com\r\n"); . F; r7 u Q9 I5 a8 o0 d; J
fputs($fp, "Content-type: application/x-www-form-urlencoded\r\n"); : P9 F4 N) p/ k1 p+ s. C5 Z! a
fputs($fp, "Content-length: ".strlen($str)."\r\n");
6 s& U( t6 i' M8 d, U4 m3 o fputs($fp, "Connection: close\r\n\r\n"); ; E# E, Z+ r, E8 b" V/ s2 s9 T
fputs($fp, $str."\r\n\r\n"); # B9 o, D3 d. J% K" B3 d
fclose($fp);
+ u2 P3 p* G3 ^* W" G }
9 i( P1 {# n/ z% c6 ]) }9 U }else{ ! [% g' r- A/ t" P: i" A& r1 z4 j7 d
return FALSE; : j/ K+ V1 o7 P6 j7 }9 o+ W
} $ S9 A! m. H0 @2 o
} [/mw_shl_code]
7 z% C7 C& ?& ~" ^为什么要修改这里,一方面如果发送统计信息,dedecms会统计哪些网站在使用dedecms,dedecms官方就自动统计网站的流量(从网站,alexa排名)。dedecms自身的服务器速度特别慢,如果不屏蔽掉这些,那么网站后台的访问都会有问题! # i( O9 H" C) t! R4 S" D( n
|