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
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 Topic: Use WWF authentication for other parts of website
    Posted: 26 Oct 2010 at 9:34pm

A solution I found for a phpBB forum I have (which has the same security in place) was to use URL Rewrites.

If you have this available on your server (I believe WebWiz has it on their servers if your with them) you can do a similar thing to what you did above but in a .htaccess file.

The solution I decided to do was to basically have "rw_folder_file.php" which would translate to "/folder/file.php".

To do this, Add the following to your htaccess file in the forum folder
RewriteRule ^rw_(.*)_(.*).asp$    /$1/$2.asp [R=301]


If how ever you dont have access to URL Rewrite then this post was a waste of time, and I'll see if i can figure something else out

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: 26 Oct 2010 at 5:48am

Scotty, hello again...

I am currently redirecting guest users to the login page. What I need to do is redirect the user back to the page where they came from (which is outside of the forum).
 
What I have done, so far, since WWF security measures don't allow redirecting to page outside of the forum, is I created a page within the forum directory that will redirect the user to where I want them to be redirected.
 
However, for whatever reason, I cannot get this to work.
 
I added the following function in the login_user_test.asp file but it does not seem to be working:
If strReturnURL = "mypage.asp" Then strReturnURL = "my_redirect_page_within_the_forum.asp"

What else should I do...? I appreciate your help!
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
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: 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: 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: 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 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 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
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
 Post Reply Post Reply Page  12>
  Share Topic   

Forum Jump Forum Permissions View Drop Down



This page was generated in 0.063 seconds.