Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/O Code)
 Code to force a login
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

jfitz
Junior Member

USA
345 Posts

Posted - 11 December 2002 :  23:06:07  Show Profile
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  Show Profile  Send ruirib a Yahoo! Message
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
Go to Top of Page

jfitz
Junior Member

USA
345 Posts

Posted - 11 December 2002 :  23:11:06  Show Profile
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
Go to Top of Page

seven
Senior Member

USA
1037 Posts

Posted - 11 December 2002 :  23:32:11  Show Profile  Visit seven's Homepage
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?


Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 11 December 2002 :  23:35:48  Show Profile  Send ruirib a Yahoo! Message
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
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 11 December 2002 :  23:37:26  Show Profile  Send ruirib a Yahoo! Message
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
Go to Top of Page

jfitz
Junior Member

USA
345 Posts

Posted - 11 December 2002 :  23:45:36  Show Profile
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.
Go to Top of Page

jfitz
Junior Member

USA
345 Posts

Posted - 11 December 2002 :  23:54:17  Show Profile
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.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.28 seconds. Powered By: Snitz Forums 2000 Version 3.4.07