House of Fusion
Home of the ColdFusion Community
Hostmysite ColdFusion Hosting

Search cf-talk

September 06, 2008

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
   1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30         

Subscribe Now
Fusion Authority Quarterly Update - ColdFusion 8 Special Edition

For ColdFusion hosting try HostMySite.com.
Search over 2,500 ColdFusion resources here  >>>      
Home /  Groups /  ColdFusion Talk (CF-Talk)

Why would this generate an error?

  << Previous Post |  RSS |  Sort Oldest First |  Sort Latest First |  Subscribe to this Group Next >> 

07/18/2006 06:18 AM
Author:
Will Tomlinson

Sorry bout the lame post minus all the code, but everytime I post it, it never posts. lol Anyway, I have an Application.cfc in an admin folder... it extends the rootApplication.cfc. In the admin folder App.cfc I'm using onRequestStart() to restrict access. <cffunction name="onRequestStart" returntype="void" output="false">   <cfif NOT IsDefined("SESSION.auth.isLoggedIn")>      <cfinclude template="login.cfm">        <cfabort>     </cfif>       <cfif IsDefined("URL.logout")>          <cfset StructDelete(SESSION,"auth")>        <cflocation url="login.cfm">      </cfif> </cffunction> In my root Application.cfc, I'm using onError(). The problem is, if you simply login to the admin folder, an error is thrown. You never see anything wrong when you go thru login, onError() just fires off. I can't figure out why an error would be generated from loggin in like this. Thanks, Will

07/18/2006 06:40 AM
Author:
Tom Chiverton

>   <cfif NOT IsDefined("SESSION.auth.isLoggedIn")> Are you sure session.auth will always exist ? -- Tom Chiverton **************************************************** This email is sent for and on behalf of Halliwells LLP. Halliwells LLP is a limited liability partnership registered in England and Wales under registered number OC307980 whose registered office address is at St James's Court Brown Street Manchester M2 2JF.  A list of members is available for inspection at the registered office. Any reference to a partner in relation to Halliwells LLP means a member of Halliwells LLP. Regulated by the Law Society. CONFIDENTIALITY This email is intended only for the use of the addressee named above and may be confidential or legally privileged.  If you are not the addressee you must not read it and must not use any information contained in nor copy it nor inform any person other than Halliwells LLP or the addressee of its existence or contents.  If you have received this email in error please delete it and notify Halliwells LLP IT Department on 0870 365 8008. For more information about Halliwells LLP visit www.halliwells.com.

07/18/2006 07:59 AM
Author:
Ben Nadel

CFLocation fires the onError function (I believe). Are you using a CFLocation after they Log into the system? I put this in my onError() method (original idea by Ray Camden): <!---   CFLocation will cause an error for no reason in the event model. If   that happens, the exceptions type will be Aport Exception. Just   return out if that is the case. ---> <cfif NOT CompareNoCase( ARGUMENTS.Exception.RootCause.Type, "coldfusion.runtime.AbortException" )>   <cfreturn /> </cfif> ...................... Ben Nadel www.bennadel.com Sorry bout the lame post minus all the code, but everytime I post it, it never posts. lol Anyway, I have an Application.cfc in an admin folder... it extends the rootApplication.cfc. In the admin folder App.cfc I'm using onRequestStart() to restrict access. <cffunction name="onRequestStart" returntype="void" output="false">   <cfif NOT IsDefined("SESSION.auth.isLoggedIn")>      <cfinclude template="login.cfm">        <cfabort>     </cfif>       <cfif IsDefined("URL.logout")>          <cfset StructDelete(SESSION,"auth")>        <cflocation url="login.cfm">      </cfif> </cffunction> In my root Application.cfc, I'm using onError(). The problem is, if you simply login to the admin folder, an error is thrown. You never see anything wrong when you go thru login, onError() just fires off. I can't figure out why an error would be generated from loggin in like this. Thanks, Will

07/18/2006 03:39 PM
Author:
Will Tomlinson

>CFLocation fires the onError function (I believe). Are you using a >CFLocation after they Log into the system? I tried posting again after the first one but it wouldn't come thru. It actually throws the error when you just hit the login page. You don't even hafta login. Lemme try some of these ideas that've been posted. Thanks, Will

07/18/2006 02:20 PM
Author:
Cutter (CFRelated)

Why the include/abort? Maybe something like this (untested)... <cffunction name="onRequestStart" returntype="void" output="false">       <cfif not structkeyexists(session.auth,"isLoggedIn")>   <cfif structkeyexists(url,"logout")>        <cfset structdelete(session,"auth") />   </cfif>          <cflocation url="login.cfm" />       </cfif> </cffunction> Cutter __________ http://blog.cutterscrossing.com Will Tomlinson wrote:


<< Previous Thread Today's Threads Next Thread >>

Mailing Lists