Restrict page access to parent page only (not by permissions)

Ask a Question related to Macromedia ColdFusion, Design and Development.

  1. #1

    Default Restrict page access to parent page only (not by permissions)

    I wish to restrict access of a pop-up page to parent page only.
    i.e. - if a request for "popup.cfm" comes from anywhere except
    "launch.cfm" then redirect the request back to "launch.cfm". I have
    cases where the links are to plain dot.CFM pages and pages with
    dot.CFM?#URLvariables#

    I've tried <cfif> conditionals with "server_name", "cgi.remote_addr" and
    such but can't get them to work below domain or IP scope. In plain
    english: if referrer is not launch.cfm redirect to launch.cfm.

    CFMX7 on Windows 2003

    Earl Guest

  2. Similar Questions and Discussions

    1. Restrict Access to Index Page
      I would like to limit access for a user to just a website's main index page. I have found in Contribute that you can only restrict access by...
    2. how to access user web control from parent page?
      Hi, I've created a user web control with 4 drop down list boxes in it. I've added this user control to my main web form page. I created the...
    3. Restrict Access To Page MX2004
      Yes me too...how to resolve? Anyone?
    4. cant get Restrict Access to Page server behaviour towork
      All my asp pages have been working up until now. The first problem started when I put the Restrict Access to Page server behaviour on a page... it...
    5. Access properties of parent page from user control
      I am trying to build a control that can only be used on a page that inherits from a custom class. This base class as a series of public...
  3. #2

    Default Re: Restrict page access to parent page only (not bypermissions)

    This should do the trick, althogh I have not checked to see how calling from
    JavaScript will effect the CGI variable.

    <!--- if this page was not referenced from launch.cfm then redirect to
    launch.cfm --->
    <cfif Right(CGI.HTTP_Referer, 10) IS NOT "launch.cfm">
    <cflocation url="launch.cfm">
    </cfif>

    Stressed_Simon Guest

  4. #3

    Default Re: Restrict page access to parent page only (not bypermissions)

    I think some software (Norton, et. al.) can block the CGI.HTTP_REFERER variable
    from being populated. So it is possible that the CGI.HTTP_REFERER on the pop-up
    page may be blank ("") even if the user legitimately accessed the pop-up page
    through "launch.cfm". Just something to think about.

    What about passing some sort of encrypted value as a parameter? Then on the
    pop-up page, you could check the value and if it is not correct, redirect the
    user to the launch.cfm page?



    mxstu Guest

  5. #4

    Default Re: Restrict page access to parent page only (not by permissions)

    mxstu wrote:
    > I think some software (Norton, et. al.) can block the CGI.HTTP_REFERER variable
    > from being populated. So it is possible that the CGI.HTTP_REFERER on the pop-up
    > page may be blank ("") even if the user legitimately accessed the pop-up page
    > through "launch.cfm". Just something to think about.
    >
    > What about passing some sort of encrypted value as a parameter? Then on the
    > pop-up page, you could check the value and if it is not correct, redirect the
    > user to the launch.cfm page?
    >
    >
    >
    Thanks for both reponses!

    Stressed, I went with something like this:
    <cfif CGI.HTTP_Referer DOES NOT CONTAIN "gallery.cfm">
    <cflocation url="images.cfm" addtoken="no">
    </cfif>

    and it worked beautifully, until I read a good bit about how Norton and
    other tools do seems to whack this approach. Maybe I could put a "this
    site for Mac and *nix only" banner up?

    So I tried and tried mxstu's approach and came up with this:
    <cfif IsDefined("url.gal_ImageID")>

    which prevents accidental landings on the page (should have been there
    to start with!) but does not prevent people from refering directly to
    the pop-up pages. Referral seems to be what I need, back to the drawing
    board...
    Earl Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

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 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139