Author |
Topic |
|
jfitz
Junior Member
USA
345 Posts |
Posted - 11 December 2002 : 23:06:07
|
What includes / calls do I need to make to require a user login from a brand-new page that I am creating to add to my forum before the page will display? |
--Jördan It's a wasted day if you don't spend at least part of it flying upside down. |
Edited by - ruirib on 11 December 2002 23:10:12 |
|
ruirib
Snitz Forums Admin
Portugal
26364 Posts |
Posted - 11 December 2002 : 23:09:54
|
You'll be adding the page to your forum and you want it to be displayed only after login? Are you using the forum's login system, by including config.asp and inc_header.asp in that page? |
Snitz 3.4 Readme | Like the support? Support Snitz too |
|
|
jfitz
Junior Member
USA
345 Posts |
Posted - 11 December 2002 : 23:11:06
|
I included config.asp and inc_header_short.asp (it's going to be a pop_up page) but it can still be called without being logged-in.
I made the includes the very first lines of the new page, in that order. |
--Jördan It's a wasted day if you don't spend at least part of it flying upside down. |
Edited by - jfitz on 11 December 2002 23:20:56 |
|
|
seven
Senior Member
USA
1037 Posts |
Posted - 11 December 2002 : 23:32:11
|
The subject of this post made we want to ask this...
How would I get the forum to force users who checked the "save password" checkbox to force a re-login?
|
|
|
|
ruirib
Snitz Forums Admin
Portugal
26364 Posts |
Posted - 11 December 2002 : 23:35:48
|
Ok, so add this code to the top of the page:
if mlev < 1 Then
Response.Write " <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """ color=""" & strHiLiteFontColor & """>Sorry you need to login to be able to access this page</font></p>"
Response.write "<meta http-equiv=""Refresh"" content=""2; URL=default.asp"">"
WriteFooter()
Response.End
end if
This will redirect to default.asp if the member is no logged in, after showing a message informing the member that he needs to be logged in to access the page. |
Snitz 3.4 Readme | Like the support? Support Snitz too |
|
|
ruirib
Snitz Forums Admin
Portugal
26364 Posts |
Posted - 11 December 2002 : 23:37:26
|
quote: Originally posted by airilm
The subject of this post made we want to ask this...
How would I get the forum to force users who checked the "save password" checkbox to force a re-login?
Edit the code that creates the cookies, in the DoCookies function, so that you remove the expiration date from the cookie. That will make the cookie expire when the browser is closed. |
Snitz 3.4 Readme | Like the support? Support Snitz too |
|
|
jfitz
Junior Member
USA
345 Posts |
Posted - 11 December 2002 : 23:45:36
|
I apologize for misleading title to my post.
The following test page does not always require a user to be logged in before the "This is a test page" is displayed. What should I do to make it force the login first?
<%@ Language=VBScript %>
<!--#INCLUDE FILE="config.asp"-->
<!--#INCLUDE FILE="inc_header_short.asp" -->
This is a test page.
After further experimentation, it seems that it is related to browser cache. If I clear cache, then the first time, it requires a login. The next time, even after I log out first, it does not require a login, buth when I click on the "refresh", then it does force a login.
I guess I'm getting confused by testing from the same machine I'm developing on. |
--Jördan It's a wasted day if you don't spend at least part of it flying upside down. |
|
|
jfitz
Junior Member
USA
345 Posts |
Posted - 11 December 2002 : 23:54:17
|
ruirib,
First, thanks so much for your virtually instantaneous reply! The include files do behave as you suggested, however...
I added your code, and the behavior is the same...undoubtedly related somehow to browser cache:
1. start a new browser and link to testpage.asp (the name I used) 2. a login is forced and then the page displays 3. click logout and wait for the login page 4. select the testpage.asp from the browser's address dropdown (even after visiting another web site) 5. the test page displays without a login 6. click refresh - a login is now required
(I'm using IE 5.50, but, of course, I have no control over my visitors' choice of browser). |
--Jördan It's a wasted day if you don't spend at least part of it flying upside down. |
|
|
|
Topic |
|