Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 02-19-2004, 03:53 AM
jarekn jarekn is offline
 
Join Date: Feb 2004
Posts: 57
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Cookie Authentication In ASP/html???

Hello,

I hope someone can help me out with this.

I have two sites... www.mysite.com running html and asp and forum.mysite.com running php.

I would like to authenticate some of the pages on the main site with the forum. I know that when person logs in to the forum a cookie is created on the system.

Here is the question, does anyone have ASP code that would check to see if the person is logged in, if so the script should allow displaying of the content and if not it should redirect the person to the login screen on forum.mysite.com.

I don't think that this should be hard to write, but I don't have enough experience to acomplish this. I think this would be a great mod.

Any help would be very much apreciated!

Regards,

JarekN
Reply With Quote
  #2  
Old 02-19-2004, 09:17 PM
jarekn jarekn is offline
 
Join Date: Feb 2004
Posts: 57
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Anyone???
Reply With Quote
  #3  
Old 02-19-2004, 09:21 PM
assassingod's Avatar
assassingod assassingod is offline
 
Join Date: Jul 2002
Posts: 3,337
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Don't bump a thread until 24 hours later. Thank you.
Reply With Quote
  #4  
Old 02-19-2004, 10:02 PM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I don't know anything of ASP, but the cookies you'll need are
- bbuserid (the User's ID)
- bbpassword = md5(concat(password, 'LicenseNo'))

Where LicenseNo is your vB License Number and password the value from vB's user table which is actually md5(concat(md5(password), salt)).
Reply With Quote
  #5  
Old 02-24-2004, 12:31 PM
shazzy shazzy is offline
 
Join Date: Feb 2004
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

In the past I have used...

setcookie("bbuserid","-1", time()-(3600 *24*7*365),"/","domain.com");
setcookie("bbpassword","-1", time()-(3600 *24*7*365),"/","domain.com");

In VB3 this dosent work, do I just change it to:

setcookie("bbuserid","-1", time()-(3600 *24*7*365),"/","domain.com");
setcookie("bbpassword","-1", time()-(3600 *24*7*365),"/","domain.com",LICENCENO);
Reply With Quote
  #6  
Old 02-24-2004, 12:41 PM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No ... at least I think this isn't correct.

Do you want to verify that the cookies are correct or do you want to set cookies?

If you want to set cookies then it should be smth. like this (in PHP):
PHP Code:
setcookie('bbuserid'$useridtime() + 60 60 24 365'/''domain.com');
setcookie('bbpassword'md5($password 'FOOBAR'), time() + 60 60 24 365'/''domain.com'); 
Where $userid is the user id, $password is md5(md5('password') . $salt) and FOOBAR is your vB License Number.
Reply With Quote
  #7  
Old 02-24-2004, 01:04 PM
shazzy shazzy is offline
 
Join Date: Feb 2004
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by KirbyDE
No ... at least I think this isn't correct.

Do you want to verify that the cookies are correct or do you want to set cookies?

If you want to set cookies then it should be smth. like this (in PHP):
PHP Code:
setcookie('bbuserid'$useridtime() + 60 60 24 365'/''domain.com');
setcookie('bbpassword'md5($password 'FOOBAR'), time() + 60 60 24 365'/''domain.com'); 
Where $userid is the user id, $password is md5(md5('password') . $salt) and FOOBAR is your vB License Number.
Duh I posted the incorrect code ;(

PHP Code:
setcookie("bbuserid"$row["player_id"], time()+(3600 *24*7*365),"/","domain.com");
setcookie("bbpassword"$row["player_password"], time()+(3600 *24*7*365),"/","domain.com"); 

This is what I have currently, The $row["player_password"] is already in MD5 format ....
Do I need to MD5 phase the license key?
Reply With Quote
  #8  
Old 02-24-2004, 01:10 PM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What exactly is $row["player_password"], the value of column password in vB user table?

Then you would have to call
PHP Code:
setcookie("bbpassword"md5($row["player_password"] . 'LICENSENO'), time()+(3600 *24*365),"/","domain.com"); 
Reply With Quote
  #9  
Old 02-24-2004, 01:11 PM
shazzy shazzy is offline
 
Join Date: Feb 2004
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by KirbyDE
What exactly is $row["player_password"], the value of column password in vB user table?

Then you would have to call
PHP Code:
setcookie("bbpassword"md5($row["player_password"] . 'LICENSENO'), time()+(3600 *24*365),"/","domain.com"); 
That is the MD5 password from our database, non VB ....

.....so e.g. $row["player_password"] = "4hg5h345y345bhbh35345"
Reply With Quote
  #10  
Old 02-24-2004, 01:29 PM
shazzy shazzy is offline
 
Join Date: Feb 2004
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks Kirby I have got it to work....

Regards,
-Shazzy
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:32 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04197 seconds
  • Memory Usage 2,270KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (5)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete