Skip to main content
Inspiring
October 10, 2007
Question

Which index.cfm is being called?

  • October 10, 2007
  • 1 reply
  • 303 views
Ok. I have a feeling there will be an easy solution to this and feel dumb because I cannot seem to come up with it right now...

I have two index.cfm pages... one in my webroot/index.cfm and the other in webroot/admin/index.cfm...

Is there a quick way in code to determine weather the page being requested is in the admin directory or the root during my onRequestStart to determine what level of authentication is neccesary. I am trying to avoid using two Application.cfc files as that would mean i need to duplicate some code and then if changes are made i would have two places to make them which i am trying to avoid.

I am assuming this is going to use GetTemplatePath() but I must be using it incorrectly.

Thanks for all of your help.
    This topic has been closed for replies.

    1 reply

    Inspiring
    October 10, 2007
    1) cgi.script_name holds full path to your file from webroot.so <cfif
    find("/admin/", cgi.script_name)> will tell you what authentication to use

    2) is it possible to extend one Application.cfc with another
    Application.cfc?..

    --

    Azadi Saryev
    Sabai-dee.com
    http://www.sabai-dee.com
    joshebyAuthor
    Inspiring
    October 10, 2007
    quote:

    Originally posted by: Newsgroup User
    2) is it possible to extend one Application.cfc with another
    Application.cfc?..



    I had not even thought of that... how would that work... which functions would get called on a page request?