Author |
Topic  |
|
thewebgeeks
Starting Member
18 Posts |
Posted - 09 July 2001 : 12:21:14
|
Where to start...
I have a default page (not forum default page) and I want my users to be able to log in from this page. I have made a file called "loginpage.asp" (see bottom of post) its basiclly inc_top.asp with the unneeded code removed. If I am logged into the forum, and call this page up alone in my browser, it works great! It says "you are logged in as ..."
The trouble is that I am trying put this on my default page via an include. When I do so, the page displays that I am not logged in, even tho I AM logged in. All I did was say to include loginpage.asp. Why is it that loginpage.asp work perfect alone, but when I call it into default.asp via an include it doesnt?!?!?!?!?!
I have tried cutting and pasting the code from loginpage.asp directly into default.asp, but it does not recongize that I am logged in. I have even tried deleting the include for /forums/config.asp and /forums/inc_functions.asp from the loginpage.asp and pasting it directly into default.asp
Please help! I am going crazy with this code! This is not all that difficult of an opperation, but it is taking me weeks to get worked out! P-P-P-Please help me!
---loginpage.asp---also the code i pasted directly into default.asp--- '##################################################### <!--#INCLUDE virtual="/forums/config.asp" --> <!--#INCLUDE virtual="/forums/inc_functions.asp" --> <% dim mLev, strLoginStatus
set my_Conn = Server.CreateObject("ADODB.Connection") my_Conn.Open strConnString
if (strAuthType = "nt") then call NTauthenticate() if (ChkAccountReg() = "1") then call NTUser() end if end if
STRdbntUserName = Request.Cookies(strCookieURL & "User")("Name")
if strAuthType = "nt" then STRdbntUserName = Session(strCookieURL & "userID") end if
select case Request.Form("Method_Type")
case "login" select case ChkUser2(Request.Form("Name"), Request.Form("Password")) case 1, 2, 3, 4 Call DoCookies() strLoginStatus = 1 case else strLoginStatus = 0 end select case "logout" Call ClearCookies() end select
mLev = cint(ChkUser2(STRdbntUserName, Request.Cookies(strCookieURL & "User")("Pword"))) %>
<!-- If Loggedin/Loggedout --> <% if (ChkUser2((STRdbntUserName), (Request.Cookies(strCookieURL & "User")("Pword"))) = 0) then %> <form action="/login/vfy.asp" method="post" id=form1 name=form1> <INPUT type="hidden" name="Method_Type" value="login"> <!-- If User Not Logged in --> <% if (strAuthType = "db") then %> <font face="<% =strDefaultFontFace %>" size="<% =strFooterFontSize %>"> <b>Username:</b></font><br><INPUT type="text" name="Name" size="10" value=""> <font face="<% =strDefaultFontFace %>" size="<% =strFooterFontSize %>"> <b>Password:</b></font><br><INPUT type="password" name="Password" size="10" value=""> <% if strGfxButtons <> "0" then %> <INPUT src=button_login.gif type="image" value="Login" id=submit1 name=submit1 border=0 hspace=4> <% else %> <% if strGfxButtons = "0" then %> <INPUT type="submit" value="Login" id=submit1 name=submit1> <% end if %> <% end if %> <% else %> <% if (strAuthType = "nt") then %> <font face="<% =strDefaultFontFace %>" size="1" color="red">Please <a href="policy.asp">register</a> to post in these Forums</font> <% end if %> <% end if %> <% if (lcase(strEmail) = "1") then %> <font face="<% =strDefaultFontFace %>" size="<% =strFooterFontSize %>"> <a href="JavaScript:openWindow('pop_pword.asp')">Forgot your <% if strAuthType = "nt" then %>admin <% end if %>Password?</a> <% if (lcase(strNoCookies) = "1") then %> | <a href="admin_home.asp">Admin Options</a> <% end if %> </font> <% end if %> <!-- /If User Not Logged in --> </form> <!-- If User IS Logged in --> <% else %> <form action="/login/vfy.asp" method="post" id=form2 name=form2> <INPUT type="hidden" name="Method_Type" value="logout"> <A CLASS="regblack">You are logged on as<br> <% if strAuthType="nt" then %> <b><% =Session(strCookieURL & "username")%> (<% =Session(strCookieURL & "userid") %>) </b></A> <% else %> <% if strAuthType = "db" then %> <b><% =STRdbntUserName %></b></A> <br><INPUT type="submit" value="Logout" id=submit1 name=submit1> <% end if %> <% end if %> <% if (mlev = 4) or (lcase(strNoCookies) = "1") then %> <font face="<% =strDefaultFontFace %>" size="<% =strFooterFontSize %>"> <a href="admin_home.asp">Admin Options</a></font> <% end if %> </form> <% end if %> <!-- /If User IS Logged in -->
<!-- End If Loggedin/Loggedout --> '####################################################
Sincerely,
Tom Henkel Web Geek Web Design 11000 Lindo Trl. Lindstrom, MN 55045 (651) 257-5932 www.webgeekwebdesign.com
Midwest Road To NOPI Tour 2001 Planner/Organizer
Vice President, MN Region Leader and Webmaster for www.hircc.com Member #1011
Owner/Operator www.customcockpits.com
Edited by - thewebgeeks on 09 July 2001 12:26:20
Edited by - thewebgeeks on 15 July 2001 23:54:36
Edited by - thewebgeeks on 15 July 2001 23:55:54 |
|
thewebgeeks
Starting Member
18 Posts |
Posted - 15 July 2001 : 19:28:41
|
Anyone? Was I not specific enough? Please help! This is taking forever to figure out!
|
 |
|
barky81
Junior Member
 
USA
166 Posts |
Posted - 16 July 2001 : 00:26:26
|
Okay, let's see...
You've got a whole lot of stuff going on...way too much.
There are a couple of issues: Primarily, is the logon page inside the same directory as the forum? (From your posted code, I am guessing it is not in the same directory.)
If you're trying to "login to the forums" from outside the directory that contains the forums, the first thing you have to be sure of is that you are using website cookies, not forum cookies. Search the snitz forum for additional info.
Second, your "logon" page is really nothing more than a "holder" for a stripped down version of inc_top.asp (Say to wrap it with your graphics or add additional explanatory text; but the inc_top.asp will still do all the "heavy lifting."
So, if you are trying to setup a website wide login functionality with snitz, first read all the past threads (although many of the most useful ones are now archived...); second, enable website cookies; third, copy inc_top.asp into the toplevel directory where you want to manage logons from, and rename it something else (site_inc_top.asp); fourth, modify your new site_inc_top.asp so that it still points to your original config.asp and inc_functions.asp (just edit the link to point in the right place, don't copy these files!); fifth, create a blank "logon" page that ONLY contains site_inc_top.asp as an include file.
Try it and see what happens....
If it logs you in, and tries to redirect you, you'll know it works. Then you will have to fix up a number of little things like graphic links, and the re-directs (which depends on how you want you site to work); and finally, after it's working, you can edit site_inc_top.asp to take out all the forum links and stuff you don't need--after it is working, of course...
So, let's start over and see if we can get it working. (The key after all is keeping un-logged-in users out, and we haven't talked about that yet....)
Good luck!
Edited by - barky81 on 16 July 2001 00:28:02 |
 |
|
thewebgeeks
Starting Member
18 Posts |
Posted - 16 July 2001 : 14:35:49
|
Thanks,
Perhaps I should start over, completely. I have a site that has an E-store. I am trying to make it work so that when they log in, they are logged into the forums and the store. I dont want them to have to log in twice, and remeber two seperate passwords. I also want to make it so the main page will allow them to see if they are logged in or not, and allow them to log in if they are not.
Can you please direct me ont he best way to do this? My mind is going crazy trying to figure it out. Should I make it so that when they sign up for the forums, their info and password is also wrote to the stores database? Then how do I go abotu making it so the cookie will also work for the store? PPPPPPPlease help!
Edited by - thewebgeeks on 16 July 2001 15:05:02 |
 |
|
barky81
Junior Member
 
USA
166 Posts |
Posted - 17 July 2001 : 18:48:43
|
What is the store software?
quote:
Thanks,
Perhaps I should start over, completely. I have a site that has an E-store. I am trying to make it work so that when they log in, they are logged into the forums and the store. I dont want them to have to log in twice, and remeber two seperate passwords. I also want to make it so the main page will allow them to see if they are logged in or not, and allow them to log in if they are not.
Can you please direct me ont he best way to do this? My mind is going crazy trying to figure it out. Should I make it so that when they sign up for the forums, their info and password is also wrote to the stores database? Then how do I go abotu making it so the cookie will also work for the store? PPPPPPPlease help!
Edited by - thewebgeeks on 16 July 2001 15:05:02
|
 |
|
Crazyhorse
Starting Member
USA
9 Posts |
Posted - 17 July 2001 : 20:14:15
|
Hi,
I am doing basically the same thing you are talking about, I think.
Here is a link to a page where I have this going on (still under development, but the login into Snitz from a non-Snitz page works:
www.rcmadness.com/dev3
When you get there, register for a free account, then, go through the login process.
Owner, VermontOffshore.com |
 |
|
thewebgeeks
Starting Member
18 Posts |
Posted - 17 July 2001 : 23:54:59
|
The store is a HEAVILY modified version of Comersus
|
 |
|
bjlt
Senior Member
   
1144 Posts |
Posted - 18 July 2001 : 23:51:00
|
I've sort out the files as a global log in mod, it's generally the same of your files but seems working you can find it in the w/code forum. well, IMHO, if you run a store, you need to consider security more. esp the current version of snitz do not enc data in db, it even store plain password in cookie. This will be fixed soon, check the topic of in bug forum named grand bug. after the fix come out, you also need to ecnrypt user info in the database someway. You may have already done that, but i thouth you'd like to know.
|
 |
|
|
Topic  |
|
|
|