New Posts New Posts RSS Feed - Use WWF authentication for other parts of website
  FAQ FAQ  Forum Search   Register Register  Login Login

Use WWF authentication for other parts of website

 Post Reply Post Reply Page  12>
Author
Info_Tech View Drop Down
Newbie
Newbie
Avatar

Joined: 08 Apr 2007
Location: United States
Status: Offline
Points: 9
Post Options Post Options   Quote Info_Tech Quote  Post ReplyReply Direct Link To This Post Topic: Use WWF authentication for other parts of website
    Posted: 04 Oct 2010 at 4:59am
Hello guys...

Is there a way to use WWF authentication for pages that are outside of the forum? If so, how can that be done? Thanks!
Back to Top
Matt View Drop Down
Admin Group
Admin Group


Joined: 07 Feb 2003
Location: Manchester, UK
Status: Offline
Points: 195
Post Options Post Options   Quote Matt Quote  Post ReplyReply Direct Link To This Post Posted: 09 Oct 2010 at 4:02pm

You can secure pages with our Member-Only Pages tutorial.

Or if you just want to grab user details (eg submitting a form) you can follow part of the tutorial (eg everything except for the redirect).

Details you can use are (among others)

Username = strLoggedInUsername
Group ID = intGroupID (1 = admin, 2 = guest, rest depend on how you set it)
User ID = lngLoggedInUserID (1 = admin, 2 = guest, rest are users who signed up)

so adding the following to a page will print the members username:

[code]<%=strLoggedInUsername%>[/url]
Back to Top
Info_Tech View Drop Down
Newbie
Newbie
Avatar

Joined: 08 Apr 2007
Location: United States
Status: Offline
Points: 9
Post Options Post Options   Quote Info_Tech Quote  Post ReplyReply Direct Link To This Post Posted: 13 Oct 2010 at 11:19pm
Scotty, this is great, thank you!!!
I am setting up a page (conference page) that involves other attributes, such as username color, gender, etc... so I don't know if I should do it so that they are logged in first, then redirected to a page where they pick a username color before they can login to the conference page or what.. I'm working on it and will probably need some more help. Thank you again!


Edited by Info_Tech - 13 Oct 2010 at 11:20pm
Back to Top
Info_Tech View Drop Down
Newbie
Newbie
Avatar

Joined: 08 Apr 2007
Location: United States
Status: Offline
Points: 9
Post Options Post Options   Quote Info_Tech Quote  Post ReplyReply Direct Link To This Post Posted: 14 Oct 2010 at 2:40am
Ok here is the first problem I'm having:

I'm trying to include a URL to get to a member profile... so I'm using the following
Profile URL: <a href="forum/member_profile.asp?PF=<% = lngUserID %>" rel="nofollow"><% = strLoggedInUsername %></a><br /> 

However, the URL isn't including the User ID at the end... it only takes you to this:

forum/member_profile.asp?PF=

As you could see from the URL above, the user ID is missing after the equal ( = ) sign... what am I missing?


Edited by Info_Tech - 14 Oct 2010 at 2:59am
Back to Top
Matt View Drop Down
Admin Group
Admin Group


Joined: 07 Feb 2003
Location: Manchester, UK
Status: Offline
Points: 195
Post Options Post Options   Quote Matt Quote  Post ReplyReply Direct Link To This Post Posted: 14 Oct 2010 at 6:02pm

Is this a link for the currently logged in user?

If so, then "lngUserID" is wrong and, as I said above, should be "lngLoggedInUserID"

for example:
Profile URL: <a href="forum/member_profile.asp?PF=<% = lngLoggedInUserID %>" rel="nofollow"><% = strLoggedInUsername %></a><br />


If this is your own custom code grabbing the user data from somewhere else, I would need more info on where "lngUserID" is set.


Back to Top
Info_Tech View Drop Down
Newbie
Newbie
Avatar

Joined: 08 Apr 2007
Location: United States
Status: Offline
Points: 9
Post Options Post Options   Quote Info_Tech Quote  Post ReplyReply Direct Link To This Post Posted: 14 Oct 2010 at 6:45pm
Dear Scotty,

You're the man! The "lngLoggedInUserID" did the trick : ) 

Now, I'm struggling to display the user's gender... my own profile displays my gender but when i try to grab it from outside the forum, I keep getting "Not Given".. even though it's specified.
I'm using the following code:

Gender: <% If strGender <> "" Then Response.Write(strGender) Else Response.Write(strTxtNotGiven) %>

I appreciate all the help you've provided... it helped me tremendously!

Back to Top
Matt View Drop Down
Admin Group
Admin Group


Joined: 07 Feb 2003
Location: Manchester, UK
Status: Offline
Points: 195
Post Options Post Options   Quote Matt Quote  Post ReplyReply Direct Link To This Post Posted: 14 Oct 2010 at 7:16pm

The Gender field isnt set as part of the current users details, its only things that are used frequently throughout the forum for that user.

The full list of variables set globally for the current user is:

Quote strLoggedInUsername
intGroupID
lngLoggedInUserID
blnActiveMember
strDateFormat
strTimeOffSet
intTimeOffSet
blnReplyNotify
blnAttachSignature
blnWYSIWYGEditor
strLoggedInUserEmail
intNoOfPms
dtmUserLastVisitDate
blnLoggedInUserSignature
blnBanned
blnAttachments
blnImageUpload



You can add more if you wish, to the "functions/functions_login.asp" file.

Add the variable (eg strLoggedInUserGender) to the start of the Function around line 321 like so:

'Sun procedure to get the user data for users

Public Sub getUserData(ByVal strSessionItem)
    Dim strLoggedInUserGender

Though I would recommend using something unique. You will notice from my mods that I generally prefix things with "S2H", For example "strS2HUserGender" so that it isnt likely to create a conflict with the forum software.


Add the fields you want (in this case "Gender" to the end of (roughly) line 350, it should look like so:

strSQL = "SELECT " & strDbTable & "Author.Username, " & strDbTable & "Author.Author_ID, " & strDbTable & "Author.Group_ID, " & strDbTable & "Author.Active, " & strDbTable & "Author.Signature, " & strDbTable & "Author.Author_email, " & strDbTable & "Author.Date_format, " & strDbTable & "Author.Time_offset, " & strDbTable & "Author.Time_offset_hours, " & strDbTable & "Author.Reply_notify, " & strDbTable & "Author.Attach_signature, " & strDbTable & "Author.Rich_editor, " & strDbTable & "Author.Last_visit, " & strDbTable & "Author.No_of_PM, " & strDbTable & "Author.Banned, " & strDbTable & "Group.Image_uploads, " & strDbTable & "Group.File_uploads, " & strDbTable & "Author.Gender " & _


Then grab the data Around like 390 like so:

            blnImageUpload = CBool(rsCommon("Image_uploads"))

            strLoggedInUserGender = rsCommon("Gender")


Back to Top
Info_Tech View Drop Down
Newbie
Newbie
Avatar

Joined: 08 Apr 2007
Location: United States
Status: Offline
Points: 9
Post Options Post Options   Quote Info_Tech Quote  Post ReplyReply Direct Link To This Post Posted: 16 Oct 2010 at 9:16pm
Hello Scotty,

I tried doing the following for two items I'm trying to grab (Gender and Avatar) so I did the following in the functions/functions_login.asp file:

  1. Declared the variable:

    'Sun procedure to get the user data for users
    Public Sub getUserData(ByVal strSessionItem)

    'Grab User Gender
    Dim strLoggedInUserGender
    'Grab User Avatar
    Dim strLoggedInUserAvatar 


  2. Added both items to the following line, as follows:
    strSQL = "SELECT " & strDbTable & "Author.Username, " & strDbTable & "Author.Author_ID, " & strDbTable & "Author.Group_ID, " & strDbTable & "Author.Active, " & strDbTable & "Author.Signature, " & strDbTable & "Author.Author_email, " & strDbTable & "Author.Date_format, " & strDbTable & "Author.Time_offset, " & strDbTable & "Author.Time_offset_hours, " & strDbTable & "Author.Reply_notify, " & strDbTable & "Author.Attach_signature, " & strDbTable & "Author.Rich_editor, " & strDbTable & "Author.Last_visit, " & strDbTable & "Author.No_of_PM, " & strDbTable & "Author.Banned, " & strDbTable & "Group.Image_uploads, " & strDbTable & "Group.File_uploads, " & strDbTable & "Author.Gender, " & strDbTable & "Author.Avatar "& _


  3. And last step, I added the following around line 383 along with other details:
    blnImageUpload = CBool(rsCommon("Image_uploads"))
    strLoggedInUserGender = rsCommon("Gender")
    strLoggedInUserAvatar = rsCommon("Avatar")
But I still cannot get those two from outside the forum.... what did I miss this time?
Back to Top
Matt View Drop Down
Admin Group
Admin Group


Joined: 07 Feb 2003
Location: Manchester, UK
Status: Offline
Points: 195
Post Options Post Options   Quote Matt Quote  Post ReplyReply Direct Link To This Post Posted: 20 Oct 2010 at 8:26pm

Im sorry I have no idea, I do a similar thing my self on one of my forums and it works perfectly.

Does the user your logged in as (Guest, if not logged in) have anything set for those fields?

Also, I would try doing a simple "<%=strLoggedInUserGender%>" to see if anything is produced.

Back to Top
Info_Tech View Drop Down
Newbie
Newbie
Avatar

Joined: 08 Apr 2007
Location: United States
Status: Offline
Points: 9
Post Options Post Options   Quote Info_Tech Quote  Post ReplyReply Direct Link To This Post Posted: 21 Oct 2010 at 7:31am

Scotty,

I'm not sure what I did.. but it works now. Thank you for all your help!! Thumbs Up
Back to Top
 Post Reply Post Reply Page  12>
  Share Topic   

Forum Jump Forum Permissions View Drop Down



This page was generated in 0.047 seconds.