vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Cookie Authentication In ASP/html??? (https://vborg.vbsupport.ru/showthread.php?t=61722)

jarekn 02-19-2004 03:53 AM

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

jarekn 02-19-2004 09:17 PM

Anyone???

assassingod 02-19-2004 09:21 PM

Don't bump a thread until 24 hours later. Thank you.

Andreas 02-19-2004 10:02 PM

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)).

shazzy 02-24-2004 12:31 PM

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);

Andreas 02-24-2004 12:41 PM

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.

shazzy 02-24-2004 01:04 PM

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?

Andreas 02-24-2004 01:10 PM

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"); 


shazzy 02-24-2004 01:11 PM

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"

shazzy 02-24-2004 01:29 PM

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

Regards,
-Shazzy


All times are GMT. The time now is 11:20 AM.

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.02004 seconds
  • Memory Usage 1,755KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (5)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete