Get a Quote Today!   |   + 1 (301) 424 3903




 
  Community
 
Need Help?
Visit our Training page
Request a Quote or Consultation
SIGN UP FOR THE TERATECH NEWSLETTER
 

ColdCuts

Cut: send message to IP address
Cut#: 211 
Cut Date: 03/20/2001 
Cutter: Pam 
Topic: Appearance 
Overview: I've got users signing into my application and I'm setting an application variable using the cgi.remote_addr.

I can check to see how many and who is signed into my application via their IP address. Is there any way to send an email or maybe cause a javascript alert box to pop up on the users screen? I need a way to 'tell' users to log off for maintenance or other problems.

Answer: Just do a CFABORT In your application.cfm with your message. Then the next page anyone hits will display the message and not let them use the site.

 

Cut Code:
<!--- session tracker --->
<cflock timeout="20" throwontimeout="yes" type="Exclusive" name="#APPLICATION.ApplicationName#">
<CFLOCK TYPE="application" TIMEOUT=10>
<!---Is session-tracker doesnot exist, generate it --->
<cfparam name="APPLICATION.sessionTracker" default=#StructNew()#>

<!---Log current user --->
<CFSET dummy=StructInsert(APPLICATION.SessionTracker, CGI.REMOTE_ADDR, Now(), true)>
</CFLOCK>
<!--- uncomment to put site down for maintenance.
Site down for maintenance
<CFABORT>
--->