The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Using vb database for login on separate domain
Hi. I've been looking around but can't seem to find an easy answer. All I want to do is be able to is authenticate a user and password against the vbulletin user (4.1.4) database on a domain that is separate from the forums (hence not shared cookies) and go from there.
Don't need anything fancy. I just want to be able to have them authenticate that they are a forum user on the forum domain. I'm sorry if I missed an article, but could someone point something like this out or demonstrate how it might be done? Thanks in advance. --------------- Added [DATE]1310747479[/DATE] at [TIME]1310747479[/TIME] --------------- I found this, but it does not work. Code:
<form action="index.php?p=login" method="post" enctype="multipart/form-data"> Username: <input type="text" name="user" /> Password: <input type="password" name="pass" /> <input type="submit" value="Login" /> </form> <?php if ( $_GET['p'] == 'login' ) { $host = "localhost"; $user = "username"; $pass = "password"; $$db = "forums"; $con = mysql_connect($server, $username, $password); mysql_select_db($database); // MD5 the form password $md5Pass = MD5(MD5(pass.salt)); // Get user details from MySQL Table print "$md5Pass<br>"; $Query = mysql_query( " SELECT * FROM user WHERE username = '$_POST[user]' " ); $result = mysql_fetch_array( $Query ); // Check that the form password matches the one in the database if ( $md5Pass == $result['password'] ) { echo 'User logged in'; } else { echo 'Wrong Password, please try again'; } } ?> |
#2
|
||||
|
||||
are you trying to only show a pages content if they are a logged in user?
Use PHP Here is an example PHP Code:
the domains would have to be on the same server though. |
#3
|
|||
|
|||
Hi thanks for replying. I tried what you suggested, making the changes to the forum path and it didn't work. I think anything I work on has a ghost in it.
Actually, what I was hoping for was a way to validate against the vbulletin user database. Create a login form on a different domain (on the same machine) then validate it with the database using the username and password, and going from there. Maybe I have something set wrong? Thanks again for replying. |
#4
|
|||
|
|||
Hi,
I made a few changes but didn't test it. Give it a try... PHP Code:
Hope that helps. Tim www.SuppYo.com |
#5
|
|||
|
|||
Thank you very very much. I've seen code just like that in a lot of places and most of them have that middle parens off so it doesn't work but this one works. Thanks again!
|
#6
|
|||
|
|||
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|