Erika
I just emailed you mod_display_variables.cfm off list (I think Michael Dinowitz set up 
this list to not take
attachments).

Here is the code in case any one is interested. It is similar to CF_debug I think. 
Douglas gave a talk on it at an
MDCFUG meeting last year. It is free for anyone to use.

- Michael Smith, TeraTech, Inc http://www.teratech.com/

<CFSETTING enablecfoutputonly="Yes">
<!---

Project: Maryland ColdFusion User Group

TeraTech, Inc.
100 Park Ave, Ste 360
Rockville, MD  20850
301-424-3903 fax: 301-762-8185
http://www.teratech.com/   [EMAIL PROTECTED]

Copyright TeraTech, Inc 2000.

ELEMENT NAME: mod_display_variables.cfm
 Programmer: Douglas M. Smith
 Created: June 2000

Purpose:
 To display/debug various classes of variables: Application, Session, Client, Request, 
and Cookie

Method:
 For stuctures, loop over the structure
 Structure or Arrays inside structures must be handed special
 For non-structured scopes, you must provide a list of variable names


Change History: (CR=Change Request)
--------------
When      Who What
--------- --- -------------------------------------
7/11/2000 dms Turned off display of CF debug text, which was being forced on at the 
bottom of the page.
7/12/2000 dms Discovered cookies are a structure in the CF 4.5.1
3/30/2001 dml Changed Attributes Allowed_IP_List and Allowed_DOMAIN_List to default 
blank
              and ScopeVarList
       Was causing ***HUGE*** problems with non-modified hosted websites
4/5/2001  dml Added locking to SERVER VARIABLES
--->

<!--- SETUP SOME LOCAL VARIABLES --->
<CFPARAM Name="DebugAccessAllowed" Default=False>

<!--- ================================================== --->
<!--- USE THIS SECTION TO DEFINE THE IP ADDRESS THAT ARE ALLOWED --->
<!--- ================================================== --->
<!--- Lists that Allow Access to Debug Variables --->
<CFPARAM Name="Attributes.Allowed_IP_List" default="">
<CFPARAm Name="Attributes.Allowed_DOMAIN_List" default="">

<!--- ================================================== --->
<!--- TESTED APPLICATION SPECIFIC VARIABLES --->
<!--- USE THIS SECTION TO SETUP VARIABLES THAT CAN BE TESTED THAT ARE SPECIFIC TO YOUR 
APPLICATION --->
<!--- FOR EXAMPLE, ONLY SHOW DEBUG VARIABLES AFTER LOGON, FOR SPECIFIC USERS, OR 
ADMINS ONLY ETC. --->
<!--- ================================================== --->
<!--- <CFPARAM Name="Client.UserID" Default=""> --->
<!--- <CFPARAM Name="Client.Email" Default=""> --->
<!--- <CFSET Allowed_UserID_List="admin,theboss,developer1,developer2,4567245"> --->
<!--- <CFSET
Allowed_Email_List="[EMAIL PROTECTED],[EMAIL PROTECTED],[EMAIL PROTECTED],[EMAIL PROTECTED],[EMAIL PROTECTED],[EMAIL PROTECTED]">
--->

<!--- ================================================== --->
<!--- LIST THE STRUCTURED SCOPES THAT YOU WANT TO VIEW --->
<!--- MANY TIMES, YOU WILL NOT WANT TO INCLUDE THE FORM, URL, AND CGI SCOPES,  --->
<!--- SINCE THESE ARE DISPLAYED ON THE STANDARD CF DEBUGING SCREEEN --->
<!--- ================================================== --->
<!--- <CFSET Attributes.ScopeVarList = 
"APPLICATION,REQUEST,ATTRIBUTES,CLIENT,SESSION,COOKIE,FORM,URL,CGI"> --->
<CFPARAM NAME="Attributes.ScopeVarList"
DEFAULT="APPLICATION,REQUEST,ATTRIBUTES,CLIENT,SESSION,COOKIE,FORM,URL,CGI">

<!--- ================================================== --->
<!--- OTHER NON-STRUCTURED SCOPES AND VARIABLES THAT WE WANT TO SEE --->
<!--- WILL USUALLY BE HANDLED WITH A LIST OF VARIABLES --->
<!--- ================================================== --->
<!--- <CFSET OtherVarList="Client.HitCount,Client.LastVisit"> ---> --->
<CFSET
ServerVarList="Server.ColdFusion.ProductLevel,Server.ColdFusion.ProductName,Server.ColdFusion.ProductVersion,Server.ColdFusion.SerialNumber,Server.ColdFusion.SupportedLocales,Server.OS.AdditionalInformation,Server.OS.BuildNumber,Server.OS.Name,Server.OS.Version">

<!--- ================================================== --->
<!--- USE THIS SECTION TO DECIDE WHAT CONDITIONS DETERMINE --->
<!--- IF THE USER IS ALLOWED TO VIEW THE DEBUG VARIABLES --->
<!--- ================================================== --->

<!--- CURRENT USER IS COMMING FROM AN ALLOWED IP ADDRESS --->
<CFIF ListFindNoCase("#Attributes.Allowed_IP_List#","#CGI.REMOTE_ADDR#")>
  <CFSET DebugAccessAllowed=True>
</cfif>

<!--- CURRENT USER IS COMMING FROM ANYWERE IN A CLASS C DOMAIN  --->
<CFLOOP list="#Attributes.Allowed_DOMAIN_List#" index="Allowed_DOMAIN">
 <CFIF Left(cgi.HTTP_REMOTE_ADDR,Len(Allowed_DOMAIN)) IS Allowed_DOMAIN>
  <CFSET DebugAccessAllowed=True>
 </cfif>
</cfloop>

<!---
<!--- TEST IF A SPECIFIC USER IS LOGGED ON --->
<CFIF ListFindNoCase("#Allowed_UserID_List#","#Client.UserID#")>
  <CFSET DebugAccessAllowed=True>
</cfif>

<!--- TEST IF A USER WITH A SPECIFIC EMAIL ADDRESS IS LOGGED ON --->
<CFIF ListFindNoCase("#Allowed_Email_List#","#Client.Email#")>
  <CFSET DebugAccessAllowed=True>
</cfif>
 --->

<!--- ================================================== --->
<!--- NOW, DISPLAY THE DEBUG VARIABLES IF ALLOWED --->
<!--- ================================================== --->
<CFIF DebugAccessAllowed >
 <cfoutput>
 <table border="0" style="font-size: 12;font-family: arial">

 <!--- STRUCTURED SCOPES CAN ALL BE HANDLED THE SAME  --->
 <CFLOOP list="#Attributes.ScopeVarList#" index="SCOPE">

  <!--- NON STRUCTURED SCOPES MUST BE HANDLED DIFFERENTLY --->
  <CFIF SCOPE IS "CLIENT" AND IsDefined("Client.LastVisit")>

   <!--- APPARENTLY, CLIENT VARS ARE NOT STORED IN A STRUCTURE, SO THEY CAN'T BE 
LOOPED THROUGH --->
   <!--- However, we can use the new function available in CF 4.5: 
GetClientVariablesList() --->
   <tr><td colspan=2><hr><b>CLIENT VARIABLES</b><hr></td></tr>
   <CFLOOP list="#ListSort(GetClientVariablesList(),"text")#" index="CurKey">
    <TR><TD valign="top">#CurKey#</td><td><b><CFIF
IsDefined("Client.#CurKey#")>#Evaluate("client.#CurKey#")#<cfelse>[NOT 
DEFINED]</cfif></b></td></tr>
   </cfloop>
   <!--- OTHER CLIENT VARIABLES THAT FOR SOME REASON ARE NOT INCLUDED IN 
GETCLIENTVARIABLESLIST --->
   <TR><TD>HitCount</td><td><b><CFIF 
IsDefined("Client.HitCount")>#Client.HitCount#<cfelse>[NOT
DEFINED]</cfif></b></td></tr>
   <TR><TD>LastVisit</td><td><b><CFIF 
IsDefined("Client.LastVisit")>#Client.LastVisit#<cfelse>[NOT
DEFINED]</cfif></b></td></tr>

  <cfelse>
   <cfif #SCOPE# is "Application">
    <cflock timeout="20" type="READONLY" scope="APPLICATION">
     <tr><td colspan=2><hr><b>#SCOPE# VARIABLES</b><hr></td></tr>
     <cfloop collection="#evaluate(scope)#" item="VarName" >
      <CFSET MyVar=Evaluate("#scope#.#VarName#")>
      <tr><td valign="top">#VarName#</td>
      <cfif IsQuery(MyVar)>
      <td><b>Complex Variable: Query</b></td></tr>
      <cfelseif IsStruct(MyVar)>
      <td><b>Complex Variable: Structure</b></td></tr>
      <cfelse>
      <td><b>#HTMLEditFormat(Evaluate("#scope#.#VarName#"))#</b></td></tr>
      </cfif>
     </cfloop>
    </cflock>
   <cfelseif #SCOPE# is "Session">
    <cflock timeout="20" type="READONLY" scope="SESSION">
     <tr><td colspan=2><hr><b>#SCOPE# VARIABLES</b><hr></td></tr>
     <cfloop collection="#evaluate(scope)#" item="VarName">
      <CFSET MyVar=Evaluate("#scope#.#VarName#")>
      <tr><td valign="top">#VarName#</td>
      <cfif IsQuery(MyVar)>
      <td><b>Complex Variable: Query</b></td></tr>
      <cfelseif IsStruct(MyVar)>
      <td><b>Complex Variable: Structure</b></td></tr>
      <cfelse>
      <td><b>#HTMLEditFormat(Evaluate("#scope#.#VarName#"))#</b></td></tr>
      </cfif>
     </cfloop>
    </cflock>
   <cfelse>
    <tr><td colspan=2><hr><b>#SCOPE# VARIABLES</b><hr></td></tr>
    <cfloop collection="#evaluate(scope)#" item="VarName">
     <CFSET MyVar=Evaluate("#scope#.#VarName#")>
     <tr><td valign="top">#VarName#</td>
     <cfif IsQuery(MyVar)>
     <td><b>Complex Variable: Query</b></td></tr>
     <cfelseif IsStruct(MyVar)>
     <td><b>Complex Variable: Structure</b></td></tr>
     <cfelse>
     <td><b>#HTMLEditFormat(Evaluate("#scope#.#VarName#"))#</b></td></tr>
     </cfif>
    </cfloop>
   </cfif>

  </cfif>

 </cfloop>

<!---
  <!--- OTHER VARIABLES --->
  <tr><td colspan=2><hr><b>OTHER USEFUL VARIABLES</b><hr></td></tr>
  <CFLOOP list="#OtherVarList#" index="CurKey">
   <TR><TD>#CurKey#</td><td><b><CFIF 
IsDefined("#CurKey#")>#Evaluate(CurKey)#<cfelse>[NOT
DEFINED]</cfif></b></td></tr>
  </cfloop>
 --->
  <!--- SERVER VARIABLES --->
  <tr><td colspan=2><hr><b>SERVER VARIABLES</b><hr></td></tr>
     <cflock timeout="20" type="READONLY" scope="SERVER">
  <CFLOOP list="#ServerVarList#" index="CurKey">
   <TR><TD valign="top">#CurKey#</td><td valign="top"><b><CFIF 
IsDefined("#CurKey#")>#Evaluate(CurKey)#<cfelse>[NOT
DEFINED]</cfif></b></td></tr>
  </cfloop>
        </cflock>

 </table>

 </cfoutput>
</cfif>

<CFSETTING enablecfoutputonly="NO">

Erika L Walker wrote:

> I just downloaded a tag from the Tag Gallery called CF_Debug....that I
> wanted to throw up on one of my hosted sites so that I could get some quick
> debugging info.......
>
> Of course I unzipped it and it doesn't contain the Debugging tag, it's got
> some silly find and replace JS function.
>
> HELP! Does anybody out there have a debugging tag? Or let me know what the
> quick method is of outputting all the wonderful things we see at the bottom
> of the pages when we have debugging turned on?
>
> *** mumbles to herself, while she goes and loads up on caffeine laced with
> arsenic that may put her out of her misery. ****
>
> Erika
>
> "You can talk a great philosophy, but if you can't be kind to people
> everyday then it doesn't mean that much to me." - unknown
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to