Print Page | Close Window

login integration

Printed From: Web Wiz Forums
Category: Web Wiz Web App Support Forums
Forum Name: Web Wiz Forums
Forum Description: Support forum for Web Wiz Forums application.
URL: https://forums.webwiz.net/forum_posts.asp?TID=21730
Printed Date: 08 April 2026 at 8:52pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: login integration
Posted By: bikeweb
Subject: login integration
Date Posted: 26 October 2006 at 9:11am
First off, I have been very impressed by the WWF software and have purchased the license key for my website at:
 
http://www.legalnurseforums.com - www.legalnurseforums.com
 
I am currently working on a way to integrate the login system for WWF to my existing website and have been successful at forcing a login from a secured page based on the following method:
 
1.  Place the common.asp file in an includes at the top of the page
 
2.  Check if a user is logged into the forum and redirect them to an access
denied page if they are not logged in.
 
3.  Have them go to the the login page
 
HERE IS THE CODE:
 
<!--#include virtual="forum/common.asp" -->
'If the user has not logged in (guest user ID = 2) then redirect them
 
If lngLoggedInUserID = 2 Then
response.redirect "access_denied.asp"
end if
 
END CODE
 
There is a link from the access denied page that takes them to the login page.
 
Although the above system seems to work fine to keep users out of unauthorized pages, I think I am doing this the hard way.  I really just want the user to be directed to the login page directly with an error showing that they need to login and skip the access denied page altogether.  Then after logging in I would like to return them to their original page.
 
My old login system was something that I have custom written and uses a variable assigned to the URL string passed to the login page that keeps this value after processing the login thus sending the user back to their original starting point after login:
 
HERE IS THE CODE
 
'If the user is not logged in they are redirected to the login page
 
Response.redirect "/login.asp?varRedirect=" &Request.Servervariables("URL") &"?" &Request.Servervariables("QUERY_STRING")
 
END OF CODE
 
The varRedirect value is passed to the process page which sends them back to their starting point after processing.
 
Is there a way in the WWF login system to accomplish the same thing and send the user back to their original page after logging in?  Otherwize they have to renavigate the site and find their old page again - kind of a pain.
 
Thanks for any assistance.



Replies:
Posted By: WebWiz-Bruce
Date Posted: 26 October 2006 at 9:28am
You could always have a look at build your own login page.

Version 8 uses a function in the file functions/functions_login.asp which you just pass the entered username and password to, if they returns one of the following codes to inform you if the login process was successful or not:-

'Key to login response
    '0 = Login Failed
    '1 = Login OK
    '2 = CAPTCHA Code OK
    '3 = CAPTCHA Code Incorrect
    '4 = CAPTHCA required


-------------
https://www.webwiz.net/web-wiz-forums/forum-hosting.htm" rel="nofollow - Web Wiz Forums Hosting
https://www.webwiz.net/web-hosting/windows-web-hosting.htm" rel="nofollow - ASP.NET Web Hosting


Posted By: bikeweb
Date Posted: 26 October 2006 at 10:54am
Looks like a great solution.
 
If I understand correctly I should build a form with username and password fields and then use the function to check the values and output a login response from 0 to 4.
 
exactly what values am I assigning to the function?
 
I don't understand all the values in the function on the line:
 
CODE
 
Private Function loginUser(ByVal strUsername, ByVal strPassword, ByVal blnCAPTCHArequired, strType)
 
END CODE
 
particularly "ByVal blnCAPTCHArequired" and "strType".  Do these values come from the CAPTCHA form?
 
I tried setting up a form and submitting the values for username and password and I am able to get back the values 0 and 1 only, however I'm not able to ever get back the values 2,3, or 4 and I'm not sure how to incorporate the values for the CAPTCHA image code.
 
Here is how I am calling the function:
 
First I created a form to get the username and password values and I included a CAPTCHA form and the common.asp and functions_login.asp files and then I called the function and displayed the results:
 
CODE
 
<!--#include virtual="forum/common.asp" -->
<!-- #include virtual="forum/functions/functions_login.asp" -->
<!--#include virtual="forum/includes/CAPTCHA_form_inc.asp" -->
'get values from the form
 
username = request.form("username")
password= request.form("password")
 
'call the loginUser function
formResults = loginUser(username, password, true, strType)
 
response.write formResults
END CODE
 
I'm not sure if I assigned the correct values under the call function for
 
"ByVal blnCAPTCHArequired" and "strType"
 
I used "true" and "strType".  Is this correct?  If not, what am I supposed to be using for these values or where are they assigned for the function?
 
Thanks for any assistance


Posted By: WebWiz-Bruce
Date Posted: 26 October 2006 at 11:02am
The blnCAPTCHArequired is only used if you are using the CAPTCHA security image found in Web Wiz Forums, the strType is only used if logining into the admin section, in which case the value 'Admin' is passed as the value.

So you only need to pass,

Call loginUser(username, password, false, "")

If you are using the CAPTCHA security image change the false part to true.


-------------
https://www.webwiz.net/web-wiz-forums/forum-hosting.htm" rel="nofollow - Web Wiz Forums Hosting
https://www.webwiz.net/web-hosting/windows-web-hosting.htm" rel="nofollow - ASP.NET Web Hosting



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net