Why won't the spooky-login protect this one page - 8/22/2001 20:10:00
The login protects all the other pages fine, but for some reason it lets users into this page without doing an automatic redirect. Since it can't find a user name it wont let them go any further, and I burried an "if then statement" further down that checks for a minimum authorization level in order to stop them from viewing the options, but I am still perplexed - I have several more pages (about 95 of them) to redo into this format, and I really didn't want to manually protect each pages content. I used the following code succesfully on other pages and it redirects fine, my fear is that it may have something to do with all the other unrelated script that gets used by the date function and the scrolling menubar however the code for these parts are below the <html> tags and spooky's code is at the very beginning.Here is the code: <% Response.Buffer = True DIM AccExpires DIM COOKIE_NAME COOKIE_NAME = "Spooky" If Session("UserName") = "" AND Request.cookies(COOKIE_NAME)("T1aUs") = "" Then Response.redirect "/login.asp?Redirect=" &Request.Servervariables("URL") Elseif Request.cookies(COOKIE_NAME)("T1aUs") <> "" then AccExpires = Request.cookies(COOKIE_NAME)("xExpires") If Trim(AccExpires) <> "" AND isDate(AccExpires) then If cDate(AccExpires) < Now() then Response.redirect "/login.asp?Redirect=" &Request.Servervariables("URL") End If End if End if %> <html> <head> <meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1252"> <meta name="GENERATOR" content="Microsoft FrontPage 4.0"> <meta name="ProgId" content="FrontPage.Editor.Document"> <title>view edit listings</title> <script language=Javascript name="J-BotDateFormat" ><!-- // Webs Unlimited's J-BOTS FrontPage 2000 JavaScript Generator version 3.0 // Copyright Webs Unlimited 1998, 1999 All rights reserved - http://WebsUnlimited.com // make an array of length n Needed for older javascript browsers function makearray(n) { this.length = n YADA, YADA, and more YADA, then it goes to this - <td valign="top" height="56" width="508" colspan="2"> <p align="center"> <%If Session("AccessLevel") >= "5" then %> <!--webbot bot="Navigation" S-Type="children" S-Orientation="horizontal" S-Rendering="text" B-Include-Home="FALSE" B-Include-Up="FALSE" U-Page S-Target --> <%Else%> <b>Error.... What are you doing here?</b> <br> <A href="login.asp">Go back and login!!</A> <%End if%> </td> Which is how I wind up protectiong the "Grey Code" for a navigation bar from displaying the related page links. I can paste the complete code if needed, but hopefully this will give enough of a clue.
------------------ TimC "Good things come to those who wait... . . but only that which was left by those who hustled" Abraham Lincoln
|