PathLevel.php 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273
  1. <?php
  2. define('EmpireCMSAdmin','1');
  3. require("../class/connect.php");
  4. require("../class/db_sql.php");
  5. require("../class/functions.php");
  6. $link=db_connect();
  7. $empire=new mysqlquery();
  8. //验证用户
  9. $lur=is_login();
  10. $logininid=$lur['userid'];
  11. $loginin=$lur['username'];
  12. $loginrnd=$lur['rnd'];
  13. $loginlevel=$lur['groupid'];
  14. $loginadminstyleid=$lur['adminstyleid'];
  15. //ehash
  16. $ecms_hashur=hReturnEcmsHashStrAll();
  17. db_close();
  18. $empire=null;
  19. //返回目录权限结果
  20. function ReturnPathLevelResult($path){
  21. $testfile=$path."/test.test";
  22. $fp=@fopen($testfile,"wb");
  23. if($fp)
  24. {
  25. @fclose($fp);
  26. @unlink($testfile);
  27. return 1;
  28. }
  29. else
  30. {
  31. return 0;
  32. }
  33. }
  34. //返回文件权限结果
  35. function ReturnFileLevelResult($filename){
  36. return is_writable($filename);
  37. }
  38. //检测目录权限
  39. function CheckFileMod($filename,$smallfile=""){
  40. $succ="√";
  41. $error="<font color=red>×</font>";
  42. if(!file_exists($filename)||($smallfile&&!file_exists($smallfile)))
  43. {
  44. return $error;
  45. }
  46. if(is_dir($filename))//目录
  47. {
  48. if(!ReturnPathLevelResult($filename))
  49. {
  50. return $error;
  51. }
  52. //子目录
  53. if($smallfile)
  54. {
  55. if(is_dir($smallfile))
  56. {
  57. if(!ReturnPathLevelResult($smallfile))
  58. {
  59. return $error;
  60. }
  61. }
  62. else//文件
  63. {
  64. if(!ReturnFileLevelResult($smallfile))
  65. {
  66. return $error;
  67. }
  68. }
  69. }
  70. }
  71. else//文件
  72. {
  73. if(!ReturnFileLevelResult($filename))
  74. {
  75. return $error;
  76. }
  77. if($smallfile)
  78. {
  79. if(!ReturnFileLevelResult($smallfile))
  80. {
  81. return $error;
  82. }
  83. }
  84. }
  85. return $succ;
  86. }
  87. ?>
  88. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  89. <html>
  90. <head>
  91. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  92. <title>帝国网站管理系统</title>
  93. <link href="adminstyle/<?=$loginadminstyleid?>/adminstyle.css" rel="stylesheet" type="text/css">
  94. </head>
  95. <body>
  96. <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" class="tableborder">
  97. <form name="form1" method="post" action="">
  98. <tr class="header">
  99. <td height="25"> <div align="center">目录权限检测</div></td>
  100. </tr>
  101. <tr>
  102. <td height="100" bgcolor="#FFFFFF"> <div align="center">
  103. <table width="99%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="D6E0EF">
  104. <tr>
  105. <td height="23"><strong>提示信息</strong></td>
  106. </tr>
  107. <tr>
  108. <td height="25" bgcolor="#FFFFFF"><table width="100%" border="0" cellpadding="3" cellspacing="1">
  109. <tr>
  110. <td height="25"> <li>将下面目录权限设为0777, 除了红色目录外,是目录全部要把权限应用于子目录与文件。<br>
  111. </li></td>
  112. </tr>
  113. </table></td>
  114. </tr>
  115. </table>
  116. <br>
  117. <table width="99%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="D6E0EF">
  118. <tr>
  119. <td width="34%" height="23"> <div align="center"><strong>目录文件名称</strong></div></td>
  120. <td width="42%"> <div align="center"><strong>说明</strong></div></td>
  121. <td width="24%"> <div align="center"><strong>权限检查</strong></div></td>
  122. </tr>
  123. <tr bgcolor="#FFFFFF">
  124. <td height="25"> <div align="left"><font color="#FF0000"><strong>/</strong></font></div></td>
  125. <td> <div align="center"><font color="#FF0000">系统根目录(不要应用于子目录)</font></div></td>
  126. <td> <div align="center">
  127. <?=CheckFileMod("../../");?>
  128. </div></td>
  129. </tr>
  130. <tr bgcolor="#FFFFFF">
  131. <td height="25"> <div align="left">/d</div></td>
  132. <td> <div align="center"><font color="#666666">附件目录</font></div></td>
  133. <td> <div align="center">
  134. <?=CheckFileMod("../../d","../../d/txt");?>
  135. </div></td>
  136. </tr>
  137. <tr bgcolor="#FFFFFF">
  138. <td height="25"> <div align="left">/s</div></td>
  139. <td> <div align="center"><font color="#666666">专题存放目录</font></div></td>
  140. <td> <div align="center">
  141. <?=CheckFileMod("../../s");?>
  142. </div></td>
  143. </tr>
  144. <tr bgcolor="#FFFFFF">
  145. <td height="25"> <div align="left">/t</div></td>
  146. <td> <div align="center"><font color="#666666">标题分类存放目录</font></div></td>
  147. <td> <div align="center">
  148. <?=CheckFileMod("../../t");?>
  149. </div></td>
  150. </tr>
  151. <tr bgcolor="#FFFFFF">
  152. <td height="25">/ecachefiles</td>
  153. <td><div align="center"><font color="#666666">动态页面缓存目录</font></div></td>
  154. <td><div align="center"><?=CheckFileMod("../../ecachefiles","../../ecachefiles/empirecms");?></div></td>
  155. </tr>
  156. <tr bgcolor="#FFFFFF">
  157. <td height="25"> <div align="left">/search</div></td>
  158. <td> <div align="center"><font color="#666666">搜索表单</font></div></td>
  159. <td> <div align="center">
  160. <?=CheckFileMod("../../search","../../search/test.txt");?>
  161. </div></td>
  162. </tr>
  163. <tr bgcolor="#FFFFFF">
  164. <td height="25"> <div align="left">/index.html</div></td>
  165. <td> <div align="center"><font color="#666666">网站首页</font></div></td>
  166. <td> <div align="center">
  167. <?=CheckFileMod("../../index.html");?>
  168. </div></td>
  169. </tr>
  170. <tr bgcolor="#FFFFFF">
  171. <td height="25"> <div align="left">/html</div></td>
  172. <td> <div align="center"><font color="#666666">默认可选的HTML存放目录</font></div></td>
  173. <td> <div align="center">
  174. <?=CheckFileMod("../../html");?>
  175. </div></td>
  176. </tr>
  177. <tr bgcolor="#FFFFFF">
  178. <td height="25">/e/admin/ebak/bdata</td>
  179. <td> <div align="center"><font color="#666666">备份数据存放目录</font></div></td>
  180. <td> <div align="center">
  181. <?=CheckFileMod("ebak/bdata");?>
  182. </div></td>
  183. </tr>
  184. <tr bgcolor="#FFFFFF">
  185. <td height="25">/e/admin/ebak/zip</td>
  186. <td> <div align="center"><font color="#666666">备份数据压缩存放目录</font></div></td>
  187. <td> <div align="center">
  188. <?=CheckFileMod("ebak/zip");?>
  189. </div></td>
  190. </tr>
  191. <tr bgcolor="#FFFFFF">
  192. <td height="25"> <div align="left">/e/config/config.php</div></td>
  193. <td> <div align="center"><font color="#666666">数据库等参数配置文件</font></div></td>
  194. <td> <div align="center">
  195. <?=CheckFileMod("../config/config.php");?>
  196. </div></td>
  197. </tr>
  198. <tr bgcolor="#FFFFFF">
  199. <td height="25"> <div align="left">/e/data</div></td>
  200. <td> <div align="center"><font color="#666666">部分配置文件存放目录</font></div></td>
  201. <td> <div align="center">
  202. <?=CheckFileMod("../data","../data/tmp");?>
  203. </div></td>
  204. </tr>
  205. <tr bgcolor="#FFFFFF">
  206. <td height="25">/e/install</td>
  207. <td> <div align="center"><font color="#666666">安装目录</font></div></td>
  208. <td> <div align="center">
  209. <?=CheckFileMod("../install");?>
  210. </div></td>
  211. </tr>
  212. <tr bgcolor="#FFFFFF">
  213. <td height="25">/e/member/iframe/index.php</td>
  214. <td><div align="center"><font color="#666666">登陆状态显示</font></div></td>
  215. <td><div align="center">
  216. <?=CheckFileMod("../member/iframe/index.php");?>
  217. </div></td>
  218. </tr>
  219. <tr bgcolor="#FFFFFF">
  220. <td height="25">/e/member/login/loginjs.php</td>
  221. <td><div align="center"><font color="#666666">JS登陆状态显示</font></div></td>
  222. <td><div align="center">
  223. <?=CheckFileMod("../member/login/loginjs.php");?>
  224. </div></td>
  225. </tr>
  226. <tr bgcolor="#FFFFFF">
  227. <td height="25">/e/pl/more/index.php</td>
  228. <td> <div align="center"><font color="#666666">评论JS调用文件</font></div></td>
  229. <td> <div align="center">
  230. <?=CheckFileMod("../pl/more/index.php");?>
  231. </div></td>
  232. </tr>
  233. <tr bgcolor="#FFFFFF">
  234. <td height="25">/e/sch/index.php</td>
  235. <td><div align="center"><font color="#666666">全站搜索文件</font></div></td>
  236. <td> <div align="center">
  237. <?=CheckFileMod("../sch/index.php");?>
  238. </div></td>
  239. </tr>
  240. <tr bgcolor="#FFFFFF">
  241. <td height="25">/e/template</td>
  242. <td> <div align="center"><font color="#666666">动态页面的模板目录</font></div></td>
  243. <td> <div align="center">
  244. <?=CheckFileMod("../template");?>
  245. </div></td>
  246. </tr>
  247. <tr bgcolor="#FFFFFF">
  248. <td height="25">/e/tool/feedback/temp</td>
  249. <td><div align="center"><font color="#666666">信息反馈</font></div></td>
  250. <td><div align="center">
  251. <?=CheckFileMod("../tool/feedback/temp","../tool/feedback/temp/test.txt");?>
  252. </div></td>
  253. </tr>
  254. <tr bgcolor="#FFFFFF">
  255. <td height="25">/e/tool/gbook/index.php</td>
  256. <td><div align="center"><font color="#666666">留言板</font></div></td>
  257. <td><div align="center">
  258. <?=CheckFileMod("../tool/gbook/index.php");?>
  259. </div></td>
  260. </tr>
  261. </table>
  262. </div></td>
  263. </tr>
  264. <tr class="header">
  265. <td><div align="center">
  266. &nbsp;&nbsp; &nbsp;&nbsp; </div></td>
  267. </tr>
  268. </form>
  269. </table>
  270. </body>
  271. </html>